The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
double_fault.h File Reference
#include "common/stdint.h"

Go to the source code of this file.

Functions

void double_fault_initialize (void)
 double-fault handling through a task gate.
void double_fault_init_core (uint32_t core, uintptr_t stack_top)
 give a core its own double-fault stack (in its TSS).

Function Documentation

◆ double_fault_initialize()

void double_fault_initialize ( void )

double-fault handling through a task gate.

a kernel stack overflow faults on the stack's guard page, and the CPU then fails to push the page-fault frame onto that same stack: a double fault. an ordinary interrupt gate would push onto the dead stack again and triple fault (a silent reset), so vector 8 is a task gate instead. the CPU switches to a separate TSS with its own stack, and the handler reports a "kernel stack overflow" panic with the overflowing process and a backtrace. install the double-fault task of the boot core and point IDT vector 8 at it. call after gdt_initialize() and exception_initialize().

◆ double_fault_init_core()

void double_fault_init_core ( uint32_t core,
uintptr_t stack_top )

give a core its own double-fault stack (in its TSS).

the boot core gets one from double_fault_initialize(); each other core calls this after its gdt_initialize(), with its kernel page tables live.

Parameters
corethe index of the core.
stack_topthe top of a stack that only this core uses for it.