Shop OBEX P1 Docs P2 Docs Learn Events
Booting from SD-card — Parallax Forums

Booting from SD-card

Filip SFilip S Posts: 54
edited 2007-09-17 05:07 in Propeller 1
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-15 02:15
    Sorry for the long wait for an answer. I've been away.

    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).
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-09-15 07:47
    (hooray! (sincerely) Mike did not Biffle! You were missed.)
  • Filip SFilip S Posts: 54
    edited 2007-09-15 11:52
    Thanks Mike

    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
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-15 13:17
    This is a documentation bug. The low level I/O routines, as written, are incapable of handling multiple sector I/O across extent boundaries and the boot I/O is completely handled at the low level (since the higher level routines ... Rokicki's ... are written in Spin and might be overwritten during the boot; the low level routines are in assembly and run in their own cog.)
  • Filip SFilip S Posts: 54
    edited 2007-09-15 16:03
    OK, I noticed that, but then i re-formatted my card to 16k sectors (32k didn't word by some reason) so that mostly programs fit into one sector.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my game page: http://fgames.110mb.com
  • mparkmpark Posts: 1,305
    edited 2007-09-17 05:01
    Do you mean sectors or clusters? I'm trying to learn this stuff and want to make sure I'm following this conversation correctly.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-17 05:07
    I don't know about Filip S, but I'm referring to 512 byte sectors. When I mentioned "extents", I was using that term to mean the same thing as clusters. I assumed that Filip S really meant 16K clusters (32 sequential 512 byte sectors) or 32K clusters (64 sequential 512 byte sectors).
Sign In or Register to comment.