My Kernel v0.1.0
Collaboration diagram for Processes - x86:

Modules

 Processes - arch specifics
 

Data Structures

struct  x86_thread
 Contains all the system-level information about a task. More...
 

Variables

u32 x86_thread::cr3
 Physical address of the process's page directory.
 
u32 x86_thread::esp0
 Address of the top of the thread's kernel stack. More...
 
u32 x86_thread::esp_user
 Address of the top of the user stack This is only valid for user threads.
 
u32 x86_thread::esp
 The thread's current stack pointer. More...
 
struct interrupt_frame x86_thread::frame
 Frame pushed during the last userland -> kernel context switch.
 

Detailed Description

Variable Documentation

◆ esp

u32 x86_thread::esp

This value is updated whenever:

  • An interrupt occurs while the thread is running
  • The thread is rescheduled

◆ esp0

u32 x86_thread::esp0

This is the value used by the kernel to locate the stack to use when switching from ring3 -> ring0. It should be loaded inside the current cpu's TSS.ESP0 when switching thread.