CustomBootloader/gdt.s
2022-02-27 20:03:19 +01:00

28 lines
555 B
ArmAsm

#GDT
gdt_start:
INITSEG = 0x0050
INITOFF = 0x0000
.section .rodata
gdt:
# Null Descriptor
.word 0x0000, 0x0000
.byte 0x00, 0b00000000, 0b00000000, 0x00
# Code Descriptor
.word 0xffff, (INITSEG * 0x10 + INITOFF)
.byte 0x00, 0b10011010, 0b11001111, 0x00
# Data Descriptor
.word 0xffff, (INITSEG * 0x10 + INITOFF)
.byte 0x00, 0b10010010, 0b11001111, 0x00
gdt_end:
gdt32ptr:
.word (gdt_end - gdt - 1)
.long (gdt + INITSEG * 0x10 + INITOFF)
gdt64ptr:
.word (gdt_end - gdt - 1)
.quad (gdt + INITSEG * 0x10 + INITOFF)