#include <global.h>
#include <types/nums.h>
Go to the source code of this file.
◆ IDT_ENTRIES
◆ KERNEL_CODE_SEGMENT
#define KERNEL_CODE_SEGMENT 0x08 |
◆ PIT_FREQ
◆ SendEOI
#define SendEOI Outb(0x20, 0x20) |
◆ _picr()
◆ AllIdt()
Initialize and load the Interrupt Descriptor Table (IDT)
- Installs GDT
- Remaps PIC interrupts
- Masks all IRQs, then unmasks IRQ 0 and 1
- Sets IDT gates for IRQ0 and IRQ1 handlers
- Loads the IDT and enables interrupts
- Starts the PIT timer at a base frequency
< Install the Global Descriptor Table (GDT)
< Remap the PIC (Programmable Interrupt Controller)
< Mask all IRQs for safety
< Unmask IRQ1 (keyboard)
< Unmask IRQ0 (timer)
< Clear the IDT entries
< Set IDT limit
< Set IDT base address
< Set IRQ0 handler
< Set IRQ1 handler
< Disable CPU interrupts during setup
< Reload the GDT
< Load the new IDT
< Re-enable CPU interrupts
< Initialize PIT with base frequency (e.g., 1193182 Hz)
Definition at line 73 of file idt.c.
◆ DebugPrintIdtEntry()
void DebugPrintIdtEntry |
( |
int | i | ) |
|
◆ GdtFlush()
◆ 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
-
num | Index of the GDT entry to set |
base | Base address for the segment |
limit | Limit of the segment |
access | Access flags (e.g., executable, readable) |
gran | Granularity and size flags |
Definition at line 35 of file gdt.c.
◆ GoodHandler()
void GoodHandler |
( |
void | | ) |
|
|
extern |
◆ IdtInit()
◆ IdtSetGate()
void IdtSetGate |
( |
u8 | num, |
|
|
u32 | base, |
|
|
u16 | sel, |
|
|
u8 | flags ) |
Set an IDT gate (entry) at given index.
- Parameters
-
num | Index of the IDT entry to set |
base | Address of the interrupt handler function |
sel | Code segment selector in GDT |
flags | Flags controlling gate type and privileges |
Definition at line 40 of file idt.c.
◆ Irq0Handler()
void Irq0Handler |
( |
void | | ) |
|
|
extern |
◆ Irq0HandlerC()
void Irq0HandlerC |
( |
void | | ) |
|
◆ Irq1Handler()
void Irq1Handler |
( |
void | | ) |
|
|
extern |
◆ MaskAllIrqs()
void MaskAllIrqs |
( |
void | | ) |
|
Mask all IRQs.
Definition at line 26 of file masker.c.
◆ MsSleep()
void MsSleep |
( |
unsigned int | milliseconds | ) |
|
◆ PitInit()
Definition at line 32 of file pit.c.
◆ SetupIdt()
◆ UnmaskIrq()
Unmask an IRQ.
- Parameters
-
irq | - IRQ NUmber to Unmask |
Definition at line 34 of file masker.c.
◆ VirtnetHandler()
void VirtnetHandler |
( |
void | | ) |
|
|
extern |
◆ VirtnetIrqHandler()
void VirtnetIrqHandler |
( |
| ) |
|
◆ idt
Interrupt Descriptor Table entries
Definition at line 27 of file idt.c.
◆ idt_ptrn
◆ PKG