From ad8ab9b672d9f040f84b9933878b22fb291e41e7 Mon Sep 17 00:00:00 2001 From: Aiden Gall Date: Sun, 26 May 2024 22:22:14 +0100 Subject: add primitive vga terminal output --- boot/boot.asm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'boot/boot.asm') diff --git a/boot/boot.asm b/boot/boot.asm index eedde07..62f80f8 100644 --- a/boot/boot.asm +++ b/boot/boot.asm @@ -1,5 +1,7 @@ format ELF64 +extrn kmain + PML4_TABLE = 0x1000 E820_MMAP = 0xf000 @@ -9,7 +11,7 @@ include 'bios.inc' include 'page.inc' include 'segdesc.inc' -section '.text.boot' executable +section '.boot' executable writeable org 0x7c00 use16 @@ -104,12 +106,17 @@ longmode: xor ecx, ecx xor edx, edx xor edi, edi + xor esi, esi ; put stack at top of addressable memory mov esp, 0x200000 mov ebp, esp - jmp 0x100000 + ; manually encoded 'jmp rel32', fasm throws an 'invalid use of symbol' + ; error when generating code for a jmp to an external symbol after + ; setting code origin with 'org' directive or a 'virtual at X' block. + db 0xe9 + dd kmain-$-4 align 4 dw 0 -- cgit v1.2.3