MentOS  0.8.0
The Mentoring Operating System
tss.h
Go to the documentation of this file.
1 
12 #pragma once
13 
14 #include "stdint.h"
15 
17 typedef struct tss_entry {
46 
48 extern void tss_flush(void);
49 
55 void tss_init(uint8_t idx, uint32_t ss0);
56 
60 void tss_set_stack(uint32_t kss, uint32_t kesp);
61 
void tss_flush(void)
Flushes the Task State Segment.
void tss_set_stack(uint32_t kss, uint32_t kesp)
This function is used to set the esp the kernel should be using.
Definition: tss.c:53
void tss_init(uint8_t idx, uint32_t ss0)
We don't need tss to assist task switching, but it's required to have one tss for switching back to k...
Definition: tss.c:20
struct tss_entry tss_entry_t
Task state segment entry.
Standard integer data-types.
unsigned short uint16_t
Define the unsigned 16-bit integer.
Definition: stdint.h:24
unsigned int uint32_t
Define the unsigned 32-bit integer.
Definition: stdint.h:18
unsigned char uint8_t
Define the unsigned 8-bit integer.
Definition: stdint.h:30
Task state segment entry.
Definition: tss.h:17
uint32_t esp
TODO: Comment.
Definition: tss.h:32
uint32_t ldt
TODO: Comment.
Definition: tss.h:42
uint32_t ss2
TODO: Comment.
Definition: tss.h:24
uint32_t ss
TODO: Comment.
Definition: tss.h:38
uint32_t esp2
TODO: Comment.
Definition: tss.h:23
uint32_t ss1
TODO: Comment.
Definition: tss.h:22
uint32_t cs
TODO: Comment.
Definition: tss.h:37
uint32_t eip
TODO: Comment.
Definition: tss.h:26
uint32_t ds
TODO: Comment.
Definition: tss.h:39
uint32_t ecx
TODO: Comment.
Definition: tss.h:29
uint16_t iomap
TODO: Comment.
Definition: tss.h:44
uint32_t eflags
TODO: Comment.
Definition: tss.h:27
uint32_t ebp
TODO: Comment.
Definition: tss.h:33
uint32_t esp0
The stack pointer to load when we change to kernel mode.
Definition: tss.h:19
uint32_t ss0
The stack segment to load when we change to kernel mode.
Definition: tss.h:20
uint32_t edx
TODO: Comment.
Definition: tss.h:30
uint32_t fs
TODO: Comment.
Definition: tss.h:40
uint32_t esp1
everything below here is unusued now.
Definition: tss.h:21
uint32_t esi
TODO: Comment.
Definition: tss.h:34
uint32_t cr3
TODO: Comment.
Definition: tss.h:25
uint32_t gs
TODO: Comment.
Definition: tss.h:41
uint16_t trap
TODO: Comment.
Definition: tss.h:43
uint32_t eax
TODO: Comment.
Definition: tss.h:28
uint32_t prev_tss
If we used hardware task switching this would form a linked list.
Definition: tss.h:18
uint32_t edi
TODO: Comment.
Definition: tss.h:35
uint32_t ebx
TODO: Comment.
Definition: tss.h:31
uint32_t es
TODO: Comment.
Definition: tss.h:36