summaryrefslogtreecommitdiff
path: root/src/kernel/sbi.cc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-01-04 14:12:24 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-01-04 14:12:24 +0800
commita64d25c07b31d57f8706073e11cd774d0880d6dd (patch)
treea4bbae6cff94fa69eea30db865267b211eb4c86b /src/kernel/sbi.cc
parent210025560c80b48af4875af199f183ad709e3bf0 (diff)
parentd3cf3f08d1343d6b265516d5a79ce2d197b59d26 (diff)
downloadlume-a64d25c07b31d57f8706073e11cd774d0880d6dd.tar.gz
lume-a64d25c07b31d57f8706073e11cd774d0880d6dd.tar.xz
Merge pull request #5 from Richard-Qin-001/dev/file-system
feat(file-system): implement read and write FAT32 File System and basic shell
Diffstat (limited to 'src/kernel/sbi.cc')
-rw-r--r--src/kernel/sbi.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/kernel/sbi.cc b/src/kernel/sbi.cc
index 442d219..9570d74 100644
--- a/src/kernel/sbi.cc
+++ b/src/kernel/sbi.cc
@@ -1,4 +1,5 @@
#include "common/types.h"
+#include "kernel/sbi.h"
namespace SBI
{
@@ -31,4 +32,17 @@ namespace SBI
{
sbi_call(0x54494D45, 0, stime_value, 0, 0);
}
+
+ void sbi_shutdown()
+ {
+ sbi_call(0x53525354, 0, 0, 0, 0);
+ sbi_call(0x08, 0, 0, 0, 0);
+ while (1)
+ ;
+ }
+
+ void sbi_reboot()
+ {
+ sbi_call(SBI_EID_SRST, SBI_FID_SRST_RESET, SBI_SRST_TYPE_COLD_REBOOT, SBI_SRST_REASON_NONE, 0);
+ }
} \ No newline at end of file