Usable hub RAM on the P2
Dave Hein
Posts: 6,347
in Propeller 2
Can all of the hub RAM be used by a user program if interrupts are disabled? I looked at the documentation online, and it seems to be a bit out of date. According to the "Propeller II Documentation" there are 16 longs used in high memory that are used by the debug interrupt. Initially, these contain a RETI0, but could be replaced by a JMP to a debug ISR. I assume I should leave these in place in case I start a new cog, which would immediately get a debug interrupt. Is this still the case, or is more memory used now. I recall some discussion about reserving hub RAM to save the state of the cog on a debug interrupt. How much of the high memory should a user program avoid?
If I don't start a new cog, and I don't enable interrupts, can I use all of the high memory? By the time my program starts the debug interrupt for cog 0 would have occurred and the RETI0 would have executed leaving interrupts disabled. So it seems like it save to used the entire hub RAM for my program.
If I don't start a new cog, and I don't enable interrupts, can I use all of the high memory? By the time my program starts the debug interrupt for cog 0 would have occurred and the RETI0 would have executed leaving interrupts disabled. So it seems like it save to used the entire hub RAM for my program.
Comments
Whether you can in fact use this RAM I cannot answer.
I think that it's ok to load the whole Hub including the ROM space from Flash or downloading by serial. But beware, you cannot load the last 16KB of Hub from SD as it runs in hubexec mode. So does the monitor. TAQOZ copies itself down to the bottom of Hub to run.
The question seems to be 'Do you expect users to run Debug with p2gcc' ?
If you want to support Debug, then it seems safest to leave that space free, even if in theory you might be able to use it in the special case of with no-debug enabled in any COG.
Yes, I would like to run debug with p2gcc. It would be nice to provide C source level debugging, but that's a ways down on the wish list.