Query about GDT entries
Posted: Mon Jan 21, 2008 11:49 am
I have a query that is not clear in the tutorials.
In the GDT, there are 32 bits for the base address but only 20 bits for the limit.
As 2^32 is 4GB, I can see that it is possible to have a segment starting anywhere in memory.
However, only having 20 bits for the limit doesn't allow you to have a segment that extends along all of memory if the limit references individual bytes.
My question is: Does the limit refer to individual bytes or does it refer to 4KB sections. i.e. if you set the base to 0 and the limit to 1, you would be able to address the first 4KB of linear memory. (4KB because its the default page size and because 1MB * 4KB = 4GB).
Thanks,
Andrew
In the GDT, there are 32 bits for the base address but only 20 bits for the limit.
As 2^32 is 4GB, I can see that it is possible to have a segment starting anywhere in memory.
However, only having 20 bits for the limit doesn't allow you to have a segment that extends along all of memory if the limit references individual bytes.
My question is: Does the limit refer to individual bytes or does it refer to 4KB sections. i.e. if you set the base to 0 and the limit to 1, you would be able to address the first 4KB of linear memory. (4KB because its the default page size and because 1MB * 4KB = 4GB).
Thanks,
Andrew