From 27b8676963d5d69353f44fde7faaa9a4dfe1567b Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 3 Aug 2024 02:04:58 +0200 Subject: kernel: send user interrupt on page fault I really should just rename interrupts to something else. This is inspired by Plan9 and meant to make debugging easier, as the dying process can take a stacktrace etc. It kinda sucks that the default handler now depends on fprintf, which is quite a bit of code, but whatever. --- src/cmd/crash.c | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/cmd/crash.c (limited to 'src/cmd') diff --git a/src/cmd/crash.c b/src/cmd/crash.c new file mode 100644 index 0000000..a644eed --- /dev/null +++ b/src/cmd/crash.c @@ -0,0 +1,7 @@ +int +main(void) +{ + // TODO flags to write into kernel mem / nonexistent mem, read/write + volatile int *thing = (void*)0xF000BAAA; + *thing = 1337; +} -- cgit v1.2.3