summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-06-09 17:43:01 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-06-09 17:43:01 +0200
commit13e26c52945650293ccc5c6c31e1470f043d7d10 (patch)
tree7d0771bd8b609c85d146cc2aa04b98534423d731 /src/Makefile
parentc5320e104bf9cf6f8ec897d5a2b6679d21885906 (diff)
downloadabaos-13e26c52945650293ccc5c6c31e1470f043d7d10.tar.gz
abaos-13e26c52945650293ccc5c6c31e1470f043d7d10.tar.bz2
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)
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: