Move descriptor classes to x86 namespace

This commit is contained in:
Eryn Wells 2016-03-09 01:12:05 -05:00
parent 0238e44efc
commit 3879b3c324
3 changed files with 17 additions and 10 deletions

View file

@ -6,8 +6,6 @@
* Oh god oh god. Descriptor tables.
*/
#include <stddef.h>
#include <stdint.h>
#include "Descriptors.hh"
namespace {
@ -24,7 +22,7 @@ struct PseudoDescriptor
}
namespace kernel {
namespace x86 {
/*
* Static
@ -223,4 +221,4 @@ IDT::load()
: : "m" (idt) :);
}
} /* namespace kernel */
} /* namespace x86 */

View file

@ -7,7 +7,14 @@
* IDT.
*/
namespace kernel {
#ifndef __DESCRIPTORS_HH__
#define __DESCRIPTORS_HH__
#include <stddef.h>
#include <stdint.h>
namespace x86 {
/**
* SegmentDescriptors are entries in the GDT and LDT that describe memory
@ -149,4 +156,6 @@ private:
Descriptor mTable[Size];
};
} /* namespace kernel */
} /* namespace x86 */
#endif /* __DESCRIPTORS_HH__ */

View file

@ -38,15 +38,15 @@ kmain()
auto console = kernel::Console::systemConsole();
console.clear(kernel::Console::Color::Blue);
auto gdt = kernel::GDT::systemGDT();
auto gdt = x86::GDT::systemGDT();
gdt.setNullDescriptor(0);
gdt.setDescriptor(1, kernel::GDT::DescriptorSpec::kernelSegment(0, 0x000FFFFF, kernel::GDT::Type::CodeEXR));
gdt.setDescriptor(2, kernel::GDT::DescriptorSpec::kernelSegment(0, 0x000FFFFF, kernel::GDT::Type::DataRW));
gdt.setDescriptor(1, x86::GDT::DescriptorSpec::kernelSegment(0, 0x000FFFFF, x86::GDT::Type::CodeEXR));
gdt.setDescriptor(2, x86::GDT::DescriptorSpec::kernelSegment(0, 0x000FFFFF, x86::GDT::Type::DataRW));
gdt.load();
console.writeString("GDT loaded\n");
auto idt = kernel::IDT::systemIDT();
auto idt = x86::IDT::systemIDT();
idt.load();
console.writeString("IDT loaded\n");