From a04424c0f86eadddfb24e0eb4c90424366721ed6 Mon Sep 17 00:00:00 2001 From: wyfcyx Date: Wed, 29 Mar 2023 12:27:49 +0000 Subject: [PATCH] deploy: 7a52aa857bc8f2d7789a1f16efe56ce74e8a7362 --- ch3/implementors/core/marker/trait.Freeze.js | 2 +- ch3/implementors/core/marker/trait.Send.js | 2 +- ch3/implementors/core/marker/trait.Sync.js | 2 +- ch3/implementors/core/marker/trait.Unpin.js | 2 +- .../panic/unwind_safe/trait.RefUnwindSafe.js | 2 +- .../panic/unwind_safe/trait.UnwindSafe.js | 2 +- ch3/implementors/os/board/trait.QEMUExit.js | 3 - ch3/os/all.html | 2 +- ch3/os/board/constant.EXIT_FAILURE.html | 1 - ch3/os/board/constant.EXIT_FAILURE_FLAG.html | 1 - ch3/os/board/constant.EXIT_RESET.html | 1 - ch3/os/board/constant.EXIT_SUCCESS.html | 1 - ch3/os/board/constant.QEMU_EXIT_HANDLE.html | 1 - ch3/os/board/constant.VIRT_TEST.html | 1 - ch3/os/board/fn.exit_code_encode.html | 2 - ch3/os/board/index.html | 6 +- ch3/os/board/sidebar-items.js | 2 +- ch3/os/board/struct.RISCV64.html | 20 --- ch3/os/board/trait.QEMUExit.html | 10 -- ch3/os/lang_items/fn.panic.html | 2 +- ch3/os/lang_items/index.html | 2 +- ch3/os/sbi/constant.SBI_CONSOLE_PUTCHAR.html | 1 - ch3/os/sbi/constant.SBI_SET_TIMER.html | 1 - ch3/os/sbi/fn.console_putchar.html | 2 +- ch3/os/sbi/fn.sbi_call.html | 2 - ch3/os/sbi/fn.set_timer.html | 2 +- ch3/os/sbi/fn.shutdown.html | 2 +- ch3/os/sbi/index.html | 5 +- ch3/os/sbi/sidebar-items.js | 2 +- ch3/os/task/struct.TASK_MANAGER.html | 18 +- ch3/os/task/struct.TaskManager.html | 12 +- ch3/os/task/struct.TaskManagerInner.html | 2 +- ch3/search-index.js | 2 +- ch3/src/os/boards/qemu.rs.html | 160 ------------------ ch3/src/os/lang_items.rs.html | 8 +- ch3/src/os/sbi.rs.html | 84 ++------- ch3/src/os/task/mod.rs.html | 4 +- 37 files changed, 55 insertions(+), 319 deletions(-) delete mode 100644 ch3/implementors/os/board/trait.QEMUExit.js delete mode 100644 ch3/os/board/constant.EXIT_FAILURE.html delete mode 100644 ch3/os/board/constant.EXIT_FAILURE_FLAG.html delete mode 100644 ch3/os/board/constant.EXIT_RESET.html delete mode 100644 ch3/os/board/constant.EXIT_SUCCESS.html delete mode 100644 ch3/os/board/constant.QEMU_EXIT_HANDLE.html delete mode 100644 ch3/os/board/constant.VIRT_TEST.html delete mode 100644 ch3/os/board/fn.exit_code_encode.html delete mode 100644 ch3/os/board/struct.RISCV64.html delete mode 100644 ch3/os/board/trait.QEMUExit.html delete mode 100644 ch3/os/sbi/constant.SBI_CONSOLE_PUTCHAR.html delete mode 100644 ch3/os/sbi/constant.SBI_SET_TIMER.html delete mode 100644 ch3/os/sbi/fn.sbi_call.html diff --git a/ch3/implementors/core/marker/trait.Freeze.js b/ch3/implementors/core/marker/trait.Freeze.js index f3e60d05..06cfc49c 100644 --- a/ch3/implementors/core/marker/trait.Freeze.js +++ b/ch3/implementors/core/marker/trait.Freeze.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["os"] = [{"text":"impl Freeze for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl Freeze for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl Freeze for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl Freeze for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl<T> !Freeze for UPSafeCell<T>","synthetic":true,"types":["os::sync::up::UPSafeCell"]},{"text":"impl Freeze for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Freeze for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Freeze for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl !Freeze for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl Freeze for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl Freeze for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl Freeze for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]}]; +implementors["os"] = [{"text":"impl Freeze for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl Freeze for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl Freeze for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl<T> !Freeze for UPSafeCell<T>","synthetic":true,"types":["os::sync::up::UPSafeCell"]},{"text":"impl Freeze for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Freeze for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Freeze for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl !Freeze for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl Freeze for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl Freeze for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl Freeze for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch3/implementors/core/marker/trait.Send.js b/ch3/implementors/core/marker/trait.Send.js index 3bdeb42a..477ead66 100644 --- a/ch3/implementors/core/marker/trait.Send.js +++ b/ch3/implementors/core/marker/trait.Send.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["os"] = [{"text":"impl Send for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl Send for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl Send for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl Send for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl<T> Send for UPSafeCell<T> where
    T: Send
","synthetic":true,"types":["os::sync::up::UPSafeCell"]},{"text":"impl Send for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Send for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Send for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl Send for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl Send for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl Send for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl Send for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]}]; +implementors["os"] = [{"text":"impl Send for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl Send for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl Send for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl<T> Send for UPSafeCell<T> where
    T: Send
","synthetic":true,"types":["os::sync::up::UPSafeCell"]},{"text":"impl Send for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Send for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Send for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl Send for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl Send for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl Send for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl Send for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch3/implementors/core/marker/trait.Sync.js b/ch3/implementors/core/marker/trait.Sync.js index fbe2855d..dac9ac10 100644 --- a/ch3/implementors/core/marker/trait.Sync.js +++ b/ch3/implementors/core/marker/trait.Sync.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["os"] = [{"text":"impl Sync for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl Sync for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl Sync for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl Sync for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl Sync for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Sync for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Sync for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl Sync for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl Sync for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl Sync for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl Sync for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]},{"text":"impl<T> Sync for UPSafeCell<T>","synthetic":false,"types":["os::sync::up::UPSafeCell"]}]; +implementors["os"] = [{"text":"impl Sync for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl Sync for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl Sync for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl Sync for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Sync for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Sync for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl Sync for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl Sync for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl Sync for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl Sync for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]},{"text":"impl<T> Sync for UPSafeCell<T>","synthetic":false,"types":["os::sync::up::UPSafeCell"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch3/implementors/core/marker/trait.Unpin.js b/ch3/implementors/core/marker/trait.Unpin.js index f5152aa0..eb193db4 100644 --- a/ch3/implementors/core/marker/trait.Unpin.js +++ b/ch3/implementors/core/marker/trait.Unpin.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["os"] = [{"text":"impl Unpin for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl Unpin for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl Unpin for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl Unpin for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl<T> Unpin for UPSafeCell<T> where
    T: Unpin
","synthetic":true,"types":["os::sync::up::UPSafeCell"]},{"text":"impl Unpin for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Unpin for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Unpin for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl Unpin for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl Unpin for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl Unpin for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl Unpin for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]}]; +implementors["os"] = [{"text":"impl Unpin for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl Unpin for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl Unpin for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl<T> Unpin for UPSafeCell<T> where
    T: Unpin
","synthetic":true,"types":["os::sync::up::UPSafeCell"]},{"text":"impl Unpin for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Unpin for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Unpin for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl Unpin for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl Unpin for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl Unpin for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl Unpin for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch3/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/ch3/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js index fef03468..563cd9a0 100644 --- a/ch3/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js +++ b/ch3/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["os"] = [{"text":"impl RefUnwindSafe for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl RefUnwindSafe for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl RefUnwindSafe for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl RefUnwindSafe for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl<T> !RefUnwindSafe for UPSafeCell<T>","synthetic":true,"types":["os::sync::up::UPSafeCell"]},{"text":"impl RefUnwindSafe for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl RefUnwindSafe for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl RefUnwindSafe for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl !RefUnwindSafe for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl RefUnwindSafe for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl RefUnwindSafe for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl RefUnwindSafe for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]}]; +implementors["os"] = [{"text":"impl RefUnwindSafe for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl RefUnwindSafe for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl RefUnwindSafe for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl<T> !RefUnwindSafe for UPSafeCell<T>","synthetic":true,"types":["os::sync::up::UPSafeCell"]},{"text":"impl RefUnwindSafe for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl RefUnwindSafe for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl RefUnwindSafe for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl !RefUnwindSafe for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl RefUnwindSafe for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl RefUnwindSafe for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl RefUnwindSafe for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch3/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/ch3/implementors/core/panic/unwind_safe/trait.UnwindSafe.js index 2a051a16..f156d0d2 100644 --- a/ch3/implementors/core/panic/unwind_safe/trait.UnwindSafe.js +++ b/ch3/implementors/core/panic/unwind_safe/trait.UnwindSafe.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["os"] = [{"text":"impl UnwindSafe for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl UnwindSafe for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl UnwindSafe for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl UnwindSafe for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl<T> UnwindSafe for UPSafeCell<T> where
    T: UnwindSafe
","synthetic":true,"types":["os::sync::up::UPSafeCell"]},{"text":"impl UnwindSafe for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl UnwindSafe for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl UnwindSafe for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl UnwindSafe for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl UnwindSafe for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl UnwindSafe for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl UnwindSafe for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]}]; +implementors["os"] = [{"text":"impl UnwindSafe for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl UnwindSafe for KernelStack","synthetic":true,"types":["os::loader::KernelStack"]},{"text":"impl UnwindSafe for UserStack","synthetic":true,"types":["os::loader::UserStack"]},{"text":"impl<T> UnwindSafe for UPSafeCell<T> where
    T: UnwindSafe
","synthetic":true,"types":["os::sync::up::UPSafeCell"]},{"text":"impl UnwindSafe for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl UnwindSafe for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl UnwindSafe for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl UnwindSafe for TaskManager","synthetic":true,"types":["os::task::TaskManager"]},{"text":"impl UnwindSafe for TaskManagerInner","synthetic":true,"types":["os::task::TaskManagerInner"]},{"text":"impl UnwindSafe for TASK_MANAGER","synthetic":true,"types":["os::task::TASK_MANAGER"]},{"text":"impl UnwindSafe for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch3/implementors/os/board/trait.QEMUExit.js b/ch3/implementors/os/board/trait.QEMUExit.js deleted file mode 100644 index 34fffcbd..00000000 --- a/ch3/implementors/os/board/trait.QEMUExit.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = {}; -implementors["os"] = []; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch3/os/all.html b/ch3/os/all.html index 2c328687..c67535b4 100644 --- a/ch3/os/all.html +++ b/ch3/os/all.html @@ -1 +1 @@ -List of all items in this crate
\ No newline at end of file +List of all items in this crate
\ No newline at end of file diff --git a/ch3/os/board/constant.EXIT_FAILURE.html b/ch3/os/board/constant.EXIT_FAILURE.html deleted file mode 100644 index d9393da5..00000000 --- a/ch3/os/board/constant.EXIT_FAILURE.html +++ /dev/null @@ -1 +0,0 @@ -EXIT_FAILURE in os::board - Rust
const EXIT_FAILURE: u32 = _; // 78_643u32
\ No newline at end of file diff --git a/ch3/os/board/constant.EXIT_FAILURE_FLAG.html b/ch3/os/board/constant.EXIT_FAILURE_FLAG.html deleted file mode 100644 index 9f36742c..00000000 --- a/ch3/os/board/constant.EXIT_FAILURE_FLAG.html +++ /dev/null @@ -1 +0,0 @@ -EXIT_FAILURE_FLAG in os::board - Rust
const EXIT_FAILURE_FLAG: u32 = 0x3333;
\ No newline at end of file diff --git a/ch3/os/board/constant.EXIT_RESET.html b/ch3/os/board/constant.EXIT_RESET.html deleted file mode 100644 index 614ace2b..00000000 --- a/ch3/os/board/constant.EXIT_RESET.html +++ /dev/null @@ -1 +0,0 @@ -EXIT_RESET in os::board - Rust
const EXIT_RESET: u32 = 0x7777;
\ No newline at end of file diff --git a/ch3/os/board/constant.EXIT_SUCCESS.html b/ch3/os/board/constant.EXIT_SUCCESS.html deleted file mode 100644 index d57b865d..00000000 --- a/ch3/os/board/constant.EXIT_SUCCESS.html +++ /dev/null @@ -1 +0,0 @@ -EXIT_SUCCESS in os::board - Rust
const EXIT_SUCCESS: u32 = 0x5555;
\ No newline at end of file diff --git a/ch3/os/board/constant.QEMU_EXIT_HANDLE.html b/ch3/os/board/constant.QEMU_EXIT_HANDLE.html deleted file mode 100644 index 0eef1868..00000000 --- a/ch3/os/board/constant.QEMU_EXIT_HANDLE.html +++ /dev/null @@ -1 +0,0 @@ -QEMU_EXIT_HANDLE in os::board - Rust
pub const QEMU_EXIT_HANDLE: RISCV64;
\ No newline at end of file diff --git a/ch3/os/board/constant.VIRT_TEST.html b/ch3/os/board/constant.VIRT_TEST.html deleted file mode 100644 index ee0a3bd0..00000000 --- a/ch3/os/board/constant.VIRT_TEST.html +++ /dev/null @@ -1 +0,0 @@ -VIRT_TEST in os::board - Rust
const VIRT_TEST: u64 = 0x100000;
\ No newline at end of file diff --git a/ch3/os/board/fn.exit_code_encode.html b/ch3/os/board/fn.exit_code_encode.html deleted file mode 100644 index f74d93f0..00000000 --- a/ch3/os/board/fn.exit_code_encode.html +++ /dev/null @@ -1,2 +0,0 @@ -exit_code_encode in os::board - Rust
const fn exit_code_encode(code: u32) -> u32
Expand description

Encode the exit code using EXIT_FAILURE_FLAG.

-
\ No newline at end of file diff --git a/ch3/os/board/index.html b/ch3/os/board/index.html index 41d99997..67d4943f 100644 --- a/ch3/os/board/index.html +++ b/ch3/os/board/index.html @@ -1,4 +1,2 @@ -os::board - Rust

Module os::board

source · []
Expand description

Constants used in rCore for qemu

-

Structs

RISCV64 configuration

-

Constants

Traits

Functions

Encode the exit code using EXIT_FAILURE_FLAG.

-
\ No newline at end of file +os::board - Rust

Module os::board

source · []
Expand description

Constants used in rCore for qemu

+

Constants

\ No newline at end of file diff --git a/ch3/os/board/sidebar-items.js b/ch3/os/board/sidebar-items.js index 3763a700..2576e522 100644 --- a/ch3/os/board/sidebar-items.js +++ b/ch3/os/board/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"constant":[["CLOCK_FREQ",""],["EXIT_FAILURE",""],["EXIT_FAILURE_FLAG",""],["EXIT_RESET",""],["EXIT_SUCCESS",""],["QEMU_EXIT_HANDLE",""],["VIRT_TEST",""]],"fn":[["exit_code_encode","Encode the exit code using EXIT_FAILURE_FLAG."]],"struct":[["RISCV64","RISCV64 configuration"]],"trait":[["QEMUExit",""]]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"constant":[["CLOCK_FREQ",""]]}; \ No newline at end of file diff --git a/ch3/os/board/struct.RISCV64.html b/ch3/os/board/struct.RISCV64.html deleted file mode 100644 index efa24dc5..00000000 --- a/ch3/os/board/struct.RISCV64.html +++ /dev/null @@ -1,20 +0,0 @@ -RISCV64 in os::board - Rust
pub struct RISCV64 {
-    addr: u64,
-}
Expand description

RISCV64 configuration

-

Fields

addr: u64

Address of the sifive_test mapped device.

-

Implementations

Create an instance.

-

Trait Implementations

Exit qemu with specified exit code.

-

Exit QEMU using EXIT_SUCCESS, aka 0, if possible. Read more

-

Exit QEMU using EXIT_FAILURE, aka 1.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
\ No newline at end of file diff --git a/ch3/os/board/trait.QEMUExit.html b/ch3/os/board/trait.QEMUExit.html deleted file mode 100644 index 168a6087..00000000 --- a/ch3/os/board/trait.QEMUExit.html +++ /dev/null @@ -1,10 +0,0 @@ -QEMUExit in os::board - Rust
pub trait QEMUExit {
-    fn exit(&self, code: u32) -> !;
-    fn exit_success(&self) -> !;
-    fn exit_failure(&self) -> !;
-}

Required Methods

Exit with specified return code.

-

Note: For X86, code is binary-OR’ed with 0x1 inside QEMU.

-

Exit QEMU using EXIT_SUCCESS, aka 0, if possible.

-

Note: Not possible for X86.

-

Exit QEMU using EXIT_FAILURE, aka 1.

-

Implementors

\ No newline at end of file diff --git a/ch3/os/lang_items/fn.panic.html b/ch3/os/lang_items/fn.panic.html index ca270052..4f56317c 100644 --- a/ch3/os/lang_items/fn.panic.html +++ b/ch3/os/lang_items/fn.panic.html @@ -1 +1 @@ -panic in os::lang_items - Rust
fn panic(info: &PanicInfo<'_>) -> !
\ No newline at end of file +panic in os::lang_items - Rust
fn panic(info: &PanicInfo<'_>) -> !
\ No newline at end of file diff --git a/ch3/os/lang_items/index.html b/ch3/os/lang_items/index.html index 6181316a..a276346e 100644 --- a/ch3/os/lang_items/index.html +++ b/ch3/os/lang_items/index.html @@ -1,2 +1,2 @@ -os::lang_items - Rust
Expand description

The panic handler

+os::lang_items - Rust
Expand description

The panic handler

Functions

panic 🔒
\ No newline at end of file diff --git a/ch3/os/sbi/constant.SBI_CONSOLE_PUTCHAR.html b/ch3/os/sbi/constant.SBI_CONSOLE_PUTCHAR.html deleted file mode 100644 index 10915495..00000000 --- a/ch3/os/sbi/constant.SBI_CONSOLE_PUTCHAR.html +++ /dev/null @@ -1 +0,0 @@ -SBI_CONSOLE_PUTCHAR in os::sbi - Rust
const SBI_CONSOLE_PUTCHAR: usize = 1;
\ No newline at end of file diff --git a/ch3/os/sbi/constant.SBI_SET_TIMER.html b/ch3/os/sbi/constant.SBI_SET_TIMER.html deleted file mode 100644 index 0d9f9f56..00000000 --- a/ch3/os/sbi/constant.SBI_SET_TIMER.html +++ /dev/null @@ -1 +0,0 @@ -SBI_SET_TIMER in os::sbi - Rust
const SBI_SET_TIMER: usize = 0;
\ No newline at end of file diff --git a/ch3/os/sbi/fn.console_putchar.html b/ch3/os/sbi/fn.console_putchar.html index 33b4e0c5..d0471813 100644 --- a/ch3/os/sbi/fn.console_putchar.html +++ b/ch3/os/sbi/fn.console_putchar.html @@ -1,2 +1,2 @@ -console_putchar in os::sbi - Rust
pub fn console_putchar(c: usize)
Expand description

use sbi call to putchar in console (qemu uart handler)

+console_putchar in os::sbi - Rust
pub fn console_putchar(c: usize)
Expand description

use sbi call to putchar in console (qemu uart handler)

\ No newline at end of file diff --git a/ch3/os/sbi/fn.sbi_call.html b/ch3/os/sbi/fn.sbi_call.html deleted file mode 100644 index debab151..00000000 --- a/ch3/os/sbi/fn.sbi_call.html +++ /dev/null @@ -1,2 +0,0 @@ -sbi_call in os::sbi - Rust

Function os::sbi::sbi_call

source · []
fn sbi_call(which: usize, arg0: usize, arg1: usize, arg2: usize) -> usize
Expand description

handle SBI call with which SBI_id and other arguments

-
\ No newline at end of file diff --git a/ch3/os/sbi/fn.set_timer.html b/ch3/os/sbi/fn.set_timer.html index 4bd301f6..a4c82337 100644 --- a/ch3/os/sbi/fn.set_timer.html +++ b/ch3/os/sbi/fn.set_timer.html @@ -1,2 +1,2 @@ -set_timer in os::sbi - Rust

Function os::sbi::set_timer

source · []
pub fn set_timer(timer: usize)
Expand description

use sbi call to set timer

+set_timer in os::sbi - Rust

Function os::sbi::set_timer

source · []
pub fn set_timer(timer: usize)
Expand description

use sbi call to set timer

\ No newline at end of file diff --git a/ch3/os/sbi/fn.shutdown.html b/ch3/os/sbi/fn.shutdown.html index 0e756eb3..f71d2b8e 100644 --- a/ch3/os/sbi/fn.shutdown.html +++ b/ch3/os/sbi/fn.shutdown.html @@ -1,2 +1,2 @@ -shutdown in os::sbi - Rust

Function os::sbi::shutdown

source · []
pub fn shutdown() -> !
Expand description

use sbi call to shutdown the kernel

+shutdown in os::sbi - Rust

Function os::sbi::shutdown

source · []
pub fn shutdown(failure: bool) -> !
Expand description

use sbi call to shutdown the kernel

\ No newline at end of file diff --git a/ch3/os/sbi/index.html b/ch3/os/sbi/index.html index 0ae82365..cfd89b06 100644 --- a/ch3/os/sbi/index.html +++ b/ch3/os/sbi/index.html @@ -1,6 +1,5 @@ -os::sbi - Rust

Module os::sbi

source · []
Expand description

SBI call wrappers

-

Constants

Functions

use sbi call to putchar in console (qemu uart handler)

-
sbi_call 🔒

handle SBI call with which SBI_id and other arguments

+os::sbi - Rust

Module os::sbi

source · []
Expand description

SBI call wrappers

+

Functions

use sbi call to putchar in console (qemu uart handler)

use sbi call to set timer

use sbi call to shutdown the kernel

\ No newline at end of file diff --git a/ch3/os/sbi/sidebar-items.js b/ch3/os/sbi/sidebar-items.js index a5830cda..8ebce08e 100644 --- a/ch3/os/sbi/sidebar-items.js +++ b/ch3/os/sbi/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"constant":[["SBI_CONSOLE_PUTCHAR",""],["SBI_SET_TIMER",""]],"fn":[["console_putchar","use sbi call to putchar in console (qemu uart handler)"],["sbi_call","handle SBI call with `which` SBI_id and other arguments"],["set_timer","use sbi call to set timer"],["shutdown","use sbi call to shutdown the kernel"]]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"fn":[["console_putchar","use sbi call to putchar in console (qemu uart handler)"],["set_timer","use sbi call to set timer"],["shutdown","use sbi call to shutdown the kernel"]]}; \ No newline at end of file diff --git a/ch3/os/task/struct.TASK_MANAGER.html b/ch3/os/task/struct.TASK_MANAGER.html index 02d04aee..73f7c569 100644 --- a/ch3/os/task/struct.TASK_MANAGER.html +++ b/ch3/os/task/struct.TASK_MANAGER.html @@ -1,18 +1,18 @@ -TASK_MANAGER in os::task - Rust
pub struct TASK_MANAGER {
+TASK_MANAGER in os::task - Rust
pub struct TASK_MANAGER {
     __private_field: (),
 }
Expand description

Global variable: TASK_MANAGER

-

Fields

__private_field: ()

Methods from Deref<Target = TaskManager>

Run the first task in task list.

+

Fields

__private_field: ()

Methods from Deref<Target = TaskManager>

Run the first task in task list.

Generally, the first task in task list is an idle task (we call it zero process later). But in ch3, we load apps statically, so the first task is a real app.

-

Change the status of current Running task into Ready.

-

Change the status of current Running task into Exited.

-

Find next task to run and return task id.

+

Change the status of current Running task into Ready.

+

Change the status of current Running task into Exited.

+

Find next task to run and return task id.

In this case, we only return the first Ready task in task list.

-

Switch current Running task to the task we have found, +

Switch current Running task to the task we have found, or there is no Ready task and we can exit with all applications completed

-

Trait Implementations

The resulting type after dereferencing.

-

Dereferences the value.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

diff --git a/ch3/os/task/struct.TaskManager.html b/ch3/os/task/struct.TaskManager.html index 2e2d73c6..57d28430 100644 --- a/ch3/os/task/struct.TaskManager.html +++ b/ch3/os/task/struct.TaskManager.html @@ -1,4 +1,4 @@ -TaskManager in os::task - Rust
pub struct TaskManager {
+TaskManager in os::task - Rust
pub struct TaskManager {
     num_app: usize,
     inner: UPSafeCell<TaskManagerInner>,
 }
Expand description

The task manager, where all the tasks are managed.

@@ -10,14 +10,14 @@ borrowing checks to runtime. You can see examples on how to use innerTaskManager.

Fields

num_app: usize

total number of tasks

inner: UPSafeCell<TaskManagerInner>

use inner value to get mutable access

-

Implementations

Run the first task in task list.

+

Implementations

Run the first task in task list.

Generally, the first task in task list is an idle task (we call it zero process later). But in ch3, we load apps statically, so the first task is a real app.

-

Change the status of current Running task into Ready.

-

Change the status of current Running task into Exited.

-

Find next task to run and return task id.

+

Change the status of current Running task into Ready.

+

Change the status of current Running task into Exited.

+

Find next task to run and return task id.

In this case, we only return the first Ready task in task list.

-

Switch current Running task to the task we have found, +

Switch current Running task to the task we have found, or there is no Ready task and we can exit with all applications completed

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

diff --git a/ch3/os/task/struct.TaskManagerInner.html b/ch3/os/task/struct.TaskManagerInner.html index 66e355cd..1c4e3d70 100644 --- a/ch3/os/task/struct.TaskManagerInner.html +++ b/ch3/os/task/struct.TaskManagerInner.html @@ -1,4 +1,4 @@ -TaskManagerInner in os::task - Rust
pub struct TaskManagerInner {
+TaskManagerInner in os::task - Rust
pub struct TaskManagerInner {
     tasks: [TaskControlBlock; 4],
     current_task: usize,
 }
Expand description

Inner of Task Manager

diff --git a/ch3/search-index.js b/ch3/search-index.js index 9982e226..385b7553 100644 --- a/ch3/search-index.js +++ b/ch3/search-index.js @@ -1,5 +1,5 @@ var searchIndex = JSON.parse('{\ -"os":{"doc":"The main module and entrypoint","t":[0,5,0,0,0,0,14,14,5,0,0,0,0,0,0,17,17,17,17,17,8,17,3,17,12,11,11,10,11,5,10,11,10,11,11,11,11,11,11,11,17,17,2,17,17,17,3,11,11,11,11,5,11,11,11,11,5,7,3,7,3,11,11,11,11,11,11,12,12,11,11,5,5,11,11,5,11,11,5,11,11,11,11,11,11,11,17,17,5,5,5,5,2,0,3,11,11,11,11,12,11,11,11,11,11,17,17,17,17,0,0,5,17,5,5,5,5,3,3,3,3,12,11,11,11,11,11,11,0,12,11,5,11,11,11,11,12,11,11,11,5,11,5,11,12,12,5,11,5,11,12,12,5,0,0,12,11,11,11,11,11,11,11,11,11,3,11,11,11,11,11,11,12,12,12,11,11,11,11,5,13,13,13,3,4,13,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,17,17,5,5,5,3,0,5,5,12,12,5,12,3,11,11,11,11,11,12,11,12,11,11,11,12],"n":["board","clear_bss","config","console","lang_items","loader","print","println","rust_main","sbi","sync","syscall","task","timer","trap","CLOCK_FREQ","EXIT_FAILURE","EXIT_FAILURE_FLAG","EXIT_RESET","EXIT_SUCCESS","QEMUExit","QEMU_EXIT_HANDLE","RISCV64","VIRT_TEST","addr","borrow","borrow_mut","exit","exit","exit_code_encode","exit_failure","exit_failure","exit_success","exit_success","from","into","new","try_from","try_into","type_id","APP_BASE_ADDRESS","APP_SIZE_LIMIT","CLOCK_FREQ","KERNEL_STACK_SIZE","MAX_APP_NUM","USER_STACK_SIZE","Stdout","borrow","borrow_mut","from","into","print","try_from","try_into","type_id","write_str","panic","KERNEL_STACK","KernelStack","USER_STACK","UserStack","borrow","borrow","borrow_mut","borrow_mut","clone","clone","data","data","from","from","get_base_i","get_num_app","get_sp","get_sp","init_app_cx","into","into","load_apps","push_context","try_from","try_from","try_into","try_into","type_id","type_id","SBI_CONSOLE_PUTCHAR","SBI_SET_TIMER","console_putchar","sbi_call","set_timer","shutdown","UPSafeCell","up","UPSafeCell","borrow","borrow_mut","exclusive_access","from","inner","into","new","try_from","try_into","type_id","SYSCALL_EXIT","SYSCALL_GET_TIME","SYSCALL_WRITE","SYSCALL_YIELD","fs","process","syscall","FD_STDOUT","sys_write","sys_exit","sys_get_time","sys_yield","TASK_MANAGER","TaskContext","TaskManager","TaskManagerInner","__private_field","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","context","current_task","deref","exit_current_and_run_next","find_next_task","from","from","from","inner","into","into","into","mark_current_exited","mark_current_exited","mark_current_suspended","mark_current_suspended","num_app","ra","run_first_task","run_first_task","run_next_task","run_next_task","s","sp","suspend_current_and_run_next","switch","task","tasks","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","TaskContext","borrow","borrow_mut","clone","from","goto_restore","into","ra","s","sp","try_from","try_into","type_id","zero_init","__switch","Exited","Ready","Running","TaskControlBlock","TaskStatus","UnInit","borrow","borrow","borrow_mut","borrow_mut","clone","clone","eq","from","from","into","into","task_cx","task_status","try_from","try_from","try_into","try_into","type_id","type_id","MSEC_PER_SEC","TICKS_PER_SEC","get_time","get_time_ms","set_next_trigger","TrapContext","context","enable_timer_interrupt","init","sepc","sstatus","trap_handler","x","TrapContext","app_init_context","borrow","borrow_mut","from","into","sepc","set_sp","sstatus","try_from","try_into","type_id","x"],"q":["os","","","","","","","","","","","","","","","os::board","","","","","","","","","","","","","","","","","","","","","","","","","os::config","","","","","","os::console","","","","","","","","","","os::lang_items","os::loader","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::sbi","","","","","","os::sync","","os::sync::up","","","","","","","","","","","os::syscall","","","","","","","os::syscall::fs","","os::syscall::process","","","os::task","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::task::context","","","","","","","","","","","","","","os::task::switch","os::task::task","","","","","","","","","","","","","","","","","","","","","","","","","os::timer","","","","","os::trap","","","","","","","","os::trap::context","","","","","","","","","","","",""],"d":["Constants used in rCore for qemu","clear BSS segment","Constants used in rCore","SBI console driver, for text output","The panic handler","Loading user applications into memory","print string macro","println string macro","the rust entry-point of os","SBI call wrappers","Synchronization and interior mutability primitives","Implementation of syscalls","Task management implementation","RISC-V timer-related functionality","Trap handling functionality","","","","","","","","RISCV64 configuration","","Address of the sifive_test mapped device.","","","Exit with specified return code.","Exit qemu with specified exit code.","Encode the exit code using EXIT_FAILURE_FLAG.","Exit QEMU using EXIT_FAILURE, aka 1.","","Exit QEMU using EXIT_SUCCESS, aka 0, if possible.","","Returns the argument unchanged.","Calls U::from(self).","Create an instance.","","","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Get base address of app i.","Get the total number of applications.","","","get app info with entry and sp and save TrapContext in …","Calls U::from(self).","Calls U::from(self).","Load nth user app at [APP_BASE_ADDRESS + n * …","","","","","","","","","","use sbi call to putchar in console (qemu uart handler)","handle SBI call with which SBI_id and other arguments","use sbi call to set timer","use sbi call to shutdown the kernel","","Uniprocessor interior mutability primitives","Wrap a static data structure inside it so that we are able …","","","Exclusive access inner data in UPSafeCell. Panic if the …","Returns the argument unchanged.","inner data","Calls U::from(self).","User is responsible to guarantee that inner struct is only …","","","","","","","","File and filesystem-related syscalls","Process management syscalls","handle syscall exception with syscall_id and other …","","write buf of length len to a file with fd","task exits and submit an exit code","get time in milliseconds","current task gives up resources for other tasks","Global variable: TASK_MANAGER","Task Context","The task manager, where all the tasks are managed.","Inner of Task Manager","","","","","","","","Implementation of TaskContext","id of current Running task","","exit current task, then run next task","Find next task to run and return task id.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","use inner value to get mutable access","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","exit current task","Change the status of current Running task into Exited.","suspend current task","Change the status of current Running task into Ready.","total number of tasks","return address ( e.g. __restore ) of __switch ASM function","run first task","Run the first task in task list.","rust next task","Switch current Running task to the task we have found, or …","callee saved registers: s 0..11","kernel stack pointer of app","suspend current task, then run next task","Rust wrapper around __switch.","Types related to task management","task list","","","","","","","","","","Task Context","","","","Returns the argument unchanged.","set task context {__restore ASM funciton, kernel stack, …","Calls U::from(self).","return address ( e.g. __restore ) of __switch ASM function","callee saved registers: s 0..11","kernel stack pointer of app","","","","init task context","Switch to the context of next_task_cx_ptr, saving the …","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","read the mtime register","get current time in milliseconds","set the next timer interrupt","Trap Context","","timer interrupt enabled","initialize CSR stvec as the entry of __alltraps","CSR sepc","CSR sstatus ","handle an interrupt, exception, or system call from user …","general regs[0..31]","Trap Context","init app context","","","Returns the argument unchanged.","Calls U::from(self).","CSR sepc","set stack pointer to x_2 reg (sp)","CSR sstatus ","","","","general regs[0..31]"],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,28,3,0,28,3,28,3,3,3,3,3,3,3,0,0,0,0,0,0,0,8,8,8,8,0,8,8,8,8,0,0,0,0,0,12,13,12,13,12,13,12,13,12,13,0,0,12,13,0,12,13,0,12,12,13,12,13,12,13,0,0,0,0,0,0,0,0,0,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,22,29,21,22,29,21,0,29,21,0,22,22,29,21,22,22,29,21,0,22,0,22,22,24,0,22,0,22,24,24,0,0,0,29,22,29,21,22,29,21,22,29,21,0,24,24,24,24,24,24,24,24,24,24,24,24,24,0,26,26,26,0,0,26,25,26,25,26,25,26,26,25,26,25,26,25,25,25,26,25,26,25,26,0,0,0,0,0,0,0,0,0,15,15,0,15,0,15,15,15,15,15,15,15,15,15,15,15,15],"f":[0,[[]],0,0,0,0,0,0,[[],1],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[2,1],[[3,2],1],[2,2],[[],1],[3,1],[[],1],[3,1],[[]],[[]],[4,3],[[],5],[[],5],[[],6],0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[7],[[],5],[[],5],[[],6],[[8,9],10],[11,1],0,0,0,0,[[]],[[]],[[]],[[]],[12,12],[13,13],0,0,[[]],[[]],[14,14],[[],14],[12,14],[13,14],[14,14],[[]],[[]],[[]],[[12,15],14],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],0,0,[14],[[14,14,14,14],14],[14],[[],1],0,0,0,[[]],[[]],[16,17],[[]],0,[[]],[[],16],[[],5],[[],5],[[],6],0,0,0,0,0,0,[14,18],0,[[14,19,14],18],[20,1],[[],18],[[],18],0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],0,0,[21,22],[[]],[22,[[23,[14]]]],[[]],[[]],[[]],0,[[]],[[]],[[]],[[]],[22],[[]],[22],0,0,[[]],[22,1],[[]],[22],0,0,[[]],0,0,0,[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],0,[[]],[[]],[24,24],[[]],[14,24],[[]],0,0,0,[[],5],[[],5],[[],6],[[],24],0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[25,25],[26,26],[[26,26],27],[[]],[[]],[[]],[[]],0,0,[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],0,0,[[],14],[[],14],[[]],0,0,[[]],[[]],0,0,[15,15],0,0,[[14,14],15],[[]],[[]],[[]],[[]],0,[[15,14]],0,[[],5],[[],5],[[],6],0],"p":[[15,"never"],[15,"u32"],[3,"RISCV64"],[15,"u64"],[4,"Result"],[3,"TypeId"],[3,"Arguments"],[3,"Stdout"],[15,"str"],[6,"Result"],[3,"PanicInfo"],[3,"KernelStack"],[3,"UserStack"],[15,"usize"],[3,"TrapContext"],[3,"UPSafeCell"],[3,"RefMut"],[15,"isize"],[15,"u8"],[15,"i32"],[3,"TASK_MANAGER"],[3,"TaskManager"],[4,"Option"],[3,"TaskContext"],[3,"TaskControlBlock"],[4,"TaskStatus"],[15,"bool"],[8,"QEMUExit"],[3,"TaskManagerInner"]]}\ +"os":{"doc":"The main module and entrypoint","t":[0,5,0,0,0,0,14,14,5,0,0,0,0,0,0,17,17,17,2,17,17,17,3,11,11,11,11,5,11,11,11,11,5,7,3,7,3,11,11,11,11,11,11,12,12,11,11,5,5,11,11,5,11,11,5,11,11,11,11,11,11,11,5,5,5,2,0,3,11,11,11,11,12,11,11,11,11,11,17,17,17,17,0,0,5,17,5,5,5,5,3,3,3,3,12,11,11,11,11,11,11,0,12,11,5,11,11,11,11,12,11,11,11,5,11,5,11,12,12,5,11,5,11,12,12,5,0,0,12,11,11,11,11,11,11,11,11,11,3,11,11,11,11,11,11,12,12,12,11,11,11,11,5,13,13,13,3,4,13,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,17,17,5,5,5,3,0,5,5,12,12,5,12,3,11,11,11,11,11,12,11,12,11,11,11,12],"n":["board","clear_bss","config","console","lang_items","loader","print","println","rust_main","sbi","sync","syscall","task","timer","trap","CLOCK_FREQ","APP_BASE_ADDRESS","APP_SIZE_LIMIT","CLOCK_FREQ","KERNEL_STACK_SIZE","MAX_APP_NUM","USER_STACK_SIZE","Stdout","borrow","borrow_mut","from","into","print","try_from","try_into","type_id","write_str","panic","KERNEL_STACK","KernelStack","USER_STACK","UserStack","borrow","borrow","borrow_mut","borrow_mut","clone","clone","data","data","from","from","get_base_i","get_num_app","get_sp","get_sp","init_app_cx","into","into","load_apps","push_context","try_from","try_from","try_into","try_into","type_id","type_id","console_putchar","set_timer","shutdown","UPSafeCell","up","UPSafeCell","borrow","borrow_mut","exclusive_access","from","inner","into","new","try_from","try_into","type_id","SYSCALL_EXIT","SYSCALL_GET_TIME","SYSCALL_WRITE","SYSCALL_YIELD","fs","process","syscall","FD_STDOUT","sys_write","sys_exit","sys_get_time","sys_yield","TASK_MANAGER","TaskContext","TaskManager","TaskManagerInner","__private_field","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","context","current_task","deref","exit_current_and_run_next","find_next_task","from","from","from","inner","into","into","into","mark_current_exited","mark_current_exited","mark_current_suspended","mark_current_suspended","num_app","ra","run_first_task","run_first_task","run_next_task","run_next_task","s","sp","suspend_current_and_run_next","switch","task","tasks","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","TaskContext","borrow","borrow_mut","clone","from","goto_restore","into","ra","s","sp","try_from","try_into","type_id","zero_init","__switch","Exited","Ready","Running","TaskControlBlock","TaskStatus","UnInit","borrow","borrow","borrow_mut","borrow_mut","clone","clone","eq","from","from","into","into","task_cx","task_status","try_from","try_from","try_into","try_into","type_id","type_id","MSEC_PER_SEC","TICKS_PER_SEC","get_time","get_time_ms","set_next_trigger","TrapContext","context","enable_timer_interrupt","init","sepc","sstatus","trap_handler","x","TrapContext","app_init_context","borrow","borrow_mut","from","into","sepc","set_sp","sstatus","try_from","try_into","type_id","x"],"q":["os","","","","","","","","","","","","","","","os::board","os::config","","","","","","os::console","","","","","","","","","","os::lang_items","os::loader","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::sbi","","","os::sync","","os::sync::up","","","","","","","","","","","os::syscall","","","","","","","os::syscall::fs","","os::syscall::process","","","os::task","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::task::context","","","","","","","","","","","","","","os::task::switch","os::task::task","","","","","","","","","","","","","","","","","","","","","","","","","os::timer","","","","","os::trap","","","","","","","","os::trap::context","","","","","","","","","","","",""],"d":["Constants used in rCore for qemu","clear BSS segment","Constants used in rCore","SBI console driver, for text output","The panic handler","Loading user applications into memory","print string macro","println string macro","the rust entry-point of os","SBI call wrappers","Synchronization and interior mutability primitives","Implementation of syscalls","Task management implementation","RISC-V timer-related functionality","Trap handling functionality","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Get base address of app i.","Get the total number of applications.","","","get app info with entry and sp and save TrapContext in …","Calls U::from(self).","Calls U::from(self).","Load nth user app at [APP_BASE_ADDRESS + n * …","","","","","","","","use sbi call to putchar in console (qemu uart handler)","use sbi call to set timer","use sbi call to shutdown the kernel","","Uniprocessor interior mutability primitives","Wrap a static data structure inside it so that we are able …","","","Exclusive access inner data in UPSafeCell. Panic if the …","Returns the argument unchanged.","inner data","Calls U::from(self).","User is responsible to guarantee that inner struct is only …","","","","","","","","File and filesystem-related syscalls","Process management syscalls","handle syscall exception with syscall_id and other …","","write buf of length len to a file with fd","task exits and submit an exit code","get time in milliseconds","current task gives up resources for other tasks","Global variable: TASK_MANAGER","Task Context","The task manager, where all the tasks are managed.","Inner of Task Manager","","","","","","","","Implementation of TaskContext","id of current Running task","","exit current task, then run next task","Find next task to run and return task id.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","use inner value to get mutable access","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","exit current task","Change the status of current Running task into Exited.","suspend current task","Change the status of current Running task into Ready.","total number of tasks","return address ( e.g. __restore ) of __switch ASM function","run first task","Run the first task in task list.","rust next task","Switch current Running task to the task we have found, or …","callee saved registers: s 0..11","kernel stack pointer of app","suspend current task, then run next task","Rust wrapper around __switch.","Types related to task management","task list","","","","","","","","","","Task Context","","","","Returns the argument unchanged.","set task context {__restore ASM funciton, kernel stack, …","Calls U::from(self).","return address ( e.g. __restore ) of __switch ASM function","callee saved registers: s 0..11","kernel stack pointer of app","","","","init task context","Switch to the context of next_task_cx_ptr, saving the …","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","read the mtime register","get current time in milliseconds","set the next timer interrupt","Trap Context","","timer interrupt enabled","initialize CSR stvec as the entry of __alltraps","CSR sepc","CSR sstatus ","handle an interrupt, exception, or system call from user …","general regs[0..31]","Trap Context","init app context","","","Returns the argument unchanged.","Calls U::from(self).","CSR sepc","set stack pointer to x_2 reg (sp)","CSR sstatus ","","","","general regs[0..31]"],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,0,5,5,5,5,0,0,0,0,0,9,10,9,10,9,10,9,10,9,10,0,0,9,10,0,9,10,0,9,9,10,9,10,9,10,0,0,0,0,0,0,14,14,14,14,14,14,14,14,14,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,20,25,19,20,25,19,0,25,19,0,20,20,25,19,20,20,25,19,0,20,0,20,20,22,0,20,0,20,22,22,0,0,0,25,20,25,19,20,25,19,20,25,19,0,22,22,22,22,22,22,22,22,22,22,22,22,22,0,24,24,24,0,0,24,23,24,23,24,23,24,24,23,24,23,24,23,23,23,24,23,24,23,24,0,0,0,0,0,0,0,0,0,12,12,0,12,0,12,12,12,12,12,12,12,12,12,12,12,12],"f":[0,[[]],0,0,0,0,0,0,[[],1],0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[2],[[],3],[[],3],[[],4],[[5,6],7],[8,1],0,0,0,0,[[]],[[]],[[]],[[]],[9,9],[10,10],0,0,[[]],[[]],[11,11],[[],11],[9,11],[10,11],[11,11],[[]],[[]],[[]],[[9,12],11],[[],3],[[],3],[[],3],[[],3],[[],4],[[],4],[11],[11],[13,1],0,0,0,[[]],[[]],[14,15],[[]],0,[[]],[[],14],[[],3],[[],3],[[],4],0,0,0,0,0,0,[11,16],0,[[11,17,11],16],[18,1],[[],16],[[],16],0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],0,0,[19,20],[[]],[20,[[21,[11]]]],[[]],[[]],[[]],0,[[]],[[]],[[]],[[]],[20],[[]],[20],0,0,[[]],[20,1],[[]],[20],0,0,[[]],0,0,0,[[],3],[[],3],[[],3],[[],3],[[],3],[[],3],[[],4],[[],4],[[],4],0,[[]],[[]],[22,22],[[]],[11,22],[[]],0,0,0,[[],3],[[],3],[[],4],[[],22],0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[23,23],[24,24],[[24,24],13],[[]],[[]],[[]],[[]],0,0,[[],3],[[],3],[[],3],[[],3],[[],4],[[],4],0,0,[[],11],[[],11],[[]],0,0,[[]],[[]],0,0,[12,12],0,0,[[11,11],12],[[]],[[]],[[]],[[]],0,[[12,11]],0,[[],3],[[],3],[[],4],0],"p":[[15,"never"],[3,"Arguments"],[4,"Result"],[3,"TypeId"],[3,"Stdout"],[15,"str"],[6,"Result"],[3,"PanicInfo"],[3,"KernelStack"],[3,"UserStack"],[15,"usize"],[3,"TrapContext"],[15,"bool"],[3,"UPSafeCell"],[3,"RefMut"],[15,"isize"],[15,"u8"],[15,"i32"],[3,"TASK_MANAGER"],[3,"TaskManager"],[4,"Option"],[3,"TaskContext"],[3,"TaskControlBlock"],[4,"TaskStatus"],[3,"TaskManagerInner"]]}\ }'); if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; diff --git a/ch3/src/os/boards/qemu.rs.html b/ch3/src/os/boards/qemu.rs.html index 03552acc..fa8bd551 100644 --- a/ch3/src/os/boards/qemu.rs.html +++ b/ch3/src/os/boards/qemu.rs.html @@ -1,168 +1,8 @@ qemu.rs - source
1
 2
 3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
 
//! Constants used in rCore for qemu
 
 pub const CLOCK_FREQ: usize = 12500000;
-
-//ref:: https://github.com/andre-richter/qemu-exit
-use core::arch::asm;
-
-const EXIT_SUCCESS: u32 = 0x5555; // Equals `exit(0)`. qemu successful exit
-
-const EXIT_FAILURE_FLAG: u32 = 0x3333;
-const EXIT_FAILURE: u32 = exit_code_encode(1); // Equals `exit(1)`. qemu failed exit
-const EXIT_RESET: u32 = 0x7777; // qemu reset
-
-pub trait QEMUExit {
-    /// Exit with specified return code.
-    ///
-    /// Note: For `X86`, code is binary-OR'ed with `0x1` inside QEMU.
-    fn exit(&self, code: u32) -> !;
-
-    /// Exit QEMU using `EXIT_SUCCESS`, aka `0`, if possible.
-    ///
-    /// Note: Not possible for `X86`.
-    fn exit_success(&self) -> !;
-
-    /// Exit QEMU using `EXIT_FAILURE`, aka `1`.
-    fn exit_failure(&self) -> !;
-}
-
-/// RISCV64 configuration
-pub struct RISCV64 {
-    /// Address of the sifive_test mapped device.
-    addr: u64,
-}
-
-/// Encode the exit code using EXIT_FAILURE_FLAG.
-const fn exit_code_encode(code: u32) -> u32 {
-    (code << 16) | EXIT_FAILURE_FLAG
-}
-
-impl RISCV64 {
-    /// Create an instance.
-    pub const fn new(addr: u64) -> Self {
-        RISCV64 { addr }
-    }
-}
-
-impl QEMUExit for RISCV64 {
-    /// Exit qemu with specified exit code.
-    fn exit(&self, code: u32) -> ! {
-        // If code is not a special value, we need to encode it with EXIT_FAILURE_FLAG.
-        let code_new = match code {
-            EXIT_SUCCESS | EXIT_FAILURE | EXIT_RESET => code,
-            _ => exit_code_encode(code),
-        };
-
-        unsafe {
-            asm!(
-                "sw {0}, 0({1})",
-                in(reg)code_new, in(reg)self.addr
-            );
-
-            // For the case that the QEMU exit attempt did not work, transition into an infinite
-            // loop. Calling `panic!()` here is unfeasible, since there is a good chance
-            // this function here is the last expression in the `panic!()` handler
-            // itself. This prevents a possible infinite loop.
-            loop {
-                asm!("wfi", options(nomem, nostack));
-            }
-        }
-    }
-
-    fn exit_success(&self) -> ! {
-        self.exit(EXIT_SUCCESS);
-    }
-
-    fn exit_failure(&self) -> ! {
-        self.exit(EXIT_FAILURE);
-    }
-}
-
-const VIRT_TEST: u64 = 0x100000;
-
-pub const QEMU_EXIT_HANDLE: RISCV64 = RISCV64::new(VIRT_TEST);
 
\ No newline at end of file diff --git a/ch3/src/os/lang_items.rs.html b/ch3/src/os/lang_items.rs.html index 70d5d37b..34d1a4ee 100644 --- a/ch3/src/os/lang_items.rs.html +++ b/ch3/src/os/lang_items.rs.html @@ -17,24 +17,26 @@ 17 18 19 +20
//! The panic handler
 
 use crate::sbi::shutdown;
 use core::panic::PanicInfo;
+use log::*;
 
 #[panic_handler]
 fn panic(info: &PanicInfo) -> ! {
     if let Some(location) = info.location() {
-        println!(
+        error!(
             "[kernel] Panicked at {}:{} {}",
             location.file(),
             location.line(),
             info.message().unwrap()
         );
     } else {
-        println!("[kernel] Panicked: {}", info.message().unwrap());
+        error!("[kernel] Panicked: {}", info.message().unwrap());
     }
-    shutdown()
+    shutdown(true)
 }
 
\ No newline at end of file diff --git a/ch3/src/os/sbi.rs.html b/ch3/src/os/sbi.rs.html index b966eaa3..2d4f9cb9 100644 --- a/ch3/src/os/sbi.rs.html +++ b/ch3/src/os/sbi.rs.html @@ -21,86 +21,28 @@ 21 22 23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52
//! SBI call wrappers
 
-use core::arch::asm;
-
-const SBI_SET_TIMER: usize = 0;
-const SBI_CONSOLE_PUTCHAR: usize = 1;
-
-// const SBI_CONSOLE_GETCHAR: usize = 2;
-// const SBI_CLEAR_IPI: usize = 3;
-// const SBI_SEND_IPI: usize = 4;
-// const SBI_REMOTE_FENCE_I: usize = 5;
-// const SBI_REMOTE_SFENCE_VMA: usize = 6;
-// const SBI_REMOTE_SFENCE_VMA_ASID: usize = 7;
-// const SBI_SHUTDOWN: usize = 8;
-
-///  handle SBI call with `which` SBI_id and other arguments
-#[inline(always)]
-fn sbi_call(which: usize, arg0: usize, arg1: usize, arg2: usize) -> usize {
-    let mut ret;
-    unsafe {
-        asm!(
-            "li x16, 0",
-            "ecall",
-            inlateout("x10") arg0 => ret,
-            in("x11") arg1,
-            in("x12") arg2,
-            in("x17") which,
-        );
-    }
-    ret
+/// use sbi call to putchar in console (qemu uart handler)
+pub fn console_putchar(c: usize) {
+    #[allow(deprecated)]
+    sbi_rt::legacy::console_putchar(c);
 }
 
 /// use sbi call to set timer
 pub fn set_timer(timer: usize) {
-    sbi_call(SBI_SET_TIMER, timer, 0, 0);
+    sbi_rt::set_timer(timer as _);
 }
 
-/// use sbi call to putchar in console (qemu uart handler)
-pub fn console_putchar(c: usize) {
-    sbi_call(SBI_CONSOLE_PUTCHAR, c, 0, 0);
-}
-
-/// use sbi call to getchar from console (qemu uart handler)
-// pub fn console_getchar() -> usize {
-//     sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0)
-// }
-
-use crate::board::QEMUExit;
 /// use sbi call to shutdown the kernel
-pub fn shutdown() -> ! {
-    crate::board::QEMU_EXIT_HANDLE.exit_failure();
+pub fn shutdown(failure: bool) -> ! {
+    use sbi_rt::{system_reset, NoReason, Shutdown, SystemFailure};
+    if !failure {
+        system_reset(Shutdown, NoReason);
+    } else {
+        system_reset(Shutdown, SystemFailure);
+    }
+    unreachable!()
 }
 
\ No newline at end of file diff --git a/ch3/src/os/task/mod.rs.html b/ch3/src/os/task/mod.rs.html index 42e6e2e7..4cbb6e3e 100644 --- a/ch3/src/os/task/mod.rs.html +++ b/ch3/src/os/task/mod.rs.html @@ -190,6 +190,7 @@ use crate::config::MAX_APP_NUM; use crate::loader::{get_num_app, init_app_cx}; +use crate::sbi::shutdown; use crate::sync::UPSafeCell; use lazy_static::*; use switch::__switch; @@ -307,8 +308,7 @@ // go back to user mode } else { println!("All applications completed!"); - use crate::board::QEMUExit; - crate::board::QEMU_EXIT_HANDLE.exit_success(); + shutdown(false); } } }