Minor code clean up, and added some convenience to the draw_string function.

This commit is contained in:
2020-08-06 17:00:05 -05:00
parent 9fe73abe53
commit db1a68188f
5 changed files with 35 additions and 39 deletions
+11 -2
View File
@@ -8,7 +8,16 @@ void idt_install()
{
idt.size = (sizeof (struct idt_entry) * 256) - 1;
idt.idt_entries_start = (struct idt_entry *) &idt_entries;
// IDT Selector value:
// 0x08 is the code segement we want, which, as defined by the GDT, is the kernel code segment entry in the GDT.
//
// IDT Flags value:
//
// Bit: 7 6-5 4-0
// P DPL Always 01110 (14)
// For the kernel ring 8E is chosen
// 100 for bits 7-5. 1 (present) 00 (the level in this case ring zero)
// 01110 for bits 4-0. This is always set to 14.
idt_set_gate(&idt_entries[0], (unsigned int) isr0, 0x08, 0x8E);
idt_set_gate(&idt_entries[1], (unsigned int) isr1, 0x08, 0x8E);
idt_set_gate(&idt_entries[2], (unsigned int) isr2, 0x08, 0x8E);
@@ -41,7 +50,7 @@ void idt_install()
idt_set_gate(&idt_entries[29], (unsigned int) isr29, 0x08, 0x8E);
idt_set_gate(&idt_entries[30], (unsigned int) isr30, 0x08, 0x8E);
idt_set_gate(&idt_entries[31], (unsigned int) isr31, 0x08, 0x8E);
//asm("xchg %bx, %bx");
load_idt(&idt);
}