Update rustsbi; huge_write writes 1MiB

This commit is contained in:
Yifan Wu 2021-08-26 19:04:10 +08:00
parent e68f261ed6
commit bf69560f9b
5 changed files with 6 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View File

@ -22,7 +22,7 @@ const VIRTIO0: usize = 0x10001000;
pub struct VirtIOBlock(UPSafeCell<VirtIOBlk<'static>>);
lazy_static! {
static ref QUEUE_FRAMES: UPSafeCell<Vec<FrameTracker>> = unsafe {
static ref QUEUE_FRAMES: UPSafeCell<Vec<FrameTracker>> = unsafe {
UPSafeCell::new(Vec::new())
};
}

View File

@ -116,7 +116,9 @@ pub fn trap_return() -> ! {
#[no_mangle]
pub fn trap_from_kernel() -> ! {
use riscv::register::sepc;
println!("stval = {:#x}, sepc = {:#x}", stval::read(), sepc::read());
panic!("a trap {:?} from kernel!", scause::read().cause());
}
pub use context::{TrapContext};
pub use context::TrapContext;

View File

@ -24,13 +24,13 @@ pub fn main() -> i32 {
}
let f = f as usize;
let start = get_time();
let size_mb = 5usize;
let size_mb = 1usize;
for _ in 0..1024*size_mb {
write(f, &buffer);
}
close(f);
let time_ms = (get_time() - start) as usize;
let speed_kbs = size_mb * 1000000 / time_ms;
println!("time cost = {}ms, write speed = {}KiB/s", time_ms, speed_kbs);
println!("{}MiB written, time cost = {}ms, write speed = {}KiB/s", size_mb, time_ms, speed_kbs);
0
}