diff --git a/crate/memory/src/swap/fifo.rs b/crate/memory/src/swap/fifo.rs index 03ab226..80ca368 100644 --- a/crate/memory/src/swap/fifo.rs +++ b/crate/memory/src/swap/fifo.rs @@ -13,12 +13,12 @@ impl SwapManager for FifoSwapManager { fn tick(&mut self) {} fn push(&mut self, frame: Frame) { - debug!("SwapManager push token: {:x?} vaddr: {:x?}", frame.get_token(), frame.get_virtaddr()); + info!("SwapManager push token: {:x?} vaddr: {:x?}", frame.get_token(), frame.get_virtaddr()); self.deque.push_back(frame); } fn remove(&mut self, token: usize, addr: VirtAddr) { - debug!("SwapManager remove token: {:x?} vaddr: {:x?}", token, addr); + info!("SwapManager remove token: {:x?} vaddr: {:x?}", token, addr); let id = self.deque.iter() .position(|ref x| x.get_virtaddr() == addr && x.get_token() == token) .expect("address not found"); diff --git a/crate/memory/src/swap/mod.rs b/crate/memory/src/swap/mod.rs index cd2f09a..19c566e 100644 --- a/crate/memory/src/swap/mod.rs +++ b/crate/memory/src/swap/mod.rs @@ -113,7 +113,7 @@ impl SwapExt { let Self {ref mut page_table, ref mut swap_manager, ref mut swapper} = self; let targetpt = &mut *(pt); let pttoken = { - debug!("the target page table token is {:x?}", targetpt.token()); + info!("SET_SWAPPABLE: the target page table token is {:x?}, addr is {:x?}", targetpt.token(), addr); targetpt.token() }; targetpt.with(||{ @@ -139,14 +139,14 @@ impl SwapExt { ** @param alloc_frame: the function to alloc a free physical frame for once */ pub unsafe fn remove_from_swappable(&mut self, pt: *mut T2, addr: VirtAddr, alloc_frame: impl FnOnce() -> PhysAddr){ - trace!("come into remove_from swappable"); + info!("come into remove_from swappable"); let Self {ref mut page_table, ref mut swap_manager, ref mut swapper} = self; let targetpt = &mut *(pt); let pttoken = { debug!("the target page table token is {:x?}", targetpt.token()); targetpt.token() }; - debug!("try to change pagetable"); + info!("try to change pagetable"); targetpt.with(||{ let token = { let entry = page_table.get_entry(addr); @@ -169,7 +169,7 @@ impl SwapExt { let data = page_table.get_page_slice_mut(addr); swapper.swap_in(token, data).unwrap(); }); - trace!("come outof femove_from swappable"); + trace!("come out of femove_from swappable"); } /* @@ -301,7 +301,7 @@ impl SwapExt { } if(swapin){ unsafe { - self.set_swappable(pt, addr); + self.set_swappable(pt, addr & 0xfffff000); } } //area.get_flags().apply(new_entry); this instruction may be used when hide attr is used diff --git a/crate/process/src/process_manager.rs b/crate/process/src/process_manager.rs index 63878c1..988d56d 100644 --- a/crate/process/src/process_manager.rs +++ b/crate/process/src/process_manager.rs @@ -225,7 +225,7 @@ impl ProcessManager { self.wakeup(*waiter); } - //proc.context = None; + proc.context = None; } } fn new_vec_default(size: usize) -> Vec { diff --git a/crate/riscv b/crate/riscv index f358204..a37a65f 160000 --- a/crate/riscv +++ b/crate/riscv @@ -1 +1 @@ -Subproject commit f358204af01f2374ab6ed6ea059f724cd5f2fe6f +Subproject commit a37a65fa13a00c5aa0068c3f2b5d55af6a37dd93 diff --git a/docs/OSTrain2018docs-g4/expr4/lcy-labguide.md b/docs/OSTrain2018docs-g4/expr4/lcy-labguide.md new file mode 100644 index 0000000..e69de29 diff --git a/kernel/src/process/context.rs b/kernel/src/process/context.rs index 5168c45..b80dee4 100644 --- a/kernel/src/process/context.rs +++ b/kernel/src/process/context.rs @@ -130,7 +130,7 @@ impl ContextImpl { let mut memory_set = self.memory_set.clone(); info!("finish mmset clone in fork!"); // add the new memory set to the recorder - debug!("fork! new page table token: {:x?}", memory_set.token()); + info!("fork! new page table token: {:x?}", memory_set.token()); let mmset_ptr = ((&mut memory_set) as * mut MemorySet) as usize; memory_set_record().push_back(mmset_ptr); @@ -179,6 +179,7 @@ impl ContextImpl { impl Drop for ContextImpl{ fn drop(&mut self){ + info!("come in to drop for ContextImpl"); // remove the new memory set to the recorder (deprecated in the latest version) /* let id = memory_set_record().iter() @@ -251,6 +252,7 @@ fn memory_attr_from(elf_flags: Flags) -> MemoryAttr { * map the memory area in the memory_set swappalbe, specially for the user process */ pub fn memory_set_map_swappable(memory_set: &mut MemorySet){ + info!("COME INTO memory set map swappable!"); let pt = unsafe { memory_set.get_page_table_mut() as *mut InactivePageTable0 };