Re: PM stack question...

From: Fallendreamer (mailmirror_at_yahoo.it)
Date: 01/25/04


Date: Sun, 25 Jan 2004 09:32:58 +0000 (UTC)


> If you've corrupted your stack in ring 0, life is usually not good.
>
> But if you're triggering a fault related to the stack, even at ring
> zero, you should be able to catch it so long as the interrupt handler
> for that exception is a task gate.
>
> Is there a specific context for this question?

You said it!
I'm writing my own OS, and I decidet to do some experimets! If I run a task
at PL3 wich cause an #SS fault I can handle the exception, but if I make the
kernel itself crash with infinite recursive call to a dummy function the
machine reboots. So I tought to use a a task gate as interrupt handler.
NOTE: the handler task is the kernel itself. I made two kernel TSS: they are
identical except for one thing, the eip value. The EIP of the seconds TSS
(wich is pointed by the selector in task gate) points to the fault handler
inside the kernel (and, at this point I SHOULD have a new PL0 stack as
stated my Intel manual). When a fault is detected the kernel signals a
"debug" interrupt but the pc doesn't freeze or reboot. I don't know what is
happening....
And I have more question, eg.: can a kernel have a stack that grows or it
MUST be of fixed size? If the kernel must have a fixed size, how can I
predit its size?
I'm a little confused!...
 Txhx in advance,
                            Matteo

P:S. Sorry for my bad english! I'm in trouble when I have to go deeper
inside things....


Quantcast