doing some memory work and gdt and timer and vga

This commit is contained in:
2025-05-13 11:39:16 -07:00
parent 10b8fdc33f
commit 799f744f47
14 changed files with 273 additions and 21 deletions

View File

@@ -0,0 +1,21 @@
; gdt.asm
; Assembler function to load the GDT and update segment registers
global gdt_flush
gdt_flush:
mov eax, [esp + 4] ; Argument: pointer to GDT descriptor
lgdt [eax] ; Load GDT
; Reload segment registers
mov ax, 0x10 ; 0x10 = offset to kernel data segment (3rd entry)
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
; Jump to flush the instruction pipeline and load CS
jmp 0x08:.flush ; 0x08 = offset to code segment (2nd entry)
.flush:
ret