";const ul=document.createElement("ul");div.appendChild(ul);for(const crate of window.ALL_CRATES){let klass="crate";if(window.rootPath!=="./"&&crate===window.currentCrate){klass+=" current"}const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.className=klass;link.textContent=crate;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(div)}function labelForToggleButton(sectionIsCollapsed){if(sectionIsCollapsed){return"+"}return"\u2212"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}let sectionIsCollapsed=false;if(hasClass(innerToggle,"will-expand")){removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(!hasClass(e,"type-contents-toggle")){e.open=true}});innerToggle.title="collapse all docs"}else{addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});sectionIsCollapsed=true;innerToggle.title="expand all docs"}innerToggle.children[0].innerText=labelForToggleButton(sectionIsCollapsed)}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}});const pageId=getPageId();if(pageId!==null){expandSection(pageId)}}());(function(){let lineNumbersFunc=()=>{};if(getSettingValue("line-numbers")==="true"){lineNumbersFunc=x=>{const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{if(hasClass(e,"compile_fail")){e.addEventListener("mouseover",function(){this.parentElement.previousElementSibling.childNodes[0].style.color="#f00"});e.addEventListener("mouseout",function(){this.parentElement.previousElementSibling.childNodes[0].style.color=""})}else if(hasClass(e,"ignore")){e.addEventListener("mouseover",function(){this.parentElement.previousElementSibling.childNodes[0].style.color="#ff9200"});e.addEventListener("mouseout",function(){this.parentElement.previousElementSibling.childNodes[0].style.color=""})}lineNumbersFunc(e)})}());function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}function handleClick(id,f){const elem=document.getElementById(id);if(elem){elem.addEventListener("click",f)}}handleClick(MAIN_ID,()=>{hideSidebar()});onEachLazy(document.getElementsByTagName("a"),el=>{if(el.hash){el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})}});onEachLazy(document.querySelectorAll(".rustdoc-toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});onEachLazy(document.getElementsByClassName("notable-traits"),e=>{e.onclick=function(){this.getElementsByClassName("notable-traits-tooltiptext")[0].classList.toggle("force-tooltip")}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){addClass(sidebar,"shown")}else{removeClass(sidebar,"shown")}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");book_info.className="top";book_info.innerHTML="You can find more information in \
- the rustdoc book.";const shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
";const infos=["Prefix searches with a type followed by a colon (e.g., fn:) to \
- restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \
- enum, trait, type, macro, \
- and const.","Search functions by type signature (e.g., vec -> usize or \
- -> vec)","Search multiple things at once by splitting your query with comma (e.g., \
- str,u8 or String,struct:Vec,test)","You can look for items with an exact name by putting double quotes around \
- your request: \"string\"","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"
\ No newline at end of file
diff --git a/ch3-coop/os/board/constant.EXIT_FAILURE.html b/ch3-coop/os/board/constant.EXIT_FAILURE.html
deleted file mode 100644
index ce980ff01..000000000
--- a/ch3-coop/os/board/constant.EXIT_FAILURE.html
+++ /dev/null
@@ -1 +0,0 @@
-EXIT_FAILURE in os::board - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/board/constant.EXIT_FAILURE_FLAG.html b/ch3-coop/os/board/constant.EXIT_FAILURE_FLAG.html
deleted file mode 100644
index 2e97e5141..000000000
--- a/ch3-coop/os/board/constant.EXIT_FAILURE_FLAG.html
+++ /dev/null
@@ -1 +0,0 @@
-EXIT_FAILURE_FLAG in os::board - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/board/constant.EXIT_RESET.html b/ch3-coop/os/board/constant.EXIT_RESET.html
deleted file mode 100644
index b67110494..000000000
--- a/ch3-coop/os/board/constant.EXIT_RESET.html
+++ /dev/null
@@ -1 +0,0 @@
-EXIT_RESET in os::board - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/board/constant.EXIT_SUCCESS.html b/ch3-coop/os/board/constant.EXIT_SUCCESS.html
deleted file mode 100644
index a539b5636..000000000
--- a/ch3-coop/os/board/constant.EXIT_SUCCESS.html
+++ /dev/null
@@ -1 +0,0 @@
-EXIT_SUCCESS in os::board - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/board/constant.QEMU_EXIT_HANDLE.html b/ch3-coop/os/board/constant.QEMU_EXIT_HANDLE.html
deleted file mode 100644
index 7dbb59f35..000000000
--- a/ch3-coop/os/board/constant.QEMU_EXIT_HANDLE.html
+++ /dev/null
@@ -1 +0,0 @@
-QEMU_EXIT_HANDLE in os::board - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/board/constant.VIRT_TEST.html b/ch3-coop/os/board/constant.VIRT_TEST.html
deleted file mode 100644
index 2335c7e3f..000000000
--- a/ch3-coop/os/board/constant.VIRT_TEST.html
+++ /dev/null
@@ -1 +0,0 @@
-VIRT_TEST in os::board - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/board/fn.exit_code_encode.html b/ch3-coop/os/board/fn.exit_code_encode.html
deleted file mode 100644
index 8409dbc14..000000000
--- a/ch3-coop/os/board/fn.exit_code_encode.html
+++ /dev/null
@@ -1,2 +0,0 @@
-exit_code_encode in os::board - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/board/sidebar-items.js b/ch3-coop/os/board/sidebar-items.js
deleted file mode 100644
index 0e1f33a4b..000000000
--- a/ch3-coop/os/board/sidebar-items.js
+++ /dev/null
@@ -1 +0,0 @@
-window.SIDEBAR_ITEMS = {"constant":[["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
diff --git a/ch3-coop/os/board/struct.RISCV64.html b/ch3-coop/os/board/struct.RISCV64.html
deleted file mode 100644
index 1d4721276..000000000
--- a/ch3-coop/os/board/struct.RISCV64.html
+++ /dev/null
@@ -1,20 +0,0 @@
-RISCV64 in os::board - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/board/trait.QEMUExit.html b/ch3-coop/os/board/trait.QEMUExit.html
deleted file mode 100644
index 5c224cb16..000000000
--- a/ch3-coop/os/board/trait.QEMUExit.html
+++ /dev/null
@@ -1,10 +0,0 @@
-QEMUExit in os::board - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/config/constant.APP_BASE_ADDRESS.html b/ch3-coop/os/config/constant.APP_BASE_ADDRESS.html
index 8d3739db3..93d7b49f3 100644
--- a/ch3-coop/os/config/constant.APP_BASE_ADDRESS.html
+++ b/ch3-coop/os/config/constant.APP_BASE_ADDRESS.html
@@ -1 +1,2 @@
-APP_BASE_ADDRESS in os::config - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/config/constant.APP_SIZE_LIMIT.html b/ch3-coop/os/config/constant.APP_SIZE_LIMIT.html
index 98a3538df..229a830ec 100644
--- a/ch3-coop/os/config/constant.APP_SIZE_LIMIT.html
+++ b/ch3-coop/os/config/constant.APP_SIZE_LIMIT.html
@@ -1 +1,2 @@
-APP_SIZE_LIMIT in os::config - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/config/constant.KERNEL_STACK_SIZE.html b/ch3-coop/os/config/constant.KERNEL_STACK_SIZE.html
index 1b904b59b..74dbf040a 100644
--- a/ch3-coop/os/config/constant.KERNEL_STACK_SIZE.html
+++ b/ch3-coop/os/config/constant.KERNEL_STACK_SIZE.html
@@ -1 +1,2 @@
-KERNEL_STACK_SIZE in os::config - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/config/constant.MAX_APP_NUM.html b/ch3-coop/os/config/constant.MAX_APP_NUM.html
index f1872a7b2..1c833eb73 100644
--- a/ch3-coop/os/config/constant.MAX_APP_NUM.html
+++ b/ch3-coop/os/config/constant.MAX_APP_NUM.html
@@ -1 +1,2 @@
-MAX_APP_NUM in os::config - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/config/constant.USER_STACK_SIZE.html b/ch3-coop/os/config/constant.USER_STACK_SIZE.html
index cc3a1f09b..f94afaec1 100644
--- a/ch3-coop/os/config/constant.USER_STACK_SIZE.html
+++ b/ch3-coop/os/config/constant.USER_STACK_SIZE.html
@@ -1 +1,2 @@
-USER_STACK_SIZE in os::config - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/config/index.html b/ch3-coop/os/config/index.html
index 71e819e48..5ab30daeb 100644
--- a/ch3-coop/os/config/index.html
+++ b/ch3-coop/os/config/index.html
@@ -1,2 +1,3 @@
-os::config - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/config/sidebar-items.js b/ch3-coop/os/config/sidebar-items.js
index d89512575..9f8a2975a 100644
--- a/ch3-coop/os/config/sidebar-items.js
+++ b/ch3-coop/os/config/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":[["APP_BASE_ADDRESS",""],["APP_SIZE_LIMIT",""],["KERNEL_STACK_SIZE",""],["MAX_APP_NUM",""],["USER_STACK_SIZE",""]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["APP_BASE_ADDRESS","APP_SIZE_LIMIT","KERNEL_STACK_SIZE","MAX_APP_NUM","USER_STACK_SIZE"]};
\ No newline at end of file
diff --git a/ch3-coop/os/console/fn.print.html b/ch3-coop/os/console/fn.print.html
index b2afaec76..3d9ded7cf 100644
--- a/ch3-coop/os/console/fn.print.html
+++ b/ch3-coop/os/console/fn.print.html
@@ -1 +1,2 @@
-print in os::console - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/console/index.html b/ch3-coop/os/console/index.html
index 3b8358a54..4d2bc6469 100644
--- a/ch3-coop/os/console/index.html
+++ b/ch3-coop/os/console/index.html
@@ -1,2 +1,3 @@
-os::console - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/console/sidebar-items.js b/ch3-coop/os/console/sidebar-items.js
index cf66d5ebe..d7b318cf8 100644
--- a/ch3-coop/os/console/sidebar-items.js
+++ b/ch3-coop/os/console/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"fn":[["print",""]],"struct":[["Stdout",""]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"fn":["print"],"struct":["Stdout"]};
\ No newline at end of file
diff --git a/ch3-coop/os/console/struct.Stdout.html b/ch3-coop/os/console/struct.Stdout.html
index a6d180bca..98c855cf7 100644
--- a/ch3-coop/os/console/struct.Stdout.html
+++ b/ch3-coop/os/console/struct.Stdout.html
@@ -1,16 +1,13 @@
-Stdout in os::console - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/fn.clear_bss.html b/ch3-coop/os/fn.clear_bss.html
index 676f66037..2daa29a0f 100644
--- a/ch3-coop/os/fn.clear_bss.html
+++ b/ch3-coop/os/fn.clear_bss.html
@@ -1,2 +1,3 @@
-clear_bss in os - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/fn.rust_main.html b/ch3-coop/os/fn.rust_main.html
index acdfabd57..0fe2cb70e 100644
--- a/ch3-coop/os/fn.rust_main.html
+++ b/ch3-coop/os/fn.rust_main.html
@@ -1,3 +1,4 @@
-rust_main in os - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/index.html b/ch3-coop/os/index.html
index 0baa828f7..d1c25077c 100644
--- a/ch3-coop/os/index.html
+++ b/ch3-coop/os/index.html
@@ -1,28 +1,17 @@
-os - Rust
The operating system also starts in this module. Kernel code starts
-executing from entry.asm, after which rust_main() is called to
+executing from entry.asm, after which rust_main() is called to
initialize various pieces of functionality. (See its source code for
details.)
\ No newline at end of file
diff --git a/ch3-coop/os/lang_items/fn.panic.html b/ch3-coop/os/lang_items/fn.panic.html
index ca2700524..ce71c8490 100644
--- a/ch3-coop/os/lang_items/fn.panic.html
+++ b/ch3-coop/os/lang_items/fn.panic.html
@@ -1 +1,2 @@
-panic in os::lang_items - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/lang_items/index.html b/ch3-coop/os/lang_items/index.html
index 6181316ab..4acbd5774 100644
--- a/ch3-coop/os/lang_items/index.html
+++ b/ch3-coop/os/lang_items/index.html
@@ -1,2 +1,3 @@
-os::lang_items - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/lang_items/sidebar-items.js b/ch3-coop/os/lang_items/sidebar-items.js
index 65e8609b9..6330d5939 100644
--- a/ch3-coop/os/lang_items/sidebar-items.js
+++ b/ch3-coop/os/lang_items/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"fn":[["panic",""]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"fn":["panic"]};
\ No newline at end of file
diff --git a/ch3-coop/os/loader/fn.get_base_i.html b/ch3-coop/os/loader/fn.get_base_i.html
index e3b1c3b80..e6e3e8a48 100644
--- a/ch3-coop/os/loader/fn.get_base_i.html
+++ b/ch3-coop/os/loader/fn.get_base_i.html
@@ -1,2 +1,3 @@
-get_base_i in os::loader - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/loader/fn.get_num_app.html b/ch3-coop/os/loader/fn.get_num_app.html
index 66b02e249..d7e6839b2 100644
--- a/ch3-coop/os/loader/fn.get_num_app.html
+++ b/ch3-coop/os/loader/fn.get_num_app.html
@@ -1,2 +1,3 @@
-get_num_app in os::loader - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/loader/fn.init_app_cx.html b/ch3-coop/os/loader/fn.init_app_cx.html
index 42be68a35..a287d15f1 100644
--- a/ch3-coop/os/loader/fn.init_app_cx.html
+++ b/ch3-coop/os/loader/fn.init_app_cx.html
@@ -1,2 +1,3 @@
-init_app_cx in os::loader - Rust
get app info with entry and sp and save TrapContext in kernel stack
+
\ No newline at end of file
diff --git a/ch3-coop/os/loader/fn.load_apps.html b/ch3-coop/os/loader/fn.load_apps.html
index 96920b810..37eac8ec6 100644
--- a/ch3-coop/os/loader/fn.load_apps.html
+++ b/ch3-coop/os/loader/fn.load_apps.html
@@ -1,3 +1,4 @@
-load_apps in os::loader - Rust
Load nth user app at
[APP_BASE_ADDRESS + n * APP_SIZE_LIMIT, APP_BASE_ADDRESS + (n+1) * APP_SIZE_LIMIT).
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ch3-coop/os/loader/index.html b/ch3-coop/os/loader/index.html
index 2e6dc886e..266769fca 100644
--- a/ch3-coop/os/loader/index.html
+++ b/ch3-coop/os/loader/index.html
@@ -1,11 +1,8 @@
-os::loader - Rust
For chapter 3, user applications are simply part of the data included in the
kernel binary, so we only need to copy them to the space allocated for each
app to load them. We also allocate fixed spaces for each task’s
-KernelStack and UserStack.
Load nth user app at
+[APP_BASE_ADDRESS + n * APP_SIZE_LIMIT, APP_BASE_ADDRESS + (n+1) * APP_SIZE_LIMIT).
\ No newline at end of file
diff --git a/ch3-coop/os/loader/sidebar-items.js b/ch3-coop/os/loader/sidebar-items.js
index b4d1a4c30..48e59666b 100644
--- a/ch3-coop/os/loader/sidebar-items.js
+++ b/ch3-coop/os/loader/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"fn":[["get_base_i","Get base address of app i."],["get_num_app","Get the total number of applications."],["init_app_cx","get app info with entry and sp and save `TrapContext` in kernel stack"],["load_apps","Load nth user app at [APP_BASE_ADDRESS + n * APP_SIZE_LIMIT, APP_BASE_ADDRESS + (n+1) * APP_SIZE_LIMIT)."]],"static":[["KERNEL_STACK",""],["USER_STACK",""]],"struct":[["KernelStack",""],["UserStack",""]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"fn":["get_base_i","get_num_app","init_app_cx","load_apps"],"static":["KERNEL_STACK","USER_STACK"],"struct":["KernelStack","UserStack"]};
\ No newline at end of file
diff --git a/ch3-coop/os/loader/static.KERNEL_STACK.html b/ch3-coop/os/loader/static.KERNEL_STACK.html
index b85db6a19..aeb3e9185 100644
--- a/ch3-coop/os/loader/static.KERNEL_STACK.html
+++ b/ch3-coop/os/loader/static.KERNEL_STACK.html
@@ -1 +1,2 @@
-KERNEL_STACK in os::loader - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/loader/static.USER_STACK.html b/ch3-coop/os/loader/static.USER_STACK.html
index ba714128e..009da3f1c 100644
--- a/ch3-coop/os/loader/static.USER_STACK.html
+++ b/ch3-coop/os/loader/static.USER_STACK.html
@@ -1 +1,2 @@
-USER_STACK in os::loader - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/loader/struct.KernelStack.html b/ch3-coop/os/loader/struct.KernelStack.html
index 6a221299b..9670affd7 100644
--- a/ch3-coop/os/loader/struct.KernelStack.html
+++ b/ch3-coop/os/loader/struct.KernelStack.html
@@ -1,16 +1,14 @@
-KernelStack in os::loader - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/loader/struct.UserStack.html b/ch3-coop/os/loader/struct.UserStack.html
index 4797a7bb7..c542dfac2 100644
--- a/ch3-coop/os/loader/struct.UserStack.html
+++ b/ch3-coop/os/loader/struct.UserStack.html
@@ -1,16 +1,14 @@
-UserStack in os::loader - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/macro.print.html b/ch3-coop/os/macro.print.html
index 512a6bb45..002bff4f1 100644
--- a/ch3-coop/os/macro.print.html
+++ b/ch3-coop/os/macro.print.html
@@ -1,5 +1,5 @@
-print in os - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/macro.println.html b/ch3-coop/os/macro.println.html
index c8fcf42d4..df0ded176 100644
--- a/ch3-coop/os/macro.println.html
+++ b/ch3-coop/os/macro.println.html
@@ -1,5 +1,5 @@
-println in os - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/sbi/constant.SBI_CONSOLE_PUTCHAR.html b/ch3-coop/os/sbi/constant.SBI_CONSOLE_PUTCHAR.html
deleted file mode 100644
index 617403d68..000000000
--- a/ch3-coop/os/sbi/constant.SBI_CONSOLE_PUTCHAR.html
+++ /dev/null
@@ -1 +0,0 @@
-SBI_CONSOLE_PUTCHAR in os::sbi - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/sbi/fn.console_getchar.html b/ch3-coop/os/sbi/fn.console_getchar.html
new file mode 100644
index 000000000..eaf3ed479
--- /dev/null
+++ b/ch3-coop/os/sbi/fn.console_getchar.html
@@ -0,0 +1,3 @@
+console_getchar in os::sbi - Rust
+
use sbi call to getchar from console (qemu uart handler)
+
\ No newline at end of file
diff --git a/ch3-coop/os/sbi/fn.console_putchar.html b/ch3-coop/os/sbi/fn.console_putchar.html
index 285d34970..d5ef59e95 100644
--- a/ch3-coop/os/sbi/fn.console_putchar.html
+++ b/ch3-coop/os/sbi/fn.console_putchar.html
@@ -1,2 +1,3 @@
-console_putchar in os::sbi - Rust
use sbi call to putchar in console (qemu uart handler)
+
\ No newline at end of file
diff --git a/ch3-coop/os/sbi/fn.sbi_call.html b/ch3-coop/os/sbi/fn.sbi_call.html
deleted file mode 100644
index debab1510..000000000
--- a/ch3-coop/os/sbi/fn.sbi_call.html
+++ /dev/null
@@ -1,2 +0,0 @@
-sbi_call in os::sbi - Rust
handle SBI call with which SBI_id and other arguments
-
\ No newline at end of file
diff --git a/ch3-coop/os/sbi/fn.shutdown.html b/ch3-coop/os/sbi/fn.shutdown.html
index ef6840564..ec7307ac8 100644
--- a/ch3-coop/os/sbi/fn.shutdown.html
+++ b/ch3-coop/os/sbi/fn.shutdown.html
@@ -1,2 +1,3 @@
-shutdown in os::sbi - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/sbi/index.html b/ch3-coop/os/sbi/index.html
index 2a0824122..419779505 100644
--- a/ch3-coop/os/sbi/index.html
+++ b/ch3-coop/os/sbi/index.html
@@ -1,5 +1,3 @@
-os::sbi - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/sbi/sidebar-items.js b/ch3-coop/os/sbi/sidebar-items.js
index 685637e3c..0915077db 100644
--- a/ch3-coop/os/sbi/sidebar-items.js
+++ b/ch3-coop/os/sbi/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":[["SBI_CONSOLE_PUTCHAR",""]],"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"],["shutdown","use sbi call to shutdown the kernel"]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"fn":["console_getchar","console_putchar","shutdown"]};
\ No newline at end of file
diff --git a/ch3-coop/os/sidebar-items.js b/ch3-coop/os/sidebar-items.js
index 204741730..d66d98402 100644
--- a/ch3-coop/os/sidebar-items.js
+++ b/ch3-coop/os/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"fn":[["clear_bss","clear BSS segment"],["rust_main","the rust entry-point of os"]],"macro":[["print","print string macro"],["println","println string macro"]],"mod":[["board",""],["config","Constants used in rCore"],["console","SBI console driver, for text output"],["lang_items","The panic handler"],["loader","Loading user applications into memory"],["sbi","SBI call wrappers"],["sync","Synchronization and interior mutability primitives"],["syscall","Implementation of syscalls"],["task","Task management implementation"],["trap","Trap handling functionality"]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"fn":["clear_bss","rust_main"],"macro":["print","println"],"mod":["config","console","lang_items","loader","sbi","sync","syscall","task","trap"]};
\ No newline at end of file
diff --git a/ch3-coop/os/sync/index.html b/ch3-coop/os/sync/index.html
index eea82f9a2..9c9f33152 100644
--- a/ch3-coop/os/sync/index.html
+++ b/ch3-coop/os/sync/index.html
@@ -1,3 +1,3 @@
-os::sync - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/sync/sidebar-items.js b/ch3-coop/os/sync/sidebar-items.js
index a49a7b7c7..a2bbcb3e9 100644
--- a/ch3-coop/os/sync/sidebar-items.js
+++ b/ch3-coop/os/sync/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"mod":[["up","Uniprocessor interior mutability primitives"]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"mod":["up"]};
\ No newline at end of file
diff --git a/ch3-coop/os/sync/up/index.html b/ch3-coop/os/sync/up/index.html
index cab436166..58b768b0c 100644
--- a/ch3-coop/os/sync/up/index.html
+++ b/ch3-coop/os/sync/up/index.html
@@ -1,4 +1,4 @@
-os::sync::up - Rust
Wrap a static data structure inside it so that we are
+able to access it without any unsafe.
\ No newline at end of file
diff --git a/ch3-coop/os/sync/up/sidebar-items.js b/ch3-coop/os/sync/up/sidebar-items.js
index 8f4cda097..f4e9455dc 100644
--- a/ch3-coop/os/sync/up/sidebar-items.js
+++ b/ch3-coop/os/sync/up/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"struct":[["UPSafeCell","Wrap a static data structure inside it so that we are able to access it without any `unsafe`."]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"struct":["UPSafeCell"]};
\ No newline at end of file
diff --git a/ch3-coop/os/sync/up/struct.UPSafeCell.html b/ch3-coop/os/sync/up/struct.UPSafeCell.html
index 62465d244..4a3c0517c 100644
--- a/ch3-coop/os/sync/up/struct.UPSafeCell.html
+++ b/ch3-coop/os/sync/up/struct.UPSafeCell.html
@@ -1,23 +1,26 @@
-UPSafeCell in os::sync::up - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/constant.SYSCALL_EXIT.html b/ch3-coop/os/syscall/constant.SYSCALL_EXIT.html
index cb68704e2..a7a34ee30 100644
--- a/ch3-coop/os/syscall/constant.SYSCALL_EXIT.html
+++ b/ch3-coop/os/syscall/constant.SYSCALL_EXIT.html
@@ -1 +1,2 @@
-SYSCALL_EXIT in os::syscall - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/constant.SYSCALL_WRITE.html b/ch3-coop/os/syscall/constant.SYSCALL_WRITE.html
index d90f659f4..5a99ecae4 100644
--- a/ch3-coop/os/syscall/constant.SYSCALL_WRITE.html
+++ b/ch3-coop/os/syscall/constant.SYSCALL_WRITE.html
@@ -1 +1,2 @@
-SYSCALL_WRITE in os::syscall - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/constant.SYSCALL_YIELD.html b/ch3-coop/os/syscall/constant.SYSCALL_YIELD.html
index b4d92a075..c0b34faee 100644
--- a/ch3-coop/os/syscall/constant.SYSCALL_YIELD.html
+++ b/ch3-coop/os/syscall/constant.SYSCALL_YIELD.html
@@ -1 +1,2 @@
-SYSCALL_YIELD in os::syscall - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/fn.syscall.html b/ch3-coop/os/syscall/fn.syscall.html
index 21a157920..9d04170ca 100644
--- a/ch3-coop/os/syscall/fn.syscall.html
+++ b/ch3-coop/os/syscall/fn.syscall.html
@@ -1,2 +1,3 @@
-syscall in os::syscall - Rust
handle syscall exception with syscall_id and other arguments
+
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/fs/constant.FD_STDOUT.html b/ch3-coop/os/syscall/fs/constant.FD_STDOUT.html
index fa68cebda..bf45a0fd2 100644
--- a/ch3-coop/os/syscall/fs/constant.FD_STDOUT.html
+++ b/ch3-coop/os/syscall/fs/constant.FD_STDOUT.html
@@ -1 +1,2 @@
-FD_STDOUT in os::syscall::fs - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/fs/fn.sys_write.html b/ch3-coop/os/syscall/fs/fn.sys_write.html
index f57f8a186..f8e6a142f 100644
--- a/ch3-coop/os/syscall/fs/fn.sys_write.html
+++ b/ch3-coop/os/syscall/fs/fn.sys_write.html
@@ -1,2 +1,3 @@
-sys_write in os::syscall::fs - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/fs/index.html b/ch3-coop/os/syscall/fs/index.html
index 641f627fe..817fb8301 100644
--- a/ch3-coop/os/syscall/fs/index.html
+++ b/ch3-coop/os/syscall/fs/index.html
@@ -1,3 +1,3 @@
-os::syscall::fs - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/fs/sidebar-items.js b/ch3-coop/os/syscall/fs/sidebar-items.js
index d0e955ea9..e5a5f56cd 100644
--- a/ch3-coop/os/syscall/fs/sidebar-items.js
+++ b/ch3-coop/os/syscall/fs/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":[["FD_STDOUT",""]],"fn":[["sys_write","write buf of length `len` to a file with `fd`"]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["FD_STDOUT"],"fn":["sys_write"]};
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/index.html b/ch3-coop/os/syscall/index.html
index 0770e97f9..9946937ef 100644
--- a/ch3-coop/os/syscall/index.html
+++ b/ch3-coop/os/syscall/index.html
@@ -1,13 +1,11 @@
-os::syscall - Rust
The single entry point to all system calls, syscall(), is called
whenever userspace wishes to perform a system call using the ecall
instruction. In this case, the processor raises an ‘Environment call from
U-mode’ exception, which is handled as one of the cases in
-crate::trap::trap_handler.
For clarity, each single syscall is implemented as its own function, named
sys_ then the name of the syscall. You can find functions like this in
submodules, and you should also implement syscalls this way.
handle syscall exception with syscall_id and other arguments
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/process/fn.sys_exit.html b/ch3-coop/os/syscall/process/fn.sys_exit.html
index bbe972cf7..6014a5481 100644
--- a/ch3-coop/os/syscall/process/fn.sys_exit.html
+++ b/ch3-coop/os/syscall/process/fn.sys_exit.html
@@ -1,2 +1,3 @@
-sys_exit in os::syscall::process - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/process/fn.sys_yield.html b/ch3-coop/os/syscall/process/fn.sys_yield.html
index c23acbda9..fb0f74b1d 100644
--- a/ch3-coop/os/syscall/process/fn.sys_yield.html
+++ b/ch3-coop/os/syscall/process/fn.sys_yield.html
@@ -1,2 +1,3 @@
-sys_yield in os::syscall::process - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/process/index.html b/ch3-coop/os/syscall/process/index.html
index 6d5bbcace..4059029ae 100644
--- a/ch3-coop/os/syscall/process/index.html
+++ b/ch3-coop/os/syscall/process/index.html
@@ -1,4 +1,3 @@
-os::syscall::process - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/process/sidebar-items.js b/ch3-coop/os/syscall/process/sidebar-items.js
index 993eeb069..6e0905445 100644
--- a/ch3-coop/os/syscall/process/sidebar-items.js
+++ b/ch3-coop/os/syscall/process/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"fn":[["sys_exit","task exits and submit an exit code"],["sys_yield","current task gives up resources for other tasks"]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"fn":["sys_exit","sys_yield"]};
\ No newline at end of file
diff --git a/ch3-coop/os/syscall/sidebar-items.js b/ch3-coop/os/syscall/sidebar-items.js
index e216354b4..9f6a6ef77 100644
--- a/ch3-coop/os/syscall/sidebar-items.js
+++ b/ch3-coop/os/syscall/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":[["SYSCALL_EXIT",""],["SYSCALL_WRITE",""],["SYSCALL_YIELD",""]],"fn":[["syscall","handle syscall exception with `syscall_id` and other arguments"]],"mod":[["fs","File and filesystem-related syscalls"],["process","Process management syscalls"]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":["SYSCALL_EXIT","SYSCALL_WRITE","SYSCALL_YIELD"],"fn":["syscall"],"mod":["fs","process"]};
\ No newline at end of file
diff --git a/ch3-coop/os/task/context/index.html b/ch3-coop/os/task/context/index.html
index 12807bbc7..328f1a386 100644
--- a/ch3-coop/os/task/context/index.html
+++ b/ch3-coop/os/task/context/index.html
@@ -1,3 +1,3 @@
-os::task::context - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/context/sidebar-items.js b/ch3-coop/os/task/context/sidebar-items.js
index fd7c55f49..f64436cc6 100644
--- a/ch3-coop/os/task/context/sidebar-items.js
+++ b/ch3-coop/os/task/context/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"struct":[["TaskContext","Task Context"]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"struct":["TaskContext"]};
\ No newline at end of file
diff --git a/ch3-coop/os/task/context/struct.TaskContext.html b/ch3-coop/os/task/context/struct.TaskContext.html
index 9980823f0..ef623123f 100644
--- a/ch3-coop/os/task/context/struct.TaskContext.html
+++ b/ch3-coop/os/task/context/struct.TaskContext.html
@@ -1,24 +1,22 @@
-TaskContext in os::task::context - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/fn.exit_current_and_run_next.html b/ch3-coop/os/task/fn.exit_current_and_run_next.html
index 97519d7cf..b2c5ebf19 100644
--- a/ch3-coop/os/task/fn.exit_current_and_run_next.html
+++ b/ch3-coop/os/task/fn.exit_current_and_run_next.html
@@ -1,2 +1,3 @@
-exit_current_and_run_next in os::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/fn.mark_current_exited.html b/ch3-coop/os/task/fn.mark_current_exited.html
index 86fa24ac0..063841b86 100644
--- a/ch3-coop/os/task/fn.mark_current_exited.html
+++ b/ch3-coop/os/task/fn.mark_current_exited.html
@@ -1,2 +1,3 @@
-mark_current_exited in os::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/fn.mark_current_suspended.html b/ch3-coop/os/task/fn.mark_current_suspended.html
index 7e93bb2c5..e2b10079a 100644
--- a/ch3-coop/os/task/fn.mark_current_suspended.html
+++ b/ch3-coop/os/task/fn.mark_current_suspended.html
@@ -1,2 +1,3 @@
-mark_current_suspended in os::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/fn.run_first_task.html b/ch3-coop/os/task/fn.run_first_task.html
index 633381e73..163b0ef9e 100644
--- a/ch3-coop/os/task/fn.run_first_task.html
+++ b/ch3-coop/os/task/fn.run_first_task.html
@@ -1,2 +1,3 @@
-run_first_task in os::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/fn.run_next_task.html b/ch3-coop/os/task/fn.run_next_task.html
index 99619ffad..bc8806c0a 100644
--- a/ch3-coop/os/task/fn.run_next_task.html
+++ b/ch3-coop/os/task/fn.run_next_task.html
@@ -1,2 +1,3 @@
-run_next_task in os::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/fn.suspend_current_and_run_next.html b/ch3-coop/os/task/fn.suspend_current_and_run_next.html
index b83cb42ec..b4223d8bb 100644
--- a/ch3-coop/os/task/fn.suspend_current_and_run_next.html
+++ b/ch3-coop/os/task/fn.suspend_current_and_run_next.html
@@ -1,2 +1,3 @@
-suspend_current_and_run_next in os::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/index.html b/ch3-coop/os/task/index.html
index 5ad2dc084..9b2b84768 100644
--- a/ch3-coop/os/task/index.html
+++ b/ch3-coop/os/task/index.html
@@ -1,21 +1,9 @@
-os::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/sidebar-items.js b/ch3-coop/os/task/sidebar-items.js
index 3eaa6844b..14f376d93 100644
--- a/ch3-coop/os/task/sidebar-items.js
+++ b/ch3-coop/os/task/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"fn":[["exit_current_and_run_next","exit current task, then run next task"],["mark_current_exited","exit current task"],["mark_current_suspended","suspend current task"],["run_first_task","run first task"],["run_next_task","rust next task"],["suspend_current_and_run_next","suspend current task, then run next task"]],"mod":[["context","Implementation of [`TaskContext`]"],["switch","Rust wrapper around `__switch`."],["task","Types related to task management"]],"struct":[["TASK_MANAGER","Global variable: TASK_MANAGER"],["TaskContext","Task Context"],["TaskManager","The task manager, where all the tasks are managed."],["TaskManagerInner","Inner of Task Manager"]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"fn":["exit_current_and_run_next","mark_current_exited","mark_current_suspended","run_first_task","run_next_task","suspend_current_and_run_next"],"mod":["context","switch","task"],"struct":["TASK_MANAGER","TaskContext","TaskManager","TaskManagerInner"]};
\ No newline at end of file
diff --git a/ch3-coop/os/task/struct.TASK_MANAGER.html b/ch3-coop/os/task/struct.TASK_MANAGER.html
index 6db1f0959..5e8b6bea7 100644
--- a/ch3-coop/os/task/struct.TASK_MANAGER.html
+++ b/ch3-coop/os/task/struct.TASK_MANAGER.html
@@ -1,26 +1,24 @@
-TASK_MANAGER in os::task - Rust
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.
\ No newline at end of file
diff --git a/ch3-coop/os/task/struct.TaskContext.html b/ch3-coop/os/task/struct.TaskContext.html
index 71779552f..045266b14 100644
--- a/ch3-coop/os/task/struct.TaskContext.html
+++ b/ch3-coop/os/task/struct.TaskContext.html
@@ -1,24 +1,22 @@
-TaskContext in os::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/struct.TaskManager.html b/ch3-coop/os/task/struct.TaskManager.html
index 6f9c050f3..82d2e765b 100644
--- a/ch3-coop/os/task/struct.TaskManager.html
+++ b/ch3-coop/os/task/struct.TaskManager.html
@@ -1,33 +1,33 @@
-TaskManager in os::task - Rust
The task manager, where all the tasks are managed.
+}Expand description
The task manager, where all the tasks are managed.
Functions implemented on TaskManager deals with all task state transitions
and task context switching. For convenience, you can find wrappers around it
in the module level.
Most of TaskManager are hidden behind the field inner, to defer
borrowing checks to runtime. You can see examples on how to use inner in
existing functions on TaskManager.
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.
\ No newline at end of file
diff --git a/ch3-coop/os/task/struct.TaskManagerInner.html b/ch3-coop/os/task/struct.TaskManagerInner.html
index 66e355cdb..6e3108020 100644
--- a/ch3-coop/os/task/struct.TaskManagerInner.html
+++ b/ch3-coop/os/task/struct.TaskManagerInner.html
@@ -1,18 +1,18 @@
-TaskManagerInner in os::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/switch/fn.__switch.html b/ch3-coop/os/task/switch/fn.__switch.html
index 6bffd0ef5..92804e91f 100644
--- a/ch3-coop/os/task/switch/fn.__switch.html
+++ b/ch3-coop/os/task/switch/fn.__switch.html
@@ -1,3 +1,7 @@
-__switch in os::task::switch - Rust
Switch to the context of next_task_cx_ptr, saving the current context
in current_task_cx_ptr.
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ch3-coop/os/task/switch/index.html b/ch3-coop/os/task/switch/index.html
index 699dc5cd1..b84800f4e 100644
--- a/ch3-coop/os/task/switch/index.html
+++ b/ch3-coop/os/task/switch/index.html
@@ -1,8 +1,8 @@
-os::task::switch - Rust
Switching to a different task’s context happens here. The actual
implementation must not be in Rust and (essentially) has to be in assembly
language (Do you know why?), so this module really is just a wrapper around
switch.S.
Switch to the context of next_task_cx_ptr, saving the current context
+in current_task_cx_ptr.
\ No newline at end of file
diff --git a/ch3-coop/os/task/switch/sidebar-items.js b/ch3-coop/os/task/switch/sidebar-items.js
index 2edbce928..8dea751ad 100644
--- a/ch3-coop/os/task/switch/sidebar-items.js
+++ b/ch3-coop/os/task/switch/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"fn":[["__switch","Switch to the context of `next_task_cx_ptr`, saving the current context in `current_task_cx_ptr`."]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"fn":["__switch"]};
\ No newline at end of file
diff --git a/ch3-coop/os/task/task/enum.TaskStatus.html b/ch3-coop/os/task/task/enum.TaskStatus.html
index 1385c021c..295c0affe 100644
--- a/ch3-coop/os/task/task/enum.TaskStatus.html
+++ b/ch3-coop/os/task/task/enum.TaskStatus.html
@@ -1,22 +1,19 @@
-TaskStatus in os::task::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/task/index.html b/ch3-coop/os/task/task/index.html
index 5febd2bbc..7a12af8ff 100644
--- a/ch3-coop/os/task/task/index.html
+++ b/ch3-coop/os/task/task/index.html
@@ -1,2 +1,3 @@
-os::task::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/task/task/sidebar-items.js b/ch3-coop/os/task/task/sidebar-items.js
index 5b61a43d6..01990d5e4 100644
--- a/ch3-coop/os/task/task/sidebar-items.js
+++ b/ch3-coop/os/task/task/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":[["TaskStatus",""]],"struct":[["TaskControlBlock",""]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["TaskStatus"],"struct":["TaskControlBlock"]};
\ No newline at end of file
diff --git a/ch3-coop/os/task/task/struct.TaskControlBlock.html b/ch3-coop/os/task/task/struct.TaskControlBlock.html
index 165940f5e..520889428 100644
--- a/ch3-coop/os/task/task/struct.TaskControlBlock.html
+++ b/ch3-coop/os/task/task/struct.TaskControlBlock.html
@@ -1,17 +1,15 @@
-TaskControlBlock in os::task::task - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/trap/context/index.html b/ch3-coop/os/trap/context/index.html
index e93a395a9..1a179fbea 100644
--- a/ch3-coop/os/trap/context/index.html
+++ b/ch3-coop/os/trap/context/index.html
@@ -1,2 +1,2 @@
-os::trap::context - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/trap/context/sidebar-items.js b/ch3-coop/os/trap/context/sidebar-items.js
index 4fa95ba17..920f7c9e8 100644
--- a/ch3-coop/os/trap/context/sidebar-items.js
+++ b/ch3-coop/os/trap/context/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"struct":[["TrapContext","Trap Context"]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"struct":["TrapContext"]};
\ No newline at end of file
diff --git a/ch3-coop/os/trap/context/struct.TrapContext.html b/ch3-coop/os/trap/context/struct.TrapContext.html
index a236f3626..b682007f6 100644
--- a/ch3-coop/os/trap/context/struct.TrapContext.html
+++ b/ch3-coop/os/trap/context/struct.TrapContext.html
@@ -1,22 +1,22 @@
-TrapContext in os::trap::context - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/trap/fn.init.html b/ch3-coop/os/trap/fn.init.html
index bf3ab0842..e63933b77 100644
--- a/ch3-coop/os/trap/fn.init.html
+++ b/ch3-coop/os/trap/fn.init.html
@@ -1,2 +1,3 @@
-init in os::trap - Rust
\ No newline at end of file
diff --git a/ch3-coop/os/trap/fn.trap_handler.html b/ch3-coop/os/trap/fn.trap_handler.html
index de43a756b..f7979b4d8 100644
--- a/ch3-coop/os/trap/fn.trap_handler.html
+++ b/ch3-coop/os/trap/fn.trap_handler.html
@@ -1,3 +1,4 @@
-trap_handler in os::trap - Rust
handle an interrupt, exception, or system call from user space
+
\ No newline at end of file
diff --git a/ch3-coop/os/trap/index.html b/ch3-coop/os/trap/index.html
index ab7cc950a..edd2223ce 100644
--- a/ch3-coop/os/trap/index.html
+++ b/ch3-coop/os/trap/index.html
@@ -1,14 +1,12 @@
-os::trap - Rust
For rCore, we have a single trap entry point, namely __alltraps. At
-initialization in init(), we set the stvec CSR to point to it.
+initialization in init(), we set the stvec CSR to point to it.
All traps go through __alltraps, which is defined in trap.S. The
assembly language code does just enough work restore the kernel space
context, ensuring that Rust code safely runs, and transfers control to
-trap_handler().
It then calls different functionality based on what exactly the exception
was. For example, timer interrupts trigger task preemption, and syscalls go
-to syscall().
handle an interrupt, exception, or system call from user space
\ No newline at end of file
diff --git a/ch3-coop/os/trap/sidebar-items.js b/ch3-coop/os/trap/sidebar-items.js
index 5333df2ff..59a4119ba 100644
--- a/ch3-coop/os/trap/sidebar-items.js
+++ b/ch3-coop/os/trap/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"fn":[["init","initialize CSR `stvec` as the entry of `__alltraps`"],["trap_handler","handle an interrupt, exception, or system call from user space"]],"mod":[["context",""]],"struct":[["TrapContext","Trap Context"]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"fn":["init","trap_handler"],"mod":["context"],"struct":["TrapContext"]};
\ No newline at end of file
diff --git a/ch3-coop/os/trap/struct.TrapContext.html b/ch3-coop/os/trap/struct.TrapContext.html
index c14984068..89ec4d8af 100644
--- a/ch3-coop/os/trap/struct.TrapContext.html
+++ b/ch3-coop/os/trap/struct.TrapContext.html
@@ -1,22 +1,22 @@
-TrapContext in os::trap - Rust
\ No newline at end of file
diff --git a/ch3-coop/rustdoc.css b/ch3-coop/rustdoc.css
deleted file mode 100644
index 2e22b4cf1..000000000
--- a/ch3-coop/rustdoc.css
+++ /dev/null
@@ -1 +0,0 @@
- @font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html{content:"";}@media (prefers-color-scheme:light){html{content:"light";}}@media (prefers-color-scheme:dark){html{content:"dark";}}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;-webkit-font-feature-settings:"kern","liga";-moz-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:20px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}h1.fqn{margin:0;padding:0;border-bottom-color:var(--headings-border-bottom-color);}h2,h3,h4{border-bottom-color:var(--headings-border-bottom-color);}.main-heading{display:flex;flex-wrap:wrap;justify-content:space-between;padding-bottom:6px;margin-bottom:15px;}.main-heading a:hover{text-decoration:underline;}#toggle-all-docs{text-decoration:none;}h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;border-bottom-style:none;margin:0;padding:0;margin-top:0.6em;margin-bottom:0.4em;}.impl,.impl-items .method,.methods .method,.impl-items .type,.methods .type,.impl-items .associatedconstant,.methods .associatedconstant,.impl-items .associatedtype,.methods .associatedtype{flex-basis:100%;font-weight:600;position:relative;}div.impl-items>div{padding-left:0;}h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,a.source,.search-input,.search-results .result-name,.content table td:first-child>a,.item-left>a,.out-of-band,span.since,#source-sidebar,#sidebar-toggle,details.rustdoc-toggle>summary::before,div.impl-items>div:not(.docblock):not(.item-info),.content ul.crate a.crate,a.srclink,#main-content>.since,#help-button>button,details.rustdoc-toggle.top-doc>summary,details.rustdoc-toggle.top-doc>summary::before,details.rustdoc-toggle.non-exhaustive>summary,details.rustdoc-toggle.non-exhaustive>summary::before,.scraped-example-title,.more-examples-toggle summary,.more-examples-toggle .hide-more,.example-links a,#main-content>ul.docblock>li>a{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}h1,h2,h3,h4,a#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,pre.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,.in-band a,.search-results a,.module-item .stab,.import-item .stab,.result-name .primitive>i,.result-name .keyword>i,.content .method .where,.content .fn .where,.content .where.fmt-newline{color:var(--main-color);}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p{margin:0 0 .75em 0;}summary{outline:none;}td,th{padding:0;}table{border-collapse:collapse;}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;}button{padding:1px 6px;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.source main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}.source .width-limiter{max-width:unset;}details:not(.rustdoc-toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;}.docblock.item-decl{margin-left:0;}.item-decl pre{overflow-x:auto;}.source .content pre{padding:20px;}img{max-width:100%;}li{position:relative;}.source .content{max-width:none;overflow:visible;margin-left:0px;}nav.sub{position:relative;font-size:1rem;}.sub-container{display:flex;flex-direction:row;flex-wrap:nowrap;}.sub-logo-container{display:none;margin-right:20px;}.source .sub-logo-container{display:block;}.source .sub-logo-container>img{height:60px;width:60px;object-fit:contain;}.sidebar,.mobile-topbar,.sidebar-menu-toggle{background-color:var(--sidebar-background-color);}.sidebar{font-size:0.875rem;width:250px;min-width:200px;overflow-y:scroll;position:sticky;height:100vh;top:0;left:0;}.sidebar-elems,.sidebar>.location{padding-left:24px;}.sidebar .location{overflow-wrap:anywhere;}.rustdoc.source .sidebar{width:50px;min-width:0px;max-width:300px;flex-grow:0;flex-shrink:0;flex-basis:auto;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;}.rustdoc.source .sidebar .sidebar-logo{display:none;}.source .sidebar,#sidebar-toggle,#source-sidebar{background-color:var(--sidebar-background-color);}#sidebar-toggle>button:hover,#sidebar-toggle>button:focus{background-color:var(--sidebar-background-color-hover);}.source .sidebar>*:not(#sidebar-toggle){opacity:0;visibility:hidden;}.source-sidebar-expanded .source .sidebar{overflow-y:auto;}.source-sidebar-expanded .source .sidebar>*:not(#sidebar-toggle){opacity:1;visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.sidebar .logo-container{display:flex;margin-top:10px;margin-bottom:10px;justify-content:center;}.version{overflow-wrap:break-word;}.logo-container>img{height:100px;width:100px;}.location:empty{border:none;}.location a:first-of-type{font-weight:500;}.block{padding:0;}.block ul,.block li{padding:0;margin:0;list-style:none;}.block a,h2.location a{display:block;padding:0.25rem;margin-left:-0.25rem;text-overflow:ellipsis;overflow:hidden;}.sidebar h2{border-bottom:none;font-weight:500;padding:0;margin:0;margin-top:0.7rem;margin-bottom:0.7rem;}.sidebar h3{font-size:1.125rem;font-weight:500;padding:0;margin:0;}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;}.mobile-topbar{display:none;}.source .content pre.rust{white-space:pre;overflow:auto;padding-left:0;}.rustdoc .example-wrap{display:inline-flex;margin-bottom:10px;}.example-wrap{position:relative;width:100%;}.example-wrap>pre.line-number{overflow:initial;border:1px solid;padding:13px 8px;text-align:right;border-top-left-radius:5px;border-bottom-left-radius:5px;}.example-wrap>pre.rust a:hover{text-decoration:underline;}.line-numbers{text-align:right;}.rustdoc:not(.source) .example-wrap>pre:not(.line-number){width:100%;overflow-x:auto;}.rustdoc:not(.source) .example-wrap>pre.line-numbers{width:auto;overflow-x:visible;}.rustdoc .example-wrap>pre{margin:0;}#search{position:relative;}.search-loading{text-align:center;}#results>table{width:100%;table-layout:fixed;}.content>.example-wrap pre.line-numbers{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.line-numbers span{cursor:pointer;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock-short p{display:inline;}.docblock-short p{overflow:hidden;text-overflow:ellipsis;margin:0;}.docblock>:not(pre)>code,.docblock-short>:not(pre)>code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:var(--headings-border-bottom-color);}.docblock{margin-left:24px;position:relative;}.docblock>:not(.information):not(.more-examples-toggle){max-width:100%;overflow-x:auto;}.content .out-of-band{flex-grow:0;font-size:1.125rem;font-weight:normal;float:right;}.method>.code-header,.trait-impl>.code-header{max-width:calc(100% - 41px);display:block;}.content .in-band{flex-grow:1;margin:0px;padding:0px;overflow-wrap:break-word;overflow-wrap:anywhere;}.in-band>code,.in-band>.code-header{display:inline-block;}.docblock code,.docblock-short code,pre,.rustdoc.source .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}#main-content>.since{top:inherit;}.content table:not(.table-display){border-spacing:0 5px;}.content td{vertical-align:top;}.content td:first-child{padding-right:20px;}.content td p:first-child{margin-top:0;}.content td h1,.content td h2{margin-left:0;font-size:1.125rem;}.content tr:first-child td{border-top:0;}.docblock table{margin:.5em 0;width:calc(100% - 2px);overflow-x:auto;display:block;}.docblock table td{padding:.5em;border:1px dashed;}.docblock table th{padding:.5em;text-align:left;border:1px solid;}.fields+table{margin-bottom:1em;}.content .item-list{list-style-type:none;padding:0;}.content .multi-column{-moz-column-count:5;-moz-column-gap:2.5em;-webkit-column-count:5;-webkit-column-gap:2.5em;column-count:5;column-gap:2.5em;}.content .multi-column li{width:100%;display:inline-block;}.content>.methods>.method{font-size:1rem;position:relative;}.content .method .where,.content .fn .where,.content .where.fmt-newline{display:block;font-size:0.875rem;}.content .methods>div:not(.notable-traits):not(.method){margin-left:40px;margin-bottom:15px;}.content .docblock>.impl-items{margin-left:20px;margin-top:-34px;}.content .docblock>.impl-items .table-display{margin:0;}.content .docblock>.impl-items table td{padding:0;}.content .docblock>.impl-items .table-display,.impl-items table td{border:none;}.item-info{display:block;}.content .item-info code{font-size:0.875rem;}.content .item-info{position:relative;margin-left:24px;}.sub-variant>div>.item-info{margin-top:initial;}.content .impl-items .docblock,.content .impl-items .item-info{margin-bottom:.6em;}.content .impl-items>.item-info{margin-left:40px;}.methods>.item-info,.content .impl-items>.item-info{margin-top:-8px;}.impl-items{flex-basis:100%;}#main-content>.item-info{margin-top:0;margin-left:0;}nav.sub{flex-grow:1;margin-bottom:25px;}.source nav.sub{margin-left:32px;}nav.main{padding:20px 0;text-align:center;}nav.main .current{border-top:1px solid;border-bottom:1px solid;}nav.main .separator{border:1px solid;display:inline-block;height:23px;margin:0 20px;}nav.sum{text-align:right;}nav.sub form{display:inline;}a{text-decoration:none;background:transparent;}.small-section-header{display:flex;justify-content:space-between;position:relative;}.small-section-header:hover>.anchor{display:initial;}.in-band:hover>.anchor,.impl:hover>.anchor,.method.trait-impl:hover>.anchor,.type.trait-impl:hover>.anchor,.associatedconstant.trait-impl:hover>.anchor,.associatedtype.trait-impl:hover>.anchor{display:inline-block;position:absolute;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-15px;padding-right:8px;}h2.small-section-header>.anchor{padding-right:6px;}.anchor::before{content:'§';}.docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,.docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,.item-info a{text-decoration:underline;}.block a.current.crate{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;}.item-row{display:table-row;}.item-left,.item-right{display:table-cell;}.item-left{padding-right:1.25rem;}.search-container{position:relative;display:flex;height:34px;}.search-container>*{height:100%;}.search-results-title{display:inline;}#search-settings{font-size:1.5rem;font-weight:500;margin-bottom:20px;}#crate-search{min-width:115px;margin-top:5px;padding-left:0.15em;padding-right:23px;border:1px solid;border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;background-repeat:no-repeat;background-color:transparent;background-size:20px;background-position:calc(100% - 1px) 56%;background-image:url("down-arrow.svg");max-width:100%;text-overflow:ellipsis;}.search-container{margin-top:4px;}.search-input{-webkit-appearance:none;-moz-box-sizing:border-box !important;box-sizing:border-box !important;outline:none;border:1px solid;border-radius:2px;padding:8px;font-size:1rem;width:100%;}.search-results{display:none;padding-bottom:2em;}.search-results.active{display:block;clear:both;}.search-results .desc>span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;}.search-results>a{display:block;width:100%;margin-left:2px;margin-right:2px;border-bottom:1px solid #aaa3;}.search-results>a>div{display:flex;flex-flow:row wrap;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:50%;}.search-results .result-name{padding-right:1em;}.search-results .result-name>span{display:inline-block;margin:0;font-weight:normal;}.popover{font-size:1rem;position:absolute;right:0;z-index:2;display:block;margin-top:7px;border-radius:3px;border:1px solid;font-size:1rem;}.popover::before{content:'';position:absolute;right:11px;border:solid;border-width:1px 1px 0 0;display:inline-block;padding:4px;transform:rotate(-45deg);top:-5px;}.popover,.popover::before{background-color:var(--main-background-color);color:var(--main-color);}#help-button .popover{max-width:600px;}#help-button .popover::before{right:48px;}#help-button dt{float:left;clear:left;display:block;margin-right:0.5rem;}#help-button span.top,#help-button span.bottom{text-align:center;display:block;font-size:1.125rem;}#help-button span.top{text-align:center;display:block;margin:10px 0;border-bottom:1px solid;padding-bottom:4px;margin-bottom:6px;}#help-button span.bottom{clear:both;border-top:1px solid;}.side-by-side{text-align:initial;}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{width:fit-content;min-height:36px;display:flex;align-items:center;white-space:pre-wrap;}.stab{padding:3px;margin-bottom:5px;font-size:0.875rem;font-weight:normal;}.stab p{display:inline;margin:0;}.stab .emoji{font-size:1.25rem;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.module-item .stab,.import-item .stab{border-radius:3px;display:inline-block;font-size:0.875rem;line-height:1.2;margin-bottom:0;margin-left:0.3125em;padding:2px;vertical-align:text-bottom;}.module-item.unstable,.import-item.unstable{opacity:0.65;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;padding-right:2px;position:initial;}.impl-items .srclink,.impl .srclink,.methods .srclink{font-weight:normal;font-size:1rem;}.rightside{float:right;}.variants_table{width:100%;}.variants_table tbody tr td:first-child{width:1%;}td.summary-column{width:100%;}.summary{padding-right:0px;}pre.rust .question-mark{font-weight:bold;}a.test-arrow{display:inline-block;visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;}.example-wrap:hover .test-arrow{visibility:visible;}a.test-arrow:hover{text-decoration:none;}.code-attribute{font-weight:300;}.item-spacer{width:100%;height:12px;}.out-of-band>span.since{position:initial;font-size:1.25rem;}h3.variant{font-weight:600;font-size:1.125rem;margin-bottom:10px;border-bottom:none;}.sub-variant h4{font-size:1rem;font-weight:400;border-bottom:none;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}.toggle-label{display:inline-block;margin-left:4px;margin-top:3px;}:target>code,:target>.code-header{opacity:1;}:target{padding-right:3px;}.information{position:absolute;left:-25px;margin-top:7px;z-index:1;}.tooltip{position:relative;display:inline-block;cursor:pointer;}.tooltip::after{display:none;text-align:center;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;font-size:1rem;}.tooltip.ignore::after{content:"This example is not tested";}.tooltip.compile_fail::after{content:"This example deliberately fails to compile";}.tooltip.should_panic::after{content:"This example panics";}.tooltip.edition::after{content:"This code runs with edition " attr(data-edition);}.tooltip::before{content:" ";position:absolute;top:50%;left:16px;margin-top:-5px;border-width:5px;border-style:solid;display:none;}.tooltip:hover::before,.tooltip:hover::after{display:inline;}.tooltip.compile_fail,.tooltip.should_panic,.tooltip.ignore{font-weight:bold;font-size:1.25rem;}.notable-traits-tooltip{display:inline-block;cursor:pointer;}.notable-traits:hover .notable-traits-tooltiptext,.notable-traits .notable-traits-tooltiptext.force-tooltip{display:inline-block;}.notable-traits .notable-traits-tooltiptext{display:none;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;z-index:10;font-size:1rem;cursor:default;position:absolute;border:1px solid;}.notable-traits-tooltip::after{content:"\00a0\00a0\00a0";}.notable-traits .notable,.notable-traits .docblock{margin:0;}.notable-traits .notable{margin:0;margin-bottom:13px;font-size:1.1875rem;font-weight:600;display:block;}.notable-traits .docblock code.content{margin:0;padding:0;font-size:1.25rem;}pre.rust.rust-example-rendered{position:relative;}pre.rust{tab-size:4;-moz-tab-size:4;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#titles{height:35px;}#titles>button{float:left;width:33.3%;text-align:center;font-size:1.125rem;cursor:pointer;border:0;border-top:2px solid;}#titles>button:first-child:last-child{margin-right:1px;width:calc(100% - 1px);}#titles>button:not(:last-child){margin-right:1px;width:calc(33.3% - 1px);}#titles>button>div.count{display:inline-block;font-size:1rem;}.notable-traits{cursor:pointer;z-index:2;margin-left:5px;}#sidebar-toggle{position:sticky;top:0;left:0;font-weight:bold;font-size:1.25rem;border-bottom:1px solid;display:flex;height:40px;justify-content:center;align-items:center;z-index:10;}#source-sidebar{width:100%;z-index:1;overflow:auto;}#source-sidebar>.title{font-size:1.5rem;text-align:center;border-bottom:1px solid;margin-bottom:6px;}#sidebar-toggle>button{background:none;color:inherit;cursor:pointer;text-align:center;border:none;outline:none;position:absolute;top:0;bottom:0;left:0;right:0;width:100%;-webkit-appearance:none;opacity:1;}#settings-menu,#help-button{margin-left:4px;outline:none;}#copy-path{height:34px;}#settings-menu>a,#help-button>button,#copy-path{padding:5px;width:33px;border:1px solid;border-radius:2px;cursor:pointer;}#settings-menu{padding:0;}#settings-menu>a,#help-button>button{padding:5px;height:100%;display:block;}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}.setting-line .radio-line input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-line .radio-line input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-line .radio-line input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-line .radio-line input:hover{border-color:var(--settings-input-color) !important;}input:checked+.slider{background-color:var(--settings-input-color);}#help-button>button{text-align:center;font-size:20px;padding-top:2px;}#copy-path{background:initial;margin-left:10px;padding:0;padding-left:2px;border:0;}#theme-choices{display:none;position:absolute;left:0;top:28px;border:1px solid;border-radius:3px;z-index:1;cursor:pointer;}#theme-choices>button{border:none;width:100%;padding:4px 8px;text-align:center;background:rgba(0,0,0,0);overflow-wrap:normal;}#theme-choices>button:not(:first-child){border-top:1px solid;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px;border-radius:3px;cursor:default;}.hidden-by-impl-hider,.hidden-by-usual-hider{display:none !important;}#implementations-list>h3>span.in-band{width:100%;}.table-display{width:100%;border:0;border-collapse:collapse;border-spacing:0;font-size:1rem;}.table-display tr td:first-child{padding-right:0;}.table-display tr td:last-child{float:right;}.table-display .out-of-band{position:relative;font-size:1.125rem;display:block;}.table-display td:hover .anchor{display:block;top:2px;left:-5px;}#main-content>ul{padding-left:10px;}#main-content>ul>li{list-style:none;}.non-exhaustive{margin-bottom:1em;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 13px;list-style-position:outside;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.rustdoc-toggle>summary.hideme{cursor:pointer;}details.rustdoc-toggle>summary{list-style:none;}details.rustdoc-toggle>summary::-webkit-details-marker,details.rustdoc-toggle>summary::marker{display:none;}details.rustdoc-toggle>summary.hideme>span{margin-left:9px;}details.rustdoc-toggle>summary::before{content:"";cursor:pointer;width:16px;height:16px;background-repeat:no-repeat;background-position:top left;display:inline-block;vertical-align:middle;opacity:.5;}details.rustdoc-toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.rustdoc-toggle>summary.hideme::after{content:"";}details.rustdoc-toggle>summary:focus::before,details.rustdoc-toggle>summary:hover::before{opacity:1;}details.rustdoc-toggle.top-doc>summary,details.rustdoc-toggle.top-doc>summary::before,details.rustdoc-toggle.non-exhaustive>summary,details.rustdoc-toggle.non-exhaustive>summary::before{font-size:1rem;}details.non-exhaustive{margin-bottom:8px;}details.rustdoc-toggle>summary.hideme::before{position:relative;}details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.rustdoc-toggle[open] >summary.hideme{position:absolute;}details.rustdoc-toggle{position:relative;}details.rustdoc-toggle[open] >summary.hideme>span{display:none;}details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle[open] >summary.hideme::before{background-image:url("toggle-minus.svg");}details.rustdoc-toggle>summary::before{background-image:url("toggle-plus.svg");}details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle[open] >summary.hideme::before{width:16px;height:16px;background-repeat:no-repeat;background-position:top left;display:inline-block;content:"";}details.rustdoc-toggle[open] >summary::after,details.rustdoc-toggle[open] >summary.hideme::after{content:"Collapse";}.docblock summary>*{display:inline-block;}@media (min-width:701px){.docblock>.information:first-child>.tooltip{margin-top:16px;}.source-sidebar-expanded .source .sidebar+main .width-limiter .sub-logo-container.rust-logo{display:none;}.source-sidebar-expanded .source .sidebar{width:300px;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{padding-top:0px;display:block;}main{padding-left:15px;padding-top:0px;}.rustdoc,.main-heading{flex-direction:column;}.content .out-of-band{text-align:left;margin-left:initial;padding:initial;}.content .out-of-band .since::before{content:"Since ";}#copy-path{display:none;}.sidebar .sidebar-logo,.sidebar .location{display:none;}.sidebar-elems{margin-top:1em;}.sidebar{position:fixed;top:45px;left:-1000px;margin-left:0;margin:0;padding:0;z-index:11;height:calc(100vh - 45px);}.source main,.rustdoc.source .sidebar{top:0;padding:0;height:100vh;border:0;}.sidebar.shown,.source-sidebar-expanded .source .sidebar,.sidebar:focus-within{left:0;}.rustdoc.source>.sidebar{position:fixed;margin:0;z-index:11;width:0;}.mobile-topbar .location a{padding:0;margin:0;}.mobile-topbar .location{border:none;padding:0;margin:auto 0.5em auto auto;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:24px;}.mobile-topbar .logo-container{max-height:45px;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin-left:20px;margin-top:5px;margin-bottom:5px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.source .mobile-topbar{display:none;}.sidebar-menu-toggle{width:45px;font-size:32px;border:none;}.sidebar-elems{background-color:var(--sidebar-background-color);}.source nav:not(.sidebar).sub{margin-left:32px;}.content{margin-left:0px;}.source .content{margin-top:10px;}#search{margin-left:0;padding:0;}.anchor{display:none !important;}.notable-traits{position:absolute;left:-22px;top:24px;}#titles>button>div.count{float:left;width:100%;}#titles{height:50px;}#sidebar-filler{position:fixed;left:45px;width:calc(100% - 45px);top:0;height:45px;z-index:-1;border-bottom:1px solid;}#main-content>details.rustdoc-toggle>summary::before,#main-content>div>details.rustdoc-toggle>summary::before{left:-11px;}#sidebar-toggle{position:fixed;left:1px;top:100px;width:30px;font-size:1.5rem;text-align:center;padding:0;z-index:10;border-top-right-radius:3px;border-bottom-right-radius:3px;cursor:pointer;font-weight:bold;border:1px solid;border-left:0;}.source-sidebar-expanded #sidebar-toggle{left:unset;top:unset;width:unset;border-top-right-radius:unset;border-bottom-right-radius:unset;position:sticky;border:0;border-bottom:1px solid;}#source-sidebar{z-index:11;}#main-content>.line-numbers{margin-top:0;}.notable-traits .notable-traits-tooltiptext{left:0;top:100%;}#help-button{display:none;}.item-table{display:block;}.item-row{display:flex;flex-flow:column wrap;}.item-left,.item-right{width:100%;}.search-results>a{border-bottom:1px solid #aaa9;padding:5px 0px;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:100%;}.search-results div.desc,.search-results .result-description,.item-right{padding-left:2em;}.source-sidebar-expanded .source .sidebar{max-width:100vw;width:100vw;}details.rustdoc-toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.rustdoc-toggle>summary:not(.hideme)::before,#main-content>details.rustdoc-toggle:not(.top-doc)>summary::before,#main-content>div>details.rustdoc-toggle>summary::before{left:-11px;}}@media print{nav.sidebar,nav.sub,.content .out-of-band,a.srclink,#copy-path,details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle>summary::before,details.rustdoc-toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){#titles,#titles>button{height:73px;}#main-content>table:not(.table-display) td{word-break:break-word;width:50%;}#crate-search{border-radius:4px;}.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}.sub-container{flex-direction:column;}.sub-logo-container{align-self:center;}.source .sub-logo-container>img{height:35px;width:35px;}#sidebar-toggle{top:10px;}.source-sidebar-expanded #sidebar-toggle{top:unset;}}.method-toggle summary,.implementors-toggle summary,.impl{margin-bottom:0.75em;}.method-toggle[open]{margin-bottom:2em;}.implementors-toggle[open]{margin-bottom:2em;}#trait-implementations-list .method-toggle,#synthetic-implementations-list .method-toggle,#blanket-implementations-list .method-toggle{margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;background:transparent;border-width:1px;border-style:solid;border-radius:50px;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:240px;}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;max-height:240px;padding-bottom:0;}.scraped-example:not(.expanded) .code-wrapper pre.line-numbers{overflow-x:hidden;}.scraped-example .code-wrapper .prev{position:absolute;top:0.25em;right:2.25em;z-index:100;cursor:pointer;}.scraped-example .code-wrapper .next{position:absolute;top:0.25em;right:1.25em;z-index:100;cursor:pointer;}.scraped-example .code-wrapper .expand{position:absolute;top:0.25em;right:0.25em;z-index:100;cursor:pointer;}.scraped-example:not(.expanded) .code-wrapper:before{content:" ";width:100%;height:5px;position:absolute;z-index:100;top:0;}.scraped-example:not(.expanded) .code-wrapper:after{content:" ";width:100%;height:5px;position:absolute;z-index:100;bottom:0;}.scraped-example .code-wrapper .line-numbers{margin:0;padding:14px 0;}.scraped-example .code-wrapper .line-numbers span{padding:0 14px;}.scraped-example .code-wrapper .example-wrap{flex:1;overflow-x:auto;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .code-wrapper .example-wrap pre.rust{overflow-x:inherit;width:inherit;overflow-y:hidden;}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;margin-bottom:5px;cursor:pointer;}.more-scraped-examples{margin-left:5px;display:flex;flex-direction:row;}.more-scraped-examples-inner{width:calc(100% - 20px);}.toggle-line{align-self:stretch;margin-right:10px;margin-top:5px;padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;}.more-scraped-examples .scraped-example{margin-bottom:20px;}.more-scraped-examples .scraped-example:last-child{margin-bottom:0;}.example-links a{margin-top:20px;}.example-links ul{margin-bottom:0;}
\ No newline at end of file
diff --git a/ch3-coop/search-index.js b/ch3-coop/search-index.js
index 90f7dade8..f5c2c3cfc 100644
--- a/ch3-coop/search-index.js
+++ b/ch3-coop/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,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,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,5,5,5,2,0,3,11,11,11,11,12,11,11,11,11,11,17,17,17,0,0,5,17,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,3,0,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","trap","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","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","console_putchar","sbi_call","shutdown","UPSafeCell","up","UPSafeCell","borrow","borrow_mut","exclusive_access","from","inner","into","new","try_from","try_into","type_id","SYSCALL_EXIT","SYSCALL_WRITE","SYSCALL_YIELD","fs","process","syscall","FD_STDOUT","sys_write","sys_exit","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","TrapContext","context","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::trap","","","","","","","os::trap::context","","","","","","","","","","","",""],"d":["","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","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 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","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 app 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).","","","","","","","","","Trap Context","","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,3,3,3,28,3,0,28,3,28,3,3,3,3,3,3,3,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,16,16,16,16,16,16,16,16,16,16,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,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,[[]],[[]],[2,1],[[3,2],1],[2,2],[[],1],[3,1],[[],1],[3,1],[[]],[[]],[4,3],[[],5],[[],5],[[],6],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,[14],[[14,14,14,14],14],[[],1],0,0,0,[[]],[[]],[16,17],[[]],0,[[]],[[],16],[[],5],[[],5],[[],6],0,0,0,0,0,[14,18],0,[[14,19,14],18],[20,1],[[],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,[[]],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"]]}\
-}');
-if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
-if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
+var searchIndex = new Map(JSON.parse('[\
+["os",{"doc":"The main module and entrypoint","t":"HCCCCQQHCCCCCSSSSSFNNNNHNNNNHJFJFNNNNNNOONNHHNNHNNHNNNNNNNHHHECFNNNNONNNNNSSSCCHSHHHFFFFONNNNNNCONHNNNNONNNHNHNOOHNHNOOHCCONNNNNNNNNFNNNNNNOOONNNNHPPPFGPNNNNNNNNNNNOONNNNNNFCHOOHOFNNNNNONONNNO","n":["clear_bss","config","console","lang_items","loader","print","println","rust_main","sbi","sync","syscall","task","trap","APP_BASE_ADDRESS","APP_SIZE_LIMIT","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_getchar","console_putchar","shutdown","UPSafeCell","up","UPSafeCell","borrow","borrow_mut","exclusive_access","from","inner","into","new","try_from","try_into","type_id","SYSCALL_EXIT","SYSCALL_WRITE","SYSCALL_YIELD","fs","process","syscall","FD_STDOUT","sys_write","sys_exit","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","TrapContext","context","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":[[0,"os"],[13,"os::config"],[18,"os::console"],[28,"os::lang_items"],[29,"os::loader"],[58,"os::sbi"],[61,"os::sync"],[63,"os::sync::up"],[74,"os::syscall"],[80,"os::syscall::fs"],[82,"os::syscall::process"],[84,"os::task"],[132,"os::task::context"],[146,"os::task::switch"],[147,"os::task::task"],[172,"os::trap"],[179,"os::trap::context"],[192,"core::fmt"],[193,"core::result"],[194,"core::any"],[195,"core::fmt"],[196,"core::cell"],[197,"core::option"]],"d":["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","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 getchar from console (qemu uart handler)","use sbi call to putchar in console (qemu uart handler)","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","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 app 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).","","","","","","","","","Trap Context","","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,6,6,6,6,0,6,6,6,6,0,0,0,0,0,10,11,10,11,10,11,10,11,10,11,0,0,10,11,0,10,11,0,10,10,11,10,11,10,11,0,0,0,0,0,0,15,15,15,15,15,15,15,15,15,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,22,27,21,22,27,21,0,27,21,0,22,22,27,21,22,22,27,21,0,22,0,22,22,24,0,22,0,22,24,24,0,0,0,27,22,27,21,22,27,21,22,27,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,13,13,0,13,0,13,13,13,13,13,13,13,13,13,13,13,13],"f":"{{}b}``````{{}d}```````````{ce{}{}}0{cc{}}1{fb}{c{{h{e}}}{}{}}0{cj{}}{{ln}A`}{Abd}````6666{AdAd}{AfAf}``77{AhAh}{{}Ah}{AdAh}{AfAh}3<<>{{AdAj}Ah}::::993{Ahb}{Ald}```??{{{An{c}}}{{B`{c}}}{}}?`{ce{}{}}{c{{An{c}}}{}}??>`````{{Ah{Bb{Ah}}}Bd}`{{AhBfAh}Bd}{Bhd}{{}Bd}`````555555``{BjBl}{{}b}{Bl{{Bn{Ah}}}}{cc{}}00`9992{Blb}30``3{Bld}41``4```{c{{h{e}}}{}{}}00000{cj{}}00`=={C`C`}5{AhC`}?```332{{}C`}```````{ce{}{}}000{CbCb}{CdCd}{{CdCd}Al};;33``888877``=``{AjAj}``{{AhAh}Aj}55=5`{{AjAh}b}`;;:`","c":[],"p":[[1,"unit"],[1,"never"],[5,"Arguments",192],[6,"Result",193],[5,"TypeId",194],[5,"Stdout",18],[1,"str"],[8,"Result",192],[5,"PanicInfo",195],[5,"KernelStack",29],[5,"UserStack",29],[1,"usize"],[5,"TrapContext",179],[1,"bool"],[5,"UPSafeCell",63],[5,"RefMut",196],[1,"array"],[1,"isize"],[1,"u8"],[1,"i32"],[5,"TASK_MANAGER",84],[5,"TaskManager",84],[6,"Option",197],[5,"TaskContext",132],[5,"TaskControlBlock",147],[6,"TaskStatus",147],[5,"TaskManagerInner",84]],"b":[]}]\
+]'));
+if (typeof exports !== 'undefined') exports.searchIndex = searchIndex;
+else if (window.initSearch) window.initSearch(searchIndex);
diff --git a/ch3-coop/search.js b/ch3-coop/search.js
deleted file mode 100644
index d35a7db81..000000000
--- a/ch3-coop/search.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(function(){const itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias",];const TY_PRIMITIVE=itemTypes.indexOf("primitive");const TY_KEYWORD=itemTypes.indexOf("keyword");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";function hasOwnPropertyRustdoc(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("titles").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb}else if(nb!==0){printTab(0)}}const levenshtein_row2=[];function levenshtein(s1,s2){if(s1===s2){return 0}const s1_len=s1.length,s2_len=s2.length;if(s1_len&&s2_len){let i1=0,i2=0,a,b,c,c2;const row=levenshtein_row2;while(i1-".indexOf(c)!==-1}function isStopCharacter(c){return isWhitespace(c)||isEndCharacter(c)}function isErrorCharacter(c){return"()".indexOf(c)!==-1}function itemTypeFromName(typename){for(let i=0,len=itemTypes.length;i0){throw new Error("Cannot use literal search when there is more than one element")}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw new Error("Unclosed `\"`")}else if(parserState.userQuery[end]!=="\""){throw new Error(`Unexpected \`${parserState.userQuery[end]}\` in a string element`)}else if(start===end){throw new Error("Cannot have empty string element")}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","||isWhitespaceCharacter(c)}function isWhitespaceCharacter(c){return c===" "||c==="\t"}function createQueryElement(query,parserState,name,generics,isInGenerics){if(name==="*"||(name.length===0&&generics.length===0)){return}if(query.literalSearch&&parserState.totalElems-parserState.genericsElems>0){throw new Error("You cannot have more than one element if you use quotes")}const pathSegments=name.split("::");if(pathSegments.length>1){for(let i=0,len=pathSegments.length;i=end){throw new Error("Found generics without a path")}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}if(start>=end&&generics.length===0){return}elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics))}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;while(parserState.pos"){extra="`<`"}else if(endChar===""){extra="`->`"}throw new Error("Unexpected `"+c+"` after "+extra)}if(!foundStopChar){if(endChar!==""){throw new Error(`Expected \`,\`, \` \` or \`${endChar}\`, found \`${c}\``)}throw new Error(`Expected \`,\` or \` \`, found \`${c}\``)}const posBefore=parserState.pos;getNextElem(query,parserState,elems,endChar===">");if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}parserState.pos+=1}function checkExtraTypeFilterCharacters(parserState){const query=parserState.userQuery;for(let pos=0;pos"){if(isReturnArrow(parserState)){break}throw new Error(`Unexpected \`${c}\` (did you mean \`->\`?)`)}throw new Error(`Unexpected \`${c}\``)}else if(c===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw new Error("Unexpected `:`")}if(query.elems.length===0){throw new Error("Expected type filter before `:`")}else if(query.elems.length!==1||parserState.totalElems!==1){throw new Error("Unexpected `:`")}else if(query.literalSearch){throw new Error("You cannot use quotes on type filter")}checkExtraTypeFilterCharacters(parserState);parserState.typeFilter=query.elems.pop().name;parserState.pos+=1;parserState.totalElems=0;query.literalSearch=false;foundStopChar=true;continue}if(!foundStopChar){if(parserState.typeFilter!==null){throw new Error(`Expected \`,\`, \` \` or \`->\`, found \`${c}\``)}throw new Error(`Expected \`,\`, \` \`, \`:\` or \`->\`, found \`${c}\``)}before=query.elems.length;getNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}while(parserState.pos`")}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),typeFilter:NO_TYPE_FILTER,elems:[],returned:[],foundElems:0,literalSearch:false,error:null,}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="All crates"&&hasOwnPropertyRustdoc(rawSearchIndex,elem.value)){return elem.value}return null}function parseQuery(userQuery){userQuery=userQuery.trim();const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);if(parserState.typeFilter!==null){let typeFilter=parserState.typeFilter;if(typeFilter==="const"){typeFilter="constant"}query.typeFilter=itemTypeFromName(typeFilter)}}catch(err){query=newParsedQuery(userQuery);query.error=err.message;query.typeFilter=-1;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}function execQuery(parsedQuery,searchWords,filterCrates,currentCrate){const results_others={},results_in_args={},results_returned={};function transformResults(results){const duplicates={};const out=[];for(const result of results){if(result.id>-1){const obj=searchIndex[result.id];obj.lev=result.lev;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;if(duplicates[obj.fullPath]){continue}duplicates[obj.fullPath]=true;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType,preferredCrate){const userQuery=parsedQuery.userQuery;const ar=[];for(const entry in results){if(hasOwnPropertyRustdoc(results,entry)){const result=results[entry];result.word=searchWords[result.id];result.item=searchIndex[result.id]||{};ar.push(result)}}results=ar;if(results.length===0){return[]}results.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.lev);b=(bbb.lev);if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});let nameSplit=null;if(parsedQuery.elems.length===1){const hasPath=typeof parsedQuery.elems[0].path==="undefined";nameSplit=hasPath?null:parsedQuery.elems[0].path}for(const result of results){if(result.dontValidate){continue}const name=result.item.name.toLowerCase(),path=result.item.path.toLowerCase(),parent=result.item.parent;if(!isType&&!validateResult(name,path,nameSplit,parent)){result.id=-1}}return transformResults(results)}function checkGenerics(row,elem,defaultLev){if(row.generics.length===0){return elem.generics.length===0?defaultLev:MAX_LEV_DISTANCE+1}else if(row.generics.length>0&&row.generics[0].name===null){return checkGenerics(row.generics[0],elem,defaultLev)}let elem_name;if(elem.generics.length>0&&row.generics.length>=elem.generics.length){const elems=Object.create(null);for(const entry of row.generics){elem_name=entry.name;if(elem_name===""){if(checkGenerics(entry,elem,MAX_LEV_DISTANCE+1)!==0){return MAX_LEV_DISTANCE+1}continue}if(elems[elem_name]===undefined){elems[elem_name]=0}elems[elem_name]+=1}for(const generic of elem.generics){let match=null;if(elems[generic.name]){match=generic.name}else{for(elem_name in elems){if(!hasOwnPropertyRustdoc(elems,elem_name)){continue}if(elem_name===generic){match=elem_name;break}}}if(match===null){return MAX_LEV_DISTANCE+1}elems[match]-=1;if(elems[match]===0){delete elems[match]}}return 0}return MAX_LEV_DISTANCE+1}function checkIfInGenerics(row,elem){let lev=MAX_LEV_DISTANCE+1;for(const entry of row.generics){lev=Math.min(checkType(entry,elem,true),lev);if(lev===0){break}}return lev}function checkType(row,elem,literalSearch){if(row.name===null){if(row.generics.length>0){return checkIfInGenerics(row,elem)}return MAX_LEV_DISTANCE+1}let lev=levenshtein(row.name,elem.name);if(literalSearch){if(lev!==0){if(elem.generics.length===0){const checkGeneric=row.generics.length>0;if(checkGeneric&&row.generics.findIndex(tmp_elem=>tmp_elem.name===elem.name)!==-1){return 0}}return MAX_LEV_DISTANCE+1}else if(elem.generics.length>0){return checkGenerics(row,elem,MAX_LEV_DISTANCE+1)}return 0}else if(row.generics.length>0){if(elem.generics.length===0){if(lev===0){return 0}lev=checkIfInGenerics(row,elem);return lev+0.5}else if(lev>MAX_LEV_DISTANCE){return checkIfInGenerics(row,elem)}else{const tmp_lev=checkGenerics(row,elem,lev);if(tmp_lev>MAX_LEV_DISTANCE){return MAX_LEV_DISTANCE+1}return(tmp_lev+lev)/2}}else if(elem.generics.length>0){return MAX_LEV_DISTANCE+1}return lev}function findArg(row,elem,typeFilter){let lev=MAX_LEV_DISTANCE+1;if(row&&row.type&&row.type.inputs&&row.type.inputs.length>0){for(const input of row.type.inputs){if(!typePassesFilter(typeFilter,input.ty)){continue}lev=Math.min(lev,checkType(input,elem,parsedQuery.literalSearch));if(lev===0){return 0}}}return parsedQuery.literalSearch?MAX_LEV_DISTANCE+1:lev}function checkReturned(row,elem,typeFilter){let lev=MAX_LEV_DISTANCE+1;if(row&&row.type&&row.type.output.length>0){const ret=row.type.output;for(const ret_ty of ret){if(!typePassesFilter(typeFilter,ret_ty.ty)){continue}lev=Math.min(lev,checkType(ret_ty,elem,parsedQuery.literalSearch));if(lev===0){return 0}}}return parsedQuery.literalSearch?MAX_LEV_DISTANCE+1:lev}function checkPath(contains,ty){if(contains.length===0){return 0}let ret_lev=MAX_LEV_DISTANCE+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;if(clength>length){return MAX_LEV_DISTANCE+1}for(let i=0;ilength){break}let lev_total=0;let aborted=false;for(let x=0;xMAX_LEV_DISTANCE){aborted=true;break}lev_total+=lev}if(!aborted){ret_lev=Math.min(ret_lev,Math.round(lev_total/clength))}}return ret_lev}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES[filterCrates]&&ALIASES[filterCrates][lowerQuery]){const query_aliases=ALIASES[filterCrates][lowerQuery];for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{Object.keys(ALIASES).forEach(crate=>{if(ALIASES[crate][lowerQuery]){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=ALIASES[crate][lowerQuery];for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}})}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,lev){if(lev===0||(!parsedQuery.literalSearch&&lev<=MAX_LEV_DISTANCE)){if(results[fullId]!==undefined){const result=results[fullId];if(result.dontValidate||result.lev<=lev){return}}results[fullId]={id:id,index:index,dontValidate:parsedQuery.literalSearch,lev:lev,}}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let lev,lev_add=0,index=-1;const fullId=row.id;const in_args=findArg(row,elem,parsedQuery.typeFilter);const returned=checkReturned(row,elem,parsedQuery.typeFilter);addIntoResults(results_in_args,fullId,pos,index,in_args);addIntoResults(results_returned,fullId,pos,index,returned);if(!typePassesFilter(parsedQuery.typeFilter,row.ty)){return}const searchWord=searchWords[pos];if(parsedQuery.literalSearch){if(searchWord===elem.name){addIntoResults(results_others,fullId,pos,-1,0)}return}if(elem.name.length===0){if(row.type!==null){lev=checkGenerics(row.type,elem,MAX_LEV_DISTANCE+1);addIntoResults(results_others,fullId,pos,index,lev)}return}if(elem.fullPath.length>1){lev=checkPath(elem.pathWithoutLast,row);if(lev>MAX_LEV_DISTANCE||(parsedQuery.literalSearch&&lev!==0)){return}else if(lev>0){lev_add=lev/10}}if(searchWord.indexOf(elem.pathLast)>-1||row.normalizedName.indexOf(elem.pathLast)>-1){index=row.normalizedName.indexOf(elem.pathLast)}lev=levenshtein(searchWord,elem.pathLast);if(lev>0&&elem.pathLast.length>2&&searchWord.indexOf(elem.pathLast)>-1){if(elem.pathLast.length<6){lev=1}else{lev=0}}lev+=lev_add;if(lev>MAX_LEV_DISTANCE){return}else if(index!==-1&&elem.fullPath.length<2){lev-=1}if(lev<0){lev=0}addIntoResults(results_others,fullId,pos,index,lev)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let totalLev=0;let nbLev=0;function checkArgs(elems,callback){for(const elem of elems){const lev=callback(row,elem,NO_TYPE_FILTER);if(lev<=1){nbLev+=1;totalLev+=lev}else{return false}}return true}if(!checkArgs(parsedQuery.elems,findArg)){return}if(!checkArgs(parsedQuery.returned,checkReturned)){return}if(nbLev===0){return}const lev=Math.round(totalLev/nbLev);addIntoResults(results,row.id,pos,0,lev)}function innerRunQuery(){let elem,i,nSearchWords,in_returned,row;if(parsedQuery.foundElems===1){if(parsedQuery.elems.length===1){elem=parsedQuery.elems[0];for(i=0,nSearchWords=searchWords.length;i0){for(i=0,nSearchWords=searchWords.length;i-1||path.indexOf(key)>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(key)>-1)||levenshtein(name,key)<=MAX_LEV_DISTANCE)){return false}}return true}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#titles > button").item(searchState.currentTab);if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor="#"+type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function escape(content){const h1=document.createElement("h1");h1.textContent=content;return h1.innerHTML}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){let extraClass="";if(display===true){extraClass=" active"}const output=document.createElement("div");let length=0;if(array.length>0){output.className="search-results "+extraClass;array.forEach(item=>{const name=item.name;const type=itemTypes[item.ty];length+=1;let extra="";if(type==="primitive"){extra=" (primitive type)"}else if(type==="keyword"){extra=" (keyword)"}const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const wrapper=document.createElement("div");const resultName=document.createElement("div");resultName.className="result-name";if(item.is_alias){const alias=document.createElement("span");alias.className="alias";const bold=document.createElement("b");bold.innerText=item.alias;alias.appendChild(bold);alias.insertAdjacentHTML("beforeend"," - see ");resultName.appendChild(alias)}resultName.insertAdjacentHTML("beforeend",item.displayPath+""+name+extra+"");wrapper.appendChild(resultName);const description=document.createElement("div");description.className="desc";const spanDesc=document.createElement("span");spanDesc.insertAdjacentHTML("beforeend",item.desc);description.appendChild(spanDesc);wrapper.appendChild(description);link.appendChild(wrapper);output.appendChild(link)})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :( "+"Try on DuckDuckGo?
"+"Or try looking in one of these:
The Rust Reference "+" for technical details about the language.
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"}return output}function buildSettingsPage(){const themes=getVar("themes").split(",");const settings=[{"name":"Use system theme","js_name":"use-system-theme","default":true,},{"name":"Theme","js_name":"theme","default":"light","options":themes,},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":themes,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":themes,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
//ref:: https://github.com/andre-richter/qemu-exit
-usecore::arch::asm;
-
-constEXIT_SUCCESS: u32=0x5555; // Equals `exit(0)`. qemu successful exit
-
-constEXIT_FAILURE_FLAG: u32=0x3333;
-constEXIT_FAILURE: u32=exit_code_encode(1); // Equals `exit(1)`. qemu failed exit
-constEXIT_RESET: u32=0x7777; // qemu reset
-
-pubtraitQEMUExit {
- /// Exit with specified return code.
- ///
- /// Note: For `X86`, code is binary-OR'ed with `0x1` inside QEMU.
- fnexit(&self, code: u32) -> !;
-
- /// Exit QEMU using `EXIT_SUCCESS`, aka `0`, if possible.
- ///
- /// Note: Not possible for `X86`.
- fnexit_success(&self) -> !;
-
- /// Exit QEMU using `EXIT_FAILURE`, aka `1`.
- fnexit_failure(&self) -> !;
-}
-
-/// RISCV64 configuration
-pubstructRISCV64 {
- /// Address of the sifive_test mapped device.
- addr: u64,
-}
-
-/// Encode the exit code using EXIT_FAILURE_FLAG.
-constfnexit_code_encode(code: u32) -> u32 {
- (code<<16) |EXIT_FAILURE_FLAG
-}
-
-implRISCV64 {
- /// Create an instance.
- pubconstfnnew(addr: u64) -> Self {
- RISCV64 { addr }
- }
-}
-
-implQEMUExitforRISCV64 {
- /// Exit qemu with specified exit code.
- fnexit(&self, code: u32) -> ! {
- // If code is not a special value, we need to encode it with EXIT_FAILURE_FLAG.
- letcode_new=matchcode {
- 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));
- }
- }
- }
-
- fnexit_success(&self) -> ! {
- self.exit(EXIT_SUCCESS);
- }
-
- fnexit_failure(&self) -> ! {
- self.exit(EXIT_FAILURE);
- }
-}
-
-constVIRT_TEST: u64=0x100000;
-
-pubconstQEMU_EXIT_HANDLE: RISCV64=RISCV64::new(VIRT_TEST);
-
-
\ No newline at end of file
diff --git a/ch3-coop/src/os/config.rs.html b/ch3-coop/src/os/config.rs.html
index 99f1ee425..5e8e1a8b9 100644
--- a/ch3-coop/src/os/config.rs.html
+++ b/ch3-coop/src/os/config.rs.html
@@ -1,16 +1,17 @@
-config.rs - source
\ No newline at end of file
diff --git a/ch3-coop/src/os/console.rs.html b/ch3-coop/src/os/console.rs.html
index eb80857d4..d5f986b04 100644
--- a/ch3-coop/src/os/console.rs.html
+++ b/ch3-coop/src/os/console.rs.html
@@ -1,72 +1,73 @@
-console.rs - source
\ No newline at end of file
diff --git a/ch3-coop/src/os/lang_items.rs.html b/ch3-coop/src/os/lang_items.rs.html
index 70d5d37b6..40d11caba 100644
--- a/ch3-coop/src/os/lang_items.rs.html
+++ b/ch3-coop/src/os/lang_items.rs.html
@@ -1,40 +1,43 @@
-lang_items.rs - source
\ No newline at end of file
diff --git a/ch3-coop/src/os/loader.rs.html b/ch3-coop/src/os/loader.rs.html
index f52bb5995..05fb4dc96 100644
--- a/ch3-coop/src/os/loader.rs.html
+++ b/ch3-coop/src/os/loader.rs.html
@@ -1,198 +1,199 @@
-loader.rs - source
//! Loading user applications into memory
-//!
-//! For chapter 3, user applications are simply part of the data included in the
-//! kernel binary, so we only need to copy them to the space allocated for each
-//! app to load them. We also allocate fixed spaces for each task's
-//! [`KernelStack`] and [`UserStack`].
+loader.rs - source
+
//! Loading user applications into memory
+//!
+//! For chapter 3, user applications are simply part of the data included in the
+//! kernel binary, so we only need to copy them to the space allocated for each
+//! app to load them. We also allocate fixed spaces for each task's
+//! [`KernelStack`] and [`UserStack`].
-usecrate::config::*;
-usecrate::trap::TrapContext;
-usecore::arch::asm;
+use crate::config::*;
+use crate::trap::TrapContext;
+use core::arch::asm;
-#[repr(align(4096))]
-#[derive(Copy, Clone)]
-structKernelStack {
- data: [u8; KERNEL_STACK_SIZE],
+#[repr(align(4096))]
+#[derive(Copy, Clone)]
+struct KernelStack {
+ data: [u8; KERNEL_STACK_SIZE],
}
-#[repr(align(4096))]
-#[derive(Copy, Clone)]
-structUserStack {
- data: [u8; USER_STACK_SIZE],
+#[repr(align(4096))]
+#[derive(Copy, Clone)]
+struct UserStack {
+ data: [u8; USER_STACK_SIZE],
}
-staticKERNEL_STACK: [KernelStack; MAX_APP_NUM] = [KernelStack {
- data: [0; KERNEL_STACK_SIZE],
-}; MAX_APP_NUM];
+static KERNEL_STACK: [KernelStack; MAX_APP_NUM] = [KernelStack {
+ data: [0; KERNEL_STACK_SIZE],
+}; MAX_APP_NUM];
-staticUSER_STACK: [UserStack; MAX_APP_NUM] = [UserStack {
- data: [0; USER_STACK_SIZE],
-}; MAX_APP_NUM];
+static USER_STACK: [UserStack; MAX_APP_NUM] = [UserStack {
+ data: [0; USER_STACK_SIZE],
+}; MAX_APP_NUM];
-implKernelStack {
- fnget_sp(&self) -> usize {
- self.data.as_ptr() asusize+KERNEL_STACK_SIZE
+impl KernelStack {
+ fn get_sp(&self) -> usize {
+ self.data.as_ptr() as usize + KERNEL_STACK_SIZE
}
- pubfnpush_context(&self, trap_cx: TrapContext) -> usize {
- lettrap_cx_ptr= (self.get_sp() -core::mem::size_of::<TrapContext>()) as*mutTrapContext;
- unsafe {
- *trap_cx_ptr=trap_cx;
+ pub fn push_context(&self, trap_cx: TrapContext) -> usize {
+ let trap_cx_ptr = (self.get_sp() - core::mem::size_of::<TrapContext>()) as *mut TrapContext;
+ unsafe {
+ *trap_cx_ptr = trap_cx;
}
- trap_cx_ptrasusize
+ trap_cx_ptr as usize
}
}
-implUserStack {
- fnget_sp(&self) -> usize {
- self.data.as_ptr() asusize+USER_STACK_SIZE
+impl UserStack {
+ fn get_sp(&self) -> usize {
+ self.data.as_ptr() as usize + USER_STACK_SIZE
}
}
-/// Get base address of app i.
-fnget_base_i(app_id: usize) -> usize {
- APP_BASE_ADDRESS+app_id*APP_SIZE_LIMIT
+/// Get base address of app i.
+fn get_base_i(app_id: usize) -> usize {
+ APP_BASE_ADDRESS + app_id * APP_SIZE_LIMIT
}
-/// Get the total number of applications.
-pubfnget_num_app() -> usize {
- extern"C" {
- fn_num_app();
+/// Get the total number of applications.
+pub fn get_num_app() -> usize {
+ extern "C" {
+ fn _num_app();
}
- unsafe { (_num_appasusizeas*constusize).read_volatile() }
+ unsafe { (_num_app as usize as *const usize).read_volatile() }
}
-/// Load nth user app at
-/// [APP_BASE_ADDRESS + n * APP_SIZE_LIMIT, APP_BASE_ADDRESS + (n+1) * APP_SIZE_LIMIT).
-pubfnload_apps() {
- extern"C" {
- fn_num_app();
+/// Load nth user app at
+/// [APP_BASE_ADDRESS + n * APP_SIZE_LIMIT, APP_BASE_ADDRESS + (n+1) * APP_SIZE_LIMIT).
+pub fn load_apps() {
+ extern "C" {
+ fn _num_app();
}
- letnum_app_ptr=_num_appasusizeas*constusize;
- letnum_app=get_num_app();
- letapp_start=unsafe { core::slice::from_raw_parts(num_app_ptr.add(1), num_app+1) };
- // clear i-cache first
- unsafe {
- asm!("fence.i");
+ let num_app_ptr = _num_app as usize as *const usize;
+ let num_app = get_num_app();
+ let app_start = unsafe { core::slice::from_raw_parts(num_app_ptr.add(1), num_app + 1) };
+ // clear i-cache first
+ unsafe {
+ asm!("fence.i");
}
- // load apps
- foriin0..num_app {
- letbase_i=get_base_i(i);
- // clear region
- (base_i..base_i+APP_SIZE_LIMIT)
- .for_each(|addr|unsafe { (addras*mutu8).write_volatile(0) });
- // load app from data section to memory
- letsrc=unsafe {
- core::slice::from_raw_parts(app_start[i] as*constu8, app_start[i+1] -app_start[i])
+ // load apps
+ for i in 0..num_app {
+ let base_i = get_base_i(i);
+ // clear region
+ (base_i..base_i + APP_SIZE_LIMIT)
+ .for_each(|addr| unsafe { (addr as *mut u8).write_volatile(0) });
+ // load app from data section to memory
+ let src = unsafe {
+ core::slice::from_raw_parts(app_start[i] as *const u8, app_start[i + 1] - app_start[i])
};
- letdst=unsafe { core::slice::from_raw_parts_mut(base_ias*mutu8, src.len()) };
- dst.copy_from_slice(src);
+ let dst = unsafe { core::slice::from_raw_parts_mut(base_i as *mut u8, src.len()) };
+ dst.copy_from_slice(src);
}
}
-/// get app info with entry and sp and save `TrapContext` in kernel stack
-pubfninit_app_cx(app_id: usize) -> usize {
- KERNEL_STACK[app_id].push_context(TrapContext::app_init_context(
- get_base_i(app_id),
- USER_STACK[app_id].get_sp(),
+/// get app info with entry and sp and save `TrapContext` in kernel stack
+pub fn init_app_cx(app_id: usize) -> usize {
+ KERNEL_STACK[app_id].push_context(TrapContext::app_init_context(
+ get_base_i(app_id),
+ USER_STACK[app_id].get_sp(),
))
}
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ch3-coop/src/os/main.rs.html b/ch3-coop/src/os/main.rs.html
index bd9f1ff8b..e315e8981 100644
--- a/ch3-coop/src/os/main.rs.html
+++ b/ch3-coop/src/os/main.rs.html
@@ -1,130 +1,123 @@
-main.rs - source
//! The main module and entrypoint
-//!
-//! Various facilities of the kernels are implemented as submodules. The most
-//! important ones are:
-//!
-//! - [`trap`]: Handles all cases of switching from userspace to the kernel
-//! - [`task`]: Task management
-//! - [`syscall`]: System call handling and implementation
-//!
-//! The operating system also starts in this module. Kernel code starts
-//! executing from `entry.asm`, after which [`rust_main()`] is called to
-//! initialize various pieces of functionality. (See its source code for
-//! details.)
-//!
-//! We then call [`task::run_first_task()`] and for the first time go to
-//! userspace.
+main.rs - source
+
//! The main module and entrypoint
+//!
+//! Various facilities of the kernels are implemented as submodules. The most
+//! important ones are:
+//!
+//! - [`trap`]: Handles all cases of switching from userspace to the kernel
+//! - [`task`]: Task management
+//! - [`syscall`]: System call handling and implementation
+//!
+//! The operating system also starts in this module. Kernel code starts
+//! executing from `entry.asm`, after which [`rust_main()`] is called to
+//! initialize various pieces of functionality. (See its source code for
+//! details.)
+//!
+//! We then call [`task::run_first_task()`] and for the first time go to
+//! userspace.
-#![deny(missing_docs)]
-#![deny(warnings)]
-#![no_std]
-#![no_main]
-#![feature(panic_info_message)]
+#![deny(missing_docs)]
+#![deny(warnings)]
+#![no_std]
+#![no_main]
+#![feature(panic_info_message)]
-usecore::arch::global_asm;
+use core::arch::global_asm;
+#[macro_use]
+mod console;
+mod config;
+mod lang_items;
+mod loader;
+mod sbi;
+mod sync;
+pub mod syscall;
+pub mod task;
+pub mod trap;
-#[path="boards/qemu.rs"]
-modboard;
+global_asm!(include_str!("entry.asm"));
+global_asm!(include_str!("link_app.S"));
-#[macro_use]
-modconsole;
-modconfig;
-modlang_items;
-modloader;
-modsbi;
-modsync;
-pubmodsyscall;
-pubmodtask;
-pubmodtrap;
-
-global_asm!(include_str!("entry.asm"));
-global_asm!(include_str!("link_app.S"));
-
-/// clear BSS segment
-fnclear_bss() {
- extern"C" {
- fnsbss();
- fnebss();
+/// clear BSS segment
+fn clear_bss() {
+ extern "C" {
+ fn sbss();
+ fn ebss();
}
- unsafe {
- core::slice::from_raw_parts_mut(sbssasusizeas*mutu8, ebssasusize-sbssasusize)
- .fill(0);
+ unsafe {
+ core::slice::from_raw_parts_mut(sbss as usize as *mut u8, ebss as usize - sbss as usize)
+ .fill(0);
}
}
-/// the rust entry-point of os
-#[no_mangle]
-pubfnrust_main() -> ! {
- clear_bss();
- println!("[kernel] Hello, world!");
- trap::init();
- loader::load_apps();
- task::run_first_task();
- panic!("Unreachable in rust_main!");
+/// the rust entry-point of os
+#[no_mangle]
+pub fn rust_main() -> ! {
+ clear_bss();
+ println!("[kernel] Hello, world!");
+ trap::init();
+ loader::load_apps();
+ task::run_first_task();
+ panic!("Unreachable in rust_main!");
}
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ch3-coop/src/os/sbi.rs.html b/ch3-coop/src/os/sbi.rs.html
index 5b1bfb923..bfe62a538 100644
--- a/ch3-coop/src/os/sbi.rs.html
+++ b/ch3-coop/src/os/sbi.rs.html
@@ -1,96 +1,53 @@
-sbi.rs - source
\ No newline at end of file
diff --git a/ch3-coop/src/os/sync/mod.rs.html b/ch3-coop/src/os/sync/mod.rs.html
index 7254c0d67..33020e005 100644
--- a/ch3-coop/src/os/sync/mod.rs.html
+++ b/ch3-coop/src/os/sync/mod.rs.html
@@ -1,12 +1,13 @@
-mod.rs - source
1
-2
-3
-4
-5
-
//! Synchronization and interior mutability primitives
+mod.rs - source
+
\ No newline at end of file
+pub use up::UPSafeCell;
+
\ No newline at end of file
diff --git a/ch3-coop/src/os/sync/up.rs.html b/ch3-coop/src/os/sync/up.rs.html
index c085d6ca1..fed75fb0d 100644
--- a/ch3-coop/src/os/sync/up.rs.html
+++ b/ch3-coop/src/os/sync/up.rs.html
@@ -1,64 +1,65 @@
-up.rs - source
//! Uniprocessor interior mutability primitives
-usecore::cell::{RefCell, RefMut};
+use core::cell::{RefCell, RefMut};
-/// Wrap a static data structure inside it so that we are
-/// able to access it without any `unsafe`.
-///
-/// We should only use it in uniprocessor.
-///
-/// In order to get mutable reference of inner data, call
-/// `exclusive_access`.
-pubstructUPSafeCell<T> {
- /// inner data
- inner: RefCell<T>,
+/// Wrap a static data structure inside it so that we are
+/// able to access it without any `unsafe`.
+///
+/// We should only use it in uniprocessor.
+///
+/// In order to get mutable reference of inner data, call
+/// `exclusive_access`.
+pub struct UPSafeCell<T> {
+ /// inner data
+ inner: RefCell<T>,
}
-unsafeimpl<T>SyncforUPSafeCell<T> {}
+unsafe impl<T> Sync for UPSafeCell<T> {}
-impl<T>UPSafeCell<T> {
- /// User is responsible to guarantee that inner struct is only used in
- /// uniprocessor.
- pubunsafefnnew(value: T) -> Self {
- Self {
- inner: RefCell::new(value),
+impl<T> UPSafeCell<T> {
+ /// User is responsible to guarantee that inner struct is only used in
+ /// uniprocessor.
+ pub unsafe fn new(value: T) -> Self {
+ Self {
+ inner: RefCell::new(value),
}
}
- /// Exclusive access inner data in UPSafeCell. Panic if the data has been borrowed.
- pubfnexclusive_access(&self) -> RefMut<'_, T> {
- self.inner.borrow_mut()
+ /// Exclusive access inner data in UPSafeCell. Panic if the data has been borrowed.
+ pub fn exclusive_access(&self) -> RefMut<'_, T> {
+ self.inner.borrow_mut()
}
}
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ch3-coop/src/os/syscall/fs.rs.html b/ch3-coop/src/os/syscall/fs.rs.html
index 97416c796..3dcfa502d 100644
--- a/ch3-coop/src/os/syscall/fs.rs.html
+++ b/ch3-coop/src/os/syscall/fs.rs.html
@@ -1,38 +1,39 @@
-fs.rs - source
//! File and filesystem-related syscalls
-constFD_STDOUT: usize=1;
+const FD_STDOUT: usize = 1;
-/// write buf of length `len` to a file with `fd`
-pubfnsys_write(fd: usize, buf: *constu8, len: usize) -> isize {
- matchfd {
- FD_STDOUT => {
- letslice=unsafe { core::slice::from_raw_parts(buf, len) };
- letstr=core::str::from_utf8(slice).unwrap();
- print!("{}", str);
- lenasisize
+/// write buf of length `len` to a file with `fd`
+pub fn sys_write(fd: usize, buf: *const u8, len: usize) -> isize {
+ match fd {
+ FD_STDOUT => {
+ let slice = unsafe { core::slice::from_raw_parts(buf, len) };
+ let str = core::str::from_utf8(slice).unwrap();
+ print!("{}", str);
+ len as isize
}
- _ => {
- panic!("Unsupported fd in sys_write!");
+ _ => {
+ panic!("Unsupported fd in sys_write!");
}
}
}
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ch3-coop/src/os/syscall/mod.rs.html b/ch3-coop/src/os/syscall/mod.rs.html
index 7413d5417..17109d7c4 100644
--- a/ch3-coop/src/os/syscall/mod.rs.html
+++ b/ch3-coop/src/os/syscall/mod.rs.html
@@ -1,66 +1,67 @@
-mod.rs - source
//! Implementation of syscalls
-//!
-//! The single entry point to all system calls, [`syscall()`], is called
-//! whenever userspace wishes to perform a system call using the `ecall`
-//! instruction. In this case, the processor raises an 'Environment call from
-//! U-mode' exception, which is handled as one of the cases in
-//! [`crate::trap::trap_handler`].
-//!
-//! For clarity, each single syscall is implemented as its own function, named
-//! `sys_` then the name of the syscall. You can find functions like this in
-//! submodules, and you should also implement syscalls this way.
+mod.rs - source
+
//! Implementation of syscalls
+//!
+//! The single entry point to all system calls, [`syscall()`], is called
+//! whenever userspace wishes to perform a system call using the `ecall`
+//! instruction. In this case, the processor raises an 'Environment call from
+//! U-mode' exception, which is handled as one of the cases in
+//! [`crate::trap::trap_handler`].
+//!
+//! For clarity, each single syscall is implemented as its own function, named
+//! `sys_` then the name of the syscall. You can find functions like this in
+//! submodules, and you should also implement syscalls this way.
-constSYSCALL_WRITE: usize=64;
-constSYSCALL_EXIT: usize=93;
-constSYSCALL_YIELD: usize=124;
-//const SYSCALL_GET_TIME: usize = 169;
+const SYSCALL_WRITE: usize = 64;
+const SYSCALL_EXIT: usize = 93;
+const SYSCALL_YIELD: usize = 124;
+//const SYSCALL_GET_TIME: usize = 169;
-modfs;
-modprocess;
+mod fs;
+mod process;
-usefs::*;
-useprocess::*;
+use fs::*;
+use process::*;
-/// handle syscall exception with `syscall_id` and other arguments
-pubfnsyscall(syscall_id: usize, args: [usize; 3]) -> isize {
- matchsyscall_id {
- SYSCALL_WRITE => sys_write(args[0], args[1] as*constu8, args[2]),
- SYSCALL_EXIT => sys_exit(args[0] asi32),
- SYSCALL_YIELD => sys_yield(),
- _ => panic!("Unsupported syscall_id: {}", syscall_id),
+/// handle syscall exception with `syscall_id` and other arguments
+pub fn syscall(syscall_id: usize, args: [usize; 3]) -> isize {
+ match syscall_id {
+ SYSCALL_WRITE => sys_write(args[0], args[1] as *const u8, args[2]),
+ SYSCALL_EXIT => sys_exit(args[0] as i32),
+ SYSCALL_YIELD => sys_yield(),
+ _ => panic!("Unsupported syscall_id: {}", syscall_id),
}
}
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ch3-coop/src/os/syscall/process.rs.html b/ch3-coop/src/os/syscall/process.rs.html
index fbf9ed3c7..e14eb2e34 100644
--- a/ch3-coop/src/os/syscall/process.rs.html
+++ b/ch3-coop/src/os/syscall/process.rs.html
@@ -1,32 +1,33 @@
-process.rs - source
//! Process management syscalls
+use crate::task::{exit_current_and_run_next, suspend_current_and_run_next};
-/// task exits and submit an exit code
-pubfnsys_exit(exit_code: i32) -> ! {
- println!("[kernel] Application exited with code {}", exit_code);
- exit_current_and_run_next();
- panic!("Unreachable in sys_exit!");
+/// task exits and submit an exit code
+pub fn sys_exit(exit_code: i32) -> ! {
+ println!("[kernel] Application exited with code {}", exit_code);
+ exit_current_and_run_next();
+ panic!("Unreachable in sys_exit!");
}
-/// current task gives up resources for other tasks
-pubfnsys_yield() -> isize {
- suspend_current_and_run_next();
- 0
-}
-
-
\ No newline at end of file
+/// current task gives up resources for other tasks
+pub fn sys_yield() -> isize {
+ suspend_current_and_run_next();
+ 0
+}
+
\ No newline at end of file
diff --git a/ch3-coop/src/os/task/context.rs.html b/ch3-coop/src/os/task/context.rs.html
index 64a6a43e2..445eac43f 100644
--- a/ch3-coop/src/os/task/context.rs.html
+++ b/ch3-coop/src/os/task/context.rs.html
@@ -1,74 +1,75 @@
-context.rs - source
\ No newline at end of file
diff --git a/ch3-coop/src/os/task/mod.rs.html b/ch3-coop/src/os/task/mod.rs.html
index d4395c27d..262770757 100644
--- a/ch3-coop/src/os/task/mod.rs.html
+++ b/ch3-coop/src/os/task/mod.rs.html
@@ -1,348 +1,349 @@
-mod.rs - source
//! Task management implementation
-//!
-//! Everything about task management, like starting and switching tasks is
-//! implemented here.
-//!
-//! A single global instance of [`TaskManager`] called `TASK_MANAGER` controls
-//! all the tasks in the operating system.
-//!
-//! Be careful when you see `__switch` ASM function in `switch.S`. Control flow around this function
-//! might not be what you expect.
+mod.rs - source
+
//! Task management implementation
+//!
+//! Everything about task management, like starting and switching tasks is
+//! implemented here.
+//!
+//! A single global instance of [`TaskManager`] called `TASK_MANAGER` controls
+//! all the tasks in the operating system.
+//!
+//! Be careful when you see `__switch` ASM function in `switch.S`. Control flow around this function
+//! might not be what you expect.
-modcontext;
-modswitch;
+mod context;
+mod switch;
-#[allow(clippy::module_inception)]
-modtask;
+#[allow(clippy::module_inception)]
+mod task;
-usecrate::config::MAX_APP_NUM;
-usecrate::loader::{get_num_app, init_app_cx};
-usecrate::sync::UPSafeCell;
-uselazy_static::*;
-useswitch::__switch;
-usetask::{TaskControlBlock, TaskStatus};
+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;
+use task::{TaskControlBlock, TaskStatus};
-pubusecontext::TaskContext;
+pub use context::TaskContext;
-/// The task manager, where all the tasks are managed.
-///
-/// Functions implemented on `TaskManager` deals with all task state transitions
-/// and task context switching. For convenience, you can find wrappers around it
-/// in the module level.
-///
-/// Most of `TaskManager` are hidden behind the field `inner`, to defer
-/// borrowing checks to runtime. You can see examples on how to use `inner` in
-/// existing functions on `TaskManager`.
-pubstructTaskManager {
- /// total number of tasks
- num_app: usize,
- /// use inner value to get mutable access
- inner: UPSafeCell<TaskManagerInner>,
+/// The task manager, where all the tasks are managed.
+///
+/// Functions implemented on `TaskManager` deals with all task state transitions
+/// and task context switching. For convenience, you can find wrappers around it
+/// in the module level.
+///
+/// Most of `TaskManager` are hidden behind the field `inner`, to defer
+/// borrowing checks to runtime. You can see examples on how to use `inner` in
+/// existing functions on `TaskManager`.
+pub struct TaskManager {
+ /// total number of tasks
+ num_app: usize,
+ /// use inner value to get mutable access
+ inner: UPSafeCell<TaskManagerInner>,
}
-/// Inner of Task Manager
-pubstructTaskManagerInner {
- /// task list
- tasks: [TaskControlBlock; MAX_APP_NUM],
- /// id of current `Running` task
- current_task: usize,
+/// Inner of Task Manager
+pub struct TaskManagerInner {
+ /// task list
+ tasks: [TaskControlBlock; MAX_APP_NUM],
+ /// id of current `Running` task
+ current_task: usize,
}
-lazy_static! {
- /// Global variable: TASK_MANAGER
- pubstaticrefTASK_MANAGER: TaskManager= {
- letnum_app=get_num_app();
- letmuttasks= [TaskControlBlock {
- task_cx: TaskContext::zero_init(),
- task_status: TaskStatus::UnInit,
- }; MAX_APP_NUM];
- for (i, task) intasks.iter_mut().enumerate() {
- task.task_cx=TaskContext::goto_restore(init_app_cx(i));
- task.task_status=TaskStatus::Ready;
+lazy_static! {
+ /// Global variable: TASK_MANAGER
+ pub static ref TASK_MANAGER: TaskManager = {
+ let num_app = get_num_app();
+ let mut tasks = [TaskControlBlock {
+ task_cx: TaskContext::zero_init(),
+ task_status: TaskStatus::UnInit,
+ }; MAX_APP_NUM];
+ for (i, task) in tasks.iter_mut().enumerate() {
+ task.task_cx = TaskContext::goto_restore(init_app_cx(i));
+ task.task_status = TaskStatus::Ready;
}
- TaskManager {
- num_app,
- inner: unsafe {
- UPSafeCell::new(TaskManagerInner {
- tasks,
- current_task: 0,
+ TaskManager {
+ num_app,
+ inner: unsafe {
+ UPSafeCell::new(TaskManagerInner {
+ tasks,
+ current_task: 0,
})
},
}
};
}
-implTaskManager {
- /// 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.
- fnrun_first_task(&self) -> ! {
- letmutinner=self.inner.exclusive_access();
- lettask0=&mutinner.tasks[0];
- task0.task_status=TaskStatus::Running;
- letnext_task_cx_ptr=&task0.task_cxas*constTaskContext;
- drop(inner);
- letmut_unused=TaskContext::zero_init();
- // before this, we should drop local variables that must be dropped manually
- unsafe {
- __switch(&mut_unusedas*mutTaskContext, next_task_cx_ptr);
+impl 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.
+ fn run_first_task(&self) -> ! {
+ let mut inner = self.inner.exclusive_access();
+ let task0 = &mut inner.tasks[0];
+ task0.task_status = TaskStatus::Running;
+ let next_task_cx_ptr = &task0.task_cx as *const TaskContext;
+ drop(inner);
+ let mut _unused = TaskContext::zero_init();
+ // before this, we should drop local variables that must be dropped manually
+ unsafe {
+ __switch(&mut _unused as *mut TaskContext, next_task_cx_ptr);
}
- panic!("unreachable in run_first_task!");
+ panic!("unreachable in run_first_task!");
}
- /// Change the status of current `Running` task into `Ready`.
- fnmark_current_suspended(&self) {
- letmutinner=self.inner.exclusive_access();
- letcurrent=inner.current_task;
- inner.tasks[current].task_status=TaskStatus::Ready;
+ /// Change the status of current `Running` task into `Ready`.
+ fn mark_current_suspended(&self) {
+ let mut inner = self.inner.exclusive_access();
+ let current = inner.current_task;
+ inner.tasks[current].task_status = TaskStatus::Ready;
}
- /// Change the status of current `Running` task into `Exited`.
- fnmark_current_exited(&self) {
- letmutinner=self.inner.exclusive_access();
- letcurrent=inner.current_task;
- inner.tasks[current].task_status=TaskStatus::Exited;
+ /// Change the status of current `Running` task into `Exited`.
+ fn mark_current_exited(&self) {
+ let mut inner = self.inner.exclusive_access();
+ let current = inner.current_task;
+ inner.tasks[current].task_status = TaskStatus::Exited;
}
- /// Find next task to run and return app id.
- ///
- /// In this case, we only return the first `Ready` task in task list.
- fnfind_next_task(&self) -> Option<usize> {
- letinner=self.inner.exclusive_access();
- letcurrent=inner.current_task;
- (current+1..current+self.num_app+1)
- .map(|id|id%self.num_app)
- .find(|id|inner.tasks[*id].task_status==TaskStatus::Ready)
+ /// Find next task to run and return app id.
+ ///
+ /// In this case, we only return the first `Ready` task in task list.
+ fn find_next_task(&self) -> Option<usize> {
+ let inner = self.inner.exclusive_access();
+ let current = inner.current_task;
+ (current + 1..current + self.num_app + 1)
+ .map(|id| id % self.num_app)
+ .find(|id| inner.tasks[*id].task_status == TaskStatus::Ready)
}
- /// Switch current `Running` task to the task we have found,
- /// or there is no `Ready` task and we can exit with all applications completed
- fnrun_next_task(&self) {
- ifletSome(next) =self.find_next_task() {
- letmutinner=self.inner.exclusive_access();
- letcurrent=inner.current_task;
- inner.tasks[next].task_status=TaskStatus::Running;
- inner.current_task=next;
- letcurrent_task_cx_ptr=&mutinner.tasks[current].task_cxas*mutTaskContext;
- letnext_task_cx_ptr=&inner.tasks[next].task_cxas*constTaskContext;
- drop(inner);
- // before this, we should drop local variables that must be dropped manually
- unsafe {
- __switch(current_task_cx_ptr, next_task_cx_ptr);
+ /// Switch current `Running` task to the task we have found,
+ /// or there is no `Ready` task and we can exit with all applications completed
+ fn run_next_task(&self) {
+ if let Some(next) = self.find_next_task() {
+ let mut inner = self.inner.exclusive_access();
+ let current = inner.current_task;
+ inner.tasks[next].task_status = TaskStatus::Running;
+ inner.current_task = next;
+ let current_task_cx_ptr = &mut inner.tasks[current].task_cx as *mut TaskContext;
+ let next_task_cx_ptr = &inner.tasks[next].task_cx as *const TaskContext;
+ drop(inner);
+ // before this, we should drop local variables that must be dropped manually
+ unsafe {
+ __switch(current_task_cx_ptr, next_task_cx_ptr);
}
- // go back to user mode
- } else {
- println!("All applications completed!");
- usecrate::board::QEMUExit;
- crate::board::QEMU_EXIT_HANDLE.exit_success();
+ // go back to user mode
+ } else {
+ println!("All applications completed!");
+ shutdown(false);
}
}
}
-/// run first task
-pubfnrun_first_task() {
- TASK_MANAGER.run_first_task();
+/// run first task
+pub fn run_first_task() {
+ TASK_MANAGER.run_first_task();
}
-/// rust next task
-fnrun_next_task() {
- TASK_MANAGER.run_next_task();
+/// rust next task
+fn run_next_task() {
+ TASK_MANAGER.run_next_task();
}
-/// suspend current task
-fnmark_current_suspended() {
- TASK_MANAGER.mark_current_suspended();
+/// suspend current task
+fn mark_current_suspended() {
+ TASK_MANAGER.mark_current_suspended();
}
-/// exit current task
-fnmark_current_exited() {
- TASK_MANAGER.mark_current_exited();
+/// exit current task
+fn mark_current_exited() {
+ TASK_MANAGER.mark_current_exited();
}
-/// suspend current task, then run next task
-pubfnsuspend_current_and_run_next() {
- mark_current_suspended();
- run_next_task();
+/// suspend current task, then run next task
+pub fn suspend_current_and_run_next() {
+ mark_current_suspended();
+ run_next_task();
}
-/// exit current task, then run next task
-pubfnexit_current_and_run_next() {
- mark_current_exited();
- run_next_task();
+/// exit current task, then run next task
+pub fn exit_current_and_run_next() {
+ mark_current_exited();
+ run_next_task();
}
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ch3-coop/src/os/task/switch.rs.html b/ch3-coop/src/os/task/switch.rs.html
index 7c429938c..7c038e58d 100644
--- a/ch3-coop/src/os/task/switch.rs.html
+++ b/ch3-coop/src/os/task/switch.rs.html
@@ -1,36 +1,37 @@
-switch.rs - source
//! Rust wrapper around `__switch`.
-//!
-//! Switching to a different task's context happens here. The actual
-//! implementation must not be in Rust and (essentially) has to be in assembly
-//! language (Do you know why?), so this module really is just a wrapper around
-//! `switch.S`.
+switch.rs - source
+
//! Rust wrapper around `__switch`.
+//!
+//! Switching to a different task's context happens here. The actual
+//! implementation must not be in Rust and (essentially) has to be in assembly
+//! language (Do you know why?), so this module really is just a wrapper around
+//! `switch.S`.
-usesuper::TaskContext;
-usecore::arch::global_asm;
+use super::TaskContext;
+use core::arch::global_asm;
-global_asm!(include_str!("switch.S"));
+global_asm!(include_str!("switch.S"));
-extern"C" {
- /// Switch to the context of `next_task_cx_ptr`, saving the current context
- /// in `current_task_cx_ptr`.
- pubfn__switch(current_task_cx_ptr: *mutTaskContext, next_task_cx_ptr: *constTaskContext);
+extern "C" {
+ /// Switch to the context of `next_task_cx_ptr`, saving the current context
+ /// in `current_task_cx_ptr`.
+ pub fn __switch(current_task_cx_ptr: *mut TaskContext, next_task_cx_ptr: *const TaskContext);
}
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ch3-coop/src/os/task/task.rs.html b/ch3-coop/src/os/task/task.rs.html
index 9764a5fed..ae86b5e08 100644
--- a/ch3-coop/src/os/task/task.rs.html
+++ b/ch3-coop/src/os/task/task.rs.html
@@ -1,36 +1,37 @@
-task.rs - source
\ No newline at end of file
diff --git a/ch3-coop/src/os/trap/context.rs.html b/ch3-coop/src/os/trap/context.rs.html
index 02da14fbc..9fd498401 100644
--- a/ch3-coop/src/os/trap/context.rs.html
+++ b/ch3-coop/src/os/trap/context.rs.html
@@ -1,62 +1,63 @@
-context.rs - source
\ No newline at end of file
diff --git a/ch3-coop/src/os/trap/mod.rs.html b/ch3-coop/src/os/trap/mod.rs.html
index 8d4244a89..9795da396 100644
--- a/ch3-coop/src/os/trap/mod.rs.html
+++ b/ch3-coop/src/os/trap/mod.rs.html
@@ -1,138 +1,139 @@
-mod.rs - source
//! Trap handling functionality
-//!
-//! For rCore, we have a single trap entry point, namely `__alltraps`. At
-//! initialization in [`init()`], we set the `stvec` CSR to point to it.
-//!
-//! All traps go through `__alltraps`, which is defined in `trap.S`. The
-//! assembly language code does just enough work restore the kernel space
-//! context, ensuring that Rust code safely runs, and transfers control to
-//! [`trap_handler()`].
-//!
-//! It then calls different functionality based on what exactly the exception
-//! was. For example, timer interrupts trigger task preemption, and syscalls go
-//! to [`syscall()`].
+mod.rs - source
+
//! Trap handling functionality
+//!
+//! For rCore, we have a single trap entry point, namely `__alltraps`. At
+//! initialization in [`init()`], we set the `stvec` CSR to point to it.
+//!
+//! All traps go through `__alltraps`, which is defined in `trap.S`. The
+//! assembly language code does just enough work restore the kernel space
+//! context, ensuring that Rust code safely runs, and transfers control to
+//! [`trap_handler()`].
+//!
+//! It then calls different functionality based on what exactly the exception
+//! was. For example, timer interrupts trigger task preemption, and syscalls go
+//! to [`syscall()`].
-modcontext;
+mod context;
-usecrate::syscall::syscall;
-usecore::arch::global_asm;
-useriscv::register::{
- mtvec::TrapMode,
- scause::{self, Exception, Trap},
- stval, stvec,
+use crate::syscall::syscall;
+use core::arch::global_asm;
+use riscv::register::{
+ mtvec::TrapMode,
+ scause::{self, Exception, Trap},
+ stval, stvec,
};
-global_asm!(include_str!("trap.S"));
+global_asm!(include_str!("trap.S"));
-/// initialize CSR `stvec` as the entry of `__alltraps`
-pubfninit() {
- extern"C" {
- fn__alltraps();
+/// initialize CSR `stvec` as the entry of `__alltraps`
+pub fn init() {
+ extern "C" {
+ fn __alltraps();
}
- unsafe {
- stvec::write(__alltrapsasusize, TrapMode::Direct);
+ unsafe {
+ stvec::write(__alltraps as usize, TrapMode::Direct);
}
}
-#[no_mangle]
-/// handle an interrupt, exception, or system call from user space
-pubfntrap_handler(cx: &mutTrapContext) -> &mutTrapContext {
- letscause=scause::read(); // get trap cause
- letstval=stval::read(); // get extra value
- matchscause.cause() {
- Trap::Exception(Exception::UserEnvCall) => {
- cx.sepc+=4;
- cx.x[10] =syscall(cx.x[17], [cx.x[10], cx.x[11], cx.x[12]]) asusize;
+#[no_mangle]
+/// handle an interrupt, exception, or system call from user space
+pub fn trap_handler(cx: &mut TrapContext) -> &mut TrapContext {
+ let scause = scause::read(); // get trap cause
+ let stval = stval::read(); // get extra value
+ match scause.cause() {
+ Trap::Exception(Exception::UserEnvCall) => {
+ cx.sepc += 4;
+ cx.x[10] = syscall(cx.x[17], [cx.x[10], cx.x[11], cx.x[12]]) as usize;
}
- Trap::Exception(Exception::StoreFault) |Trap::Exception(Exception::StorePageFault) => {
- println!("[kernel] PageFault in application, bad addr = {:#x}, bad instruction = {:#x}, kernel killed it.", stval, cx.sepc);
- panic!("[kernel] Cannot continue!");
- //run_next_app();
- }
- Trap::Exception(Exception::IllegalInstruction) => {
- println!("[kernel] IllegalInstruction in application, kernel killed it.");
- panic!("[kernel] Cannot continue!");
- //run_next_app();
- }
- _ => {
+ Trap::Exception(Exception::StoreFault) | Trap::Exception(Exception::StorePageFault) => {
+ println!("[kernel] PageFault in application, bad addr = {:#x}, bad instruction = {:#x}, kernel killed it.", stval, cx.sepc);
+ panic!("[kernel] Cannot continue!");
+ //run_next_app();
+ }
+ Trap::Exception(Exception::IllegalInstruction) => {
+ println!("[kernel] IllegalInstruction in application, kernel killed it.");
+ panic!("[kernel] Cannot continue!");
+ //run_next_app();
+ }
+ _ => {
panic!(
- "Unsupported trap {:?}, stval = {:#x}!",
- scause.cause(),
- stval
+ "Unsupported trap {:?}, stval = {:#x}!",
+ scause.cause(),
+ stval
);
}
}
- cx
+ cx
}
-pubusecontext::TrapContext;
-
-
\ No newline at end of file
+pub use context::TrapContext;
+
\ No newline at end of file
diff --git a/ch3-coop/COPYRIGHT.txt b/ch3-coop/static.files/COPYRIGHT-23e9bde6c69aea69.txt
similarity index 97%
rename from ch3-coop/COPYRIGHT.txt
rename to ch3-coop/static.files/COPYRIGHT-23e9bde6c69aea69.txt
index 34e48134c..1447df792 100644
--- a/ch3-coop/COPYRIGHT.txt
+++ b/ch3-coop/static.files/COPYRIGHT-23e9bde6c69aea69.txt
@@ -1,3 +1,5 @@
+# REUSE-IgnoreStart
+
These documentation pages include resources by third parties. This copyright
file applies only to those resources. The following third party resources are
included, and carry their own copyright notices and license terms:
@@ -44,3 +46,5 @@ included, and carry their own copyright notices and license terms:
See SourceSerif4-LICENSE.md.
This copyright file is intended to be distributed with rustdoc output.
+
+# REUSE-IgnoreEnd
diff --git a/ch3-coop/FiraSans-LICENSE.txt b/ch3-coop/static.files/FiraSans-LICENSE-db4b642586e02d97.txt
similarity index 99%
rename from ch3-coop/FiraSans-LICENSE.txt
rename to ch3-coop/static.files/FiraSans-LICENSE-db4b642586e02d97.txt
index ff9afab06..d7e9c149b 100644
--- a/ch3-coop/FiraSans-LICENSE.txt
+++ b/ch3-coop/static.files/FiraSans-LICENSE-db4b642586e02d97.txt
@@ -1,3 +1,5 @@
+// REUSE-IgnoreStart
+
Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A.
with Reserved Font Name < Fira >,
@@ -92,3 +94,5 @@ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
+
+// REUSE-IgnoreEnd
diff --git a/ch3-coop/FiraSans-Medium.woff2 b/ch3-coop/static.files/FiraSans-Medium-8f9a781e4970d388.woff2
similarity index 100%
rename from ch3-coop/FiraSans-Medium.woff2
rename to ch3-coop/static.files/FiraSans-Medium-8f9a781e4970d388.woff2
diff --git a/ch3-coop/FiraSans-Regular.woff2 b/ch3-coop/static.files/FiraSans-Regular-018c141bf0843ffd.woff2
similarity index 100%
rename from ch3-coop/FiraSans-Regular.woff2
rename to ch3-coop/static.files/FiraSans-Regular-018c141bf0843ffd.woff2
diff --git a/ch3-coop/LICENSE-APACHE.txt b/ch3-coop/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt
similarity index 100%
rename from ch3-coop/LICENSE-APACHE.txt
rename to ch3-coop/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt
diff --git a/ch3-coop/LICENSE-MIT.txt b/ch3-coop/static.files/LICENSE-MIT-65090b722b3f6c56.txt
similarity index 100%
rename from ch3-coop/LICENSE-MIT.txt
rename to ch3-coop/static.files/LICENSE-MIT-65090b722b3f6c56.txt
diff --git a/ch3-coop/NanumBarunGothic.ttf.woff2 b/ch3-coop/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2
similarity index 100%
rename from ch3-coop/NanumBarunGothic.ttf.woff2
rename to ch3-coop/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2
diff --git a/ch3-coop/NanumBarunGothic-LICENSE.txt b/ch3-coop/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt
similarity index 99%
rename from ch3-coop/NanumBarunGothic-LICENSE.txt
rename to ch3-coop/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt
index 0bf46682b..4b3edc29e 100644
--- a/ch3-coop/NanumBarunGothic-LICENSE.txt
+++ b/ch3-coop/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt
@@ -1,3 +1,5 @@
+// REUSE-IgnoreStart
+
Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/),
with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic,
@@ -97,3 +99,5 @@ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
+
+// REUSE-IgnoreEnd
diff --git a/ch3-coop/SourceCodePro-It.ttf.woff2 b/ch3-coop/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2
similarity index 100%
rename from ch3-coop/SourceCodePro-It.ttf.woff2
rename to ch3-coop/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2
diff --git a/ch3-coop/SourceCodePro-LICENSE.txt b/ch3-coop/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt
similarity index 99%
rename from ch3-coop/SourceCodePro-LICENSE.txt
rename to ch3-coop/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt
index 07542572e..0d2941e14 100644
--- a/ch3-coop/SourceCodePro-LICENSE.txt
+++ b/ch3-coop/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt
@@ -1,3 +1,5 @@
+// REUSE-IgnoreStart
+
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
@@ -91,3 +93,5 @@ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
+
+// REUSE-IgnoreEnd
diff --git a/ch3-coop/SourceCodePro-Regular.ttf.woff2 b/ch3-coop/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2
similarity index 100%
rename from ch3-coop/SourceCodePro-Regular.ttf.woff2
rename to ch3-coop/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2
diff --git a/ch3-coop/SourceCodePro-Semibold.ttf.woff2 b/ch3-coop/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2
similarity index 100%
rename from ch3-coop/SourceCodePro-Semibold.ttf.woff2
rename to ch3-coop/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2
diff --git a/ch3-coop/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 b/ch3-coop/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2
new file mode 100644
index 000000000..181a07f63
Binary files /dev/null and b/ch3-coop/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 differ
diff --git a/ch3-coop/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 b/ch3-coop/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2
new file mode 100644
index 000000000..2ae08a7be
Binary files /dev/null and b/ch3-coop/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 differ
diff --git a/ch3-coop/SourceSerif4-LICENSE.md b/ch3-coop/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md
similarity index 94%
rename from ch3-coop/SourceSerif4-LICENSE.md
rename to ch3-coop/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md
index 68ea18924..175fa4f47 100644
--- a/ch3-coop/SourceSerif4-LICENSE.md
+++ b/ch3-coop/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md
@@ -1,4 +1,7 @@
+
+
Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
+Copyright 2014 - 2023 Adobe (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
@@ -91,3 +94,5 @@ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
+
+
diff --git a/ch3-coop/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 b/ch3-coop/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2
new file mode 100644
index 000000000..0263fc304
Binary files /dev/null and b/ch3-coop/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 differ
diff --git a/ch3-coop/clipboard.svg b/ch3-coop/static.files/clipboard-7571035ce49a181d.svg
similarity index 100%
rename from ch3-coop/clipboard.svg
rename to ch3-coop/static.files/clipboard-7571035ce49a181d.svg
diff --git a/ch3-coop/favicon-16x16.png b/ch3-coop/static.files/favicon-16x16-8b506e7a72182f1c.png
similarity index 100%
rename from ch3-coop/favicon-16x16.png
rename to ch3-coop/static.files/favicon-16x16-8b506e7a72182f1c.png
diff --git a/ch3-coop/favicon.svg b/ch3-coop/static.files/favicon-2c020d218678b618.svg
similarity index 100%
rename from ch3-coop/favicon.svg
rename to ch3-coop/static.files/favicon-2c020d218678b618.svg
diff --git a/ch3-coop/favicon-32x32.png b/ch3-coop/static.files/favicon-32x32-422f7d1d52889060.png
similarity index 100%
rename from ch3-coop/favicon-32x32.png
rename to ch3-coop/static.files/favicon-32x32-422f7d1d52889060.png
diff --git a/ch3-coop/static.files/main-0b2e2def73e61cbe.js b/ch3-coop/static.files/main-0b2e2def73e61cbe.js
new file mode 100644
index 000000000..a195dccb0
--- /dev/null
+++ b/ch3-coop/static.files/main-0b2e2def73e61cbe.js
@@ -0,0 +1,11 @@
+"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function blurHandler(event,parentElem,hideCallback){if(!parentElem.contains(document.activeElement)&&!parentElem.contains(event.relatedTarget)){hideCallback()}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileTopbar=document.querySelector(".mobile-topbar");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileTopbar){const mobileTitle=document.createElement("h2");mobileTitle.className="location";if(hasClass(document.querySelector(".rustdoc"),"crate")){mobileTitle.innerText=`Crate ${window.currentCrate}`}else if(locationTitle){mobileTitle.innerHTML=locationTitle.innerHTML}mobileTopbar.appendChild(mobileTitle)}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url){const script=document.createElement("script");script.src=url;document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=").map(x=>x.replace(/\+/g," "));params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"));loadScript(resourcePath("search-index",".js"))}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px")}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!e.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.contains(event.relatedTarget)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(event.relatedTarget)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \
+the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \
+ restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \
+ enum, trait, type, macro, \
+ and const.","Search functions by type signature (e.g., vec -> usize or \
+ -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \
+ your request: \"string\"","Look for functions that accept or return \
+ slices and \
+ arrays by writing \
+ square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
`}}return output}function buildSettingsPage(){const theme_names=getVar("themes").split(",").filter(t=>t);theme_names.push("light","dark","ayu");const settings=[{"name":"Theme","js_name":"theme","default":"system preference","options":theme_names.concat("system preference"),},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":theme_names,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":theme_names,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Hide persistent navigation bar","js_name":"hide-sidebar","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";if(!isSettingsPage){el.className="popover"}el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display="";onEachLazy(settingsMenu.querySelectorAll("input[type='checkbox']"),el=>{const val=getSettingValue(el.id);const checked=val==="true";if(checked!==el.checked&&val!==null){el.checked=checked}})}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=event=>{event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=event=>{if(settingsMenu.contains(event.target)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hideAllModals();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})()
\ No newline at end of file
diff --git a/ch3-coop/static.files/src-script-e66d777a5a92e9b2.js b/ch3-coop/static.files/src-script-e66d777a5a92e9b2.js
new file mode 100644
index 000000000..d0aebb851
--- /dev/null
+++ b/ch3-coop/static.files/src-script-e66d777a5a92e9b2.js
@@ -0,0 +1 @@
+"use strict";(function(){const rootPath=getVar("root-path");const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;const RUSTDOC_MOBILE_BREAKPOINT=700;function closeSidebarIfMobile(){if(window.innerWidth{removeClass(document.documentElement,"src-sidebar-expanded");updateLocalStorage("source-sidebar-show","false")};window.rustdocShowSourceSidebar=()=>{addClass(document.documentElement,"src-sidebar-expanded");updateLocalStorage("source-sidebar-show","true")};window.rustdocToggleSrcSidebar=()=>{if(document.documentElement.classList.contains("src-sidebar-expanded")){window.rustdocCloseSourceSidebar()}else{window.rustdocShowSourceSidebar()}};function createSrcSidebar(){const container=document.querySelector("nav.sidebar");const sidebar=document.createElement("div");sidebar.id="src-sidebar";let hasFoundFile=false;for(const[key,source]of srcIndex){source[NAME_OFFSET]=key;hasFoundFile=createDirEntry(source,sidebar,"",hasFoundFile)}container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}function highlightSrcLines(){const match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("a"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSrcHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSrcLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)||ev.ctrlKey||ev.altKey||ev.metaKey){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",highlightSrcLines);onEachLazy(document.getElementsByClassName("src-line-numbers"),el=>{el.addEventListener("click",handleSrcHighlight)});highlightSrcLines();window.createSrcSidebar=createSrcSidebar})()
\ No newline at end of file
diff --git a/ch3-coop/static.files/storage-f2adc0d6ca4d09fb.js b/ch3-coop/static.files/storage-f2adc0d6ca4d09fb.js
new file mode 100644
index 000000000..17233608a
--- /dev/null
+++ b/ch3-coop/static.files/storage-f2adc0d6ca4d09fb.js
@@ -0,0 +1 @@
+"use strict";const builtinThemes=["light","dark","ayu"];const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func){for(const elem of arr){if(func(elem)){return true}}return false}function onEachLazy(lazyArray,func){return onEach(Array.prototype.slice.call(lazyArray),func)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}const getVar=(function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+newThemeName+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}if(getSettingValue("hide-sidebar")==="true"){addClass(document.documentElement,"hide-sidebar")}function updateSidebarWidth(){const desktopSidebarWidth=getSettingValue("desktop-sidebar-width");if(desktopSidebarWidth&&desktopSidebarWidth!=="null"){document.documentElement.style.setProperty("--desktop-sidebar-width",desktopSidebarWidth+"px")}const srcSidebarWidth=getSettingValue("src-sidebar-width");if(srcSidebarWidth&&srcSidebarWidth!=="null"){document.documentElement.style.setProperty("--src-sidebar-width",srcSidebarWidth+"px")}}updateSidebarWidth();window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0);setTimeout(updateSidebarWidth,0)}})
\ No newline at end of file
diff --git a/ch3-coop/static.files/wheel-7b819b6101059cd0.svg b/ch3-coop/static.files/wheel-7b819b6101059cd0.svg
new file mode 100644
index 000000000..83c07f63d
--- /dev/null
+++ b/ch3-coop/static.files/wheel-7b819b6101059cd0.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/ch3-coop/storage.js b/ch3-coop/storage.js
deleted file mode 100644
index 07f8962f0..000000000
--- a/ch3-coop/storage.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");window.RUSTDOC_MOBILE_BREAKPOINT=701;const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}const dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current!==null){return current}if(settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return null}const localStoredTheme=getSettingValue("theme");const savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){if(reversed){const length=arr.length;for(let i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(const elem of arr){if(func(elem)){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}function switchTheme(styleElem,mainStyleElem,newTheme,saveTheme){const newHref=mainStyleElem.href.replace(/\/rustdoc([^/]*)\.css/,"/"+newTheme+"$1"+".css");if(saveTheme){updateLocalStorage("theme",newTheme)}if(styleElem.href===newHref){return}let found=false;if(savedHref.length===0){onEachLazy(document.getElementsByTagName("link"),el=>{savedHref.push(el.href)})}onEach(savedHref,el=>{if(el===newHref){found=true;return true}});if(found){styleElem.href=newHref}}function useSystemTheme(value){if(value===undefined){value=true}updateLocalStorage("use-system-theme",value);const toggle=document.getElementById("use-system-theme");if(toggle&&toggle instanceof HTMLInputElement){toggle.checked=value}}const updateSystemTheme=(function(){if(!window.matchMedia){return()=>{const cssTheme=getComputedStyle(document.documentElement).getPropertyValue("content");switchTheme(window.currentTheme,window.mainTheme,JSON.parse(cssTheme)||"light",true)}}const mql=window.matchMedia("(prefers-color-scheme: dark)");function handlePreferenceChange(mql){const use=theme=>{switchTheme(window.currentTheme,window.mainTheme,theme,true)};if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";if(mql.matches){use(darkTheme)}else{use(lightTheme)}}else{use(getSettingValue("theme"))}}mql.addListener(handlePreferenceChange);return()=>{handlePreferenceChange(mql)}})();function switchToSavedTheme(){switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)}if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchToSavedTheme()}if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"source-sidebar-expanded")}window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(switchToSavedTheme,0)}})
\ No newline at end of file
diff --git a/ch3-coop/toggle-minus.svg b/ch3-coop/toggle-minus.svg
deleted file mode 100644
index 73154788a..000000000
--- a/ch3-coop/toggle-minus.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/ch3-coop/toggle-plus.svg b/ch3-coop/toggle-plus.svg
deleted file mode 100644
index 08b17033e..000000000
--- a/ch3-coop/toggle-plus.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/ch3-coop/trait.impl/core/clone/trait.Clone.js b/ch3-coop/trait.impl/core/clone/trait.Clone.js
new file mode 100644
index 000000000..d3f708245
--- /dev/null
+++ b/ch3-coop/trait.impl/core/clone/trait.Clone.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl Clone for TaskStatus"],["impl Clone for TaskContext"],["impl Clone for UserStack"],["impl Clone for TaskControlBlock"],["impl Clone for KernelStack"]]
+};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/ch3-coop/trait.impl/core/cmp/trait.PartialEq.js b/ch3-coop/trait.impl/core/cmp/trait.PartialEq.js
new file mode 100644
index 000000000..37a1eaf15
--- /dev/null
+++ b/ch3-coop/trait.impl/core/cmp/trait.PartialEq.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl PartialEq for TaskStatus"]]
+};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/ch3-coop/trait.impl/core/fmt/trait.Write.js b/ch3-coop/trait.impl/core/fmt/trait.Write.js
new file mode 100644
index 000000000..d9d7c42d7
--- /dev/null
+++ b/ch3-coop/trait.impl/core/fmt/trait.Write.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl Write for Stdout"]]
+};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/ch3-coop/trait.impl/core/marker/trait.Copy.js b/ch3-coop/trait.impl/core/marker/trait.Copy.js
new file mode 100644
index 000000000..6f59140d2
--- /dev/null
+++ b/ch3-coop/trait.impl/core/marker/trait.Copy.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl Copy for TaskContext"],["impl Copy for UserStack"],["impl Copy for TaskStatus"],["impl Copy for TaskControlBlock"],["impl Copy for KernelStack"]]
+};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/ch3-coop/trait.impl/core/marker/trait.Freeze.js b/ch3-coop/trait.impl/core/marker/trait.Freeze.js
new file mode 100644
index 000000000..54f827061
--- /dev/null
+++ b/ch3-coop/trait.impl/core/marker/trait.Freeze.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl Freeze for Stdout",1,["os::console::Stdout"]],["impl Freeze for KernelStack",1,["os::loader::KernelStack"]],["impl Freeze for UserStack",1,["os::loader::UserStack"]],["impl<T> !Freeze for UPSafeCell<T>",1,["os::sync::up::UPSafeCell"]],["impl Freeze for TaskContext",1,["os::task::context::TaskContext"]],["impl Freeze for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Freeze for TaskStatus",1,["os::task::task::TaskStatus"]],["impl !Freeze for TaskManager",1,["os::task::TaskManager"]],["impl Freeze for TaskManagerInner",1,["os::task::TaskManagerInner"]],["impl Freeze for TASK_MANAGER",1,["os::task::TASK_MANAGER"]],["impl Freeze for TrapContext",1,["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-coop/trait.impl/core/marker/trait.Send.js b/ch3-coop/trait.impl/core/marker/trait.Send.js
new file mode 100644
index 000000000..4ddd846f2
--- /dev/null
+++ b/ch3-coop/trait.impl/core/marker/trait.Send.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl Send for Stdout",1,["os::console::Stdout"]],["impl Send for KernelStack",1,["os::loader::KernelStack"]],["impl Send for UserStack",1,["os::loader::UserStack"]],["impl<T> Send for UPSafeCell<T>
",1,["os::sync::up::UPSafeCell"]],["impl Send for TaskContext",1,["os::task::context::TaskContext"]],["impl Send for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Send for TaskStatus",1,["os::task::task::TaskStatus"]],["impl Send for TaskManager",1,["os::task::TaskManager"]],["impl Send for TaskManagerInner",1,["os::task::TaskManagerInner"]],["impl Send for TASK_MANAGER",1,["os::task::TASK_MANAGER"]],["impl Send for TrapContext",1,["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-coop/trait.impl/core/marker/trait.StructuralPartialEq.js b/ch3-coop/trait.impl/core/marker/trait.StructuralPartialEq.js
new file mode 100644
index 000000000..56a32e1b0
--- /dev/null
+++ b/ch3-coop/trait.impl/core/marker/trait.StructuralPartialEq.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl StructuralPartialEq for TaskStatus"]]
+};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/ch3-coop/trait.impl/core/marker/trait.Sync.js b/ch3-coop/trait.impl/core/marker/trait.Sync.js
new file mode 100644
index 000000000..226348ee8
--- /dev/null
+++ b/ch3-coop/trait.impl/core/marker/trait.Sync.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl Sync for Stdout",1,["os::console::Stdout"]],["impl Sync for KernelStack",1,["os::loader::KernelStack"]],["impl Sync for UserStack",1,["os::loader::UserStack"]],["impl Sync for TaskContext",1,["os::task::context::TaskContext"]],["impl Sync for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Sync for TaskStatus",1,["os::task::task::TaskStatus"]],["impl Sync for TaskManager",1,["os::task::TaskManager"]],["impl Sync for TaskManagerInner",1,["os::task::TaskManagerInner"]],["impl Sync for TASK_MANAGER",1,["os::task::TASK_MANAGER"]],["impl Sync for TrapContext",1,["os::trap::context::TrapContext"]],["impl<T> Sync for UPSafeCell<T>"]]
+};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/ch3-coop/trait.impl/core/marker/trait.Unpin.js b/ch3-coop/trait.impl/core/marker/trait.Unpin.js
new file mode 100644
index 000000000..ddcf85ca9
--- /dev/null
+++ b/ch3-coop/trait.impl/core/marker/trait.Unpin.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl Unpin for Stdout",1,["os::console::Stdout"]],["impl Unpin for KernelStack",1,["os::loader::KernelStack"]],["impl Unpin for UserStack",1,["os::loader::UserStack"]],["impl<T> Unpin for UPSafeCell<T>
",1,["os::sync::up::UPSafeCell"]],["impl Unpin for TaskContext",1,["os::task::context::TaskContext"]],["impl Unpin for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Unpin for TaskStatus",1,["os::task::task::TaskStatus"]],["impl Unpin for TaskManager",1,["os::task::TaskManager"]],["impl Unpin for TaskManagerInner",1,["os::task::TaskManagerInner"]],["impl Unpin for TASK_MANAGER",1,["os::task::TASK_MANAGER"]],["impl Unpin for TrapContext",1,["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-coop/trait.impl/core/ops/deref/trait.Deref.js b/ch3-coop/trait.impl/core/ops/deref/trait.Deref.js
new file mode 100644
index 000000000..6b7d5ffc9
--- /dev/null
+++ b/ch3-coop/trait.impl/core/ops/deref/trait.Deref.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl Deref for TASK_MANAGER"]]
+};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/ch3-coop/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/ch3-coop/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js
new file mode 100644
index 000000000..27ce2d6ba
--- /dev/null
+++ b/ch3-coop/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl RefUnwindSafe for Stdout",1,["os::console::Stdout"]],["impl RefUnwindSafe for KernelStack",1,["os::loader::KernelStack"]],["impl RefUnwindSafe for UserStack",1,["os::loader::UserStack"]],["impl<T> !RefUnwindSafe for UPSafeCell<T>",1,["os::sync::up::UPSafeCell"]],["impl RefUnwindSafe for TaskContext",1,["os::task::context::TaskContext"]],["impl RefUnwindSafe for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl RefUnwindSafe for TaskStatus",1,["os::task::task::TaskStatus"]],["impl !RefUnwindSafe for TaskManager",1,["os::task::TaskManager"]],["impl RefUnwindSafe for TaskManagerInner",1,["os::task::TaskManagerInner"]],["impl RefUnwindSafe for TASK_MANAGER",1,["os::task::TASK_MANAGER"]],["impl RefUnwindSafe for TrapContext",1,["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-coop/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/ch3-coop/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js
new file mode 100644
index 000000000..022339d92
--- /dev/null
+++ b/ch3-coop/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl UnwindSafe for Stdout",1,["os::console::Stdout"]],["impl UnwindSafe for KernelStack",1,["os::loader::KernelStack"]],["impl UnwindSafe for UserStack",1,["os::loader::UserStack"]],["impl<T> UnwindSafe for UPSafeCell<T>
",1,["os::sync::up::UPSafeCell"]],["impl UnwindSafe for TaskContext",1,["os::task::context::TaskContext"]],["impl UnwindSafe for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl UnwindSafe for TaskStatus",1,["os::task::task::TaskStatus"]],["impl UnwindSafe for TaskManager",1,["os::task::TaskManager"]],["impl UnwindSafe for TaskManagerInner",1,["os::task::TaskManagerInner"]],["impl UnwindSafe for TASK_MANAGER",1,["os::task::TASK_MANAGER"]],["impl UnwindSafe for TrapContext",1,["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-coop/trait.impl/lazy_static/trait.LazyStatic.js b/ch3-coop/trait.impl/lazy_static/trait.LazyStatic.js
new file mode 100644
index 000000000..abeb86103
--- /dev/null
+++ b/ch3-coop/trait.impl/lazy_static/trait.LazyStatic.js
@@ -0,0 +1,3 @@
+(function() {var implementors = {
+"os":[["impl LazyStatic for TASK_MANAGER"]]
+};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/ch3-coop/wheel.svg b/ch3-coop/wheel.svg
deleted file mode 100644
index 01da3b24c..000000000
--- a/ch3-coop/wheel.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file