provide a simple wasm executable for ableOS
This commit is contained in:
parent
872aa4b8d7
commit
a9643bf9d2
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -492,6 +492,10 @@ version = "0.11.0+wasi-snapshot-preview1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||
|
||||
[[package]]
|
||||
name = "wasm_syscall_test"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "wat2wasm"
|
||||
version = "0.1.0"
|
||||
|
|
|
@ -37,6 +37,7 @@ members = [
|
|||
"programs/shell",
|
||||
"programs/table_view",
|
||||
"programs/undelete",
|
||||
"programs/wasm_syscall_test",
|
||||
"programs/wat2wasm",
|
||||
"programs/xml_tests",
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ use alloc::string::{String, ToString};
|
|||
use alloc::vec::Vec;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(PartialEq, Clone, Debug, Serialize, Deserialize)]
|
||||
|
||||
pub struct Attribute {
|
||||
|
|
6
programs/wasm_syscall_test/.cargo/config.toml
Normal file
6
programs/wasm_syscall_test/.cargo/config.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
# [unstable]
|
||||
# build-std = ["core", "compiler_builtins", "alloc"]
|
||||
# build-std-features = ["compiler-builtins-mem"]
|
||||
|
||||
[build]
|
||||
target = "wasm32-unknown-unknown"
|
8
programs/wasm_syscall_test/Cargo.toml
Normal file
8
programs/wasm_syscall_test/Cargo.toml
Normal file
|
@ -0,0 +1,8 @@
|
|||
[package]
|
||||
name = "wasm_syscall_test"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
18
programs/wasm_syscall_test/src/main.rs
Normal file
18
programs/wasm_syscall_test/src/main.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
fn _start() {
|
||||
unsafe {
|
||||
let abc = read_mem_addr(13);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
fn read_mem_addr(address: usize) -> u64;
|
||||
|
||||
}
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(info: &core::panic::PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
Loading…
Reference in a new issue