Date: Sat, 03 Nov 2001 19:34:07 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: John Baldwin <jhb@FreeBSD.org> Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: RE: cvs commit: src/sys/boot/i386/cdboot Makefile cdboot.s Message-ID: <XFMail.011103193407.jhb@FreeBSD.org> In-Reply-To: <200111040324.fA43OGQ42308@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 04-Nov-01 John Baldwin wrote: > jhb 2001/11/03 19:24:16 PST > > Modified files: > sys/boot/i386/cdboot Makefile cdboot.s > Log: > This is a new CD bootstrap utility designed to replace cdldr. According > to the El Torito standard for CD booting, a CD may boot in "No emulation" > mode without using a floppy image. In this mode, the BIOS loads a program > off of the CD into memory and creates a BIOS device using 2048 byte sectors > for the CD. According to the standard, this program can be up to 0xFFFF > virtual (512-byte) sectors long. The old cdldr depended on this by having > the BIOS load the entire loader and the small cdldr stub as one binary > similar to pxeboot so that cdldr didn't have to read the CD to find the > loader. However, the NT no emulation loader just uses 1 disk sector > (4 virtual sectors), so it seems that at least some BIOS writers just did > enough to get NT to boot by only loading 1 sector and ignoring the sector > count. Thus, while cdldr should have worked in theory, it doesn't in > practice. This replacment fits entirely in 1 sector and includes simple > ISO 9660 support. It looks for /boot/loader on the CD and loads it up > using the BIOS. This allows us to not have to depend on the limited size > of floppy images but use a full GENERIC kernel for CD-ROM installs in the > future, among other things. > > This version of cdboot is a bit bloated as it includes some useful > debugging routines that people can pull to use in other x86 assembly > modules. Even with all the debugging cruft, we still have 272 bytes to > spare. Unfortunately, the loader bits don't quite work yet. I get a cd0 device, but it can't read off the CD yet. Still need more work before the loader itself is useful in this case. Here's some sample output: CD Loader 1.01 Building the boot loader arguments Len 01 Addr 0900:0000 LBA 00000010 9000:01 43 44 30 30 31 01 00-46 72 65 65 42 53 44 20 |.CD001..FreeBSD | Read Volume Descriptor Looking up /BOOT/LOADER... Starting find_file 909c:22 00 1d 00 00 00 00 00-00 1d 00 08 00 00 00 00 |"...............| 90ac:08 00 65 0a 1e 12 0c 23-e0 02 00 00 01 00 00 01 |..e....#........| 90bc:01 00 - |.. | Path = "BOOT/LOADER" Length = 04 Len 01 Addr 0980:0000 LBA 0000001d <snip> 99be:78 00 26 00 00 00 00 00-00 26 00 80 02 00 00 02 |x.&......&......| 99ce:80 00 65 0b 03 10 14 1e-e0 00 00 00 01 00 00 01 |..e.............| 99de:09 4c 4f 41 44 45 52 2e-3b 31 52 52 05 01 89 4e |.LOADER.;1RR...N| 99ee:4d 0b 01 00 6c 6f 61 64-65 72 50 58 24 01 6d 81 |M...loaderPX$.m.| 99fe:00 00 00 00 81 6d 01 00-00 00 00 00 00 01 00 00 |.....m..........| 9a0e:00 00 00 00 00 00 00 00-00 00 00 00 00 00 54 46 |..............TF| 9a1e:1a 01 0e 65 0b 03 10 14-1e e0 65 0b 03 10 0d 34 |...e......e....4| 9a2e:e0 65 0b 03 10 14 1e e0- |.e...... | ff: Scanning name: 1;;-- ff: Checking name: LOADER ff: Length matched Found Lookup returned Len 20 Addr 0900:0000 LBA 00000026 Len 20 Addr 1900:0000 LBA 00000046 Len 10 Addr 2900:0000 LBA 00000066 Relocating the loader and the BTX Entry point: 00200000 Starting the BTX loader Console: serial port BIOS CD is cd0 BIOS drive A: is disk0 BIOS drive C: is disk1 BIOS 639kB/130048kB available memory FreeBSD/i386 bootstrap loader, Revision 1.0 (john@laptop.baldwin.cx, Sat Nov 3 16:19:24 PST 2001) / can't load 'kernel' Type '?' for a list of commands, 'help' for more detailed help. ok lsdev cd devices: cd0: Device 0x700 disk devices: disk0: BIOS drive A: disk1: BIOS drive C: disk1s1a: FFS disk1s1b: swap disk1s1e: FFS disk1s1f: FFS pxe devices: ok ls open '/' failed: no such file or directory ok No, I'm not an insane person copying all that by hand (there's actually a lot more as it does a hexdump of each directory entry while doing the lookup). The debug version does dual console to both the screen and COM1 at 9600n81 using the BIOS. :) -- 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.011103193407.jhb>