This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
n00b PC booting questions
- From: Chuck McManis <ecos at mcmanis dot com>
- To: ECOS Discussion Group <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 08 Feb 2006 23:04:05 -0800
- Subject: [ECOS] n00b PC booting questions
Does anyone on this list REALLY understand how PC's boot and help me
understand this poorly documented topic?
Here is the deal, I'd like to boot ECOS from a flash chip that looks like
an IDE drive (sold as "DiskOnChip").
Now my target is an IBM PC (doh!) and I've been building stuff with Redboot
and startup "FLOPPY" which works fine. You dd the image on to the floppy
and it boots without incident. But now I want to boot from my baby Flash
Drive. So this is what I've learned/done.
So the flash is formatted with a PC valid "boot" sector with one partition
defined that is active. Since I'm developing on a FreeBSD machine I've been
snooping around how FreeBSD boots and one of the simpler ways is by using a
master boot record whose source is in mbr.s in /usr/src/boot/i386/mbr/.
Basically what this boot record does is look for the active partition, load
its "boot sector" (aka first sector) and if offset 510 has 0xaa55 in it,
then it jumps to the code it just loaded.
Now if I simply dd the redboot.bin file on to the flash at this sector it
isn't recognized as being a bootable image because it doesn't have the
0xaa55 signature. Now if I add a bit of code that uses int 13h to try to
read sector 2 - n (where n is the length of redboot) into address 0000:0200
and then try to jump to it nothing happens (well the PC doesn't complain
about "no operating system" [generated by mbr.s]) but I don't get the
Redboot ........ banner either.)
So what I would *love* would be an option to Redboot which was "HD" as a
startup method which would prepend to the binary a BIOS compatible boot
sector that could have a fake partition table that I could poke with the
real values needed, then I could dd(8) that file to the disk and have it
boot like floppies boot today.
In lieu of that, I think I need to understand where redboot expects to
land, and what it expects the system to have set up so that it can start
up. Is there anywhere where this would be documented? (I've started
browsing around the redboot code but the CDL stuff is something I've not
been really deep into yet)
Pointers appreciated, I'm not completely helpless, but reading source code
and writing a LOT of printf's is kind of painfully slow ;-)
--Chuck
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss