diff --git a/ableos/src/allocator/mod.rs b/ableos/src/allocator/mod.rs index e52a0b6..45a1f21 100644 --- a/ableos/src/allocator/mod.rs +++ b/ableos/src/allocator/mod.rs @@ -2,7 +2,9 @@ mod aalloc; pub const HEAP_START: usize = 0x_4444_4444_0000; /// 131072 bytes -pub const HEAP_MULTIPLIER: usize = 1024; +// pub const HEAP_MULTIPLIER: usize = 1024; +pub const HEAP_MULTIPLIER: usize = 100000; + pub const HEAP_BASE: usize = 100; pub const HEAP_SIZE: usize = HEAP_BASE * HEAP_MULTIPLIER; diff --git a/ableos/src/dirty_hacks/mod.rs b/ableos/src/dirty_hacks/mod.rs new file mode 100644 index 0000000..57db143 --- /dev/null +++ b/ableos/src/dirty_hacks/mod.rs @@ -0,0 +1,4 @@ +#[no_mangle] +extern "C" fn __truncdfsf2(_x: f64) -> f32 { + 0.0 +} diff --git a/ableos/src/kmain.rs b/ableos/src/kmain.rs index d43055b..ed8297b 100644 --- a/ableos/src/kmain.rs +++ b/ableos/src/kmain.rs @@ -1,7 +1,5 @@ #![allow(clippy::empty_loop)] -pub extern crate externc_libm as libm; - use { crate::{ arch::{drivers::graphics::GraphicsBuffer, init, sloop}, @@ -43,7 +41,7 @@ pub fn kernel_main() -> ! { GraphicsBuffer::draw(); GraphicsBuffer::hide_cursor(); GraphicsBuffer::show_cursor(); - // crate::wasm::evaluate(); + crate::wasm::evaluate(); println!("{} v{}", RELEASE_TYPE, KERNEL_VERSION); info!("{} v{}", RELEASE_TYPE, KERNEL_VERSION); diff --git a/ableos/src/lib.rs b/ableos/src/lib.rs index cca1880..bbf413c 100644 --- a/ableos/src/lib.rs +++ b/ableos/src/lib.rs @@ -31,6 +31,7 @@ pub mod print; pub mod log; pub mod allocator; +pub mod dirty_hacks; pub mod driver_traits; pub mod experiments; pub mod keyboard; @@ -38,6 +39,9 @@ pub mod kmain; pub mod panic; pub mod relib; pub mod scheduler; +pub mod test; pub mod wasm; extern crate alloc; + +pub extern crate externc_libm as libm; diff --git a/ableos/src/main.rs b/ableos/src/main.rs index 04916ef..f4e9d7e 100644 --- a/ableos/src/main.rs +++ b/ableos/src/main.rs @@ -1,3 +1,4 @@ #![no_std] #![no_main] + pub use ableos::*; diff --git a/ableos/src/relib/image/mod.rs b/ableos/src/relib/image/mod.rs index fd2938d..5365f2f 100644 --- a/ableos/src/relib/image/mod.rs +++ b/ableos/src/relib/image/mod.rs @@ -1 +1,2 @@ +#[allow(unused_imports)] use qoi_rs; diff --git a/ableos/src/wasm/mod.rs b/ableos/src/wasm/mod.rs index 54a16b5..a411372 100644 --- a/ableos/src/wasm/mod.rs +++ b/ableos/src/wasm/mod.rs @@ -8,8 +8,6 @@ use { }; mod wasm_sys; -pub extern crate externc_libm as libm; - struct HostFunctions; impl HostFunctions { fn check_signature(&self, index: usize, signature: &Signature) -> bool { @@ -30,7 +28,7 @@ impl Externals for HostFunctions { match index.into() { // Take in one arg discard the rest SysCall::KILL => { - println!("Program killed"); + info!("Program run at runtime called a system call"); Ok(None) } // Do nothing @@ -74,8 +72,7 @@ impl ModuleImportResolver for HostFunctions { } pub fn evaluate() { - let wasm_binary = // Spacer - include_bytes!("rust.wasm"); + let wasm_binary = include_bytes!("rust.wasm"); // Load wasm binary and prepare it for instantiation. let module = wasmi::Module::from_buffer(&wasm_binary).expect("failed to load wasm"); @@ -98,8 +95,5 @@ pub fn evaluate() { .try_into() .unwrap(); - println!( - "{:?}", - result // .unwrap() - ); + println!("{:?}", result); } diff --git a/ableos/src/wasm/wasm_sys.rs b/ableos/src/wasm/wasm_sys.rs index 349a521..def69e0 100644 --- a/ableos/src/wasm/wasm_sys.rs +++ b/ableos/src/wasm/wasm_sys.rs @@ -1,3 +1,5 @@ +#![allow(non_camel_case_types)] + macro_rules! syscall_enum { () => {}; (@get_last $Variant:ident) => { @@ -25,7 +27,6 @@ macro_rules! syscall_enum { syscall_enum!($($Variant=$Value,)* ); }; } - syscall_enum! { KILL=0, // Provide a PID CONSOLE_RESET=1, // Reset the console