Skip to content

Commit

Permalink
No more rings, other archs may not have 4 rings.
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Oct 22, 2009
1 parent 6e18243 commit 3e194b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/Processor/x86/DescriptorTables/Global.h
Expand Up @@ -44,7 +44,7 @@ class Global
} __attribute__ ((packed));

private:
static Entry _entries[9];
static Entry _entries[5];
static Pointer _pointer;

public:
Expand Down
8 changes: 2 additions & 6 deletions sources/Processor/x86/DescriptorTables/Global.cpp
Expand Up @@ -16,22 +16,18 @@ namespace Processor {

namespace DescriptorTables {

Global::Entry Global::_entries[9];
Global::Entry Global::_entries[5];
Global::Pointer Global::_pointer;

void
Global::init (void)
{
Global::_pointer.limit = (sizeof(Global::Entry) * 9) - 1;
Global::_pointer.limit = (sizeof(Global::Entry) * 5) - 1;
Global::_pointer.base = (Type::u32) &Global::_entries;

Global::set(0, 0, 0, 0, 0); // Null segment @ 0x00
Global::set(1, 0, 0xFFFFFFFF, 0x9A, 0xCF); // Code segment @ 0x08
Global::set(2, 0, 0xFFFFFFFF, 0x92, 0xCF); // Data segment @ 0x10
Global::set(3, 0, 0xFFFFFFFF, 0xBA, 0xCF); // Core service code segment @ 0x18
Global::set(4, 0, 0xFFFFFFFF, 0xB2, 0xCF); // Core service data segment @ 0x20
Global::set(5, 0, 0xFFFFFFFF, 0xDA, 0xCF); // Service code segment @ 0x28
Global::set(6, 0, 0xFFFFFFFF, 0xD2, 0xCF); // Service data segment @ 0x30
Global::set(7, 0, 0xFFFFFFFF, 0xFA, 0xCF); // User mode code segment @ 0x38
Global::set(8, 0, 0xFFFFFFFF, 0xF2, 0xCF); // User mode data segment @ 0x40

Expand Down

0 comments on commit 3e194b6

Please sign in to comment.