rdos/Makefile

20 lines
508 B
Makefile

FD_CYLINDERS = 40
FD_HEADS = 2
FD_SECTORS = 9
default: kernel.rom
kernel.rom: kernel/*.asm
nasm -s -o $@ -I kernel kernel/main.asm && ./fix-rom.sh $@
boot/%.bin: boot/%.asm
nasm -s -o $@ -I lib $<
fdimage.img: boot/floppy.bin kernel.rom
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 boot/floppy.bin ::
mcopy -i $@ kernel.rom ::kernel.rom
clean:
rm -f *.com *.bin *.rom *.img boot/*.bin