2021-03-13 05:21:01 +03:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <lib/blib.h>
|
|
|
|
#include <lib/trace.h>
|
|
|
|
#include <lib/print.h>
|
|
|
|
|
2021-07-15 11:03:47 +03:00
|
|
|
#if bios == 1
|
2021-03-13 05:21:01 +03:00
|
|
|
|
|
|
|
static const char *exception_names[] = {
|
|
|
|
"Division by 0",
|
|
|
|
"Debug",
|
|
|
|
"NMI",
|
|
|
|
"Breakpoint",
|
|
|
|
"Overflow",
|
|
|
|
"Bound range exceeded",
|
|
|
|
"Invalid opcode",
|
|
|
|
"Device not available",
|
|
|
|
"Double fault",
|
|
|
|
"???",
|
|
|
|
"Invalid TSS",
|
|
|
|
"Segment not present",
|
|
|
|
"Stack-segment fault",
|
|
|
|
"General protection fault",
|
|
|
|
"Page fault",
|
|
|
|
"???",
|
|
|
|
"x87 exception",
|
|
|
|
"Alignment check",
|
|
|
|
"Machine check",
|
|
|
|
"SIMD exception",
|
|
|
|
"Virtualisation",
|
|
|
|
"???",
|
|
|
|
"???",
|
|
|
|
"???",
|
|
|
|
"???",
|
|
|
|
"???",
|
|
|
|
"???",
|
|
|
|
"???",
|
|
|
|
"???",
|
|
|
|
"???",
|
|
|
|
"Security"
|
|
|
|
};
|
|
|
|
|
|
|
|
void except(uint32_t exception, uint32_t error_code, uint32_t ebp, uint32_t eip) {
|
|
|
|
(void)ebp;
|
|
|
|
panic("%s at %x. Error code: %x", exception_names[exception], eip, error_code);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|