now it should boot on an IBM PC correctly (tested on pcem)
[eightysix] / Makefile
index 8e95cce..5c19343 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,17 @@
-bin = boot.img
+disk_numsec = 720
+#disk_numsec = 2880
+
+bin = bootldr
+img = bootldr.img
 
 CC = ia16-elf-gcc
 LD = ia16-elf-ld
 
-CFLAGS = -march=i8088 -mtune=i8088
+CFLAGS = -march=i8088 -mtune=i8088 -DFLOPPY360
+
+$(img): $(bin)
+       dd if=/dev/zero of=$@ bs=512 count=$(disk_numsec)
+       dd if=$< of=$@ bs=512 conv=notrunc
 
 $(bin): boot/boot.o boot/boot2.o boot/main.o
        $(LD) -T boot.ld -Map boot.map -o $@ $^
@@ -17,12 +25,12 @@ clean:
 
 
 .PHONY: run
-run: $(bin)
-       qemu-system-i386 -fda $(bin) -serial file:serial.log
+run: $(img)
+       qemu-system-i386 -fda $(img) -serial file:serial.log
 
 .PHONY: debug
-debug: $(bin)
-       qemu-system-i386 -fda $(bin) -serial file:serial.log -s -S
+debug: $(img)
+       qemu-system-i386 -fda $(img) -serial file:serial.log -s -S
 
 .PHONY: disasm
 disasm: $(bin)