ableos/kernel/src/bootmodules.rs

37 lines
943 B
Rust
Raw Normal View History

2023-07-08 23:22:44 -05:00
use {
2024-09-13 16:41:31 -05:00
// crate::alloc::string::ToString,
alloc::vec::Vec,
// clparse::Arguments,
// core::fmt::{Debug, Display},
// log::trace,
// xml::XMLElement,
2023-07-08 23:22:44 -05:00
};
2024-09-13 16:41:31 -05:00
pub type BootModules<'a> = Vec<BootModule<'a>>;
2023-07-08 23:22:44 -05:00
2024-09-13 16:41:31 -05:00
pub struct BootModule<'a> {
pub path: &'a str,
pub bytes: &'a [u8],
pub cmd: &'a str,
2023-07-08 23:22:44 -05:00
}
2024-09-13 16:41:31 -05:00
impl<'a> BootModule<'a> {
pub fn new(path: &'a str, bytes: &'a [u8], cmd: &'a str) -> Self {
2023-07-08 23:22:44 -05:00
Self { path, bytes, cmd }
}
}
2024-09-13 16:41:31 -05:00
// pub fn build_cmd<T: Display + Debug>(name: T, cmdline: T) -> XMLElement {
// let mut cmdline = cmdline.to_string();
// cmdline.pop();
// cmdline.remove(0);
2023-07-08 23:22:44 -05:00
2024-09-13 16:41:31 -05:00
// let cmd = Arguments::parse(cmdline.to_string()).unwrap();
// trace!("Cmdline: {cmd:?}");
2023-07-08 23:22:44 -05:00
2024-09-13 16:41:31 -05:00
// let mut clo = XMLElement::new(name);
// for (key, value) in cmd.arguments {
// clo.set_attribute(key, value);
// }
// trace!("command line object: {:?}", clo);
// clo
// }