summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile
index 615c3b6..24d0088 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -14,10 +14,14 @@ all: image.bin kernel.sym
# + 1 * 512 = 512 for magic.bin
# (M + N + 1 is the number of sectors to be read in stage 2, as stage 1
# loads only the first sector, so adapt NOF_LOAD_SECTORS to 38)
+# then we make sure the image has the size of a 1.44 MB floppy
+# (emulators like qemu do some guess work for CHS resolution based
+# on the size of the image)
image.bin: boot.bin kernel.bin magic.bin
cat boot.bin kernel.bin > image.tmp
truncate -s 19456 image.tmp
cat image.tmp magic.bin > image.bin
+ truncate -s 1474560 image.bin
boot.bin: boot.asm boot_gdt.asm stage1_functions.asm stage2_functions.asm stage2_switch_mode.asm stage2_a20.asm
$(NASM) boot.asm -DMAGIC='"$(MAGIC)"' -f bin -o boot.bin
@@ -94,11 +98,11 @@ clean:
-rm -f boot.bin kernel.bin kernel.sym kernel.elf image.bin magic.bin *.o boot.map image.tmp
run-qemu: image.bin
- qemu-system-i386 -net nic,model=ne2k_pci -d guest_errors -m 32 -drive "file=image.bin,if=ide,format=raw" \
+ qemu-system-i386 -net nic,model=ne2k_pci -d guest_errors -m 32 -drive "file=image.bin,if=floppy,format=raw" \
-serial file:serial.log
run-qemu-debug: image.bin
- qemu-system-i386 -net nic,model=ne2k_pci -S -s -d guest_errors -m 32 -drive "file=image.bin,if=ide,format=raw" \
+ qemu-system-i386 -net nic,model=ne2k_pci -S -s -d guest_errors -m 32 -drive "file=image.bin,if=floppy,format=raw" \
-serial file:serial.log
run-bochs: