WKern
Loading...
Searching...
No Matches
gdt.c File Reference
#include <idt/idtirq.h>

Go to the source code of this file.

Functions

void GdtSetGate (int num, u32 base, u32 limit, u8 access, u8 gran)
 Set a GDT entry (descriptor)
void GdtInstall ()
 Initialize and load the Global Descriptor Table (GDT)

Variables

struct GdtEntry gdt [3]
struct GdtPtr gp

Function Documentation

◆ GdtInstall()

void GdtInstall ( )

Initialize and load the Global Descriptor Table (GDT)

  • Sets up three GDT entries:
    • Null segment
    • Code segment (executable, readable)
    • Data segment (read/write)
  • Loads the GDT register with the new table

Definition at line 56 of file gdt.c.

◆ GdtSetGate()

void GdtSetGate ( int num,
u32 base,
u32 limit,
u8 access,
u8 gran )

Set a GDT entry (descriptor)

Parameters
numIndex of the GDT entry to set
baseBase address for the segment
limitLimit of the segment
accessAccess flags (e.g., executable, readable)
granGranularity and size flags

Definition at line 35 of file gdt.c.

Variable Documentation

◆ gdt

struct GdtEntry gdt[3]

Global Descriptor Table entries

Definition at line 21 of file gdt.c.

◆ gp

struct GdtPtr gp

GDT pointer structure

Definition at line 24 of file gdt.c.