25 lines
668 B
C
25 lines
668 B
C
#pragma once
|
|
|
|
#define STA_X 0x8 // Executable segment
|
|
#define STA_W 0x2 // Writeable (non-executable segments)
|
|
#define STA_R 0x2 // Readable (executable segments)
|
|
|
|
#define DPL_USER 3
|
|
|
|
#define SEG_KCODE 1
|
|
#define SEG_KDATA 2
|
|
#define SEG_UCODE 3
|
|
#define SEG_UDATA 4
|
|
#define SEG_TSS 5
|
|
|
|
#define SEG_ASM(type,base,lim) \
|
|
.word (((lim) >> 12) & 0xffff), ((base) & 0xffff); \
|
|
.byte (((base) >> 16) & 0xff), (0x90 | (type)), \
|
|
(0xC0 | (((lim) >> 28) & 0xf)), (((base) >> 24) & 0xff)
|
|
|
|
#define USER_BASE 0x400000 // 4 MB
|
|
|
|
#ifndef __ASSEMBLER__
|
|
void load_gdt();
|
|
#endif
|