Questions about SPIN Internals (and hopefully answers and pointers)
MJB
Posts: 1,235
I really love to follow threads like now the P2 ones or TACHYON,
because there I can pick up very interresting information.
But if I am looking for s.th. specific (like now) the search is often quite unspecific in this huge forum.
Currently I want to learn about the SPIN internals to better understand how TACHYON and SPIN interact,
and if it might be possible to use OBEX Spin objects loaded in their own cogs to
be used as device drivers from Tachyon.
so ...
- is there a good overview / documentation of SPIN internals ?
EDIT: I am sure there is - but where ??
like
-- Memory map i.e. how does the compiler allocate the different sections in HUB memory
-- restricted areas that should not be touched (I read spin is using some longs from $0000 upwards)
...
Thanks MJB Gemany
because there I can pick up very interresting information.
But if I am looking for s.th. specific (like now) the search is often quite unspecific in this huge forum.
Currently I want to learn about the SPIN internals to better understand how TACHYON and SPIN interact,
and if it might be possible to use OBEX Spin objects loaded in their own cogs to
be used as device drivers from Tachyon.
so ...
- is there a good overview / documentation of SPIN internals ?
EDIT: I am sure there is - but where ??
like
-- Memory map i.e. how does the compiler allocate the different sections in HUB memory
-- restricted areas that should not be touched (I read spin is using some longs from $0000 upwards)
...
Thanks MJB Gemany
Comments
Spin uses 16 bytes at the beginning of memory to provide some global pointers and other information. For example, the long at 0 is CLKFREQ and contains the assumed system clock frequency. The byte at 4 is CLKMODE and contains the assumed clock mode value which is loaded into the clock mode register when the program is loaded. The byte at 5 contains a checksum of the entire 32K of RAM as the program is loaded such that the total should come out to zero. The rest of the area contains 5 word pointers, PBASE (program base), VBASE (VARiable base), DBASE (data/stack base), PCURR (current program), DCURR (current data/stack).
Have a look at the bootloader and Spin interpreter source code here.