A task state segment (TSS) is an entity in Intel's IA32 architecture, which is the architecture of the x86/Pentium family of microprocessors. A TSS is a kind of segment, or block of memory, that saves information about a task that has just stopped running, so that the task may be restarted later on.

An x86 processor is always running exactly one task. It may switch from task to task hundreds of times a second, thereby giving the appearance that it's running many different tasks at once, but it never runs more than one task at any given instant. In order to switch from one task to the next, the processor must suspend one task and start another, and in the process remember key pieces of information about the suspended task. This information (general-purpose registers, program counter, stack pointers, status registers, paging information, and so on) goes into the TSS for the suspended task. When the suspended task is restarted, the processor takes the information out of the TSS for that task and uses it to restore the context needed for the suspended task to continue as if it had never been suspended.

Although every operating system running on an x86 processor needs at least one TSS, it doesn't have to use the IA32 task-switching facility to switch tasks. It's possible to implement a full-featured OS (preemptive multitasking, memory protection, kernel protection, resource protection) using a single TSS.

Log in or register to write something here or to contact authors.