41 idt[num].base_lo =
base & 0xFFFF;
44 idt[num].flags = flags;
45 idt[num].base_hi = (
base >> 16) & 0xFFFF;
85 Kprintf(
"Setting IDT to 0x00\n");
90 Kprintf(
"Setting IDT Limit + Base\n");
95 Kprintf(
"Setting up IDT gate 32 (IRQ0)\n");
100 Kprintf(
"Setting up IDT gate 33 (IRQ1)\n");
105 Kprintf(
"Disabling interrupts\n");
106 __asm__
volatile(
"cli");
113 __asm__
volatile(
"sgdt %0" :
"=m"(gdtr));
115 Kprintf(
"GDT base = %x, limit = %x\n", gdtr.base, gdtr.limit);
119 __asm__
volatile(
"lidt %[idt]" ::[
idt]
"m"(
idt_ptrn)
122 Kprintf(
"Enabling interrupts");
123 __asm__
volatile(
"sti");
void GdtInstall()
Initialize and load the Global Descriptor Table (GDT)
#define PKG
Add attribute packed.
void debug_print_idt_entry(int i)
Debug function to print an IDT entry's handler address.
struct IdtEntry idt[IDT_ENTRIES]
void IdtSetGate(u8 num, u32 base, u16 sel, u8 flags)
Set an IDT gate (entry) at given index.
void AllIdt()
Initialize and load the Interrupt Descriptor Table (IDT)
#define KERNEL_CODE_SEGMENT
void UnmaskIrq(u8 irq)
Unmask an IRQ.
void MaskAllIrqs(void)
Mask all IRQs.
void Kprintf(const char *fmt,...)
Formatted output to the screen.
void Kmemset(void *ptr, unsigned char value, unsigned int num)
Set memory to a value.
unsigned int u32
32-Bit Unsigned Int
unsigned short u16
16-Bit Unsigned Int
unsigned long uptr
Long Unsigned Int.
unsigned char u8
8-Bit Unsigned Int
__attribute__((noreturn))
Kernel Panics with Message.