provide a simple wasm executable for ableOS

This commit is contained in:
Able 2023-04-05 14:04:10 -05:00
parent 872aa4b8d7
commit a9643bf9d2
6 changed files with 38 additions and 0 deletions

4
Cargo.lock generated
View file

@ -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"

View file

@ -37,6 +37,7 @@ members = [
"programs/shell",
"programs/table_view",
"programs/undelete",
"programs/wasm_syscall_test",
"programs/wat2wasm",
"programs/xml_tests",

View file

@ -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 {

View file

@ -0,0 +1,6 @@
# [unstable]
# build-std = ["core", "compiler_builtins", "alloc"]
# build-std-features = ["compiler-builtins-mem"]
[build]
target = "wasm32-unknown-unknown"

View 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]

View 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 {}
}