From b58a4af6facdf16ac5969576a6f3a8c82a7a7292 Mon Sep 17 00:00:00 2001 From: Able Date: Sun, 14 Nov 2021 20:58:03 -0600 Subject: [PATCH] commit --- src/main.rs | 24 +++++++++++++----------- wasm/ableos-wasm-test.wasm | Bin 168 -> 0 bytes 2 files changed, 13 insertions(+), 11 deletions(-) delete mode 100755 wasm/ableos-wasm-test.wasm diff --git a/src/main.rs b/src/main.rs index 63196b2..c5e1f70 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,6 +34,7 @@ impl Externals for HostFunctions { } /// Do nothing SysCall::EMPTY => Ok(None), + SysCall::EXIT => Ok(None), // SysCall::CONSOLE_RESET => {} // SysCall::CONSOLE_IN => {} // SysCall::CONSOLE_OUT => {} @@ -48,6 +49,7 @@ impl ModuleImportResolver for HostFunctions { let index = match field_name { "kill" => SysCall::KILL as usize, "empty" => SysCall::EMPTY as usize, + "exit" => SysCall::EXIT as usize, _ => { return Err(Error::Instantiation(format!( "Export {} not found", @@ -74,17 +76,17 @@ fn main() { // Parse WAT (WebAssembly Text format) into wasm bytecode. // let wasm_binary = wabt::wat2wasm(include_str!("../wasm/test.wat")); let wasm_binary = //wabt::wat2wasm( - include_bytes!("../wasm/ableos-wasm-test.wasm"); //.unwrap(); - // ); - /* - let wasm_binary = match wasm_binary { - Ok(abc) => abc, - Err(abc) => { - println!("{}", abc); - return; - } - }; - */ + include_bytes!("../src/ableos-wasm-test.wasm"); //.unwrap(); + // ); + /* + let wasm_binary = match wasm_binary { + Ok(abc) => abc, + Err(abc) => { + println!("{}", abc); + return; + } + }; + */ // .expect("failed to parse wat"); // Load wasm binary and prepare it for instantiation. diff --git a/wasm/ableos-wasm-test.wasm b/wasm/ableos-wasm-test.wasm deleted file mode 100755 index e344ff1f794c9a260e3754ea24ad24a90a1cc894..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 168 zcmY+7O%8%E5JtagD;O|=xZ?^gyn`nhN0~$dEu=IiuHa}M&7ZjOZQkxZ$m|IKIXVMo zM^?k#_1!Q4)(|$9P-l%@=(Mg+lnefyA6@3vkMUuU@th