Browse Source

try to get a wasm interpreter in this

master
Cadey Ratio 1 year ago
parent
commit
1003ccc648
4 changed files with 1288 additions and 26 deletions
  1. +1265
    -22
      Cargo.lock
  2. +19
    -0
      Cargo.toml
  3. BIN
      data/h.wasm
  4. +4
    -4
      src/main.rs

+ 1265
- 22
Cargo.lock
File diff suppressed because it is too large
View File


+ 19
- 0
Cargo.toml View File

@ -16,6 +16,25 @@ pic8259_simple = "0.1.1"
pc-keyboard = "0.3.1"
linked_list_allocator = "0.6.4"
[dependencies.wasmtime-environ]
git = "https://github.com/CraneStation/wasmtime"
rev = "a7fa6bdb3197ca98bcd1b55665e3bb550888dda1"
default-features = false
features = ["core"]
[dependencies.wasmtime-jit]
git = "https://github.com/CraneStation/wasmtime"
rev = "a7fa6bdb3197ca98bcd1b55665e3bb550888dda1"
default-features = false
features = ["core"]
[dependencies.wasmtime-runtime]
git = "https://github.com/CraneStation/wasmtime"
rev = "a7fa6bdb3197ca98bcd1b55665e3bb550888dda1"
version = "*"
default-features = false
features = ["core"]
[dependencies.lazy_static]
version = "1.0"
features = ["spin_no_std"]


BIN
data/h.wasm View File


+ 4
- 4
src/main.rs View File

@ -17,10 +17,6 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! {
xe_os::init(&boot_info);
println!("Hello World{}", "!");
// allocate a number on the heap
let heap_value = Box::new(41);
println!("heap_value at {:p}", heap_value);
#[cfg(test)]
test_main();
@ -28,6 +24,10 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! {
xe_os::hlt_loop();
}
fn run_wasm() {
let bytes = include_bytes!("../data/h.wasm");
}
// our existing panic handler
#[cfg(not(test))] // new attribute
#[panic_handler]


Loading…
Cancel
Save