mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-25 19:03:35 +04:00
Update rustsbi; huge_write writes 1MiB
This commit is contained in:
parent
e68f261ed6
commit
bf69560f9b
Binary file not shown.
Binary file not shown.
@ -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())
|
||||
};
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user