commit
This commit is contained in:
parent
5ea0f4938b
commit
b58a4af6fa
24
src/main.rs
24
src/main.rs
|
@ -34,6 +34,7 @@ impl Externals for HostFunctions {
|
||||||
}
|
}
|
||||||
/// Do nothing
|
/// Do nothing
|
||||||
SysCall::EMPTY => Ok(None),
|
SysCall::EMPTY => Ok(None),
|
||||||
|
SysCall::EXIT => Ok(None),
|
||||||
// SysCall::CONSOLE_RESET => {}
|
// SysCall::CONSOLE_RESET => {}
|
||||||
// SysCall::CONSOLE_IN => {}
|
// SysCall::CONSOLE_IN => {}
|
||||||
// SysCall::CONSOLE_OUT => {}
|
// SysCall::CONSOLE_OUT => {}
|
||||||
|
@ -48,6 +49,7 @@ impl ModuleImportResolver for HostFunctions {
|
||||||
let index = match field_name {
|
let index = match field_name {
|
||||||
"kill" => SysCall::KILL as usize,
|
"kill" => SysCall::KILL as usize,
|
||||||
"empty" => SysCall::EMPTY as usize,
|
"empty" => SysCall::EMPTY as usize,
|
||||||
|
"exit" => SysCall::EXIT as usize,
|
||||||
_ => {
|
_ => {
|
||||||
return Err(Error::Instantiation(format!(
|
return Err(Error::Instantiation(format!(
|
||||||
"Export {} not found",
|
"Export {} not found",
|
||||||
|
@ -74,17 +76,17 @@ fn main() {
|
||||||
// Parse WAT (WebAssembly Text format) into wasm bytecode.
|
// Parse WAT (WebAssembly Text format) into wasm bytecode.
|
||||||
// let wasm_binary = wabt::wat2wasm(include_str!("../wasm/test.wat"));
|
// let wasm_binary = wabt::wat2wasm(include_str!("../wasm/test.wat"));
|
||||||
let wasm_binary = //wabt::wat2wasm(
|
let wasm_binary = //wabt::wat2wasm(
|
||||||
include_bytes!("../wasm/ableos-wasm-test.wasm"); //.unwrap();
|
include_bytes!("../src/ableos-wasm-test.wasm"); //.unwrap();
|
||||||
// );
|
// );
|
||||||
/*
|
/*
|
||||||
let wasm_binary = match wasm_binary {
|
let wasm_binary = match wasm_binary {
|
||||||
Ok(abc) => abc,
|
Ok(abc) => abc,
|
||||||
Err(abc) => {
|
Err(abc) => {
|
||||||
println!("{}", abc);
|
println!("{}", abc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
// .expect("failed to parse wat");
|
// .expect("failed to parse wat");
|
||||||
|
|
||||||
// Load wasm binary and prepare it for instantiation.
|
// Load wasm binary and prepare it for instantiation.
|
||||||
|
|
Binary file not shown.
Reference in a new issue