20 "#DE: Divide by zero exception",
21 "#DB: Debug exception",
22 "Non-maskable interrupt",
23 "#BP: Breakpoint exception",
24 "#OF: Overflow exception",
25 "#BR: BOUND Range exceeded exception",
26 "#UD: Invalid opcode exception",
27 "#NM: Device not available exception",
28 "#DF: Double fault exception",
29 "Coprocessor segment overrun",
30 "#TS: Invalid TSS exception",
31 "#NP: Segment not present exception",
32 "#SS: Stack fault exception",
33 "#GP: General protection exception",
34 "#PF: Page fault exception",
36 "#MF: x87 FPU floating-point error",
37 "#AC: Alignment check exception",
38 "#MC: Machine-check exception",
39 "#XM: SIMD floating-point exception",
40 "#VE: Virtualization exception",
48 "INT: %02x Error: %08x\n\n",
49 context->interrupt, context->error);
52 "CS:RIP: %04x:%016lx SS:RSP: %04x:%016lx\n\n",
53 context->cs, context->retaddr, context->ss, context->rsp);
66 void *stack = (
void *)context->rsp;
83 int i = context->interrupt;
109 for (
int i = 0; i < 32; i++)
void tty_set_textcolor(int id, textcolor_t fg, textcolor_t bg)
Set the foreground and background colors used to display text on the virtual console.
int dump_registers(char *buf, size_t bufsize, const registers_t *regs)
Dump the contents of a CPU registers structure to a string buffer.
__forceinline void halt()
static void dump_context(int id, const interrupt_context_t *context)
void isr_set(int interrupt, isr_handler handler)
Set an interrupt service routine for the given interrupt number.
static void isr_breakpoint(const interrupt_context_t *context)
void exceptions_init()
Initialize all exception handling routines.
void tty_activate(int id)
Activate the requested virtual console.
int dump_memory(char *buf, size_t bufsize, const void *mem, size_t memsize, enum dumpstyle style)
Dump the contents of memory.
__forceinline void disable_interrupts()
int dump_cpuflags(char *buf, size_t bufsize, uint64_t rflags)
Dump the contents of the CPU flags register.
static const char * exceptionstr[]
Interrupt handling operations.
x86 CPU-specific function implementations.
void tty_print(int id, const char *str)
Output a null-terminated string to the virtual console using the console's current text color and scr...
Debugging memory and CPU state dump routines.
static void isr_fatal(const interrupt_context_t *context)
int tty_printf(int id, const char *format,...)
Output a printf-formatted string to the virtual console using the console's current text color and sc...
Include full address in memory dump.
Teletype (console) screen text manipulation routines.
#define arrsize(x)
Return the number of elements in the C array.
The log context describes the state of the log buffers.
void tty_clear(int id)
Clear the virtual console screen's contents using the current text background color.
#define EXCEPTION_BREAKPOINT