blob: a991cbf5b5c25d305d8c7fd3a8daf1de520c888e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#pragma once
#include "types.h"
#define GDT_COUNT 16
#define GDT_ZERO 0x00
#define GDT_KERNEL_TEXT 0x08
#define GDT_KERNEL_DATA 0x10
#define GDT_USER_TEXT 0x18
#define GDT_USER_DATA 0x20
#define GDT_TSS 0x28
void gdt_init(void);
void gdt_set_kernel_stack(void *addr);
void gdt_set_entry(uint32_t segment, uint32_t base, uint32_t limit,
uint8_t ring, int exec, int dir, int rw);
void gdt_clear(uint32_t segment);
|