Task State Segment

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
srg

Task State Segment

Post by srg »

Hi

For a normal flat addressing paged pmode operating system, do I need TSS segments, if I do, what are they needed for.

Thanks
srg
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Task State Segment

Post by Candy »

srg wrote: For a normal flat addressing paged pmode operating system, do I need TSS segments, if I do, what are they needed for.
Since AMD put on the thinking cap you don't explicitly NEED it, but if you want to support more than AMD64 computers (you probably do) you do. At least one for switching CPLs in software (on interrupts, if you use SYSCALL/SYSENTER). They hold the ESP values for all cpl's.
srg

Re:Task State Segment

Post by srg »

Well at the moment I'm thinking in terms of normal protected mode (My OS is designed for 386 or better, the AMD64 support will come later).

As for portability, I'm assuming other architectures don't use TSSs.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Task State Segment

Post by Pype.Clicker »

one TSS is mandatory as soon as you want to give control to non-priviledged code on 386+. period. Others architectures may not have TSS so they won't need that. But even when you come to the stack switching technique, i doubt all the architecture will have the same stack frame design and so the code will be architecture-specific aswell ...
Post Reply