Got decent exception handling

This commit is contained in:
Tomáš Kubeček
2026-05-29 11:42:20 +02:00
parent 22852599df
commit 4bc3382abb
5 changed files with 186 additions and 49 deletions
+24
View File
@@ -0,0 +1,24 @@
#ifndef _EXCEPTIONS_H
#define _EXCEPTIONS_H
#include "isr.h"
#define EXCEPTION_DE 0
#define EXCEPTION_BP 3
#define EXCEPTION_OF 4
#define EXCEPTION_BR 5
#define EXCEPTION_UD 6
#define EXCEPTION_NM 7
#define EXCEPTION_DF 8
#define EXCEPTION_GP 13
#define EXCEPTION_PF 14
#define EXCEPTION_AC 17
typedef void (*exception_handler_ptr)(struct isr_int_frame* iframe, bool user);
const extern char* exception_strings[];
int exception_init(void);
void exception_handle(struct isr_int_frame* iframe);
#endif
+1
View File
@@ -9,6 +9,7 @@
#define PTE_FLAG_USER (1UL << 2) // User-mode (DPL3) access allowed
#define PTE_FLAG_PWT (1UL << 3) // Page write-thru
#define PTE_FLAG_NOCACHE (1UL << 4) // Cache disable
#define PTE_FLAG_FETCH (1UL << 4) // Fetch
#define PTE_FLAG_ACCESSED (1UL << 5) // Indicates whether page was read/written
#define PTE_FLAG_DIRTY (1UL << 6) // Indicates whether page was written to (valid for PT only)
#define PTE_FLAG_PAT (1UL << 7) // Page Attribute Table (valid for PT only)