Confused about GDT table

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
Peter
Posts: 13
Joined: Wed Jan 05, 2005 12:00 am

Confused about GDT table

Post by Peter »

Hi people,

Sorry for so many questions but I'm very confused :-P.

When I set up a GDT Table, there is a limit and base.
Base have a maximum for 4GB, but why is the limit only 16bits?
another question is, if I make the BASE 1MB, the BASE contain 0x10000 but why not ox1024?
I'm a little bit confused, do you guys know a good tut ore something?

Thanks :D Peter
sz
Posts: 3
Joined: Tue Jan 04, 2005 12:00 am
Location: Switzerland
Contact:

Re: Confused about GDT table

Post by sz »

It's again the hexadecimal system - 0x100000 = 1* 16^5 = 1,048,576 (dec) = 1 MB
Peter
Posts: 13
Joined: Wed Jan 05, 2005 12:00 am

Re: Confused about GDT table

Post by Peter »

Thanks :D, do you either why the limit is only 24 bits and de base 32?
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: Confused about GDT table

Post by JAAman »

because the 286 (for which it was designed) only had 24 address lines(therefore 24bits)

iirc: if you set limit to max it will mean 4GB: get the intel manuals they describe it better than i ever could and a lot of other things youre going to need to know

also: you wont get very far without knowing HEX -- learn it BEFORE continuing it is very useful -- plus its what everyone else uses so you will be at a huge disadvantage if you dont know it

btw: anytime you see 0x before a number it means that it is in HEX (that is zero not o)


hope this helps you out
Last edited by JAAman on Thu Jan 06, 2005 12:00 am, edited 1 time in total.
Peter
Posts: 13
Joined: Wed Jan 05, 2005 12:00 am

Re: Confused about GDT table

Post by Peter »

Thanks for your reply :D,

I know the HEX and the o whas a spelling mistake,
Where can I find the intell manual, I'm Dutch and only 14 years old so its hard to understand all those hard things but thanks.
1 question....

When I make a segment model in PMODE, The maximum amount of one segment model is the maximum of the LIMIT, that is 16MB.


Is that right?

Thanks :D
Last edited by Peter on Thu Jan 06, 2005 12:00 am, edited 1 time in total.
User avatar
gaf
Member
Member
Posts: 349
Joined: Thu Oct 21, 2004 11:00 pm
Location: Munich, Germany

Re: Confused about GDT table

Post by gaf »

Hi Peter,
you can either download the reference manual from Intel (http://www.intel.com/design/pentium4/ma ... ex_new.htm) or browse though it in this online version (my.tele2.ee/mtx/i386/manual.htm - pretty usefull if you want to quote something on a message board). Anyway, the reference manual might be usefull to look thinks up but it can't replace a good tutorial or a messageboard.
When I make a segment model in PMODE, The maximum amount of one segment model is the maximum of the LIMIT, that is 16MB.
A segment in pmode can span the whole 4GB address-space. First of all it should be said that 20bits are used to describe the limit (my.tele2.ee/mtx/i386/chp06-03.htm#06-03 - have a look at the ASCII art). These 20bits can, of course, only descibe 1MB. In order to support limits larger than 1MB a small trick is used. If a special attribute bit in the descriptor is set (I think it's the 'G'-bit) the value in the limit-field is in 4kb (2^12) pages. The imit is basically multiplied with 4096.

20bits + 12bits = 32 bits

examples:
G-bit = 0
limit = 0x100
-> segment limit is 0x100 (=245bytes - sorry)

G-bit = 1
limit 0x100
-> segment limit is 0x100*0x1000 = 0x100000 (=1MB)

regards,
gaf
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: Confused about GDT table

Post by JAAman »

sorry for the mis-information its been a long time since i studied the GDT and i didnt have my manuals with me
Peter
Posts: 13
Joined: Wed Jan 05, 2005 12:00 am

Re: Confused about GDT table

Post by Peter »

Thanks alot! :-D,

I was on a holiday so I couldn't reply.
Post Reply