tss for ring0 processes?

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
JulienDarc
Member
Member
Posts: 97
Joined: Tue Mar 10, 2015 10:08 am

tss for ring0 processes?

Post 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
User avatar
max
Member
Member
Posts: 616
Joined: Mon Mar 05, 2012 11:23 am
Libera.chat IRC: maxdev
Location: Germany
Contact:

Re: tss for ring0 processes?

Post 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
JulienDarc
Member
Member
Posts: 97
Joined: Tue Mar 10, 2015 10:08 am

Re: tss for ring0 processes?

Post by JulienDarc »

Thanks Max!

I UUUUUUNDERSSSTTTOOODDD!!!!!

I am so happy i will the whole afternoon :D
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: tss for ring0 processes?

Post 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.
Last edited by bluemoon on Sun Mar 22, 2015 9:04 am, edited 1 time in total.
JulienDarc
Member
Member
Posts: 97
Joined: Tue Mar 10, 2015 10:08 am

Re: tss for ring0 processes?

Post by JulienDarc »

Yes you are right and I will set up a tss anyway because it is useful.

Thanks a lot!
Post Reply