From d3cf3f08d1343d6b265516d5a79ce2d197b59d26 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Sun, 4 Jan 2026 14:05:49 +0800 Subject: feat(file-system): implement read and write FAT32 File System and basic shell --- src/kernel/sbi.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/kernel/sbi.cc') 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 -- cgit v1.2.3