1
0
Fork 0
forked from AbleOS/ableos
ableos-idl/kernel/src/kmain.rs

40 lines
960 B
Rust
Raw Normal View History

2023-03-30 16:43:04 -05:00
//! AbleOS Kernel Entrypoint
2023-04-05 12:29:20 -05:00
use log::{info, trace};
use crate::arch::sloop;
use crate::{interp, task};
use crate::alloc::string::ToString;
2023-03-30 16:43:04 -05:00
pub fn kmain(cmdline: &str, bootstrap: Option<&'static [u8]>) -> ! {
log::debug!("Entered kmain");
2023-04-05 12:29:20 -05:00
let mut cmdline = cmdline.to_string();
cmdline.pop();
cmdline.remove(0);
let kcmd = clparse::Arguments::parse(cmdline.to_string()).unwrap();
log::info!("Cmdline: {kcmd:?}");
if kcmd.arguments.get("baka") == Some(&"9".to_string()) {
2023-03-30 16:43:04 -05:00
let _ = crate::arch::log(format_args!(include_str!("../data/⑨. バカ")));
}
2023-04-05 12:29:20 -05:00
let bootstrap = bootstrap/*.expect("no bootstrap found")*/;
match bootstrap {
Some(bootstrap_mod) => {}
None => {
info!("No bootstrap module loaded.")
}
}
// use xml::XMLElement;
// let kcmd = XMLElement::new("cmdline");
let abc = interp::wasm();
2023-03-30 16:43:04 -05:00
2023-04-05 12:29:20 -05:00
trace!("{:?}", abc);
2023-03-30 16:43:04 -05:00
crate::arch::sloop()
}