I am studying Kernel development. Using a book I have come to a point. However, I cannot realy understand the affect of global descriptor table. My GDT is as follows:
gdt_star:
gdt_null:
dd 0x0
dd 0x0
gdt_code:
dw 0xffff
dw 0x0000
db 0x00
db 10011011b
db 11001111b
db 0x0
gdt_data:
dw 0xffff
dw 0x0
db 0x00
db 10010010b
db 11001111b
db 0x0
gdt_end:
gdt_descriptor:
dw gdt_end - gdt_star - 1
dd gdt_star
CODE_SEG equ gdt_code - gdt_star
DATA_SEG equ gdt_data - gdt_star
After loading gdt and assigning DATA_SEG to ds, ss, es, fs, gs registers; my assembly code jumps to c code. Data segment base address is 0x00000000 and the limit is 0xffff. Shouldn't it be impossible to put a value to 0x100000 memory address?
Thank you