akern-gkgoat-fork/ableos/src/scratchpad.rs

28 lines
633 B
Rust
Raw Normal View History

use alloc::{string::String, vec::Vec};
use genfs::{Fs, OpenOptions};
use crate::{filesystem::FILE_SYSTEM, wasm_jumploader::interp};
2022-02-08 03:01:29 -06:00
/// Experimental scratchpad for testing.
pub fn scratchpad() {
let fs = &*FILE_SYSTEM.lock();
let file = fs
.open(b"/home/able/kernel.md", OpenOptions::new().read(true))
.unwrap();
2022-02-08 03:01:29 -06:00
let mut file_bytes = Vec::new();
file.read_to_end(&mut file_bytes).unwrap();
2022-02-08 03:01:29 -06:00
let string = String::from_utf8_lossy(&file_bytes);
2022-02-08 03:01:29 -06:00
print!("{}", string);
2022-02-08 04:13:53 -06:00
let pci_list = tinypci::brute_force_scan();
2022-02-08 04:13:53 -06:00
for pci in pci_list {
info!("{}", pci);
}
2022-02-08 04:13:53 -06:00
interp();
2022-02-08 04:13:53 -06:00
}