Page 1 of 1
What is GDT (Global Descriptor Table) ?
Posted: Mon Dec 05, 2016 3:57 pm
by fandomas
What does the GDT do?
I know that IVT is and for what is used for. But GDT is needed for Protected Mode. What is it and where is useful?
Any nice and practical link would be also useful
Thanks in advance
Fandomas
Re: What is GDT (Global Descriptor Table) ?
Posted: Mon Dec 05, 2016 4:13 pm
by Ch4ozz
Re: What is GDT (Global Descriptor Table) ?
Posted: Mon Dec 05, 2016 4:20 pm
by fandomas
any more practical ones? (ASM)
Re: What is GDT (Global Descriptor Table) ?
Posted: Mon Dec 05, 2016 9:06 pm
by StudlyCaps
This what you're after?
http://wiki.osdev.org/GDT_Tutorial
I only just implemented a GDT myself (like 2 weeks back), so I recommend you read the wiki article but I can give you a quick answer to your questions.
Primarily the GDT is an array of elements describing segments, each one identifies a range of memory and a set of permissions for that memory. In protected mode, the segment registers - CS, DS,
et al, don't store memory offsets, but offsets into the GDT.
You need to setup a GDT with at least one code segment and one r/w data segment for ring 0 and one code and one data segment for ring 3. If you attempt a switch to protected mode without a valid GDT the processor will attempt to access the code segment, find that there is no valid code segment, and fault.
Beyond that, the GDT can also store Task State Segments, which are used in hardware multitasking, Local Descriptor Tables (legacy memory protection feature) and Call Gate descriptors, used to implement calls across protection rings.
Re: What is GDT (Global Descriptor Table) ?
Posted: Tue Dec 06, 2016 5:38 pm
by fandomas
Thank you very much. Very appreciated. I needed a short answer.
Again thanks.
Re: What is GDT (Global Descriptor Table) ?
Posted: Thu Dec 15, 2016 9:18 am
by rgmf
fandomas wrote:What does the GDT do?
I know that IVT is and for what is used for. But GDT is needed for Protected Mode. What is it and where is useful?
Any nice and practical link would be also useful
Thanks in advance
Fandomas
I was fighting with GDT several weeks ago and I recommend you reading this blog entry:
http://duartes.org/gustavo/blog/post/me ... mentation/
Also, wiki entries like
http://wiki.osdev.org/GDT_Tutorial help me a lot, too.
Good lucky.