MentOS  0.8.0
The Mentoring Operating System
kernel.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "stdint.h"
9 
11 extern uintptr_t initial_esp;
12 
14 #define K 1024
16 #define M (1024 * K)
18 #define G (1024 * M)
19 
24 typedef struct pt_regs {
struct pt_regs pt_regs
Interrupt stack frame.
uintptr_t initial_esp
The initial stack pointer.
Definition: kernel.c:78
Standard integer data-types.
unsigned uintptr_t
Define the unsigned 32-bit pointer.
Definition: stdint.h:36
unsigned int uint32_t
Define the unsigned 32-bit integer.
Definition: stdint.h:18
Interrupt stack frame.
Definition: kernel.h:24
uint32_t cs
Code Segment.
Definition: kernel.h:56
uint32_t ds
Data Segment.
Definition: kernel.h:32
uint32_t eip
Instruction Pointer Register.
Definition: kernel.h:54
uint32_t err_code
Error code.
Definition: kernel.h:52
uint32_t ecx
32-bit counter.
Definition: kernel.h:46
uint32_t esp
32-bit stack pointer register.
Definition: kernel.h:40
uint32_t eax
32-bit accumulator register.
Definition: kernel.h:48
uint32_t es
Extra Segment determined by the programmer.
Definition: kernel.h:30
uint32_t useresp
User application ESP.
Definition: kernel.h:60
uint32_t ss
Stack Segment.
Definition: kernel.h:62
uint32_t ebx
32-bit base register.
Definition: kernel.h:42
uint32_t int_no
Interrupt number.
Definition: kernel.h:50
uint32_t eflags
32-bit flag register.
Definition: kernel.h:58
uint32_t fs
FS and GS have no hardware-assigned uses.
Definition: kernel.h:28
uint32_t edi
32-bit destination register.
Definition: kernel.h:34
uint32_t ebp
32-bit base pointer register.
Definition: kernel.h:38
uint32_t gs
FS and GS have no hardware-assigned uses.
Definition: kernel.h:26
uint32_t esi
32-bit source register.
Definition: kernel.h:36
uint32_t edx
32-bit data register.
Definition: kernel.h:44