Fix to make making a bootable cd possible again.

ow that the image has grown beyond the 1.44M that fits on a floppy.
(previously, the floppy emulation mode was used for cd's.)

the boot cd now uses 'no emulation mode,' where an image is provided on
the cd that is loaded and executed directly. this is the boot monitor.

in order to make this work (the entry point is the same as where the
image is loaded, and the boot monitor needs its a.out header too) and
keep compatability with the same code being used for regular booting, i
prepended 16 bytes that jumps over its header so execution can start
there.

to be able to read the CD (mostly in order to read the boot image),
boot has to use the already present 'extended read' call, but address
the CD using 2k sectors.
This commit is contained in:
Ben Gras
2010-01-18 14:10:04 +00:00
parent 5efa92f754
commit daca9de450
8 changed files with 191 additions and 103 deletions

View File

@@ -36,9 +36,16 @@ rawfs86.o: rawfs.c rawfs.o
-cmp -s rawfs.o rawfs86.o && ln -f rawfs.o rawfs86.o
boot: boothead.s boot.o bootimage.o rawfs86.o
$(LD86) -o $@ \
$(LD86) -o bootexec \
boothead.s boot.o bootimage.o rawfs86.o $(LIBS)
install -S 8kb boot
install -S 12kb bootexec
# This is code that is executed when used on a bootable
# CD, as its entry point is the start of the file then.
# It jumps over the a.out header into the part of the
# code in boothead.s where the code knows it's booting
# from CD if entered there.
( printf '\xeb\x3e ' ; cat bootexec ) >boot
chmod 755 boot
edparams.o: boot.c
ln -f boot.c edparams.c
@@ -112,5 +119,5 @@ $(BIN)/edparams: edparams
clean:
rm -f *.bak *.o
rm -f bootblock addaout installboot boot masterboot jumpboot edparams
rm -f bootblock addaout installboot boot masterboot jumpboot edparams
rm -f dosboot boot.com mkfile mkfile.com