I have gone through the basics of Global Descriptor Table (GDT) and i have successfully written a "GDT.inc" using asm , so that we can easily include it in our bootloader. As a baby step i have configured the Code Descriptor and Data Descriptor to read and write from the first byte to byte 0xFFFFFFFF in memory (any portion in memory)
; null descriptor
dd 0 ; null descriptor--just fill 8 bytes with zero
dd 0
; code descriptor: ; code descriptor. Right after null descriptor
dw 0FFFFh ; limit low
dw 0 ; base low
db 0 ; base middle
db 10011010b ; access
db 11001111b ; granularity
db 0 ; base high
; data descriptor: ; data descriptor
dw 0FFFFh ; limit low (Same as code)
dw 0 ; base low
db 0 ; base middle
db 10010010b ; access
db 11001111b ; granularity
db 0 ; base high
Now my purpose is to create two separate regions using GDT .For example , first 512B as one region and next 512B as another region and leaving the space left as unused.
What can i do for that ?