From 0425e5a7943bd2eaeca8f4dd1079da9b5493253d Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 7 Feb 2021 23:09:21 +0200 Subject: Loading GDT --- src/kernel/dump_gdt.cc | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/kernel/dump_gdt.cc (limited to 'src/kernel/dump_gdt.cc') diff --git a/src/kernel/dump_gdt.cc b/src/kernel/dump_gdt.cc new file mode 100644 index 0000000..718ada6 --- /dev/null +++ b/src/kernel/dump_gdt.cc @@ -0,0 +1,8 @@ +#include +#include "../gdt.h" + +extern "C" void dump_gdt() { + GDT::Pointer gdtr{0, 0}; + asm volatile("sgdt %0" : "=m"(gdtr) :); + printk("GDT at ", uhex{gdtr.base}, " , limit=", gdtr.limit, '\n'); +} -- cgit v1.2.1