Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gdt64_start:
- ; Null
- dq 0
- ; Code (0x8)
- dw 0x0000 ; Limit lower
- dw 0x0000 ; Base lower
- db 0x00 ; Base middle
- db 10011010b ; Access..
- ; NOTE: The AMD Volume 2, page 88 says that the segment limit fields
- ; are actually ignored in long mode. The OSDev long mode page, however,
- ; says that the CPU will make one last limit check when jumping into long mode
- ; (tested by them in Bochs) and that's why I also set the higher bits
- ; of the limit to 1111. However, I also tested with 0000 and it works.
- ; Maybe it was a bug in Bochs that lead to checking the limit when
- ; jumping to long mode?
- db 10101111b ; Granularity & Limit
- db 0x00 ; Base higher
- ; Data (0x8)
- dw 0x0000 ; Limit lower
- dw 0x0000 ; Base lower
- db 0x00 ; Base middle
- db 10010010b ; Access..
- db 00000000b ; Granularity & Limit
- db 0x00 ; Base higher
- gdt64_end:
- gdt64_pointer:
- dw gdt64_end - gdt64_start - 1
- dq gdt64_start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement