-
Notifications
You must be signed in to change notification settings - Fork 0
/
gdt.c
45 lines (39 loc) · 987 Bytes
/
gdt.c
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
#include "gdt.h"
#include "tss.h"
gdt_entry gdt[GDT_COUNT] = {
/* Descriptor nulo*/
(gdt_entry){(unsigned int) 0x00000000, (unsigned int) 0x00000000 },
/* Codigo de kernel B=0x00000000 L=0xFFFFF*/
(gdt_entry){
(unsigned short) 0xFFFF,
(unsigned short) 0x0000,
(unsigned char) 0x00,
(unsigned char) 0xA,
(unsigned char) 1,
(unsigned char) 0,
(unsigned char) 1,
(unsigned char) 0xF,
(unsigned char) 0,
(unsigned char) 0,
(unsigned char) 1,
(unsigned char) 0,
(unsigned char) 0x00
},
/* Datos de kernel B=0x00000000 L=0xFFFFF*/
(gdt_entry){
(unsigned short) 0xFFFF,
(unsigned short) 0x0000,
(unsigned char) 0x00,
(unsigned char) 0x2,
(unsigned char) 1,
(unsigned char) 0,
(unsigned char) 1,
(unsigned char) 0xF,
(unsigned char) 0,
(unsigned char) 0,
(unsigned char) 1,
(unsigned char) 0,
(unsigned char) 0x00
},
};
gdt_descriptor GDT_DESC = {(unsigned short) sizeof(gdt)-1, (unsigned int)&gdt};