Add mechanism for additional files on floppy
This commit is contained in:
parent
fc0dd47d48
commit
956df75dae
2 changed files with 26 additions and 4 deletions
13
Makefile
13
Makefile
|
@ -2,6 +2,9 @@ FD_CYLINDERS = 40
|
|||
FD_HEADS = 2
|
||||
FD_SECTORS = 9
|
||||
|
||||
PROGRAMS = $(patsubst %.asm,%.com,$(wildcard programs/*.asm))
|
||||
DISTFILES = kernel.com $(PROGRAMS)
|
||||
|
||||
QEMU_ARCH = $(shell uname -m)
|
||||
QEMU = qemu-system-$(QEMU_ARCH)
|
||||
|
||||
|
@ -31,14 +34,16 @@ debug.rom: debug/*.asm lib/*.inc
|
|||
floppy.bs: boot/fatvbr.asm
|
||||
nasm -s -DCMDLINE='"KERNEL.COM"' -o $@ $<
|
||||
|
||||
fdimage.img: floppy.bs kernel.com
|
||||
programs/%.com: programs/%.asm
|
||||
nasm -s -I lib -o $@ $<
|
||||
|
||||
fdimage.img: floppy.bs $(DISTFILES)
|
||||
dd if=/dev/zero bs=512 count=$$(( $(FD_CYLINDERS) * $(FD_HEADS) * $(FD_SECTORS) )) of=$@
|
||||
mformat -i $@ -t $(FD_CYLINDERS) -h $(FD_HEADS) -n $(FD_SECTORS) -B floppy.bs ::
|
||||
mcopy -i $@ kernel.com ::kernel.com
|
||||
mattrib -i $@ +s ::kernel.com
|
||||
mcopy -i $@ $(DISTFILES) ::
|
||||
|
||||
clean:
|
||||
rm -f *.com *.bin *.rom *.img *.log *.bs *.lst
|
||||
rm -f *.com *.bin *.rom *.img *.log *.bs *.lst programs/*.com
|
||||
|
||||
qemu-floppy: fdimage.img $(DEBUGROM)
|
||||
$(QEMU) $(QEMU_ARGS) -boot c -fda fdimage.img
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue