Allow arbitrary floppy sizes
This commit is contained in:
parent
208b2f95b5
commit
dad80532ab
18
Makefile
18
Makefile
@ -1,15 +1,19 @@
|
|||||||
|
FD_CYLINDERS = 40
|
||||||
|
FD_HEADS = 2
|
||||||
|
FD_SECTORS = 9
|
||||||
|
|
||||||
default: kernel.com
|
default: kernel.com
|
||||||
|
|
||||||
boot.bin: kernel/*.asm
|
kernel.bin: kernel/*.asm
|
||||||
nasm -s -o $@ -I kernel kernel/main.asm
|
nasm -s -o $@ -I kernel kernel/main.asm
|
||||||
|
|
||||||
%.bin: boot/%.asm
|
boot/%.bin: boot/%.asm
|
||||||
nasm -s -o $@ -I lib $<
|
nasm -s -o $@ -I lib $<
|
||||||
|
|
||||||
fdimage.img: fat12vbr.bin boot.bin
|
fdimage.img: boot/floppy.bin kernel.bin
|
||||||
dd if=/dev/zero bs=512 count=720 of=$@
|
dd if=/dev/zero bs=512 count=$$(( $(FD_CYLINDERS) * $(FD_HEADS) * $(FD_SECTORS) )) of=$@
|
||||||
mformat -i $@ -f 360 -B fat12vbr.bin ::
|
mformat -i $@ -t $(FD_CYLINDERS) -h $(FD_HEADS) -n $(FD_SECTORS) -B boot/floppy.bin ::
|
||||||
mcopy -i fdimage.img boot.bin ::boot.bin
|
mcopy -i fdimage.img kernel.bin ::boot.bin
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.com *.bin *.img
|
rm -f *.com *.bin *.img boot/*.bin
|
||||||
|
Loading…
Reference in New Issue
Block a user