gdt: make gdt setup run before kmain

This commit is contained in:
2025-03-18 15:45:51 +03:00
parent a899964fce
commit 086bac07ed
3 changed files with 47 additions and 1 deletions
+16
View File
@@ -6,11 +6,27 @@ section .text
dd 0x00
dd - (0x1BADB002+0x00)
section .gdt
%include "src/gdt.asm"
section .text
global start
extern kmain ; this function is gonna be located in our c code(kernel.c)
start:
cli ;clears the interrupts
lgdt [gdt]
mov ax, DATA_SEG
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
jmp CODE_SEG:.huita
.huita:
push ebx
call kmain ;send processor to continue execution from the kamin funtion in c code