Files
kern/boot/stage1/gdt.s
T
Tom-on 707733e449 MAJOR REWRITE
- Kernel got pretty much deleted, will be rewriting in following days
- Bootloader got rewritten, stage1 works, stage2 will be written in following days
- Libc is still the same
- User will contains userspace stuff
- Rewrote makefiles again
- Got rid of backup (see previous commits for that)
- Image has 1 MBR partition for FAT32 which contains 'kern.bin' file
- Remade info files to be more "big project" style (all caps plain text)
- Added some dumb docs
2024-12-31 20:05:37 +01:00

29 lines
885 B
ArmAsm

; Global Descriptor Table
gdt:
.null_desc: ; Just zeros, no clue why it even exists
dq 0
.code_desc: ; 32-bit code
dw 0xffff ; Limit (low 16-bits)
dw 0x0000 ; Base (low 16 bits)
db 0x00 ; Base (mid 8 bits)
db 0b10011011 ; Access flags
db 0b11001111 ; Low 4 bits - Granularity, High 4 bits - Limit (high 4 bits)
db 0x00 ; Base (high 8 bits)
.data_desc: ; 32-bit data
dw 0xffff ; Limit (low 16-bits)
dw 0x0000 ; Base (low 16 bits)
db 0x00 ; Base (mid 8 bits)
db 0b10010011 ; Access flags
db 0b11001111 ; Low 4 bits - Granularity, High 4 bits - Limit (high 4 bits)
db 0x00 ; Base (high 8 bits)
.end:
; GDT Pointer
gdtp:
dw gdt.end - gdt - 1 ; Size
dd gdt ; Pointer
; Segments
code_seg equ gdt.code_desc - gdt
data_seg equ gdt.data_desc - gdt