You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74-39Lines changed: 74 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,87 +14,122 @@ WebAssembly Micro Runtime (WAMR) is a standalone WebAssembly (WASM) runtime with
14
14
Current Features of WAMR
15
15
=========================
16
16
- WASM interpreter (AOT is planned)
17
-
- Supports for a subset of Libc API.
18
-
- Supports for [WASI API](https://github.com/WebAssembly/WASI)
19
17
- Provides embedding C API
20
18
- Provides a mechanism for exporting native API's to WASM applications
21
-
- Supports the programming of firmware apps in a large range of languages (C/C++/Java/Rust/Go/TypeScript etc.)
22
-
- App sandbox execution environment on embedded OS
23
-
- The purely asynchronized programming model
24
-
- Menu configuration for easy platform integration
25
-
- Supports micro-service and pub-sub event inter-app communication models
26
-
- Easy to extend to support remote FW application management from host or cloud
19
+
- Supports libc for WASM applications in two modes: the built-in libc subset for embedded environment and [WASI](https://github.com/WebAssembly/WASI) for standard libc
20
+
- The WASM application framework and asynchronized app programming model
21
+
- Supports for micro-service and pub-sub event inter-app communication models
22
+
- Supports remote WASM application management from either host or cloud
23
+
- Menu configuration for easy integration of application libraries
27
24
28
25
Application framework architecture
29
26
===================================
30
27
31
-
By using the iwasm VM core, we are flexible to build different application frameworks for the specific domains.
28
+
By using the iwasm VM core, we are flexible to build different application frameworks for the specific domains.
32
29
33
30
The WAMR has offered a comprehensive application framework for device and IoT usages. The framework solves many common requirements for building a real project:
34
31
- Modular design for more language runtimes support
35
32
- Inter application communication
36
33
- Remote application management
37
-
- WASM APP programming model and API extension mechanism
34
+
- WASM APP programming model and API extension mechanism
38
35
39
36
<imgsrc="./doc/pics/wamr-arch.JPG"width="80%">
40
37
41
38
42
39
43
-
Build WAMR Core and run WASM applications
44
-
================================================
40
+
Build WAMR
41
+
==========
45
42
46
-
WAMR VM core (iwasm) can support building on different platforms:
43
+
## Build WAMR VM core
44
+
45
+
46
+
WAMR VM core (iwasm) can support building for different target platforms:
47
47
- Linux
48
48
- Zephyr
49
49
- Mac
50
50
- VxWorks
51
51
- AliOS-Things
52
-
- Docker
53
52
- Intel Software Guard Extention (SGX)
54
53
55
-
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](./doc/wamr_api.md).
54
+
See [Build WAMR VM core](./doc/build_wamr.md) for the detailed instructions.
56
55
57
-
See the [doc/building.md](./doc/building.md) for the detailed instructions.
56
+
## Libc building options
58
57
58
+
WAMR supports WASI for standard libc library as well as a [built-in libc subset](./doc/wamr_api.md) for tiny footprint.
59
59
60
-
Embed WAMR
61
-
===========
60
+
WASI is supported for following platforms and enabled by default building:
61
+
- Linux
62
62
63
-
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.
64
63
65
-
WAMR provides a set of C API for loading the WASM module, instantiating the module and invoking a WASM function from a native call.
66
64
67
-
See the [doc/embed_wamr.md](./doc/embed_wamr.md) for the details.
65
+
## Embed WAMR VM core
68
66
69
-
WAMR application programming library
70
-
===================================
67
+
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.
68
+
69
+
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 [Embed WAMR VM core](./doc/embed_wamr.md) for the details.
70
+
71
+
The WAMR application framework supports dynamically installing WASM application remotely by embedding the WAMR VM core. It can be used as reference for how to use the embedding API's.
72
+
73
+
74
+
## Integrate WAMR application library
75
+
76
+
The WAMR provides an application framework which supports event driven programming model as below:
71
77
72
-
WAMR defined event driven programming model:
73
78
- Single thread per WASM app instance
74
79
- App must implement system callbacks: on_init, on_destroy
75
80
81
+
Application programming API sets are available as below:
82
+
83
+
- Timer
84
+
- Micro service (Request/Response) and Pub/Sub inter-app communication
85
+
- Sensor
86
+
- Connectivity and data transmission
87
+
- 2D graphic UI (based on littlevgl)
88
+
89
+
See [WAMR application library](./doc/wamr_api.md) for the details.
90
+
91
+
One WAMR runtime version can also select a subsets from the WAMR application library. Refer to the sample "simple" for how to integrate API sets into WAMR building.
92
+
93
+
94
+
95
+
## Build WAMR with customized application library
96
+
97
+
In general when you build a WAMR version for a specific project, you probably will create additional API's for the applications. The API's can be expansion or modification to the standard WAMR application library.
98
+
99
+
The extended application library should be created in the folder [core/iwasm/lib/app-libs](./core/iwasm/lib/app-libs/). See the [doc/export_native_api.md](./doc/export_native_api.md) for the details.
100
+
101
+
102
+
103
+
# Create WASM application SDK
104
+
105
+
When you ship your WAMR runtime with the products, you will need to distribute the associated WASM application SDK for the application developers to develop WASM applications for your products. At the most time, the WASM application SDK should have a version match with the runtime distribution.
106
+
107
+
108
+
109
+
Typically there are a few components in a WASM APP SDK package:
110
+
111
+
***WASI-SDK**: only needed when WASI is enabled in the runtime. It can be a link to the WASI-SDK GitHub or the full offline copy.
112
+
***sysroot** folder: only needed when WASI is not enabled in the runtime. copied from [test-tools/toolchain/sysroot](./test-tools/toolchain/sysroot)
113
+
***app-lib** folder: copied from [core/iwasm/lib/app-libs](./core/iwasm/lib/app-libs/)
114
+
***cmake toolchain** file: copied from [test-tools/toolchain/wamr_toolchain.cmake](./test-tools/toolchain/wamr_toolchain.cmake)
115
+
* optionally with some guide documents and samples
116
+
117
+
118
+
119
+
Build WASM applications
120
+
===================================
76
121
77
-
In general there are a few API classes for the WASM application programming:
78
-
- WAMR Built-in API: WAMR core provides a minimal libc API set for WASM APP
79
-
- WAMR application libraries:
80
-
- Timer
81
-
- Micro service (Request/Response)
82
-
- Pub/Sub
83
-
- Sensor
84
-
- Connection and data transmission
85
-
- 2D graphic UI (based on littlevgl)
86
-
- User extended native API: extend the native API to the WASM applications
87
-
- 3rd party libraries: Programmers can download any 3rd party C/C++ source code and build it together with the WASM APP code
122
+
WebAssembly as a new binary instruction can be viewed as a virtual architecture. If the WASM application is developed in C/C++ language, developers can use conventional cross-compilation procedure to build the WASM application. cmake is the recommended building tool and Clang is the preferred compiler. While emcc may still work but it is not guaranteed.
88
123
89
-
See the [doc/wamr_api.md](./doc/wamr_api.md) for the details.
124
+
Refer to [Build WASM applications](doc/build_wasm_app.md) for details.
90
125
91
126
92
127
Samples and demos
93
128
=================
94
129
95
130
The WAMR samples are located in folder [./samples](./samples). A sample usually contains the WAMR runtime build, WASM applications and test tools. The WARM provides following samples:
96
131
-[Simple](./samples/simple/README.md): The runtime is integrated with most of the WAMR APP libaries and multiple WASM applications are provided for using different WASM API set.
97
-
-[littlevgl](./samples/littlevgl/README.md): Demostrating the graphic user interface application usage on WAMR. The whole [LittlevGL](https://github.com/littlevgl/) 2D user graphic library and the UI application is built into WASM application.
132
+
-[littlevgl](./samples/littlevgl/README.md): Demostrating the graphic user interface application usage on WAMR. The whole [LittlevGL](https://github.com/littlevgl/) 2D user graphic library and the UI application is built into WASM application.
98
133
-[gui](./samples/gui/README.md): Moved the [LittlevGL](https://github.com/littlevgl/) library into the runtime and defined a WASM application interface by wrapping the littlevgl API.
99
134
-[IoT-APP-Store-Demo](./test-tools/IoT-APP-Store-Demo/README.md): A web site for demostrating a WASM APP store usage where we can remotely install and uninstall WASM application on remote devices.
100
135
@@ -109,9 +144,9 @@ The graphic user interface demo photo:
109
144
Releases and acknowledgments
110
145
============================
111
146
112
-
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.
147
+
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.
113
148
114
-
See the [major features releasing history and contributor names](./doc/release_ack.md)
149
+
See the [major features releasing history and contributor names](./doc/release_ack.md)
0 commit comments