20 lines
342 B
ArmAsm
20 lines
342 B
ArmAsm
gdtr DW 0 ; limit store
|
|
DD 0 ; base storage
|
|
|
|
global setGdt
|
|
setGdt:
|
|
mov ax, [esp + 4]
|
|
mov [gdtr], ax
|
|
mov eax, [esp + 8]
|
|
mov [gdtr + 2], eax
|
|
lgdt [gdtr]
|
|
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
|