Get MBR ready, add hdimage target

This commit is contained in:
Nero 2019-09-17 22:41:39 +00:00
parent 7c4a618385
commit c70f388548
3 changed files with 79 additions and 7 deletions

View file

@ -29,18 +29,27 @@ kernel.com: kernel/*.asm lib/*.inc
debug.rom: debug/*.asm lib/*.inc
nasm -s -o $@ -I lib -I debug debug/main.asm && scripts/fix-rom.sh $@
floppy.bs: boot/fatvbr.asm
boot/floppy.bs: boot/fatvbr.asm
nasm -s -DCMDLINE='"KERNEL.COM"' -o $@ $<
boot/mbr.bs: boot/mbr.asm
nasm -s -DFLOPPY=$(FLOPPY) -o $@ $<
programs/%.com: programs/%.asm
nasm -s -I lib -o $@ $<
fdimage.img: floppy.bs $(DISTFILES)
mformat -C -i $@ -f $(FLOPPY) -B floppy.bs ::
fdimage.img: boot/floppy.bs $(DISTFILES)
mformat -C -i $@ -f $(FLOPPY) -B boot/floppy.bs ::
mcopy -i $@ $(DISTFILES) ::
hdimage.img: boot/mbr.bs fdimage.img
cat boot/mbr.bs fdimage.img >$@
clean:
rm -f *.com *.bin *.rom *.img *.log *.bs *.lst programs/*.com
qemu-floppy: fdimage.img $(DEBUGROM)
$(QEMU) $(QEMU_ARGS) -boot c -fda fdimage.img
qemu-hdd: hdimage.img $(DEBUGROM)
$(QEMU) $(QEMU_ARGS) -boot c -hda hdimage.img