1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-23 00:16:17 +04:00

Merge branch 'mipsel' of github.com:oscourse-tsinghua/rcore_plus into mipsel

This commit is contained in:
Harry Chen 2019-04-06 14:17:24 +08:00
commit d05c4cf09e
2 changed files with 25 additions and 2 deletions

View File

@ -1,6 +1,9 @@
use mips::interrupts;
use mips::tlb;
use mips::registers::cp0;
use crate::drivers::DRIVERS;
use mips::paging::{PageTable as MIPSPageTable, PageTableEntry, PageTableFlags as EF, TwoLevelPageTable};
use mips::addr::*;
pub use self::context::*;
use log::*;
@ -141,5 +144,10 @@ fn page_fault(tf: &mut TrapFrame) {
crate::trap::error(tf);
}
let virt_addr = VirtAddr::new(addr);
let root_table = unsafe {
&mut *(root_page_table_ptr as *mut MIPSPageTable)
};
let tlb_entry = root_table.lookup(addr);
tlb::write_tlb_random(tlb_entry);
}

View File

@ -21,7 +21,7 @@ mod stdio;
#[cfg(feature = "link_user")]
global_asm!(concat!(
r#"
.section .data
.section .data.img
.global _user_img_start
.global _user_img_end
_user_img_start:
@ -57,7 +57,22 @@ lazy_static! {
println!("Sfs start {:x}, end {:x}", _user_img_start as usize, _user_img_end as usize);
Arc::new(unsafe { device::MemBuf::new(_user_img_start, _user_img_end) })
};
let device2 = {
extern {
fn _user_img_start();
fn _user_img_end();
}
Arc::new(unsafe { device::MemBuf::new(_user_img_start, _user_img_end) })
};
let super_block = SimpleFileSystem::read(device2);
println!("Superblock: magic = {:x}, freemap_blocks = {:x}", super_block.magic, super_block.freemap_blocks);
println!("blocks = {:}", super_block.blocks);
println!("unused_blocks = {:}", super_block.unused_blocks);
let sfs = SimpleFileSystem::open(device).expect("failed to open SFS");
// println!("{:}", sfs.free_map.read());
sfs.root_inode()
};
}