Merge pull request #8 from intel/master

sync
This commit is contained in:
Weining 2019-05-20 14:02:01 +08:00 committed by GitHub
commit ab17c8e06d

View File

@ -2,8 +2,8 @@ WebAssembly Micro Runtime
========================= =========================
WebAssembly Micro Runtime (WAMR) is a standalone WebAssembly (WASM) runtime designed for a small footprint. It includes: WebAssembly Micro Runtime (WAMR) is a standalone WebAssembly (WASM) runtime designed for a small footprint. It includes:
- A WebAssembly (WASM) VM core - A WebAssembly (WASM) VM core
- The supporting APIs for the WASM applications (code is available but compilation depends on the app manager component) - The supporting APIs for the WASM applications
- A mechanism for dynamic management of the WASM application (Not available on Github yet. To be released soon) - A mechanism for dynamic management of the WASM application
Why should you use a WASM runtime out of your browser? There are a few points where this might be meaningful: Why should you use a WASM runtime out of your browser? There are a few points where this might be meaningful:
1. WASM is already an LLVM official backend target. That means WASM can run any programming languages which can be compiled to LLVM IR. It is a huge advantage compared to language bound runtimes like JS or Lua. 1. WASM is already an LLVM official backend target. That means WASM can run any programming languages which can be compiled to LLVM IR. It is a huge advantage compared to language bound runtimes like JS or Lua.
@ -11,7 +11,7 @@ Why should you use a WASM runtime out of your browser? There are a few points wh
3. WASM is designed to be very friendly for compiling to native binaries and gaining the native speed. 3. WASM is designed to be very friendly for compiling to native binaries and gaining the native speed.
4. It can potentially change the development practices. Imagine we can do both the WASM application development and validation in a browser, then just download the WASM binary code onto the target device. 4. It can potentially change the development practices. Imagine we can do both the WASM application development and validation in a browser, then just download the WASM binary code onto the target device.
5. WASM can work without garbage collection. It is designed to support execution determinics for the time sensitive requirement. 5. WASM can work without garbage collection. It is designed to support execution determinics for the time sensitive requirement.
6. Maintain the safety goals WASM has of providing a sandboxed execution environment for untrusted code. In addition, because WASM is a compilation target, this implies a benefit of being able to target both an execution and security profile that is consistent across popular high-level programming languages. 6. Maintain the safety goals WASM has of providing a sandboxed execution environment for untrusted code. In addition, because WASM is a compilation target, this implies the benefit of being able to target both an execution and security profile that is consistent across popular high-level programming languages.
@ -65,7 +65,7 @@ make
``` ```
Zephyr Zephyr
------------------------- -------------------------
You need to download the Zephyr source code first and embedded WAMR into it. You need to download the Zephyr source code first and embed WAMR into it.
``` Bash ``` Bash
git clone https://github.com/zephyrproject-rtos/zephyr.git git clone https://github.com/zephyrproject-rtos/zephyr.git
cd zephyr/samples/ cd zephyr/samples/
@ -88,7 +88,7 @@ git clone https://github.com/emscripten-core/emsdk.git
emsdk install latest emsdk install latest
emsdk activate latest emsdk activate latest
``` ```
add ```./emsdk_env.sh``` into the path to ease future use, or source it every time. source ```./emsdk_env.sh```.
The Emscripten website provides other installation methods beyond Linux. The Emscripten website provides other installation methods beyond Linux.
You can write a simple ```test.c``` as the first sample. You can write a simple ```test.c``` as the first sample.
@ -149,7 +149,7 @@ WAMR can be built into a standalone executable which takes the WASM application
<img src="./doc/pics/embed.PNG" width="60%" height="60%"> <img src="./doc/pics/embed.PNG" width="60%" height="60%">
A typical WAMR API usage is shown below (some return values checking are ignored): A typical WAMR API usage is shown below (some return value checks are ignored):
``` C ``` C
static char global_heap_buf[512 * 1024]; static char global_heap_buf[512 * 1024];
@ -484,7 +484,7 @@ In this sample, the LittlevGL source code is built into the WebAssembly code wit
EXPORT_WASM_API(display_map), EXPORT_WASM_API(display_map),
EXPORT_WASM_API(time_get_ms), }; EXPORT_WASM_API(time_get_ms), };
The runtime component supports building target for Linux and Zephyr/STM Nucleo board respectively. The beauty of this sample is the WebAssembly application can have identical display and behavior when running from both runtime environments. That implies we can do majority of application validation from desktop environment then load it to the target device as long as two runtime distributions support the same set of application interface. The runtime component supports building target for Linux and Zephyr/STM Nucleo board respectively. The beauty of this sample is the WebAssembly application can have identical display and behavior when running from both runtime environments. That implies we can do the majority of application validation from the desktop environment then load it to the target device as long as two runtime distributions support the same set of the application interface.
Below pictures show the WASM application is running on an STM board with an LCD touch panel. When users click the blue button, the WASM application increases the counter, and the latest counter value is displayed on the top banner of the touch panel. Below pictures show the WASM application is running on an STM board with an LCD touch panel. When users click the blue button, the WASM application increases the counter, and the latest counter value is displayed on the top banner of the touch panel.
@ -496,6 +496,9 @@ The sample also provides the native Linux version of application without the run
<img src="./doc/pics/vgl_linux.PNG"> <img src="./doc/pics/vgl_linux.PNG">
Submit issues and request Submit issues and contact the maintainers
========================= =========================================
[Click here to submit. Your feedback is always welcome!](https://github.com/intel/wasm-micro-runtime/issues/new) [Click here to submit. Your feedback is always welcome!](https://github.com/intel/wasm-micro-runtime/issues/new)
Contact the maintainers: imrt-public@intel.com