From cf8047f7be95463c3a32aa3a71cf8318245003c4 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 13 Mar 2016 15:47:11 -0400 Subject: [PATCH] Print descriptor table information when loading --- src/Descriptors.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Descriptors.cc b/src/Descriptors.cc index 1e9b18d..a21e3f2 100644 --- a/src/Descriptors.cc +++ b/src/Descriptors.cc @@ -7,6 +7,7 @@ */ #include "Descriptors.hh" +#include "Console.hh" namespace { @@ -123,6 +124,9 @@ GDT::load() { PseudoDescriptor gdt {Size * sizeof(Descriptor) - 1, uint32_t(&mTable)}; + auto& console = kernel::Console::systemConsole(); + console.printFormat("GDT: base = 0x%08lX, limit = %d\n", gdt.base, gdt.limit); + /* * Load the new GDT with the pointer defined above. The GDT isn't actually * used until the segment registers are reladed. Below, CS is reloaded by @@ -232,6 +236,10 @@ IDT::load() const { PseudoDescriptor idt{Size * sizeof(Descriptor) - 1, uint32_t(&mTable)}; + + auto& console = kernel::Console::systemConsole(); + console.printFormat("IDT: base = 0x%08lX, limit = %d\n", idt.base, idt.limit); + asm volatile("lidt %0\n" : : "m" (idt)); }