rdos/Makefile
2019-03-31 20:53:33 +00:00

20 lines
481 B
Makefile

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