From 71a2942a0a81a53831ade3c6dec106caafd29c5b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 8 Nov 2018 02:03:19 +0100 Subject: [PATCH] Make it run in QEMU. Looks like the problem was the weirdly-sized floppy image file. I guess QEMU was inferring the floppy disk geometry from the image size. --- Kernel/Makefile | 5 ++++- Kernel/run | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Kernel/Makefile b/Kernel/Makefile index 976a81e5d96..0b001661e1e 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -80,7 +80,10 @@ $(KERNEL): $(OBJS) @echo "LD $@"; $(LD) $(LDFLAGS) -o $@ -Ttext 0x10000 $(OBJS) $(IMAGE): $(KERNEL) $(BOOTLOADER) - @echo "CREATE $@"; cat $(BOOTLOADER) $(KERNEL) > $(IMAGE) + @echo "CREATE $@"; cat $(BOOTLOADER) $(KERNEL) > .tmp-floppy-image + @dd if=/dev/zero bs=2M count=1 >> .tmp-floppy-image 2> /dev/null + @dd if=.tmp-floppy-image of=.floppy-image bs=1440k count=1 2>/dev/null + @rm -f .tmp-floppy-image $(BOOTLOADER): Boot/boot.asm @echo "NASM $<"; $(NASM) -f bin -o $@ $< diff --git a/Kernel/run b/Kernel/run index 688f381619d..a856bcf5f65 100755 --- a/Kernel/run +++ b/Kernel/run @@ -1,8 +1,8 @@ #!/bin/sh -if [ "$1" = "q" ]; then - qemu-system-i386 -drive format=raw,file=.floppy-image,if=floppy -drive format=raw,file=_fs_contents #$@ -else +if [ "$1" = "b" ]; then bochs -q -f .bochsrc +else + qemu-system-i386 -m 32 -drive format=raw,file=.floppy-image,if=floppy -drive format=raw,file=_fs_contents #$@ fi