-
Notifications
You must be signed in to change notification settings - Fork 0
/
gdt.h
42 lines (33 loc) · 1.1 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
/* ** por compatibilidad se omiten tildes **
================================================================================
TRABAJO PRACTICO 3 - System Programming - ORGANIZACION DE COMPUTADOR II - FCEN
================================================================================
definicion de la tabla de descriptores globales
*/
#ifndef __GDT_H__
#define __GDT_H__
#define GDT_COUNT 41
#include "defines.h"
typedef struct str_gdt_descriptor {
unsigned short gdt_length;
unsigned int gdt_addr;
} __attribute__((__packed__)) gdt_descriptor;
typedef struct str_gdt_entry {
unsigned short limit_0_15;
unsigned short base_0_15;
unsigned char base_23_16;
unsigned char type:4;
unsigned char s:1;
unsigned char dpl:2;
unsigned char p:1;
unsigned char limit_16_19:4;
unsigned char avl:1;
unsigned char l:1;
unsigned char db:1;
unsigned char g:1;
unsigned char base_31_24;
} __attribute__((__packed__, aligned (8))) gdt_entry;
/* Tabla GDT */
extern gdt_entry gdt[];
extern gdt_descriptor GDT_DESC;
#endif /* !__GDT_H__ */