Code: Select all
GDTLM:
.Null: equ $ - GDTLM
dq 0
.Code: equ $ - GDTLM
dw 0xffff
dw 0
db 0
db 10011010b
db 10101111b
db 0
.Data: equ $ - GDTLM
dw 0xffff
dw 0
db 0
db 10010010b
db 11001111b
db 0
.UserCode: equ $ - GDTLM
dw 0xffff
dw 0
db 0
db 11111010b
db 10101111b
db 0
.UserData: equ $ - GDTLM
dw 0xffff
dw 0
db 0
db 11110010b
db 10101111b
db 0
.Pointer:
dw $ - GDTLM - 1
dq GDTLM
Code: Select all
cli
push 0x23
push rsp
pushfq
push 0x1B
push _user
iretq
Code: Select all
00392068645e[CPU0 ] check_cs(0x5045): not a valid code segment !
00392068648e[CPU0 ] check_cs(0x5534): not a valid code segment !
00392068651e[CPU0 ] check_cs(0x5534): not a valid code segment !
00392068654e[CPU0 ] check_cs(0x5534): not a valid code segment !
Code: Select all
00392068918e[CPU0 ] interrupt(long mode): not accessible or not code segment
00392068918e[CPU0 ] interrupt(long mode): not accessible or not code segment
I've already asked this question on stackoverflow, but no one helped.
What do I do to make it work?