P8X32A - Clarification on boot sequence details.
Wossname
Posts: 174
Does anyone know of any official / unofficial information regarding the gory details of the Propeller's startup sequence?
I think I've worked it out based on reading through the various files we've collected so far. I reckon it goes like this but I have a few question marks over a couple of details...
Is this vaguely close? It seem to me that the "booter" code is entirely self-contained and needs no setting-up or parameters, for instance it doesn't use the PAR register.
I must say that looking into the intricacies of the Propeller has doubled my already considerable respect for the P8X32A. It is a very elegant system.
I think I've worked it out based on reading through the various files we've collected so far. I reckon it goes like this but I have a few question marks over a couple of details...
- 1. VCC applied to Propeller
- 2. The "booter" PASM code is copied from ROM into Cog0 and executed immediately. (I don't know the mechanism behind this PASM insertion and cog activation, is this code transfer hard-wired in the silicon?).
- 3. If the booter is happy with the data it receives from the EEPROM or the serial port then it loads the SPIN interpreter (496 longs of bytecode) from ROM (0xf004 onwards) into Cog0 and configures its PAR address with the settings to begin interpreting the "runner" SPIN bytecode which resides in ROM.
- 4. The runner code sets up the stack and a few other important values so that the SPIN interpreter can be re-used to run the user's custom code.
- 5. The SPIN interpreter is reloaded into Cog0 and runs the user's code. (I can't seem to find the jump associated with this)
- 6. The user's code does whatever it likes, including spawning other cogs and generally having a great time.
Is this vaguely close? It seem to me that the "booter" code is entirely self-contained and needs no setting-up or parameters, for instance it doesn't use the PAR register.
I must say that looking into the intricacies of the Propeller has doubled my already considerable respect for the P8X32A. It is a very elegant system.
Comments
it doesn't get any more detailed than that!
I'm not trying to implement anything at the moment, just trying to understand in my head, the process the Prop goes through.
The Spin interpreter and booter are encrypted in the ROM. That's why you can't find them. There's additional hardware in the hub that decrypts these if they're being copied from ROM to cog RAM by a COGINIT. This was done to try to prevent them from being stolen. Eventually this fostered a contest to try to defeat the encryption. This was done and Chip released the source codes as the prize.
Sorry I deleted my post before you posted yours. Yes you're right of course.
I deleted my post out of frustration with 1) myself and 2) the ongoing "Documentation Nightmare".
nres goes low (external input)
cog_e is set to enable only cog 0 (hub.v:218)
cog_ena is set to all cogs off (hub.v:224)
ptr is set to 0xF800>>2 (cog.v:212)
run is set to 0 (cog.v:241)
nres goes high (external input)
ena_bus starts oscillating (dig.v:61)
cog_ena is set to enable only cog 0 (hub.v:226)
since run=0, instructions are replaced with RDLONG p,0 (cog.v:420)
since run=0, bus_a is replaced with (ptr+p)<<2 (cog.v:492)
when p reaches 511, set run to 1 (cog.v:244)
ROM -> RAM is very small and almost invisible (Data sheet Current specs show 640us for this)
Loaded UART.EE Booter interacts with EE and RXD
Loading Spin is yet another 'boot' step...
The source code link given above mentions these 3 :
interpreter.src - begins at $F004
booter.src - begins at $F800
runner.src - butts up against $FFFF