Page 1 of 1
tss for ring0 processes?
Posted: Sun Mar 22, 2015 6:38 am
by JulienDarc
Hello,
I perfectly understand the need for a tss in interrupts when switching task in interrupts.
Could someone tell me if i still should bother with it when an interrupt occurs while treating a ring0 process?
I have no userspace yet in my os and I want to validate my understanding.
Thanks a lot
Re: tss for ring0 processes?
Posted: Sun Mar 22, 2015 6:59 am
by max
Hey Julien,
the TSS is only used by the CPU when it has to switch from a higher privilege level (ring 3) to a lower one (ring 0). As a kernel task in ring 0 never does this privilege switch, you won't have to write to the TSS in this case.
Greets,
Max
Re: tss for ring0 processes?
Posted: Sun Mar 22, 2015 7:03 am
by JulienDarc
Thanks Max!
I UUUUUUNDERSSSTTTOOODDD!!!!!
I am so happy i will the whole afternoon
Re: tss for ring0 processes?
Posted: Sun Mar 22, 2015 7:12 am
by bluemoon
Note that intel manual specified a proper procedure to switch CPU mode, which include properly setup TSS. Although you may not observe any issue with bogus TSS since nothing could trigger a task switch, you are not following the manual at your own risk.
By the way, I advice to just do it, it's easy to setup TSS, and you need it anyway with user mode or double fault handler.
Re: tss for ring0 processes?
Posted: Sun Mar 22, 2015 8:01 am
by JulienDarc
Yes you are right and I will set up a tss anyway because it is useful.
Thanks a lot!