Hi,
Is there anybody who can explain me the purpose of each kind of Descriptor ?
- Code / Data segment descriptor
- TSS descriptor
- Call gate descriptor
- Interrupt gate descriptor
- Trap gate descriptor
- Task gate descriptor...
How does it work ?
I've understood that under PM, it was necessary do describe the different segments used. So, I think that for Code and Data segment descriptor, I've caught the idea...
Concerning the TSS descriptor, I imagine I must fill a GDT entry with this for each task running on my system ?
But I've got some troubles with Call gate, interrupt gate, trap gate and task gate descriptors... What is their aim ?
For instance, I've read that IDT can only contain Task gate, Interrupt gate or trap gate descriptor. How to choose one among them ?
I would be inclined to use Interrupt gate... But I've seen trap gate descriptors where used in IDT ! What is the difference between them ?
And what the hell a task gate descriptor comes into an IDT ?
Thanks for your help !
Silver.
System Descriptor Types
- kataklinger
- Member
- Posts: 381
- Joined: Fri Nov 04, 2005 12:00 am
- Location: Serbia
Re:System Descriptor Types
Try here:
"IA-32 Intel Architecture Software Developer?s Manual Volume 3: System Programming Guide"
It explains everything
"IA-32 Intel Architecture Software Developer?s Manual Volume 3: System Programming Guide"
It explains everything
Re:System Descriptor Types
So, I've read the IA32 Book 3.
But there is still something I didn't understand :
What is the difference between a trap gate and an interrupt gate ?
Why to use one rather another in the IDT ?
But there is still something I didn't understand :
What is the difference between a trap gate and an interrupt gate ?
Why to use one rather another in the IDT ?
Re:System Descriptor Types
Hi,
You could *almost* simulate an interrupt gate with a trap gate using the following:
The difference is that EFLAGS would be on the stack twice, and it's possible to get another IRQ between "intHandler" and "cli". With a true interrupt gate it's impossible for another interrupt/IRQ handler to be called by the CPU before the first interrupt handler has had a chance to start.
In general I'd use trap gates for software interrupts and interrupt gates for IRQs.
Cheers,
Brendan
When an interrupt gate is used the CPU will disable interrupts when the handler is being entered (and restore them during IRETD). With a trap gate this doesn't happen.Silverhawk wrote: So, I've read the IA32 Book 3.
But there is still something I didn't understand :
What is the difference between a trap gate and an interrupt gate ?
Why to use one rather another in the IDT ?
You could *almost* simulate an interrupt gate with a trap gate using the following:
Code: Select all
intHandler:
pushfd
cli
..handle interrupt..
popfd
iretd
In general I'd use trap gates for software interrupts and interrupt gates for IRQs.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re:System Descriptor Types
Hi,
Thanks a lot Brendan for this explanation !
I'll sleep better
Bye.
Silver
Thanks a lot Brendan for this explanation !
I'll sleep better
Bye.
Silver