summaryrefslogtreecommitdiff
path: root/kernel/gdt.h
blob: 9b7eeced30a6193241bc5a4e301ea780932c13ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// https://xarnze.com/posts/post/Tutorial:%20Entering%20User%20mode
// http://wiki.osdev.org/TSS
// http://wiki.osdev.org/Global_Descriptor_Table
// http://wiki.osdev.org/GDT_Tutorial
//https://wiki.osdev.org/Task_State_Segment

#include <stdint.h>

/** Call this one on each CPU to get a fresh 6-entries GDT 
 * * 0
 * * ring0 code
 * * ring0 data
 * * ring3 code
 * * ring3 data
 * * tss
 */
void gdt_init();

/** update tss.esp0 for a given cpu
 */
void install_tss(uint32_t cpu,uint32_t esp0);