[WIP] Enable ARINC653 interface within both Wasmtime / WAMR custom CLI #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a work-in-progress state
This code works currently on ArchLinux:
$ yay -S clang lld wasi-libc wasi-compiler-rt libwasmtime iwasmiwasm PKGBUILDmust be patched to not strip the static library. See https://aur.archlinux.org/packages/iwasmContent:
The given code provides a Proof-Of-Concept, showcasing that a Wasmtime can support ARINC653 APEX interfaces as host functions. The PoC shall also proof, that it could work on Little Endian as well as Big Endian architectures (such as PowerPC still represented in avionics). There are a few caveats why ARINC653 APEX interfaces can't be 100% compliant to the WebAssembly standard, however the main language C (and C++) is supported and Ada should be supportable:
wit-bindgen. Thus, the APEX interface is exposed as a plain C header, where to-be-Wasm-ised source code can be directly compiled against.CREATE_PROCESS()andCREATE_ERROR_HANDLER()can't comply to the WebAssembly standard, as they pass a function pointerSYSTEM_ADDRESS_TYPE.return .... Meaning, function parameteres are 'just' input. However, the APEX interfaces all use plain pointers as function parameters to return content.Again, as long as C, C++, Ada are the main languages, 2 and 3 should be no worry.
Open Topics:
Choosing WebAssembly runtime
The compilation will create a
binfolder. Change the symlink fromp_wasmtimetop_wamrif WAMR shall be employed.WebAssembly Specification
https://www.w3.org/TR/wasm-core-2/#concepts%E2%91%A0
https://www.w3.org/TR/wasm-core-2/#function-instances%E2%91%A0
https://www.w3.org/TR/wasm-core-2/#functions%E2%91%A4