-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgdt.H
executable file
·48 lines (32 loc) · 1.23 KB
/
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
42
43
44
45
46
47
48
/*
File: gdt.H
Author: R. Bettati
Department of Computer Science
Texas A&M University
Date : 09/03/02
Description: Management of the Global Descriptor Table (GDT)
The GDT describes memory access priviledges for memory segments.
While the table is initialized by GRUB already, it may be a good idea to
do this again in the kernel code.
For details see Section 5 of Brandon Friesen's Tutotial
on OS Kernel Development.
URL: http://www.osdever.net/bkerndev/Docs/title.htm
*/
#ifndef _GDT_H_ // include file only once
#define _GDT_H_
/*--------------------------------------------------------------------------*/
/* GDT */
/*--------------------------------------------------------------------------*/
class GDT {
private:
/* Use this function to set up an entry in the GDT. */
static void set_gate(int num,
unsigned long base, unsigned long limit,
unsigned char access, unsigned char gran);
public:
static const unsigned int SIZE = 3;
static void init();
/* Initialize the GDT to have a null segment, a code segment,
and one data segment. */
};
#endif