diff options
author | Benji Dial <benji@benjidial.net> | 2024-01-14 12:29:35 -0500 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-01-14 12:29:35 -0500 |
commit | 7c6a18d77a81f232ad2e1d3a311bb21ea8f1f5b4 (patch) | |
tree | cb7cce254e7ae2ec8691b93340ca125b8c6b4988 /kernel/interrupts.cpp | |
parent | e9898e829b8df7c0b16faec1ce490369c53fd78e (diff) | |
download | hilbert-os-7c6a18d77a81f232ad2e1d3a311bb21ea8f1f5b4.tar.gz |
register interrupts 0x08 - 0x0f
Diffstat (limited to 'kernel/interrupts.cpp')
-rw-r--r-- | kernel/interrupts.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/interrupts.cpp b/kernel/interrupts.cpp index 65daf91..8ac986d 100644 --- a/kernel/interrupts.cpp +++ b/kernel/interrupts.cpp @@ -21,6 +21,7 @@ struct [[gnu::packed]] exception_info_t { uint64_t r14; uint64_t r15; + uint64_t cr2; uint64_t cr3; uint64_t rip; uint64_t rflags; @@ -103,7 +104,12 @@ extern "C" [[noreturn]] void print_exception() { if (((exception_info.rflags >> i) & 1) == 1) terminal::put_string_sz(flag_names[i]); - print_line("rip", "cr3", exception_info.rip, exception_info.cr3); + if (exception_info.exception_number == 0x0e) { + terminal::put_string_sz("\n cr2: 0x"); + terminal::put_int_hex(exception_info.cr2, 16); + } + + print_line("cr3", "rip", exception_info.cr3, exception_info.rip); print_line("rax", "rbx", exception_info.rax, exception_info.rbx); print_line("rcx", "rdx", exception_info.rcx, exception_info.rdx); print_line("rdi", "rsi", exception_info.rdi, exception_info.rsi); |