From 13e26c52945650293ccc5c6c31e1470f043d7d10 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 9 Jun 2017 17:43:01 +0200 Subject: fixed stage 1 boot loader problems (worked in some BIOSes across the 2 times sector/track limit). loading sectors one by one now fixed also spin down problem after loading stage 2 and the kernel for now tested with 1.44 MB floppies (both real and in bochs/qemu) --- src/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Makefile') 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: -- cgit v1.2.3-54-g00ecf