diff --git a/Cargo.lock b/Cargo.lock index a6a454ed4..0fadff6f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -444,7 +444,7 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#894f73ca35199f524dff6160c57c0916169fbaf6" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#d9aab2191b57d4c9fa5a57e70c38039e605ad741" [[package]] name = "hbbytecode" @@ -454,7 +454,7 @@ source = "git+https://git.ablecorp.us/ableos/holey-bytes#894f73ca35199f524dff616 [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#894f73ca35199f524dff6160c57c0916169fbaf6" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#d9aab2191b57d4c9fa5a57e70c38039e605ad741" dependencies = [ "hbvm 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)", ] @@ -462,7 +462,7 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#894f73ca35199f524dff6160c57c0916169fbaf6" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#d9aab2191b57d4c9fa5a57e70c38039e605ad741" dependencies = [ "hbbytecode 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)", ] diff --git a/kernel/src/holeybytes/ecah.rs b/kernel/src/holeybytes/ecah.rs index 548ddeb94..f4f162cb4 100644 --- a/kernel/src/holeybytes/ecah.rs +++ b/kernel/src/holeybytes/ecah.rs @@ -74,7 +74,7 @@ pub fn handler(vm: &mut Vm) { match buffer_id { 0 => match sds_msg_handler(vm, mem_addr, length) { Ok(()) => {} - Err(err) => log::error!("Improper sds format"), + Err(err) => log::error!("Improper sds format: {err:?}"), }, 1 => match log_msg_handler(vm, mem_addr, length) { Ok(()) => {} @@ -285,6 +285,7 @@ fn log_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), LogE #[derive(Debug)] pub enum LogError { + NoMessages, InvalidLogFormat, } use {alloc::vec, log::Record}; diff --git a/kernel/src/holeybytes/kernel_services/service_definition_service.rs b/kernel/src/holeybytes/kernel_services/service_definition_service.rs index 1a12447b8..547ac337b 100644 --- a/kernel/src/holeybytes/kernel_services/service_definition_service.rs +++ b/kernel/src/holeybytes/kernel_services/service_definition_service.rs @@ -23,6 +23,9 @@ pub static SERVICES: Lazy> = Lazy::new(|| { pub fn sds_msg_handler(vm: &mut Vm, mem_addr: u64, length: usize) -> Result<(), LogError> { let mut msg_vec = block_read(mem_addr, length); + if msg_vec.is_empty() { + return Err(LogError::NoMessages); + } let sds_event_type: ServiceEventType = msg_vec[0].into(); msg_vec.remove(0); diff --git a/repbuild/src/dev.rs b/repbuild/src/dev.rs index 5c92480ec..67768e875 100644 --- a/repbuild/src/dev.rs +++ b/repbuild/src/dev.rs @@ -85,9 +85,17 @@ impl Package { Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => (), Err(e) => panic!("{}", e), } - let path = format!("target/programs/{}.hbf", self.name); - let mut file = File::create(path).unwrap(); - file.write_all(&bytes).unwrap(); + std::fs::write(format!("target/programs/{}.hbf", self.name), &bytes).unwrap(); + bytes.clear(); + let _ = hblang::run_compiler( + &path, + Options { + dump_asm: true, + ..Default::default() + }, + &mut bytes, + ); + std::fs::write(format!("target/programs/{}.hba", self.name), &bytes).unwrap(); } } }