aboutsummaryrefslogblamecommitdiff
path: root/kernel/include/gdt.h
blob: a62d0dbb53ba1f8190106d97d3348b8d2bfeebbd (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                                                                              

                




                           
                                   
#pragma once

#include <stddef.h>
#include <stdint.h>

/*	The GDT is one of the x86's descriptor tables. It is used for memory segmentation.
	Here, we don't use segmentation to separate processes from one another (this is done with paging).
	We only use segmentation to make the difference between kernel mode (ring 3) and user mode (ring 0) */

void gdt_init();

#define K_CODE_SEGMENT 0x08
#define K_DATA_SEGMENT 0x10
#define U_CODE_SEGMENT 0x18
#define U_DATA_SEGMENT 0x20

/* vim: set ts=4 sw=4 tw=0 noet :*/