-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgdt.h
41 lines (29 loc) · 1021 Bytes
/
gdt.h
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
#ifndef _GDT_H
#define _GDT_H
#include "common/types.h"
class GlobalDescriptorTable{
public:
class SegmentDescriptor {
private:
uint16_t limit_lo;
uint16_t base_lo;
uint8_t base_hi;
uint8_t type;
uint8_t flags_limit_hi;
uint8_t base_vhi;
public:
SegmentDescriptor (uint32_t base,uint32_t limit,uint8_t type);
uint32_t Base ();
uint32_t Limit();
} __attribute__((packed));
SegmentDescriptor nullSegmentSelector;
SegmentDescriptor unusedSegmentSelector;
SegmentDescriptor codeSegmentSelector;
SegmentDescriptor dataSegmentSelector;
public:
GlobalDescriptorTable();
~GlobalDescriptorTable();
uint16_t CodeSegmentSelector();
uint16_t DataSegmentSelector();
};
#endif