This commit is contained in:
chyyuu 2022-05-20 01:03:01 +00:00
parent 9a52c0f148
commit e88c823020
21 changed files with 52 additions and 62 deletions

View File

@ -4,6 +4,6 @@
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In os::mm</a></h2><div id="sidebar-vars" data-name="init" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../os/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">mm</a>::<wbr><a class="fn" href="#">init</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/mm/mod.rs.html#25-29">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn init()</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>initiate heap allocator, frame allocator and kernel space</p>
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">mm</a>::<wbr><a class="fn" href="#">init</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/mm/mod.rs.html#24-28">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn init()</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>initiate heap allocator, frame allocator and kernel space</p>
</div></details></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
</body></html>

View File

@ -1,10 +1,10 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Implementation of [`FrameAllocator`] which controls all the frames in the operating system."><meta name="keywords" content="rust, rustlang, rust-lang, frame_allocator"><title>os::mm::frame_allocator - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Implementation of [`FrameAllocator`] which controls all the frames in the operating system."><meta name="keywords" content="rust, rustlang, rust-lang, frame_allocator"><title>os::mm::frame_allocator - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
</a><h2 class="location"></h2>
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
</a><h2 class="location"><a href="#">Module frame_allocator</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div></section><div id="sidebar-vars" data-name="frame_allocator" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../os/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">os</a>::<wbr><a href="../index.html">mm</a>::<wbr><a class="mod" href="#">frame_allocator</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/mm/frame_allocator.rs.html#1-136">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implementation of <a href="trait.FrameAllocator.html" title="FrameAllocator"><code>FrameAllocator</code></a> which
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">os</a>::<wbr><a href="../index.html">mm</a>::<wbr><a class="mod" href="#">frame_allocator</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/mm/frame_allocator.rs.html#1-136">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implementation of <a href="trait.FrameAllocator.html" title="FrameAllocator"><code>FrameAllocator</code></a> which
controls all the frames in the operating system.</p>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FRAME_ALLOCATOR.html" title="os::mm::frame_allocator::FRAME_ALLOCATOR struct">FRAME_ALLOCATOR</a></div><div class="item-right docblock-short"><p>frame allocator instance through lazy_static!</p>

View File

@ -4,7 +4,7 @@
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
</a><h2 class="location"><a href="#">Module mm</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#modules">Modules</a></li><li><a href="#functions">Functions</a></li></ul></div></section><div id="sidebar-vars" data-name="mm" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../os/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">os</a>::<wbr><a class="mod" href="#">mm</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/mm/mod.rs.html#1-29">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Memory management implementation</p>
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">os</a>::<wbr><a class="mod" href="#">mm</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/mm/mod.rs.html#1-28">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Memory management implementation</p>
<p>SV39 page-based virtual-memory architecture for RV64 systems, and
everything about memory management, like frame allocator, page table,
map area and memory set, is implemented here.</p>
@ -12,7 +12,7 @@ map area and memory set, is implemented here.</p>
</div></details><h2 id="reexports" class="small-section-header"><a href="#reexports">Re-exports</a></h2>
<div class="item-table"><div class="item-row"><div class="item-left import-item"><code>pub use address::<a class="struct" href="address/struct.PhysAddr.html" title="struct os::mm::address::PhysAddr">PhysAddr</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use address::<a class="struct" href="address/struct.PhysPageNum.html" title="struct os::mm::address::PhysPageNum">PhysPageNum</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use address::<a class="struct" href="address/struct.VirtAddr.html" title="struct os::mm::address::VirtAddr">VirtAddr</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use address::<a class="struct" href="address/struct.VirtPageNum.html" title="struct os::mm::address::VirtPageNum">VirtPageNum</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use frame_allocator::<a class="fn" href="frame_allocator/fn.frame_alloc.html" title="fn os::mm::frame_allocator::frame_alloc">frame_alloc</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use frame_allocator::<a class="struct" href="frame_allocator/struct.FrameTracker.html" title="struct os::mm::frame_allocator::FrameTracker">FrameTracker</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use memory_set::<a class="fn" href="memory_set/fn.remap_test.html" title="fn os::mm::memory_set::remap_test">remap_test</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use memory_set::<a class="struct" href="memory_set/struct.MapPermission.html" title="struct os::mm::memory_set::MapPermission">MapPermission</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use memory_set::<a class="struct" href="memory_set/struct.MemorySet.html" title="struct os::mm::memory_set::MemorySet">MemorySet</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use memory_set::<a class="struct" href="memory_set/struct.KERNEL_SPACE.html" title="struct os::mm::memory_set::KERNEL_SPACE">KERNEL_SPACE</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use memory_set::KERNEL_SPACE;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use page_table::<a class="fn" href="page_table/fn.translated_byte_buffer.html" title="fn os::mm::page_table::translated_byte_buffer">translated_byte_buffer</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use page_table::<a class="struct" href="page_table/struct.PageTableEntry.html" title="struct os::mm::page_table::PageTableEntry">PageTableEntry</a>;</code></div><div class="item-right docblock-short"></div></div></div><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2>
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="address/index.html" title="os::mm::address mod">address</a><span title="Restricted Visibility">&nbsp;🔒</span> </div><div class="item-right docblock-short"><p>Implementation of physical and virtual address and page number.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="frame_allocator/index.html" title="os::mm::frame_allocator mod">frame_allocator</a><span title="Restricted Visibility">&nbsp;🔒</span> </div><div class="item-right docblock-short"><p>Implementation of <a href="frame_allocator/trait.FrameAllocator.html" title="FrameAllocator"><code>FrameAllocator</code></a> which
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="frame_allocator/index.html" title="os::mm::frame_allocator mod">frame_allocator</a><span title="Restricted Visibility">&nbsp;🔒</span> </div><div class="item-right docblock-short"><p>Implementation of <a href="frame_allocator/trait.FrameAllocator.html" title="FrameAllocator"><code>FrameAllocator</code></a> which
controls all the frames in the operating system.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="heap_allocator/index.html" title="os::mm::heap_allocator mod">heap_allocator</a><span title="Restricted Visibility">&nbsp;🔒</span> </div><div class="item-right docblock-short"><p>The global allocator</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="memory_set/index.html" title="os::mm::memory_set mod">memory_set</a><span title="Restricted Visibility">&nbsp;🔒</span> </div><div class="item-right docblock-short"><p>Implementation of <a href="memory_set/struct.MapArea.html" title="MapArea"><code>MapArea</code></a> and <a href="memory_set/struct.MemorySet.html" title="MemorySet"><code>MemorySet</code></a>.</p>

View File

@ -4,5 +4,5 @@
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In os::mm::memory_set</a></h2><div id="sidebar-vars" data-name="remap_test" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../os/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Function <a href="../../index.html">os</a>::<wbr><a href="../index.html">mm</a>::<wbr><a href="index.html">memory_set</a>::<wbr><a class="fn" href="#">remap_test</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/mm/memory_set.rs.html#322-349">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn remap_test()</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
<h1 class="fqn"><span class="in-band">Function <a href="../../index.html">os</a>::<wbr><a href="../index.html">mm</a>::<wbr><a href="index.html">memory_set</a>::<wbr><a class="fn" href="#">remap_test</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/mm/memory_set.rs.html#322-343">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn remap_test()</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
</body></html>

View File

@ -4,7 +4,7 @@
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
</a><h2 class="location"><a href="#">Module memory_set</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#functions">Functions</a></li></ul></div></section><div id="sidebar-vars" data-name="memory_set" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../os/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">os</a>::<wbr><a href="../index.html">mm</a>::<wbr><a class="mod" href="#">memory_set</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/mm/memory_set.rs.html#1-349">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implementation of <a href="struct.MapArea.html" title="MapArea"><code>MapArea</code></a> and <a href="struct.MemorySet.html" title="MemorySet"><code>MemorySet</code></a>.</p>
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">os</a>::<wbr><a href="../index.html">mm</a>::<wbr><a class="mod" href="#">memory_set</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/mm/memory_set.rs.html#1-343">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implementation of <a href="struct.MapArea.html" title="MapArea"><code>MapArea</code></a> and <a href="struct.MemorySet.html" title="MemorySet"><code>MemorySet</code></a>.</p>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.KERNEL_SPACE.html" title="os::mm::memory_set::KERNEL_SPACE struct">KERNEL_SPACE</a></div><div class="item-right docblock-short"><p>a memory set instance through lazy_static! managing kernel space</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MapArea.html" title="os::mm::memory_set::MapArea struct">MapArea</a></div><div class="item-right docblock-short"><p>map area structure, controls a contiguous piece of virtual memory</p>

View File

@ -1 +1 @@
initSidebarItems({"fn":[["init","initiate heap allocator, frame allocator and kernel space"]],"mod":[["address","Implementation of physical and virtual address and page number."],["frame_allocator","Implementation of [`FrameAllocator`] which controls all the frames in the operating system."],["heap_allocator","The global allocator"],["memory_set","Implementation of [`MapArea`] and [`MemorySet`]."],["page_table","Implementation of [`PageTableEntry`] and [`PageTable`]."]]});
initSidebarItems({"fn":[["init","initiate heap allocator, frame allocator and kernel space"]],"mod":[["address","Implementation of physical and virtual address and page number."],["frame_allocator","Implementation of [`FrameAllocator`] which controls all the frames in the operating system."],["heap_allocator","The global allocator"],["memory_set","Implementation of [`MapArea`] and [`MemorySet`]."],["page_table","Implementation of [`PageTableEntry`] and [`PageTable`]."]]});

View File

@ -1,9 +1,9 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="get current time "><meta name="keywords" content="rust, rustlang, rust-lang, sys_get_time"><title>sys_get_time in os::syscall::process - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="get current time"><meta name="keywords" content="rust, rustlang, rust-lang, sys_get_time"><title>sys_get_time in os::syscall::process - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
</a><h2 class="location"></h2>
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In os::syscall::process</a></h2><div id="sidebar-vars" data-name="sys_get_time" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../os/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Function <a href="../../index.html">os</a>::<wbr><a href="../index.html">syscall</a>::<wbr><a href="index.html">process</a>::<wbr><a class="fn" href="#">sys_get_time</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/syscall/process.rs.html#20-22">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn sys_get_time() -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.isize.html">isize</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>get current time </p>
<h1 class="fqn"><span class="in-band">Function <a href="../../index.html">os</a>::<wbr><a href="../index.html">syscall</a>::<wbr><a href="index.html">process</a>::<wbr><a class="fn" href="#">sys_get_time</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/syscall/process.rs.html#20-22">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn sys_get_time() -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.isize.html">isize</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>get current time</p>
</div></details></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
</body></html>

View File

@ -7,7 +7,7 @@
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">os</a>::<wbr><a href="../index.html">syscall</a>::<wbr><a class="mod" href="#">process</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/syscall/process.rs.html#1-22">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Process management syscalls</p>
</div></details><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2>
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.sys_exit.html" title="os::syscall::process::sys_exit fn">sys_exit</a></div><div class="item-right docblock-short"><p>task exits and submit an exit code</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.sys_get_time.html" title="os::syscall::process::sys_get_time fn">sys_get_time</a></div><div class="item-right docblock-short"><p>get current time </p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.sys_get_time.html" title="os::syscall::process::sys_get_time fn">sys_get_time</a></div><div class="item-right docblock-short"><p>get current time</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.sys_yield.html" title="os::syscall::process::sys_yield fn">sys_yield</a></div><div class="item-right docblock-short"><p>current task gives up resources for other tasks</p>
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
</body></html>

View File

@ -1 +1 @@
initSidebarItems({"fn":[["sys_exit","task exits and submit an exit code"],["sys_get_time","get current time "],["sys_yield","current task gives up resources for other tasks"]]});
initSidebarItems({"fn":[["sys_exit","task exits and submit an exit code"],["sys_get_time","get current time"],["sys_yield","current task gives up resources for other tasks"]]});

View File

@ -1,11 +1,11 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Unimplement: traps/interrupts/exceptions from kernel mode Todo: Chapter 9: I/O device "><meta name="keywords" content="rust, rustlang, rust-lang, trap_from_kernel"><title>trap_from_kernel in os::trap - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Unimplement: traps/interrupts/exceptions from kernel mode Todo: Chapter 9: I/O device"><meta name="keywords" content="rust, rustlang, rust-lang, trap_from_kernel"><title>trap_from_kernel in os::trap - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
</a><h2 class="location"></h2>
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In os::trap</a></h2><div id="sidebar-vars" data-name="trap_from_kernel" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../os/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_from_kernel</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/trap/mod.rs.html#119-121">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_from_kernel</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/trap/mod.rs.html#121-123">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
pub fn trap_from_kernel() -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.never.html">!</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Unimplement: traps/interrupts/exceptions from kernel mode
Todo: Chapter 9: I/O device </p>
Todo: Chapter 9: I/O device</p>
</div></details></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
</body></html>

View File

@ -4,7 +4,7 @@
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In os::trap</a></h2><div id="sidebar-vars" data-name="trap_handler" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../os/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_handler</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/trap/mod.rs.html#57-89">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_handler</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/trap/mod.rs.html#57-91">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
pub fn trap_handler() -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.never.html">!</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>handle an interrupt, exception, or system call from user space</p>
</div></details></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
</body></html>

View File

@ -4,7 +4,7 @@
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In os::trap</a></h2><div id="sidebar-vars" data-name="trap_return" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../os/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_return</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/trap/mod.rs.html#95-114">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_return</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/trap/mod.rs.html#97-116">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
pub fn trap_return() -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.never.html">!</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>set the new addr of __restore asm function in TRAMPOLINE page,
set the reg a0 = trap_cx_ptr, reg a1 = phy addr of usr page table,
finally, jump to new addr of __restore asm function</p>

View File

@ -4,7 +4,7 @@
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
</a><h2 class="location"><a href="#">Module trap</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div></section><div id="sidebar-vars" data-name="trap" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../os/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">os</a>::<wbr><a class="mod" href="#">trap</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/trap/mod.rs.html#1-123">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trap handling functionality</p>
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">os</a>::<wbr><a class="mod" href="#">trap</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/trap/mod.rs.html#1-125">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trap handling functionality</p>
<p>For rCore, we have a single trap entry point, namely <code>__alltraps</code>. At
initialization in <a href="fn.init.html" title="init()"><code>init()</code></a>, we set the <code>stvec</code> CSR to point to it.</p>
<p>All traps go through <code>__alltraps</code>, which is defined in <code>trap.S</code>. The
@ -22,7 +22,7 @@ to <a href="../syscall/fn.syscall.html" title="syscall()"><code>syscall()</code>
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.enable_timer_interrupt.html" title="os::trap::enable_timer_interrupt fn">enable_timer_interrupt</a></div><div class="item-right docblock-short"><p>enable timer interrupt in sie CSR</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.init.html" title="os::trap::init fn">init</a></div><div class="item-right docblock-short"><p>initialize CSR <code>stvec</code> as the entry of <code>__alltraps</code></p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.set_kernel_trap_entry.html" title="os::trap::set_kernel_trap_entry fn">set_kernel_trap_entry</a><span title="Restricted Visibility">&nbsp;🔒</span> </div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.set_user_trap_entry.html" title="os::trap::set_user_trap_entry fn">set_user_trap_entry</a><span title="Restricted Visibility">&nbsp;🔒</span> </div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.trap_from_kernel.html" title="os::trap::trap_from_kernel fn">trap_from_kernel</a></div><div class="item-right docblock-short"><p>Unimplement: traps/interrupts/exceptions from kernel mode
Todo: Chapter 9: I/O device </p>
Todo: Chapter 9: I/O device</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.trap_handler.html" title="os::trap::trap_handler fn">trap_handler</a></div><div class="item-right docblock-short"><p>handle an interrupt, exception, or system call from user space</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.trap_return.html" title="os::trap::trap_return fn">trap_return</a></div><div class="item-right docblock-short"><p>set the new addr of __restore asm function in TRAMPOLINE page,
set the reg a0 = trap_cx_ptr, reg a1 = phy addr of usr page table,

View File

@ -1 +1 @@
initSidebarItems({"fn":[["enable_timer_interrupt","enable timer interrupt in sie CSR"],["init","initialize CSR `stvec` as the entry of `__alltraps`"],["set_kernel_trap_entry",""],["set_user_trap_entry",""],["trap_from_kernel","Unimplement: traps/interrupts/exceptions from kernel mode Todo: Chapter 9: I/O device "],["trap_handler","handle an interrupt, exception, or system call from user space"],["trap_return","set the new addr of __restore asm function in TRAMPOLINE page, set the reg a0 = trap_cx_ptr, reg a1 = phy addr of usr page table, finally, jump to new addr of __restore asm function"]],"mod":[["context","Implementation of [`TrapContext`]"]],"struct":[["TrapContext","trap context structure containing sstatus, sepc and registers"]]});
initSidebarItems({"fn":[["enable_timer_interrupt","enable timer interrupt in sie CSR"],["init","initialize CSR `stvec` as the entry of `__alltraps`"],["set_kernel_trap_entry",""],["set_user_trap_entry",""],["trap_from_kernel","Unimplement: traps/interrupts/exceptions from kernel mode Todo: Chapter 9: I/O device"],["trap_handler","handle an interrupt, exception, or system call from user space"],["trap_return","set the new addr of __restore asm function in TRAMPOLINE page, set the reg a0 = trap_cx_ptr, reg a1 = phy addr of usr page table, finally, jump to new addr of __restore asm function"]],"mod":[["context","Implementation of [`TrapContext`]"]],"struct":[["TrapContext","trap context structure containing sstatus, sepc and registers"]]});

File diff suppressed because one or more lines are too long

View File

@ -139,7 +139,7 @@
<span id="134">134</span>
<span id="135">135</span>
<span id="136">136</span>
</pre><pre class="rust"><code><span class="doccomment">//! Implementation of [`FrameAllocator`] which </span>
</pre><pre class="rust"><code><span class="doccomment">//! Implementation of [`FrameAllocator`] which</span>
<span class="doccomment">//! controls all the frames in the operating system.</span>
<span class="kw">use</span> <span class="kw">super</span>::{<span class="ident">PhysAddr</span>, <span class="ident">PhysPageNum</span>};

View File

@ -346,12 +346,6 @@
<span id="341">341</span>
<span id="342">342</span>
<span id="343">343</span>
<span id="344">344</span>
<span id="345">345</span>
<span id="346">346</span>
<span id="347">347</span>
<span id="348">348</span>
<span id="349">349</span>
</pre><pre class="rust"><code><span class="doccomment">//! Implementation of [`MapArea`] and [`MemorySet`].</span>
<span class="kw">use</span> <span class="kw">super</span>::{<span class="ident">frame_alloc</span>, <span class="ident">FrameTracker</span>};
@ -381,7 +375,7 @@
}
<span class="macro">lazy_static!</span> {
<span class="doccomment">/// a memory set instance through lazy_static! managing kernel space</span>
<span class="doccomment">/// a memory set instance through lazy_static! managing kernel space</span>
<span class="kw">pub</span> <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">KERNEL_SPACE</span>: <span class="ident">Arc</span><span class="op">&lt;</span><span class="ident">UPSafeCell</span><span class="op">&lt;</span><span class="ident">MemorySet</span><span class="op">&gt;</span><span class="op">&gt;</span> <span class="op">=</span>
<span class="ident">Arc::new</span>(<span class="kw">unsafe</span> { <span class="ident">UPSafeCell::new</span>(<span class="ident">MemorySet::new_kernel</span>()) });
}
@ -678,27 +672,21 @@
<span class="kw">let</span> <span class="ident">mid_text</span>: <span class="ident">VirtAddr</span> <span class="op">=</span> ((<span class="ident">stext</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">+</span> <span class="ident">etext</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op">/</span> <span class="number">2</span>).<span class="ident">into</span>();
<span class="kw">let</span> <span class="ident">mid_rodata</span>: <span class="ident">VirtAddr</span> <span class="op">=</span> ((<span class="ident">srodata</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">+</span> <span class="ident">erodata</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op">/</span> <span class="number">2</span>).<span class="ident">into</span>();
<span class="kw">let</span> <span class="ident">mid_data</span>: <span class="ident">VirtAddr</span> <span class="op">=</span> ((<span class="ident">sdata</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">+</span> <span class="ident">edata</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op">/</span> <span class="number">2</span>).<span class="ident">into</span>();
<span class="macro">assert!</span>(
<span class="op">!</span><span class="ident">kernel_space</span>
.<span class="ident">page_table</span>
.<span class="ident">translate</span>(<span class="ident">mid_text</span>.<span class="ident">floor</span>())
.<span class="ident">unwrap</span>()
.<span class="ident">writable</span>(),
);
<span class="macro">assert!</span>(
<span class="op">!</span><span class="ident">kernel_space</span>
.<span class="ident">page_table</span>
.<span class="ident">translate</span>(<span class="ident">mid_rodata</span>.<span class="ident">floor</span>())
.<span class="ident">unwrap</span>()
.<span class="ident">writable</span>(),
);
<span class="macro">assert!</span>(
<span class="op">!</span><span class="ident">kernel_space</span>
.<span class="ident">page_table</span>
.<span class="ident">translate</span>(<span class="ident">mid_data</span>.<span class="ident">floor</span>())
.<span class="ident">unwrap</span>()
.<span class="ident">executable</span>(),
);
<span class="macro">assert!</span>(<span class="op">!</span><span class="ident">kernel_space</span>
.<span class="ident">page_table</span>
.<span class="ident">translate</span>(<span class="ident">mid_text</span>.<span class="ident">floor</span>())
.<span class="ident">unwrap</span>()
.<span class="ident">writable</span>(),);
<span class="macro">assert!</span>(<span class="op">!</span><span class="ident">kernel_space</span>
.<span class="ident">page_table</span>
.<span class="ident">translate</span>(<span class="ident">mid_rodata</span>.<span class="ident">floor</span>())
.<span class="ident">unwrap</span>()
.<span class="ident">writable</span>(),);
<span class="macro">assert!</span>(<span class="op">!</span><span class="ident">kernel_space</span>
.<span class="ident">page_table</span>
.<span class="ident">translate</span>(<span class="ident">mid_data</span>.<span class="ident">floor</span>())
.<span class="ident">unwrap</span>()
.<span class="ident">executable</span>(),);
<span class="macro">println!</span>(<span class="string">&quot;remap_test passed!&quot;</span>);
}
</code></pre></div>

View File

@ -31,16 +31,14 @@
<span id="26">26</span>
<span id="27">27</span>
<span id="28">28</span>
<span id="29">29</span>
</pre><pre class="rust"><code><span class="doccomment">//! Memory management implementation</span>
<span class="doccomment">//! </span>
<span class="doccomment">//!</span>
<span class="doccomment">//! SV39 page-based virtual-memory architecture for RV64 systems, and</span>
<span class="doccomment">//! everything about memory management, like frame allocator, page table,</span>
<span class="doccomment">//! map area and memory set, is implemented here.</span>
<span class="doccomment">//! </span>
<span class="doccomment">//!</span>
<span class="doccomment">//! Every task or process has a memory_set to control its virtual memory.</span>
<span class="kw">mod</span> <span class="ident">address</span>;
<span class="kw">mod</span> <span class="ident">frame_allocator</span>;
<span class="kw">mod</span> <span class="ident">heap_allocator</span>;

View File

@ -43,7 +43,7 @@
<span class="number">0</span>
}
<span class="doccomment">/// get current time </span>
<span class="doccomment">/// get current time</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sys_get_time</span>() -&gt; <span class="ident">isize</span> {
<span class="ident">get_time_ms</span>() <span class="kw">as</span> <span class="ident">isize</span>
}

View File

@ -90,10 +90,10 @@
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cx</span> <span class="op">=</span> <span class="self">Self</span> {
<span class="ident">x</span>: [<span class="number">0</span>; <span class="number">32</span>],
<span class="ident">sstatus</span>,
<span class="ident">sepc</span>: <span class="ident">entry</span>, <span class="comment">// entry point of app</span>
<span class="ident">kernel_satp</span>, <span class="comment">// addr of page table</span>
<span class="ident">kernel_sp</span>, <span class="comment">// kernel stack</span>
<span class="ident">trap_handler</span>,<span class="comment">// addr of trap_handler function</span>
<span class="ident">sepc</span>: <span class="ident">entry</span>, <span class="comment">// entry point of app</span>
<span class="ident">kernel_satp</span>, <span class="comment">// addr of page table</span>
<span class="ident">kernel_sp</span>, <span class="comment">// kernel stack</span>
<span class="ident">trap_handler</span>, <span class="comment">// addr of trap_handler function</span>
};
<span class="ident">cx</span>.<span class="ident">set_sp</span>(<span class="ident">sp</span>); <span class="comment">// app&#39;s user stack pointer</span>
<span class="ident">cx</span> <span class="comment">// return initial Trap Context of app</span>

View File

@ -126,6 +126,8 @@
<span id="121">121</span>
<span id="122">122</span>
<span id="123">123</span>
<span id="124">124</span>
<span id="125">125</span>
</pre><pre class="rust"><code><span class="doccomment">//! Trap handling functionality</span>
<span class="doccomment">//!</span>
<span class="doccomment">//! For rCore, we have a single trap entry point, namely `__alltraps`. At</span>
@ -192,8 +194,10 @@
<span class="ident">cx</span>.<span class="ident">sepc</span> <span class="op">+</span><span class="op">=</span> <span class="number">4</span>;
<span class="ident">cx</span>.<span class="ident">x</span>[<span class="number">10</span>] <span class="op">=</span> <span class="ident">syscall</span>(<span class="ident">cx</span>.<span class="ident">x</span>[<span class="number">17</span>], [<span class="ident">cx</span>.<span class="ident">x</span>[<span class="number">10</span>], <span class="ident">cx</span>.<span class="ident">x</span>[<span class="number">11</span>], <span class="ident">cx</span>.<span class="ident">x</span>[<span class="number">12</span>]]) <span class="kw">as</span> <span class="ident">usize</span>;
}
<span class="ident">Trap::Exception</span>(<span class="ident">Exception::StoreFault</span>) <span class="op">|</span> <span class="ident">Trap::Exception</span>(<span class="ident">Exception::StorePageFault</span>) <span class="op">|</span>
<span class="ident">Trap::Exception</span>(<span class="ident">Exception::LoadFault</span>) <span class="op">|</span> <span class="ident">Trap::Exception</span>(<span class="ident">Exception::LoadPageFault</span>) =&gt; {
<span class="ident">Trap::Exception</span>(<span class="ident">Exception::StoreFault</span>)
<span class="op">|</span> <span class="ident">Trap::Exception</span>(<span class="ident">Exception::StorePageFault</span>)
<span class="op">|</span> <span class="ident">Trap::Exception</span>(<span class="ident">Exception::LoadFault</span>)
<span class="op">|</span> <span class="ident">Trap::Exception</span>(<span class="ident">Exception::LoadPageFault</span>) =&gt; {
<span class="macro">println!</span>(<span class="string">&quot;[kernel] PageFault in application, bad addr = {:#x}, bad instruction = {:#x}, kernel killed it.&quot;</span>, <span class="ident">stval</span>, <span class="ident">cx</span>.<span class="ident">sepc</span>);
<span class="ident">exit_current_and_run_next</span>();
}
@ -243,7 +247,7 @@
<span class="attribute">#[<span class="ident">no_mangle</span>]</span>
<span class="doccomment">/// Unimplement: traps/interrupts/exceptions from kernel mode</span>
<span class="doccomment">/// Todo: Chapter 9: I/O device </span>
<span class="doccomment">/// Todo: Chapter 9: I/O device</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">trap_from_kernel</span>() -&gt; <span class="op">!</span> {
<span class="macro">panic!</span>(<span class="string">&quot;a trap from kernel!&quot;</span>);
}