Page 1 of 1

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

Posted: Sat Sep 18, 2010 10:20 am
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.

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

Posted: Sat Sep 18, 2010 11:30 am
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.

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

Posted: Sun Sep 19, 2010 3:49 am
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.