Booting from SD-card
Filip S
Posts: 54
I'm playing a bit with the binary format and i've sucessfully done a bootloader that can load binaries from tha card (based on objects from rockiki and femtobasic), but I was thinking that I wanted a splash screen while the app were loading and initializing (using an independent serial screen). I've included the picture in the brginning of the binary-file. But it doesnt work to boot the app then.·Is the BootSdCard in FsrwFemto able to boot from any position in the file or does it need som kind of alginment (beginning of sector etc). My image file is 128 * 128 * 2 + 1 bytes (32k + 1 byte).
Thanks Filip
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my game page: http://fgames.110mb.com
Thanks Filip
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my game page: http://fgames.110mb.com
Comments
The boot routine in FsrwFemto starts loading at the beginning of a sector and continues for the number of bytes specified (minimum of 16 bytes). Keep in mind that, since the code being loaded is expected to overwrite all or most of hub memory, the Spin interpreter is likely to find invalid data as the routine is being loaded, so the loader stops all other cogs before initiating the actual load.
The actual loader (in sdspifemto.spin) doesn't have to start at the beginning of a file. It can start at the beginning of any sector. Have a look at the boot routine in fsrwfemto.spin. You could copy it and give the copy a different name and change where the actual loader is to start (after your splash data).
I have seen some error loading an application when the file is fragmented (sectors containing the file isn't after each other) is this a bug or is it just my code?
//Filip
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my game page: http://fgames.110mb.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my game page: http://fgames.110mb.com