.TH "kernel/cpu/i386/gdt.c" 9 "Sun Jul 26 2020" "MyOS Kernel" \" -*- nroff -*- .ad l .nh .SH NAME kernel/cpu/i386/gdt.c .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBgdt_entry\fP" .br .ti -1c .RI "struct \fBgdt_description\fP" .br .ti -1c .RI "struct \fBtss_entry\fP" .br .in -1c .SS "Macros" .in +1c .ti -1c .RI "#define \fBNUM_ENTRIES\fP 6" .br .RI "Number of entries in the GDT\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "static void \fBset_entry\fP (int i, uint32_t base, uint32_t limit, uint8_t access)" .br .ti -1c .RI "static void \fBwrite_tss\fP (int32_t num, uint16_t ss0, uint32_t esp0)" .br .ti -1c .RI "void \fBallow_all_ports\fP ()" .br .ti -1c .RI "void \fBblock_all_ports\fP ()" .br .ti -1c .RI "void \fBgdt_init\fP ()" .br .in -1c .SS "Variables" .in +1c .ti -1c .RI "uint32_t \fBint_stack_top\fP" .br .RI "Initial kernel stack before the kernel's first yield\&. " .ti -1c .RI "static \fBgdt_entry\fP \fBgdt\fP [\fBNUM_ENTRIES\fP]" .br .RI "The GDT\&. " .ti -1c .RI "static \fBgdt_description\fP \fBgdt_desc\fP" .br .RI "The value to load into the GDTR\&. " .ti -1c .RI "\fBtss_entry\fP \fBtss\fP" .br .RI "The TSS\&. " .in -1c .SH "Function Documentation" .PP .SS "void allow_all_ports ()" Allows all ports in the IOPB\&. .SS "void block_all_ports ()" Blocks all ports in the IOPB\&. .SS "void gdt_init ()" Initializes the GDT & TSS\&. .SS "static void set_entry (int i, uint32_t base, uint32_t limit, uint8_t access)\fC [static]\fP" Set a GDT entry\&. .PP \fBParameters\fP .RS 4 \fIi\fP The GDT entry to set\&. .br \fIbase\fP The base of the GDT entry\&. .br \fIlimit\fP The limit of the GDT entry\&. .br \fIaccess\fP The access byte of the GDT entry\&. .RE .PP .SS "static void write_tss (int32_t num, uint16_t ss0, uint32_t esp0)\fC [static]\fP" Set a GDT entry\&. .PP \fBParameters\fP .RS 4 \fInum\fP The GDT entry to set\&. .br \fIss0\fP The kernel stack selector\&. .br \fIesp0\fP The kernel stack pointer\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for MyOS Kernel from the source code\&.