diff --git a/kernel/src/host_functions.rs b/kernel/src/host_functions.rs index 4bb3414ae..62b97996d 100644 --- a/kernel/src/host_functions.rs +++ b/kernel/src/host_functions.rs @@ -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, } diff --git a/kernel/src/kmain.rs b/kernel/src/kmain.rs index a1dd99246..de97f2fe5 100644 --- a/kernel/src/kmain.rs +++ b/kernel/src/kmain.rs @@ -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> = Lazy::new(|| { diff --git a/kernel/src/logger.rs b/kernel/src/logger.rs index c8ddface9..3b8cd3f07 100644 --- a/kernel/src/logger.rs +++ b/kernel/src/logger.rs @@ -1,3 +1,5 @@ +// TODO: Add a logger api with logger levels and various outputs + use log::{Level, SetLoggerError}; pub fn init() -> Result<(), SetLoggerError> { diff --git a/kernel/sycall.md b/kernel/sycall.md deleted file mode 100644 index dac5fd8b3..000000000 --- a/kernel/sycall.md +++ /dev/null @@ -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 -``` \ No newline at end of file diff --git a/repbuild/src/main.rs b/repbuild/src/main.rs index cb31167c5..51ca04da9 100644 --- a/repbuild/src/main.rs +++ b/repbuild/src/main.rs @@ -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") => {