Date: Tue, 06 Nov 2001 08:38:31 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: Joerg Wunsch <j@uriah.heep.sax.de> Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, "Kenneth D. Merry" <ken@kdm.org> Subject: Re: cvs commit: src/sys/boot/i386/cdboot Makefile cdboot.s Message-ID: <XFMail.011106083831.jhb@FreeBSD.org> In-Reply-To: <20011106083802.H43204@uriah.heep.sax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On 06-Nov-01 Joerg Wunsch wrote: > As Kenneth D. Merry wrote: > >> The code Joerg wrote was done in mid-1997, and IIRC, it would only >> work properly with version 1.23 or maybe 1.25 of the Adaptec 2940UW >> SCSI BIOS. The other BIOS versions didn't do El Torito right at >> that point. > > None of them did it right at that point. ;-) > > Adaptec 1.23 was the only one that did at least that part right that > was supposed to be implemented. That is, BIOS int 0x13 extensions > (which are needed to read the CD-ROM using BIOS functions), plus the > floppy-emulation booting. Non-emulation booting wasn't even supposed > to be implemented, according to your Adaptec contacts... Rev 1.26 > then broke again the BIOS int 0x13 extensions. > > Any ATAPI BIOS i could find around that time was too stupid to work at > all, they all broke the int 0x13 extensions. > > At some point, i think i've also tried to boot off a Tekram using a > Symbios Logic chip. No idea about non-emulation booting, but at least > the part that was done in Adaptec 1.23 also worked there. On-board > SDMS BIOSes couldn't boot CD-ROMs at all then. > > I'm really wondering, WinNT must have been around at that time. Ah, > hmm, probably only 3.5x, so the logo program you mention, John, might > have appeared afterwards only. Anyway, after discovering that none of > the existing BIOSes even bothered to implement non-emulation booting, > i discarded the idea to use it. > > Anyway, i'm glad all this is possible now. Of all that El Torito > cr*p, non-emulation booting at least looked like the most logical > thing to me. Btw. John, did you find a way using only BIOS functions > and the El Torito descriptor blocks to find out where the session > you've been booted from actually is rooted at? I didn't. So when > booting from something that was not the first session, the starting > block number of the session to boot needed to be manually entered at > the boot prompt. :( No, cdboot is quite simple. All it does is find the primary volume descriptor and look for the filename (currently hardcoded as /boot/loader, but the code is generic enough that you can change the pathname variable and recompile and it will work) and load that binary up into memory. It will only load a binary of 512k or less. If the binary is too big, it will complain. The binary also has to be an a.out binary like the one btxld spits out. I'm not sure yet what exact type of a.out it is. The code doesn't check the magic, so there is plenty of foot shooting potential here if one is not careful. It only parses ISO 9660 filenames, but it does manage to strip off trailing dots and version numbers from said filenames. It's comparison also isn't case insensitive, so the compiled in pathname currently has to be all uppercase. That could be easily fixed if desired however. As far as finding your session. It could be done, but it's hard. You would have to load the boot descriptor from sector 0x11, then use it to load the boot catalog. The boot catalog has the LBA of your loader. You would then basically have to walk the directory structure of each volume until you find one that contains your file by using that LBA to check. So long as you save the volume descriptor each time before walking a volume, you would then know that the saved VD contains your root. This is admittedly ugly however. Actually, the specification packet from Int 13 Function 4B01 has the LBA in it, so you can skip the part of looking that up via the boot catalog. You still have to take that LBA and go find it within a volume however. -- John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.011106083831.jhb>