Modestus Moon OS
R4
CS 450 project
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
tables.h
Go to the documentation of this file.
1
#ifndef _TABLES_H
2
#define _TABLES_H
3
4
#include "
system.h
"
5
6
typedef
struct
idt_entry_struct
7
{
8
u16int
base_low
;
//offset bits 0..15
9
u16int
sselect
;
//stack selector in gdt or ldt
10
u8int
zero
;
//this stays zero; unused
11
u8int
flags
;
//attributes
12
u16int
base_high
;
//offset bits 16..31
13
}
14
__attribute__
((packed)) idt_entry;
15
16
typedef struct
idt_struct
17
{
18
u16int
limit
;
19
u32int
base
;
20
}
21
__attribute__
((packed)) idt_descriptor;
22
23
typedef struct
gdt_descriptor_struct
24
{
25
u16int
limit
;
26
u32int
base
;
27
}
28
__attribute__
((packed)) gdt_descriptor;
29
30
typedef struct
gdt_entry_struct
31
{
32
u16int
limit_low
;
//first 16 bits of limit
33
u16int
base_low
;
//first 16 bits of base
34
u8int
base_mid
;
//bits 16-23 of base
35
u8int
access
;
//next 8 bits; access flags
36
u8int
flags
;
//page granularity, size
37
u8int
base_high
;
//last 8 bits of the base
38
}
39
__attribute__
((packed)) gdt_entry;
40
41
42
void
idt_set_gate
(
u8int
idx,
u32int
base
,
u16int
sel,
u8int
flags
);
43
void
gdt_init_entry
(
int
idx,
u32int
base,
u32int
limit
,
u8int
access
,
44
u8int
flags);
45
46
void
init_idt
();
47
void
init_gdt
();
48
49
#endif
gdt_entry_struct::flags
u8int flags
Definition:
tables.h:36
base
u32int base
Definition:
tables.h:53
init_gdt
void init_gdt()
Definition:
tables.c:75
gdt_descriptor_struct
Definition:
tables.h:23
u8int
unsigned char u8int
Definition:
system.h:25
gdt_entry_struct::base_low
u16int base_low
Definition:
tables.h:33
limit
u16int limit
Definition:
tables.h:52
gdt_entry_struct::access
u8int access
Definition:
tables.h:35
idt_entry_struct::zero
u8int zero
Definition:
tables.h:10
idt_struct::base
u32int base
Definition:
tables.h:19
__attribute__
struct idt_entry_struct __attribute__((packed)) idt_entry
gdt_entry_struct::base_high
u8int base_high
Definition:
tables.h:37
idt_entry_struct::base_low
u16int base_low
Definition:
tables.h:8
access
u8int access
Definition:
tables.h:55
idt_entry_struct::sselect
u16int sselect
Definition:
tables.h:9
idt_set_gate
void idt_set_gate(u8int idx, u32int base, u16int sel, u8int flags)
Definition:
tables.c:27
gdt_descriptor_struct::limit
u16int limit
Definition:
tables.h:25
idt_entry_struct::base_high
u16int base_high
Definition:
tables.h:12
gdt_entry_struct::base_mid
u8int base_mid
Definition:
tables.h:34
idt_entry_struct::flags
u8int flags
Definition:
tables.h:11
system.h
u32int
unsigned long u32int
Definition:
system.h:27
idt_struct
Definition:
tables.h:16
gdt_entry_struct
Definition:
tables.h:30
gdt_init_entry
void gdt_init_entry(int idx, u32int base, u32int limit, u8int access, u8int flags)
Definition:
tables.c:57
gdt_entry_struct::limit_low
u16int limit_low
Definition:
tables.h:32
init_idt
void init_idt()
Definition:
tables.c:43
u16int
unsigned short u16int
Definition:
system.h:26
idt_struct::limit
u16int limit
Definition:
tables.h:18
idt_entry_struct
Definition:
tables.h:6
gdt_descriptor_struct::base
u32int base
Definition:
tables.h:26
mpx_core
include
core
tables.h
Generated by
1.8.11