gdt: remove anything left from C implementation of GDT

This commit is contained in:
2025-03-18 16:24:11 +03:00
parent 086bac07ed
commit 22c7380c8d
8 changed files with 52 additions and 112 deletions
+23 -5
View File
@@ -1,20 +1,39 @@
bits 32
section .text
section .multiboot
align 4
dd 0x1BADB002
dd 0x00
dd - (0x1BADB002+0x00)
section.data
align 4
multiboot_info:
dd 0 ; flags
dd 0 ; mem_lower
dd 0 ; mem_upper
dd 0 ; boot_device
dd 0 ; cmdline
dd 0 ; mods_count
dd 0 ; mods_addr
section .bss
stack_bottom:
resb 16384
stack_top:
section .gdt
%include "src/gdt.asm"
section .text
global start
;global start
global start:function (start.end - start)
extern kmain ; this function is gonna be located in our c code(kernel.c)
start:
cli ;clears the interrupts
mov esp, stack_top
; cli ;clears the interrupts
lgdt [gdt]
mov ax, DATA_SEG
@@ -29,7 +48,6 @@ start:
push ebx
call kmain ;send processor to continue execution from the kamin funtion in c code
;;;;;;;;;;;DIVISION BY ZERO TEST
; mov ax, 10
; mov bx, 0
@@ -37,4 +55,4 @@ start:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
hlt ; halt the cpu(pause it from executing from this address
.end: