This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
wenyongh f8f61dc898 Add a switch to build simple sample without gui support (#126)
* Implement memory profiler, optimize memory usage, modify code indent

* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default

* Add a new extension library: connection

* Fix bug of reading magic number and version in big endian platform

* Re-org platform APIs: move most platform APIs from iwasm to shared-lib

* Enhance wasm loader to fix some security issues

* Fix issue about illegal load of EXC_RETURN into PC on stm32 board

* Updates that let a restricted version of the interpreter run in SGX

* Enable native/app address validation and conversion for wasm app

* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused

* Refine binary size and fix several minor issues

Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c

* Add more strict security checks for libc wrapper API's

* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files

* Enhance security of libc strcpy/sprintf wrapper function

* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions

* Remove get_module_inst() and fix issue of call native

* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate

* Refine interpreter call native process, refine memory boudary check

* Fix issues of invokeNative function of arm/mips/general version

* Add a switch to build simple sample without gui support
2019-09-25 03:42:56 -05:00
core Add a switch to build simple sample without gui support (#126) 2019-09-25 03:42:56 -05:00
doc Fix typo 'destory' and compile issue (#119) 2019-09-10 15:52:03 +08:00
samples Add a switch to build simple sample without gui support (#126) 2019-09-25 03:42:56 -05:00
test-tools Add parameter module inst for native wrapper functions (#117) 2019-09-10 10:23:46 +08:00
.gitignore Add build configuration for Mac (#110) 2019-09-06 16:51:36 +08:00
CODE_OF_CONDUCT.md Document the Contributor Covenant as our Code of Conduct. (#116) 2019-09-10 16:29:50 +08:00
CONTRIBUTING.md Document the Contributor Covenant as our Code of Conduct. (#116) 2019-09-10 16:29:50 +08:00
Dockerfile Initial Dockerfile (#97) 2019-08-14 10:34:36 +08:00
LICENSE code cleanup 2019-05-07 14:15:28 +08:00
README.md re-organized the readme (#111) 2019-09-07 14:27:11 +08:00

WebAssembly Micro Runtime

WebAssembly Micro Runtime (WAMR) is a standalone WebAssembly (WASM) runtime with small footprint. It includes a few parts as below:

  • A WebAssembly VM core (namely iwasm)
  • The supporting API's for the WASM applications
  • A mechanism for dynamic management of the WASM application

Current Features of WAMR

  • WASM interpreter (AOT is planned)
  • Supports for a subset of Libc.
  • Supports "SIDE_MODULE=1" EMCC compilation option
  • Provides embedding C API
  • Provides a mechanism for exporting native API's to WASM applications
  • Supports the programming of firmware apps in a large range of languages (C/C++/Java/Rust/Go/TypeScript etc.)
  • App sandbox execution environment on embedded OS
  • The purely asynchronized programming model
  • Menu configuration for easy platform integration
  • Supports micro-service and pub-sub event inter-app communication models
  • Easy to extend to support remote FW application management from host or cloud

Application framework architecture

By using the iwasm VM core, we are flexible to build different application frameworks for the specific domains.

The WAMR has offered a comprehensive application framework for device and IoT usages. The framework solves many common requirements for building a real project:

  • Modular design for more language runtimes support
  • Inter application communication
  • Remote application management
  • WASM APP programming model and API extension mechanism

Build WAMR Core and run WASM applications

WAMR VM core (iwasm) can support building on different platforms:

  • Linux
  • Zephyr
  • Mac
  • VxWorks
  • AliOS-Things
  • Docker
  • Intel Software Guard Extention (SGX)

After building the iwasm, we can compile some basic WASM applications and run it from the WAMR core. As the WAMR core doesn't include the extended application library, your WASM applications can only use the WAMR built-in APIs.

See the doc/building.md for the detailed instructions.

Embed WAMR

WAMR can be built into a standalone executable which takes the WASM application file name as input, and then executes it. In some other situations, the WAMR source code is embedded the product code and built into the final product.

WAMR provides a set of C API for loading the WASM module, instantiating the module and invoking a WASM function from a native call.

See the doc/embed_wamr.md for the details.

WAMR application programming library

WAMR defined event driven programming model:

  • Single thread per WASM app instance
  • App must implement system callbacks: on_init, on_destrory

In general there are a few API classes for the WASM application programming:

  • WAMR Built-in API: WAMR core provides a minimal libc API set for WASM APP
  • WAMR application libraries:
    • Timer
    • Micro service (Request/Response)
    • Pub/Sub
    • Sensor
    • Connection and data transmission
    • 2D graphic UI (based on littlevgl)
  • User extended native API: extend the native API to the WASM applications
  • 3rd party libraries: Programmers can download any 3rd party C/C++ source code and build it together with the WASM APP code

See the doc/wamr_api.md for the details.

Samples and demos

The WAMR samples are located in folder ./samples. A sample usually contains the WAMR runtime build, WASM applications and test tools. The WARM provides following samples:

  • Simple: The runtime is integrated with most of the WAMR APP libaries and multiple WASM applications are provided for using different WASM API set.
  • littlevgl: Demostrating the graphic user interface application usage on WAMR. The whole LittlevGL 2D user graphic library and the UI application is built into WASM application.
  • gui: Moved the LittlevGL library into the runtime and defined a WASM application interface by wrapping the littlevgl API.
  • IoT-APP-Store-Demo: A web site for demostrating a WASM APP store usage where we can remotely install and uninstall WASM application on remote devices.

The graphic user interface demo photo:

WAMR samples diagram

Releases and acknowledgments

WAMR is a community efforts. Since Intel Corp contributed the first release of this open source project, this project has received many good contributions from the community.

See the major features releasing history and contributor names

Roadmap

See the roadmap to understand what major features are planed or under development.

Please submit issues for any new feature request, or your plan for contributing new features.

Submit issues and contact the maintainers

Click here to submit. Your feedback is always welcome!

Contact the maintainers: imrt-public@intel.com