GDT

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Petertje
Posts: 7
Joined: Wed Apr 13, 2005 11:00 pm

GDT

Post by Petertje »

Hi,

I have a little quastion about the GDT. The maximum of the limit is 16bits, isn't it? if the segmet limit is 32bits. 16 ^ 8 = 4gb so the limit couldn't be greater than 16bits. But where does the flags & limit byte stand for?


Peter
Last edited by Petertje on Fri Apr 22, 2005 11:00 pm, edited 1 time in total.
User avatar
gaf
Member
Member
Posts: 349
Joined: Thu Oct 21, 2004 11:00 pm
Location: Munich, Germany

Re: GDT

Post by gaf »

Hello,
a descriptor has a 20bit limit (http://my.tele2.ee/mtx/i386/chp06-03.htm#F-06-01) which is sufficient for limits from (2^0 = 1 to 2^20 = 1MB). For a higher limit the G-bit (granularity) has to be set. The 20bit value is then multiplied with 4096 (2^12) so that limits from 4kb to 4GB are possible (http://my.tele2.ee/mtx/i386/chp06-03.htm#06-03-01-02).

btw:
You can calculate how many (different) numbers are possible with n digits as following:

base^digits

2^32 = 4gb
2^16 = 64kb
10^3 = 1000 (0-999)
16^2 = 256
...

regards,
gaf
Petertje
Posts: 7
Joined: Wed Apr 13, 2005 11:00 pm

Re: GDT

Post by Petertje »

Thanks alot!

By setting the G-bit it is possible to acces the 4gb. Otherwise 1 segment can only acces 1mb. Right?
ZOSdever
Member
Member
Posts: 79
Joined: Thu Mar 31, 2005 12:00 am
Contact:

Re: GDT

Post by ZOSdever »

I think
Post Reply