FENIX_kernel/arch/i386/gdt.S

35 lines
403 B
ArmAsm
Raw Normal View History

2020-12-02 02:59:57 +00:00
.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