next up previous contents index
Next: 10.7.8 base_tss_load: load the Up: (X86) Base Environment: Segmentation Previous: 10.7.6 base_tss: default task

10.7.7 base_tss_init: initialize the base task state segment

   

SYNOPSIS

#include <oskit/x86/base_tss.h>

void base_tss_init(void);

DESCRIPTION

The base_tss_init function initializes the base_tss to a valid minimal state. It sets the I/O permission bitmap offset to point past the end of the TSS, so that it will be interpreted by the processor as empty (no permissions for any I/O ports). It also initializes the ring 0 stack segment selector (ss0) to KERNEL_DS, and the ring 0 stack pointer (esp0) to the current stack pointer value at the time of the function call, to provide a minimal working context for trap handling. Once the OS kernel sets up a ``real'' kernel stack, it should reinitialize base_tss.esp0 to point to that.

DEPENDENCIES

base_tss
10.7.6



University of Utah Flux Research Group