emulator.stop sometimes works (when the GC can figure out that .start()
is unreachable and nothing can call into the instance). However, some
resources, such as any WebSocket connection, need to be closed manually.
Emulate a networking stack, intercept HTTP requests, serve
them with fetch(). Enable by setting networking_proxy=fetch
Somewhat fixes#198
Just enough networking for http to work for package managers and
net-boot. The networking stack just reflects the macaddress of
packets it receives, so shouldnt be bothered by mac address
changes. Services include:
- ARP replies by establishing the gateways IP
- DHCP server sending gateway, dns, and client-ip
- Gateway: 192.168.86.1
- Client: 192.168.86.100
- Netmask: 255.255.255.0
- UDP DNS server, all addresses resolve to: 192.168.87.1
- NTP Server, giving out the current time from Date()
- Replies to ICMP pings to any IP address
- UDP echo server on port 8
Limitations:
- Request are limited by CORS rules, but CORS-proxies can work around
this.
- Redirects are handled transparently by fetch. The upside is sites that
force an http->https upgrade appear to the VM to work over http.
Future Work:
- Allow HTTP requests from browser to be served by VM.
- HTTPS support (maybe with help of a rust based TLS stack in WASM)
- Support for POSTing binary data
* Run devices tests in CI
* Allow multiple Ne2k adapters
Co-authored-by: Fabian <copy@copy.sh>
* (feat) Docker: Add Support for Running inside Docker Container
Uses Alpine image as base to have minimal size. 2-step build process to get rid of source and library files after compilation and during runtime. Uses Python3 HTTP Server to serve static assets.
Signed-off-by: Progyan Bhattacharya <bprogyan@gmail.com>
Without this patch, the following error is thrown:
rust-lld: error: --import-table and --export-table may not be used together
Tested on the following nightly versions:
rustc 1.30.0-nightly (7e8ca9f8b 2018-08-03)
rustc 1.30.0-nightly (33b923fd4 2018-08-18)
This commit contains the final changes requires for porting all C code
to Rust and from emscripten to llvm:
- tools/wasm-patch-indirect-function-table.js: A script that rewrites
the wasm generated by llvm to remove the table limit
- tools/rust-lld-wrapper: A wrapper around rust-lld that removes
arguments forced by rustc that break compilation for us
- src/rust/cpu2/Makefile: A monstrosity to postprocess c2rust's output
- gen/generate_interpreter.js: Ported to produce Rust instead of C
- src/rust/*: A few functions and macros to connect the old Rust code
and the new Rust code
- src/*.js: Removes the loading of the old emscripten wasm module and
adapts imports and exports from emscripten to llvm