FENIX_kernel/arch/i386/gdt.S
2020-12-01 20:59:57 -06:00

34 lines
403 B
ArmAsm

.globl set_gdt
.type set_gdt,%function
gdtr:
.word 0
.int 0
set_gdt:
.fnstart
mov 4(%esp), %eax
mov %eax, 2($gdtr)
mov 8(%esp), %ax
mov %ax, $gdtr
lgdt $gdtr
ret
.fnend
.globl reload_segments
.type reload_segments,%function
reload_segments:
.fnstart
jmp 0x08:reload_CS
.fnend
reload_CS:
mov 0x10, %ax
mov %ax, %ds
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
mov %ax, %ss
ret