-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgdt.h
More file actions
46 lines (35 loc) · 1.24 KB
/
gdt.h
File metadata and controls
46 lines (35 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __MYOS__GDT_H
#define __MYOS__GDT_H
#include <types.h>
namespace myos
{
class GlobalDescriptorTable
{
public:
class SegmentDescriptor
{
private:
myos::common::uint16_t limit_lo;
myos::common::uint16_t base_lo;
myos::common::uint8_t base_hi;
myos::common::uint8_t type;
myos::common::uint8_t limit_hi;
myos::common::uint8_t base_vhi;
public:
SegmentDescriptor(myos::common::uint32_t base, myos::common::uint32_t limit, myos::common::uint8_t type);
myos::common::uint32_t Base();
myos::common::uint32_t Limit();
} __attribute__((packed));
private:
SegmentDescriptor nullSegmentSelector;
SegmentDescriptor unusedSegmentSelector;
SegmentDescriptor codeSegmentSelector;
SegmentDescriptor dataSegmentSelector;
public:
GlobalDescriptorTable();
~GlobalDescriptorTable();
myos::common::uint16_t CodeSegmentSelector();
myos::common::uint16_t DataSegmentSelector();
};
}
#endif