PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
gdt.inc
Go to the documentation of this file.
1%pragma once
2
3%define GDT_NULL 0x00
4%define GDT_KERNEL_CODE 0x08
5%define GDT_KERNEL_DATA 0x10
6%define GDT_USER_DATA 0x18
7%define GDT_USER_CODE 0x20
8%define GDT_TSS 0x28
9
10%define GDT_CS_RING0 GDT_KERNEL_CODE | 0x0
11%define GDT_SS_RING0 GDT_KERNEL_DATA | 0x0
12
13%define GDT_CS_RING3 GDT_USER_CODE | 0x3
14%define GDT_SS_RING3 GDT_USER_DATA | 0x3
@ GDT_KERNEL_DATA
Kernel data segment selector.
Definition gdt.h:40
@ GDT_CS_RING3
Value to load into the CS register for user code.
Definition gdt.h:48
@ GDT_USER_DATA
User data segment selector.
Definition gdt.h:41
@ GDT_KERNEL_CODE
Kernel code segment selector.
Definition gdt.h:39
@ GDT_TSS
TSS segment selector.
Definition gdt.h:43
@ GDT_CS_RING0
Value to load into the CS register for kernel code.
Definition gdt.h:45
@ GDT_SS_RING3
Value to load into the SS register for user data.
Definition gdt.h:49
@ GDT_SS_RING0
Value to load into the SS register for kernel data.
Definition gdt.h:46
@ GDT_NULL
Null segment selector, unused but the gdt must start with it.
Definition gdt.h:38
@ GDT_USER_CODE
User code segment selector.
Definition gdt.h:42