-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 $@ $^
.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)