From b40c851fce8e2204a602c4155d8c62619a65f98c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 24 Oct 2018 00:35:07 +0200 Subject: [PATCH] Unbreak crashy user process test. --- Kernel/init.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Kernel/init.cpp b/Kernel/init.cpp index 00308f46b9e..5e709940dc7 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -30,7 +30,7 @@ #define TEST_VFS //#define STRESS_TEST_SPAWNING //#define TEST_ELF_LOADER -//#define TEST_CRASHY_USER_PROCESSES +#define TEST_CRASHY_USER_PROCESSES system_t system; @@ -49,6 +49,22 @@ void banner() kprintf("\n"); } +#ifdef TEST_CRASHY_USER_PROCESSES +static void user_main() NORETURN; +static void user_main() +{ + DO_SYSCALL_A3(0x3000, 2, 3, 4); + // Crash ourselves! + char* x = reinterpret_cast(0xbeefbabe); + *x = 1; + HANG; + for (;;) { + // nothing? + Userspace::sleep(1 * TICKS_PER_SECOND); + } +} +#endif + static void undertaker_main() NORETURN; static void undertaker_main() {