Syncboot/arch/i386/gdt.s
Jenny Curle 31d2e10b69 Implement a GDT, IDT with ISR and IRQ
Basically, added error handling, interrupts and basic hardware communication is now possible. Yay.
2019-04-07 23:43:09 +01:00

17 lines
531 B
ArmAsm
Executable File

; This file is written with Intel ASM Syntax.
[GLOBAL load_gdt] ; Allows the C code to call gdt_flush().
[EXTERN gp]
load_gdt:
; Get the pointer to the GDT, passed as a parameter.
lgdt [gp] ; Load the new GDT pointer
mov ax, 0x10 ; 0x10 is the offset in the GDT to our data segment
mov ds, ax ; Load all data segment selectors
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
jmp 0x08:flush ; 0x08 is the offset to our code segment: Far jump!
flush:
ret