24 lines
392 B
ArmAsm
24 lines
392 B
ArmAsm
gdtr DW 0 ; limit store
|
|
DD 0 ; base storage
|
|
|
|
global set_gdt
|
|
set_gdt:
|
|
mov ax, [esp + 4]
|
|
mov [gdtr], ax
|
|
mov eax, [esp + 8]
|
|
mov [gdtr + 2], eax
|
|
lgdt [gdtr]
|
|
ret
|
|
|
|
global reload_segments
|
|
reload_segments:
|
|
jmp 0x08:.reload_CS ; 0x08 is a stand in for the code segment
|
|
.reload_CS:
|
|
mov ax, 0x10 ; stand in for the data segment
|
|
mov ds, ax
|
|
mov es, ax
|
|
mov fs, ax
|
|
mov gs, ax
|
|
mov ss, ax
|
|
ret
|