From 1d69a46f5d9823bbf2e6211ca367b409d2d5f7a7 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Mon, 1 Mar 2021 22:35:26 -0500 Subject: minimal file writing, shutdown keybinding (Win+Shift+Q) --- src/kernel/shutdown.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/kernel/shutdown.c (limited to 'src/kernel/shutdown.c') diff --git a/src/kernel/shutdown.c b/src/kernel/shutdown.c new file mode 100644 index 0000000..9f7ccc7 --- /dev/null +++ b/src/kernel/shutdown.c @@ -0,0 +1,20 @@ +#include "paging.h" +#include "window.h" +#include "fat.h" +#include "log.h" + +__attribute__ ((noreturn)) +void shutdown() { + logf(LOG_INFO, "Shutting down..."); + + asm ("cli"); + switch_to_kernel_cr3(); + + fat_ready_shutdown(); + + logf(LOG_INFO, "Finished getting ready for shutdown."); + + show_shutdown(); + while (1) + asm ("hlt"); +} \ No newline at end of file -- cgit v1.2.3