summaryrefslogtreecommitdiff
path: root/src/kernel/shutdown.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-03-01 22:35:26 -0500
committerBenji Dial <benji6283@gmail.com>2021-03-01 22:35:26 -0500
commit1d69a46f5d9823bbf2e6211ca367b409d2d5f7a7 (patch)
treea49a5498080551270a827a205cde49477d4d89ff /src/kernel/shutdown.c
parent6f1b50a4cc6c232ee505a543f006abb1c6cd33cf (diff)
downloadportland-os-1d69a46f5d9823bbf2e6211ca367b409d2d5f7a7.tar.gz
minimal file writing, shutdown keybinding (Win+Shift+Q)
Diffstat (limited to 'src/kernel/shutdown.c')
-rw-r--r--src/kernel/shutdown.c20
1 files changed, 20 insertions, 0 deletions
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