From 87af837c6222555eb973a566c8ee3d50c8767052 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Wed, 11 Aug 2021 19:00:59 +0200 Subject: [PATCH 1/2] Minor qemu bug --- start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 902b71d..82314f9 100755 --- a/start.sh +++ b/start.sh @@ -1,9 +1,10 @@ #!/usr/bin/bash bootloader=bin/bootloader.bin +osimage=bin/os-image start_bootloader() { - qemu-system-x86_64 $bootloader + qemu-system-x86_64 $osimage } compile() { From 7519806d1bfaef930f0df75e5de3c8c3368d4cdf Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Wed, 11 Aug 2021 19:11:22 +0200 Subject: [PATCH 2/2] Kernel execution --- compile.sh | 2 +- src/bootloader.asm | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/compile.sh b/compile.sh index ccdc9cd..57f142e 100755 --- a/compile.sh +++ b/compile.sh @@ -12,5 +12,5 @@ nasm -f bin $srcDir/bootloader.asm -i $srcDir -o $binDir/bootloader.bin && echo echo -n "Compiling kernel... " gcc -ffreestanding -c $srcDir/kernel.c -o $binDir/kernel.o && ld -o $binDir/kernel.bin -Ttext 0x1000 $binDir/kernel.o --oformat binary 2>/dev/null && echo $done -echo -n "Creating kernel image... " +echo -n "Creating OS image... " cat $binDir/bootloader.bin $binDir/kernel.bin > $binDir/os-image && echo $done diff --git a/src/bootloader.asm b/src/bootloader.asm index c66640c..b477677 100644 --- a/src/bootloader.asm +++ b/src/bootloader.asm @@ -25,9 +25,13 @@ %include "pm.asm" BEGIN_PM: - mov ebx, stat_pm_init + ; Inform of mode switch + mov ebx, stat_boot_success call vga_print + ; Execute kernel code + call KERNEL_OFFSET + jmp $ [bits 16]