UnnamedOS

Task State Segment. More...

+ Collaboration diagram for TSS:

Data Structures

struct  tss_t
 the task state segment More...
 

Functions

void tss_init (gdt_entry_t *gdt)
 Initializes the TSS. More...
 
void tss_set_stack (uint32_t stack_pointer)
 Sets the TSS's kernel stack which is used to handle interrupts. More...
 
void tss_load ()
 Loads the TSS into the TR register. More...
 

Variables

static tss_t tss
 the TSS, for software multitasking we only need one
 

Detailed Description

Task State Segment.

The TSS stores information for switching from user to kernel space.

See also
http://wiki.osdev.org/TSS
https://en.wikipedia.org/wiki/Task_state_segment
http://www.lowlevel.eu/wiki/Task_State_Segment
http://wiki.osdev.org/Getting_to_Ring_3
http://www.jamesmolloy.co.uk/tutorial_html/10.-User%20Mode.html

Function Documentation

void tss_init ( gdt_entry_t gdt)

Initializes the TSS.

Parameters
gdtpointer to the GDT

Creates a TSS descriptor in the GDT.

Sets the TSS's stack segment to the kernel stack segment.

Definition at line 35 of file tss.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tss_load ( )

Loads the TSS into the TR register.

Loads the TR (= Task Register) with the TSS's GDT selector.

Definition at line 53 of file tss.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tss_set_stack ( uint32_t  stack_pointer)

Sets the TSS's kernel stack which is used to handle interrupts.

Parameters
stack_pointerthe kernel stack pointer

Definition at line 48 of file tss.c.

+ Here is the caller graph for this function: