1
0
mirror of https://github.com/sgmarz/osblog.git synced 2024-11-27 20:03:32 +04:00
osblog/risc_v/src/test.rs
2020-05-17 15:08:01 -04:00

14 lines
483 B
Rust

// test.rs
use crate::fs::MinixFileSystem;
use crate::syscall;
/// Test block will load raw binaries into memory to execute them. This function
/// will load ELF files and try to execute them.
pub fn test() {
// The majority of the testing code needs to move into a system call (execv maybe?)
MinixFileSystem::init(8);
let path = "/helloworld.elf\0".as_bytes().as_ptr();
syscall::syscall_execv(path,0);
println!("I should never get here, execv should destroy our process.");
}