diff --git a/kernel/src/holeybytes/ecah.rs b/kernel/src/holeybytes/ecah.rs index a5f1e94e7..b3f82a27a 100644 --- a/kernel/src/holeybytes/ecah.rs +++ b/kernel/src/holeybytes/ecah.rs @@ -70,6 +70,10 @@ pub fn handler(vm: &mut Vm) { Ok(()) => {} Err(err) => log::error!("Improper log format"), }, + 2 => match memory_msg_handler(vm, mem_addr, length) { + Ok(()) => {} + Err(err) => log::error!("Improper log format"), + }, buffer_id => { let mut buffs = IPC_BUFFERS.lock(); @@ -140,3 +144,14 @@ pub enum LogError { InvalidLogFormat, } use {alloc::vec, log::Record}; + +fn memory_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), LogError> { + let mut val = alloc::vec::Vec::new(); + for _ in 0..4096 { + val.push(0); + } + info!("Block address: {:?}", val.as_ptr()); + vm.registers[1] = hbvm::value::Value(val.as_ptr() as u64); + vm.registers[2] = hbvm::value::Value(4096); + Ok(()) +} diff --git a/sysdata/test-programs/main.rhai b/sysdata/test-programs/main.rhai index d66433e72..63a2f2253 100644 --- a/sysdata/test-programs/main.rhai +++ b/sysdata/test-programs/main.rhai @@ -7,6 +7,8 @@ fn main(){ std::Debug("XYZ"); std::Trace("Trace Deez"); + std::ipc_send(2, 0, 0); + tx(); }