Shop OBEX P1 Docs P2 Docs Learn Events
Boot Up/Run-time procedure and memory management — Parallax Forums

Boot Up/Run-time procedure and memory management

00000000 Posts: 11
edited 2012-05-14 09:26 in Propeller 1
Hello, I'm actually trying to understand how the propeller works, especially the memory management.
On official documentation, we can read this:
Boot Up Procedure
Upon power-up (+ 100 ms), RESn low-to-high, or software reset:
[...]
3. If either step 2a or 2b was successful in loading a program into the Main RAM, and a suspend command
was not given by the host, then Cog 0 is reloaded with the built-in Spin Interpreter and the user code is run from Main RAM.
So, each corresponding cog(s) will fetch instructions from Main RAM and execute them. Am I wrong?
I also read from other non-official documentations that your program will run into each corresponding cog's RAM.
(http://propgcc.googlecode.com/hg/doc/Memory.html , Programming the Parallax Propeller using Machine Language V121, etc. )

What is exaclty the Boot Up Procedure?
Is there any multiplexing system to determine which RAM (cog or global) have to be used?

Comments

  • jazzedjazzed Posts: 11,803
    edited 2012-04-18 02:25
    0000 wrote: »
    Hello, I'm actually trying to understand how the propeller works, especially the memory management.
    On official documentation, we can read this:

    So, each corresponding cog(s) will fetch instructions from Main RAM and execute them. Am I wrong?
    I also read from other non-official documentations that your program will run into each corresponding cog's RAM.
    (http://propgcc.googlecode.com/hg/doc/Memory.html , Programming the Parallax Propeller using Machine Language V121, etc. )

    What is exaclty the Boot Up Procedure?
    Is there any multiplexing system to determine which RAM (cog or global) have to be used?

    COGs have their own memory space where instructions are stored and run using the cognew and other commands.
    COGs also have access to main memory using a round-robin time share approach.

    Spin programs are read and run from main memory by the start up COG Spin byte code interpreter.
    C programs are run using the faster LMM COG interpreter which typically load and execute PASM instructions.
  • 00000000 Posts: 11
    edited 2012-04-18 02:59
    Ok, thanks.
    An other question, why is there an offset of 0x20 in text section (using ICC compiler with LMM of course) ?
    It makes the disassembly totally wrong.
  • 00000000 Posts: 11
    edited 2012-04-19 01:45
    Ok, it seems to have something from 0x00 to 0x20 in the binary file.
    00000000   00 B4 C4 04  6F D6 10 00  0C 11 14 11  00 11 18 11  F4 10 02 00  EC 10 00 00  00 00 00 00  00 00 00 00
    00000020   10 [...]
    

    The first 16 bytes hold initialization values (CLK register, etc.) but what are there at $0010 to $001F ?


    EDIT: Ok it is on the imagecraft manual p112-113
  • kuronekokuroneko Posts: 3,623
    edited 2012-04-19 02:08
    0000 wrote: »
    00000000   00 B4 C4 04  6F D6 10 00  0C 11 14 11  00 11 18 11  [B]F4 10[/B] 02 00  [B]EC 10[/B] 00 00  00 00 00 00  00 00 00 00
    00000020   10 [...]
    

    The first 16 bytes hold initialization values (CLK register, etc.) but what are there at $0010 to $001F ?
    That's the start of the top object. $10F4 pointingA to the next object (if any), $10EC pointsA to the first public method. The DAT section (not necessarily the cog binary) starts in fact at $18 and ends at $10FB ($10EC+$10-1).

    A relative to the start of the object, i.e. $10
  • 00000000 Posts: 11
    edited 2012-04-27 07:30
    Ok thanks, and are these words present into any start of an object?
    For example at $10F4+$10 we will find a 16-bit word which point to the next object, etc.
  • kuronekokuroneko Posts: 3,623
    edited 2012-04-27 07:46
    FWIW, these (old) threads may help:
    • [thread=104847]Spin Object Binary Structure[/thread]
    • [thread=96211]Spin Bytecode Disassembler[/thread]
  • 00000000 Posts: 11
    edited 2012-05-11 07:14
    Ok thanks.
    But I've another question.
    Is there a topobj at the beginning of a subobject?
  • kuronekokuroneko Posts: 3,623
    edited 2012-05-11 16:51
    0000 wrote: »
    Is there a topobj at the beginning of a subobject?
    Not sure what you mean here. There is only one top-object which is emitted first (followed by optional sub-objects).
  • 00000000 Posts: 11
    edited 2012-05-13 05:27
    hmm yes, maybe I used wrong word, I mean the header of each object which is holding Link to the next object, number of object(s), number of PUB, etc.
  • kuronekokuroneko Posts: 3,623
    edited 2012-05-13 05:31
    Yes, there is a a header per object. Out of curiosity, where is this going?
  • 00000000 Posts: 11
    edited 2012-05-14 04:07
    kuroneko wrote: »
    Yes, there is a a header per object. Out of curiosity, where is this going?


    And per sub-object?
    I'm trying to write a disassembler just for fun.
  • kuronekokuroneko Posts: 3,623
    edited 2012-05-14 05:35
    0000 wrote: »
    And per sub-object?
    Any object.
  • AribaAriba Posts: 2,690
    edited 2012-05-14 08:51
    Here is a very old document from Hippy which describes what you want to know (maybe). There are perhaps newer and better descriptions, but this one helped me alot.

    Andy
  • 00000000 Posts: 11
    edited 2012-05-14 09:26
    Yes, I already seen this doc.
    BTW, how can we identify a PUB/PRI pointer to a subobject pointer?
Sign In or Register to comment.