Page 1 of 1
Exception handler of 3rd level privilege task
Posted: Mon Jan 13, 2014 9:24 am
by Jane1991c
Hi,
My task is running segments for program/data with DPL=3
Let's say this task executes this code:
Exception occurs (not executing interrupt handler procedure), but when it's executed by task at 3rd privilege level then bochs crashes, when its done by main task (0 lvl) then all is fine.
What should be done to allow exceptions to be thrown while 3rd lvl task is executed ?
Re: Exception handler of 3rd level privilege task
Posted: Mon Jan 13, 2014 2:52 pm
by Combuster
Jane1991c wrote:then bochs crashes
And you obviously did not bother to read the error log it produced while it did that.
The difference between exceptions from ring 0 and ring 3 is the mandatory stack switch. To find out which part of that is broken is homework for you (and a lesson in reading).
Re: Exception handler of 3rd level privilege task
Posted: Mon Jan 13, 2014 5:15 pm
by Jane1991c
Combuster wrote:Jane1991c wrote:then bochs crashes
And you obviously did not bother to read the error log it produced while it did that.
The difference between exceptions from ring 0 and ring 3 is the mandatory stack switch. To find out which part of that is broken is homework for you (and a lesson in reading).
Do you mean ESP0/SS0 in TSS are missing ? They are set. Did you have on your mind something else ?
Bochs log:
01638740346e[CPU0 ] stackPrefetch(4): access [0xfffffffc] > SS.limit [0x00009100]
01638740346e[CPU0 ] stackPrefetch(4): access [0xfffffffc] > SS.limit [0x00009100]
01638740346e[CPU0 ] stackPrefetch(4): access [0xfffffffc] > SS.limit [0x00009100]
0x00009100 is my base address of my stack segment
Re: Exception handler of 3rd level privilege task
Posted: Mon Jan 13, 2014 6:17 pm
by Jane1991c
Solved it