The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
double_fault.h
Go to the documentation of this file.
1#pragma once
2
3/**
4 * double-fault handling through a task gate.
5 *
6 * a kernel stack overflow faults on the stack's guard page, and the CPU then
7 * fails to push the page-fault frame onto that same stack: a double fault.
8 * an ordinary interrupt gate would push onto the dead stack again and triple
9 * fault (a silent reset), so vector 8 is a task gate instead. the CPU
10 * switches to a separate TSS with its own stack, and the handler reports a
11 * "kernel stack overflow" panic with the overflowing process and a backtrace.
12 */
13
14#include "common/stdint.h"
15
16/**
17 * install the double-fault task of the boot core and point IDT vector 8 at
18 * it. call after gdt_initialize() and exception_initialize().
19 */
21
22/**
23 * give a core its own double-fault stack (in its TSS). the boot core gets
24 * one from double_fault_initialize(); each other core calls this after its
25 * gdt_initialize(), with its kernel page tables live.
26 * @param core the index of the core.
27 * @param stack_top the top of a stack that only this core uses for it.
28 */
29void double_fault_init_core(uint32_t core, uintptr_t stack_top);
void double_fault_init_core(uint32_t core, uintptr_t stack_top)
give a core its own double-fault stack (in its TSS).
Definition double_fault.c:132
void double_fault_initialize(void)
double-fault handling through a task gate.
Definition double_fault.c:143
unsigned int uint32_t
Definition fb.h:17
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:19