Set up GDT in Protected Mode (lgdtr question)
Posted: Wed May 15, 2024 5:43 am
Hi all, I'm experimenting with writing some simple bootloaders and currently I'm trying to switch to protected mode from real mode.
When reading the https://wiki.osdev.org/Global_Descriptor_Table wiki page, I stumbled upon something that made me wonder and question my understanding so far.
Specifically when loading the 6-byte register gdtr via lgdtr, the wiki says for the offset:
" Offset: The linear address of the GDT (not the physical address, paging applies)."
I don't get how paging applies at this point, when we still have not set page tables (or even disable paging because we can do so in protected mode).
I was under the impression that the offset at this point is the physical address of the start of the GDT.
Thanks!
When reading the https://wiki.osdev.org/Global_Descriptor_Table wiki page, I stumbled upon something that made me wonder and question my understanding so far.
Specifically when loading the 6-byte register gdtr via lgdtr, the wiki says for the offset:
" Offset: The linear address of the GDT (not the physical address, paging applies)."
I don't get how paging applies at this point, when we still have not set page tables (or even disable paging because we can do so in protected mode).
I was under the impression that the offset at this point is the physical address of the start of the GDT.
Thanks!