Example #1
0
/* starts the IDT */
void idt_install()
{
    /* Sets the special IDT pointer up, just like in 'gdt.c' */
    _idtp.limit = (sizeof (struct idt_entry) * 256) - 1;
    _idtp.base = (unsigned)&idt;

    /* Clear out the entire IDT, initializing it to zeros */
    memset((unsigned char *)&idt, 0, sizeof(struct idt_entry) * 256);

    /* Add any new ISRs to the IDT here using idt_set_gate */

    /* Points the processor's internal register to the new IDT */
    _idt_load();
}
Example #2
0
// Installs the IDT
void idt_install() {
  kernel_log("os", "Installing IDT\n");

  // Sets up the special IDT pointer
  _idtp.limit = (sizeof(struct idt_entry) * 256 -1);
  _idtp.base = (uint32_t) &idt;

  // Zero out the IDT
  memset(&idt, 0, sizeof(struct idt_entry) * 256);

  uint32_t check = idt[0].base_lo;

  if (!check) {
    kernel_log("os", "Cleared old IDT successfully\n");
  }

  _idt_load();
}