From 504401355f8d885f1b2f33d4df86e25ae9111d7b Mon Sep 17 00:00:00 2001 From: lcy1996 <992195697@qq.com> Date: Tue, 30 Oct 2018 21:50:38 +0800 Subject: [PATCH] Add expr3 report(not finiished. --- crate/memory/src/swap/mod.rs | 1 + docs/OSTrain2018docs-g4/expr3/report.md | 9 +++++++++ kernel/src/memory.rs | 1 - 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 docs/OSTrain2018docs-g4/expr3/report.md diff --git a/crate/memory/src/swap/mod.rs b/crate/memory/src/swap/mod.rs index d568f91..088f9c3 100644 --- a/crate/memory/src/swap/mod.rs +++ b/crate/memory/src/swap/mod.rs @@ -259,6 +259,7 @@ impl SwapExt { ** @retval bool whether swap in happens. */ pub fn page_fault_handler(&mut self, pt: *mut T2, addr: VirtAddr, alloc_frame: impl FnOnce() -> PhysAddr) -> bool { + // now we didn't attach the cow so the present will be false when swapped(), to enable the cow some changes will be needed if !self.page_table.get_entry(addr).swapped() { return false; } diff --git a/docs/OSTrain2018docs-g4/expr3/report.md b/docs/OSTrain2018docs-g4/expr3/report.md new file mode 100644 index 0000000..a1be136 --- /dev/null +++ b/docs/OSTrain2018docs-g4/expr3/report.md @@ -0,0 +1,9 @@ +# Rust OS 教学lab实验的制作 基础功能完善 +## 1 内存管理 +@刘辰屹 +## 2 进程管理 +@陈秋昊 +## 3 同步互斥 +@陈秋昊 +## 4 文件系统 +@朱书聪 \ No newline at end of file diff --git a/kernel/src/memory.rs b/kernel/src/memory.rs index 1badead..23070e9 100644 --- a/kernel/src/memory.rs +++ b/kernel/src/memory.rs @@ -7,7 +7,6 @@ use ucore_memory::{*, paging::PageTable}; use ucore_memory::cow::CowExt; pub use ucore_memory::memory_set::{MemoryArea, MemoryAttr, MemorySet as MemorySet_, Stack}; use ucore_memory::swap::*; -use alloc::collections::VecDeque; use process::processor; pub type MemorySet = MemorySet_;