IgrOS-Kernel 0.1.34.545
Simple C++20 Kernel for i386/x86_64
Loading...
Searching...
No Matches
exceptions.cpp
Go to the documentation of this file.
1
11
12
13// IgrOS-Kernel arch x86
15#include <arch/x86/irq.hpp>
16#include <arch/x86/native.hpp>
17// IgrOS-Kernel library
18#include <klib/kPrint.hpp>
19
20
21// x86 namespace
22namespace igros::x86 {
23
24
25 // Init exceptions
50
51
52 // Default exception handler
53 [[noreturn]]
54 void except::defaultHandler(const register_t* regs) noexcept {
55 // Disable interrupts
57 // Print exception name
59 "Exception:\t%s",
60 except::NAME[regs->number]
61 );
62 // Dump registres
63 cpu::dumpRegisters(regs);
64 // Hang CPU
65 cpu::halt();
66 }
67
68
69} // namespace igros::x86
70
static void defaultHandler(const register_t *regs) noexcept
Default exception handler.
static constexpr void install() noexcept
Install exceptions handler.
NUMBER
Exceptions number enumeration.
static constexpr std::array< const char *const, 32_usize > NAME
Exceptions names.
static void init() noexcept
Init exceptions.
static void disable() noexcept
Disable interrupts.
Definition irq.cpp:70
Exceptions low-level operations.
Kernel text print functions.
void kprintf(const char *const format,...) noexcept
Kernel printf function (arguments are checked against format at compile time).
Definition kPrint.cpp:358
Code shared by i386 and x86_64: ports, interrupts, exceptions, paging.
x86 family current (native) architecture selection
Interrupts low-level operations.