Commit Diff


commit - ce2fe6074b26d5e2a24125d0a40bee93e6da5751
commit + 6b04638f5bbbc03cf5848b9d69c8ffe6204048e0
blob - 9cccd7b79bc793815e2ede3b2acecfb8968ee503
blob + 722893b531ef4abd9d897099a15cd772593b7b42
--- sys/Makefile
+++ sys/Makefile
@@ -11,17 +11,20 @@ xxd: ${IMG}
 	xxd ${IMG} | less
 
 clean:
-	rm -f *.o *.elf *.img
+	rm -f *.o *.elf *.bin *.img
 
 run: ${IMG}
 	qemu-system-i386 -M pc -m 1M -fda ${IMG}
 
-floppy1440.img: sys.elf
-	objcopy -O binary --pad-to $$((2880 * 512)) sys.elf floppy1440.img
+floppy1440.img: sys.bin
+	cat sys.bin /dev/zero | dd of=floppy1440.img bs=512 count=2880
 
-sys.img: sys.elf
-	objcopy -O binary --pad-to $$((128 * 512)) sys.elf sys.img
+sys.img: sys.bin
+	cat sys.bin /dev/zero | dd of=sys.img bs=512 count=128
 
+sys.bin: sys.elf
+	objcopy -O binary sys.elf sys.bin
+
 sys.elf: linker.ld ${OBJ}
 	ld -o $@ -T linker.ld ${OBJ} ${LDFLAGS}