PKUOS - Pintos
Pintos source browser for PKU Operating System course
Macros | Functions
gdt.h File Reference
#include "threads/loader.h"
Include dependency graph for gdt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SEL_UCSEG   0x1B
 Segment selectors. More...
 
#define SEL_UDSEG   0x23
 User data selector. More...
 
#define SEL_TSS   0x28
 Task-state segment. More...
 
#define SEL_CNT   6
 Number of segments. More...
 

Functions

void gdt_init (void)
 userprog/gdt.h More...
 

Macro Definition Documentation

◆ SEL_CNT

#define SEL_CNT   6

Number of segments.

Definition at line 11 of file gdt.h.

◆ SEL_TSS

#define SEL_TSS   0x28

Task-state segment.

Definition at line 10 of file gdt.h.

◆ SEL_UCSEG

#define SEL_UCSEG   0x1B

Segment selectors.

More selectors are defined by the loader in loader.h. User code selector.

Definition at line 8 of file gdt.h.

◆ SEL_UDSEG

#define SEL_UDSEG   0x23

User data selector.

Definition at line 9 of file gdt.h.

Function Documentation

◆ gdt_init()

void gdt_init ( void  )

userprog/gdt.h

userprog/gdt.h

The bootstrap loader's GDT didn't include user-mode selectors or a TSS, but we need both now.

Definition at line 36 of file gdt.c.

References gdt, make_code_desc(), make_data_desc(), make_gdtr_operand(), make_tss_desc(), SEL_KCSEG, SEL_KDSEG, SEL_NULL, SEL_TSS, SEL_UCSEG, SEL_UDSEG, and tss_get().

Referenced by pintos_init().

Here is the call graph for this function:
Here is the caller graph for this function: