minor cleanups

pull/4/head
able 2023-05-25 07:04:19 -05:00
parent 3d726a7c61
commit 4156c78f2f
5 changed files with 14 additions and 49 deletions

View File

@ -1,11 +1,11 @@
use {hbvm::engine::Engine};
use hbvm::engine::Engine;
use {
crate::ipc::message::Message,
crossbeam_queue::{ArrayQueue, SegQueue},
log::trace,
};
use crate::{ipc::message::Message};
pub enum HostError {
MemoryError,
}

View File

@ -1,39 +1,27 @@
//! AbleOS Kernel Entrypoint
// use std::collections::HashMap;
use {
log::info,
crate::{alloc::string::ToString, arch::logging::SERIAL_CONSOLE, device_tree::DeviceTree},
hbvm::engine::Engine,
log::{debug, info},
spin::{Lazy, Mutex},
};
use hbvm::engine::Engine;
use crate::{
arch::logging::SERIAL_CONSOLE,
device_tree::DeviceTree,
// host_functions::read_device_tree,
};
use crate::alloc::string::ToString;
pub fn kmain(cmdline: &str, bootstrap: Option<&'static [u8]>) -> ! {
log::debug!("Entered kmain");
debug!("Entered kmain");
let mut cmdline = cmdline.to_string();
cmdline.pop();
cmdline.remove(0);
let kcmd = clparse::Arguments::parse(cmdline.to_string()).unwrap();
log::info!("Cmdline: {kcmd:?}");
info!("Cmdline: {kcmd:?}");
if kcmd.arguments.get("baka") == Some(&"true".to_string()) {
let _ = crate::arch::log(format_args!(include_str!("../data/⑨. バカ")));
}
if kcmd.arguments.get("foobles") == Some(&"true".to_string()) {
let _ = crate::arch::log(format_args!("foobles\n\r"));
let mut kcl = xml::XMLElement::new("Kernel Command Line");
for (key, value) in kcmd.arguments {
kcl.set_attribute(key, value);
}
info!("kernel command line object: {:?}", kcl);
let bootstrap = bootstrap/*.expect("no bootstrap found")*/;
match bootstrap {
@ -65,8 +53,6 @@ pub fn kmain(cmdline: &str, bootstrap: Option<&'static [u8]>) -> ! {
sc.send(byte);
}
}
// crate::arch::sloop()
}
pub static DEVICE_TREE: Lazy<Mutex<DeviceTree>> = Lazy::new(|| {

View File

@ -1,3 +1,5 @@
// TODO: Add a logger api with logger levels and various outputs
use log::{Level, SetLoggerError};
pub fn init() -> Result<(), SetLoggerError> {

View File

@ -1,24 +0,0 @@
`create_object`
```
params
i32
start address of the string to use as the object name
i32
length of string
returns
i64 Handle to the object
```
`read_object_attribute`
```
params
i64 Handle to the object
i32
start address of the string to use as the attribute name
i32
end address of the string to use as the attribute name
returns
```

View File

@ -8,6 +8,7 @@ fn main() -> Result<(), Error> {
env_logger::init();
let mut args = std::env::args();
args.next();
// TODO: work on adding in system.toml support
match args.next().as_deref() {
Some("build" | "b") => {