Does staying in ring 0 eliminate the need for int gates?

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
azblue
Member
Member
Posts: 147
Joined: Sat Feb 27, 2010 8:55 pm

Does staying in ring 0 eliminate the need for int gates?

Post by azblue »

I understand how protected mode segmentation works, but I start to feel overwhelmed when I read about interrupt gates, call gates, task gates, trap gates, etc.

As far as I'm aware, the only point of gates is to allow switching between privilege levels. If I'm always in ring 0, does this eliminate the need for any of these gates? Of course this has an obvious drawback, there is no protection if everything has the highest privilege; I just want to know if it's possible.
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: Does staying in ring 0 eliminate the need for int gates?

Post by Gigasoft »

Interrupt/trap gates are necessary for interrupt and exception handling. A task gate is typically used to handle double faults, since a double fault usually indicates a stack overflow. Call gates are seldom used. So, no, keeping everything at ring 0 won't make much of a difference.
skyking
Member
Member
Posts: 174
Joined: Sun Jan 06, 2008 8:41 am

Re: Does staying in ring 0 eliminate the need for int gates?

Post by skyking »

You don't necessarily need them (any gate) for anything other than for HW interrupt handling. For syscall you could simply use a direct call (but you might want to use SW interrupt in order to be ready for usermode applications), for exception you could not generate them (but you might generate them anyway - nobody's perfect).

However staying in ring 0 simplifies stuff like you don't have to use a TSS, so it's perfectly reasonable to start by not using more rings.
Post Reply