diff options
author | Aiden Gall <aiden@aidengall.xyz> | 2024-05-26 22:22:14 +0100 |
---|---|---|
committer | Aiden Gall <aiden@aidengall.xyz> | 2024-05-26 22:22:14 +0100 |
commit | ad8ab9b672d9f040f84b9933878b22fb291e41e7 (patch) | |
tree | 8bc093e045723f8f5c234150a407760189ce8e05 /boot | |
parent | 5ebc67833086eccb3c3b1708745c927d5bcfd811 (diff) |
Diffstat (limited to 'boot')
-rw-r--r-- | boot/boot.asm | 11 |
1 files changed, 9 insertions, 2 deletions
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 |