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
+55-44Lines changed: 55 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@ WebAssembly Micro Runtime
2
2
=========================
3
3
WebAssembly Micro Runtime (WAMR) is a standalone WebAssembly (WASM) runtime designed for a small footprint. It includes:
4
4
- A WebAssembly (WASM) VM core
5
-
- The supporting APIs for the WASM applications
5
+
- The supporting API's for the WASM applications
6
6
- A mechanism for dynamic management of the WASM application
7
7
8
-
Why should you use a WASM runtime out of your browser? There are a few points where this might be meaningful:
8
+
Why should you use a WASM runtime out of your browser? There are a few points where this might be meaningful:
9
9
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.
10
-
2. WASM is an open standard and it is fast becoming supported by the whole web ecosystem.
10
+
2. WASM is an open standard and it is fast becoming supported by the whole web ecosystem.
11
11
3. WASM is designed to be very friendly for compiling to native binaries and gaining the native speed.
12
-
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.
12
+
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.
13
13
5. WASM can work without garbage collection. It is designed to support execution determinics for the time sensitive requirement.
14
14
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.
15
15
@@ -18,8 +18,8 @@ Why should you use a WASM runtime out of your browser? There are a few points wh
- Provides API's for embedding runtime into production software
24
24
- Provides a mechanism for exporting native API's to WASM applications
25
25
- Supports the programming of firmware apps in a large range of languages (C/C++/Java/Rust/Go/TypeScript etc.)
@@ -31,7 +31,7 @@ Current Features of WAMR
31
31
32
32
Architecture
33
33
=========================
34
-
The application manager component handles the packets that the platform receives from external sources through any communication buses such as a socket, serial port or PSI. A packet type can be either a request, response or an event. The app manager will serve the requests with URI "/applet" and call the runtime glue layer interfaces for installing/uninstalling the application. For other URI's, it will filter the resource registration table and route the request to the internal queue of the responsible application.
34
+
The application manager component handles the packets that the platform receives from external sources through any communication buses such as a socket, serial port or SPI. A packet type can be either a request, a response or an event. The application manager will serve the requests with URI "/applet" and call the runtime glue layer interfaces for installing/uninstalling the application. For other URI's, it will filter the resource registration table and route the request to the internal queue of the responsible application.
35
35
36
36
- The WebAssembly runtime provides the execution environment for WASM applications.
37
37
@@ -144,7 +144,7 @@ ninja run
144
144
145
145
Embed WAMR into software production
146
146
=====================================
147
-
WAMR can be built into a standalone executable which takes the WASM application file name as input, and then executes it. To use it in the embedded environment you should embed WAMR into your own software product. WASM provides a set of APIs for embedded code to load the WASM module, instantiate the module and invoke a WASM function from a native call.
147
+
WAMR can be built into a standalone executable which takes the WASM application file name as input, and then executes it. To use it in the embedded environment you should embed WAMR into your own software product. WASM provides a set of API's for embedded code to load the WASM module, instantiate the module and invoke a WASM function from a native call.
@@ -174,7 +174,7 @@ A typical WAMR API usage is shown below (some return value checks are ignored):
174
174
wasm_runtime_clear_exception(inst);
175
175
}
176
176
/* the return value is stored in argv[0]*/
177
-
printf(“fib function return: %d\n”, argv[0]);
177
+
printf("fib function return: %d\n", argv[0]);
178
178
179
179
wasm_runtime_destory_exec_env(env);
180
180
wasm_runtime_deinstantiate(inst);
@@ -194,10 +194,10 @@ In general, there are 3 classes of API's important for the WASM application:
194
194
195
195
Built-in application library
196
196
---------------
197
-
Built-in API's include Libc APIs, Base library and Extension library reference.
197
+
Built-in API's include Libc API's, Base library and Extension library reference.
198
198
199
-
**Libc APIs**<br/>
200
-
This is a minimal set of Libc APIs for memory allocation, string manipulation and printing. The header file is located at ```lib/app-libs/libc/lib_base.h```. The current supported API set is listed here:
199
+
**Libc API's**<br/>
200
+
This is a minimal set of Libc API's for memory allocation, string manipulation and printing. The header file is located at ```lib/app-libs/libc/lib_base.h```. The current supported API set is listed here:
Basic support for communication, timers, etc is available. You can refer to the header file ```lib/app-libs/base/wasm_app.h``` which contains the definitions for request and response API's, event pub/sub APIs and timer APIs. Please note that these API's require the native implementations.
221
+
Basic support for communication, timers, etc is available. You can refer to the header file ```lib/app-libs/base/wasm_app.h``` which contains the definitions for request and response API's, event pub/sub API's and timer API's. Please note that these API's require the native implementations.
In the application source project, it will include the WAMR built-in APIs header file and platform extension header files. Assuming the board vendor extends the library which added an API called customized(), the WASM application would be like this:
355
+
In the application source project, it will include the WAMR built-in API's header file and platform extension header files. Assuming the board vendor extends the library which added an API called customized(), the WASM application would be like this:
356
356
```C
357
357
#include<stdio.h>
358
358
#include"lib_export_dec.h"// provided by the platform vendor
@@ -382,8 +382,6 @@ Below is the reference implementation of the server application. It provides roo
@@ -424,35 +422,20 @@ One WASM application acts as the event publisher. It publishes events to notify
424
422
Below is the reference implementation of the pub application. It utilizes a timer to repeatedly publish an overheat alert event to the subscriber applications. Then the subscriber applications receive the events immediately.
Copy file name to clipboardExpand all lines: samples/simple/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
Introduction
2
2
==============
3
-
This project builds out both host tools running on the host side, an application running on the device side. The device application consists of iwasm, application library, application manager, timers and sensors support. The device runs on Linux OS and interacts with host tools.
3
+
This project builds out both host tools running on the host side, and an application running on the device side. The device application consists of iwasm, application library, application manager, timers and sensors support. The device runs on Linux OS and interacts with host tools.
4
4
5
5
It demonstrates an end to end scenario, the wasm applications life cycle management and communication programming models.
0 commit comments