freebsd-dev/sys/boot/i386/cdboot/Makefile
John Baldwin 5af9115c77 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.
2001-11-04 03:24:16 +00:00

24 lines
424 B
Makefile

# $FreeBSD$
MAINTAINER=jhb@FreeBSD.org
ORG= 0x7c00
PROG= cdboot
NOMAN=
STRIP=
BINDIR?= /boot
${PROG}: ${PROG}.o
.if ${OBJFORMAT} == aout
${LD} -nostdlib -N -s -T ${ORG} -o ${PROG}.out ${PROG}.o
dd if=${PROG}.out of=${.TARGET} ibs=32 skip=1
.else
${LD} -N -e start -Ttext ${ORG} -o ${PROG}.out ${PROG}.o
objcopy -S -O binary ${PROG}.out ${.TARGET}
.endif
CLEANFILES+= ${PROG}.o ${PROG}.out
.include <bsd.prog.mk>