diff options
| author | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2023-12-13 01:38:14 +0100 |
|---|---|---|
| committer | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2024-04-02 23:17:31 +0200 |
| commit | 36137438446c1754a522c5b3cc3aff92c43ac1ee (patch) | |
| tree | f7358ef0aec7023321e52e116f94fba95e52611f /src/arch/x86_64/boot/boot64.S | |
X86/X86_64 debug/release WORKING
riscv64 WORKING uart
idk
Diffstat (limited to 'src/arch/x86_64/boot/boot64.S')
| -rw-r--r-- | src/arch/x86_64/boot/boot64.S | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/arch/x86_64/boot/boot64.S b/src/arch/x86_64/boot/boot64.S new file mode 100644 index 0000000..848256f --- /dev/null +++ b/src/arch/x86_64/boot/boot64.S @@ -0,0 +1,26 @@ +.code64 + +.set KERNEL_VMA, 0xffffffff80000000 +.set GDT_KERNEL_CS, 0x10 + +.section .boot64.text, "a" + +.global begin_long_mode +begin_long_mode: + mov $GDT_KERNEL_CS, %ax + mov %ax, %ds + mov %ax, %es + mov %ax, %ss + mov %ax, %fs + mov %ax, %gs + + add $KERNEL_VMA, %rsp + movabs $jump_main, %rax + jmp *%rax + +.section .text +jump_main: + popq %rdi + popq %rsi + call kernel_main + hlt |
