dbg = -g
inc = -Isrc -Isrc/libc
-CFLAGS = $(ccarch) $(warn) $(dbg) -nostdinc -fno-builtin $(inc) $(def)
-ASFLAGS = $(asarch) $(dbg) -nostdinc -fno-builtin $(inc)
+CFLAGS = $(ccarch) -march=i386 $(warn) $(dbg) -nostdinc -fno-builtin $(inc) $(def)
+ASFLAGS = $(asarch) -march=i386 $(dbg) -nostdinc -fno-builtin $(inc)
LDFLAGS = $(ldarch) -T pcboot.ld -print-gc-sections
ldarch = -m elf_i386
endif
+floppy.img: $(bin)
+ dd if=/dev/zero of=$@ bs=512 count=2880
+ dd if=$< of=$@ conv=notrunc
+
$(bin): $(elf)
objcopy -O binary $< $@
.PHONY: clean
clean:
- rm -f $(obj) $(bin)
+ rm -f $(obj) $(bin) floppy.img
.PHONY: cleandep
cleandep:
.PHONY: run
run: $(bin)
- qemu-system-i386 -fda $(bin)
+ qemu-system-i386 -fda floppy.img -serial file:serial.log