Boot mechanism from SD card - ideas ??
Cluso99
Posts: 18,069
I am currently defining a boot mechanism for my RamBlade board. I have mentioned this previously.
I intend to use a small loader in eeprom that only knows the location (propeller pins) of the SD card (or microSD card). It will perform the following...
Why have I included some parameters? So that I can pass options such as...
I do not have the luxury of knowing what is attached to the RamBlade for I/O when the SD card is being loaded.
Are there any comments on this method? Any flaws? Does this sound like it is usable for other projects? Any suggestions (without unnecessarily complicating the boot proceedure)?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
I intend to use a small loader in eeprom that only knows the location (propeller pins) of the SD card (or microSD card). It will perform the following...
- The SD card will be checked for FAT16 (maybe also·FAT32 later)
- If not found the propeller will stop
- The SD card will be searched for a filename "AUTOEXEC.BAT"
- If AUTOEXEC.BAT is not found, continue at Step 5
- The first sector of AUTOEXEC.BAT will be read
- It should contain a "filename.BIN" and·optional·parameters (filename = valid file name)
- If a valid filename.BIN is not found, or the file does not exist, continue at Step 5
- The·binary file "filename.BIN" will be located
- The file will be·loaded into hub ram
- The parameters (32 bytes) will be loaded into hub ram at $7FE0
- The prop will then execute the binary in hub ram
- Otherwise, the binary file "BOOTPROP.BIN" will be located, loaded into hub ram, and executed
- It "BOOTPROP.BIN" was not found, the propeller will stop
Why have I included some parameters? So that I can pass options such as...
- If a serial port exists, what pins they are on, and baudrate
- If a keyboard exists, what pin(s) they are on
- If a video exists, what pin(s) they are on
- Xtal frequency
I do not have the luxury of knowing what is attached to the RamBlade for I/O when the SD card is being loaded.
Are there any comments on this method? Any flaws? Does this sound like it is usable for other projects? Any suggestions (without unnecessarily complicating the boot proceedure)?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Comments
I think this is fine as it is.
Regards,
Coley
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PropGFX - The home of the Hybrid Development System and PropGFX Lite
However if I understand correctly the full EEPROM is loaded to the Prop no matter how much of it is used. So the need for a "small" boot loader seems moot. Looks like it could hold the full FAT driver plus plus combinations of serial, keyboard, video drivers. Customized for the available environment of course. So a full up mini DOS could be available from the get go complete with simple command shell or menu driven program selection.
Certainly have an AUTOEXEC possibility.
Edit: Scratch all that, I think I'm just catching up with the problem. Is it so that users cannot get to the EEPROM to program any customizations into it? There for it has to be hardware layout agnostic.
Not sure of the need for parameters in the AUTOEXEC though. Surly bin files one creates with the Prop Tool, or whatever, already have clock frequency, pins etc configured into them. Just like they do normally.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Post Edited (heater) : 12/22/2009 10:32:05 AM GMT
1. I never want to change it the eeprom boot code. The eeprom is disabled from being written by default.
2. It is my aim to subsequently replace the eeprom with a cheap micro, so minimal code size is required.
3. The environment is unknown at eeprom programming time.
4. All code changes are done on (to) the SD card.
It is possible the first binary loaded from the SD card may be a version of Propeller DOS or some such system. It will then permit loading of other binaries by a menu selection (e.g. ZiCog).
Initially ZiCog would be the binary loaded from the SD card, although I am thinking longer term. This method would also allow ZiCog to be passed parameters which could be used to determine if CPM2 or CPM3 is loaded, etc. This would allow us to release ZiCog binaries for those who do not wish to compile their own versions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
All in all you have a sound plan there.
Wish we could get away from the "AUTOEXEC.BAT" name though, it's too DOSy for my tastes. But as we are using FAT I guess that's it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
I like the idea that you don't necessarily need a prop editor to get this working.
@heater, if AUTOEXEC.BAT is too Dossy, what about ZICOG.SYS (or anything ZICOG.*)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Don't forget that FAT is using clusters, or whatever they are called there, so there will be many kilobytes stored in consecutive sectors. The length limit on the AUTOEXEC.BAT is not just one 512 byte block.
It's not going to be ZICOG.SYS, this is more general purpose than just CP/M. I'd go for just "INIT" or some such. But as long as it works who cares what it's called.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Autoexec.bat was used in PropDos/ProCmd and it is readily recognisable from Dos days, hence I thought it was a easy choice.
I think the ZiCog/CPM "HALT" program should possibly allow for booting alternate binaries, one of which could be a simple editor for autoexec.bat.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
I'm not sure but it isn't it the case that the "cluster size" used in FAT is big enough an entire Prop program can be read from contiguous sectors once you have found the start sector. No more FAT code required.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
bootloader code space might be very tight if he is not using an EEPROM but some dinky 2 cent micro controller instead.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
I am using the new fsrw from lonesock/rokicki so I will need to do the actual binary load section (not difficult as I understand what is required).
I just editted a file "autoexec.bat" in Notepad and copied it to the SD card. Works fine.
In doing this I had a thought... (dangerous I know!)
Since we have the SD card, it is almost certain we will be using an SD driver. We could just get the parameters from the file using the newly booted code. Comments??
jazzed: once used, they are not required - depends on the application, but the app could copy the parameters somewhere as soon as it starts (for later use).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
If a defines.spin file could be used for the program, that would be simplest as a compile-time option.
A config.sys file with pin names and definitions as Key::Value pairs would be attractive for run-time.
It does not load and execute the binary, but it does locate the files (in the order I set above) and if there are parameters, it extracts them.
jazzed: I know there were previous discussions. I am after something small and simple for starters. It could be expanded later.
I do like the idea of being able to specify the hardware (pins, uart, keyboard, video, etc) for runtime. This is the essential point in my parameters. I need to be able to determine for RamBlade if serial or keyboard/video are being used.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
While this does not satisfy my ultimate requirements (because I want to replace the eeprom with a much cheaper micro and other reasons), it is a very smart idea, and worthy of mentioning here for future reference. I am still considering this in conjunction with my work above.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Currently I am not booting from eeprom but this code could be in eeprom.
The autoexec.bat section works.
I would like to change the fsrwFemto code to the latest fsrw26 code, but this will have to be later.
BTW There is another thread for a minimal version...
Simple SD Card Bootstrap Loader· http://forums.parallax.com/showthread.php?p=868757
IIRC there is PropCmd code in there that allows you to output a text file from the keyboard. You can also delete a file. So, you can create your own autoexec.bat and edit it.
localroger: I didn't know what to call it as I didn't want to confuse people from your original PropCmd, but as you can see a large part of it is yours unchanged. Any ideas? Or would you like to take it on as V2?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Post Edited (Cluso99) : 1/1/2010 6:09:16 PM GMT
For now I will use PropCmd (SD boot) - cluso.056 if that's ok with you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
I was working myself on a much more advanced PropCMD that could redirect I/O, and it was just taking too much RAM (even in Spin, which is an extremely memory efficient language). On the Prop, it is critical to get anything that isn't used out of Hub RAM. This means chopping unneeded functionality out of OBEX objects, overwriting PASM code once it's been launched in a cog, and taking seriously the mantra of one of the gurus of the Atari 2600 forums I used to haunt, that "every bit is sacred."
Here is the link (3rd post)· http://forums.parallax.com/showthread.php?p=849265
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm