Skip to content

Experimental support for QEMU TCG#307

Merged
ktock merged 1 commit intomainfrom
qemutcg
Sep 4, 2024
Merged

Experimental support for QEMU TCG#307
ktock merged 1 commit intomainfrom
qemutcg

Conversation

@ktock
Copy link
Collaborator

@ktock ktock commented Aug 21, 2024

Enable to use QEMU TCG on Wasm(emscripten). Multicore CPUs can also enabled leveraging MTTCG(Multi-Threded TCG).
This also patches QEMU to generate Wasm code from TCG: https://github.com/ktock/qemu/tree/qemu-tcg-wasm

  • NOTE1: Booting the kernel and the containers can take about 1 min. This example enables boot logs to allow tracking the status.
  • NOTE2: Works only on chrome. Networking is not supported as of now.

Example: x86_64 alpine on emscripten

$ make
$ mkdir -p /tmp/out-js4/htdocs
$ ./out/c2w --assets=. --target-stage=js-qemu-amd64 alpine /tmp/out-js4/htdocs/
$ cp -R ./examples/emscripten-qemu-tcg/* /tmp/out-js4/
$ docker run --rm -p 8082:80 \
         -v "/tmp/out-js4/htdocs:/usr/local/apache2/htdocs/:ro" \
         -v "/tmp/out-js4/xterm-pty.conf:/usr/local/apache2/conf/extra/xterm-pty.conf:ro" \
         --entrypoint=/bin/sh httpd -c 'echo "Include conf/extra/xterm-pty.conf" >> /usr/local/apache2/conf/httpd.conf && httpd-foreground'

Then localhost:8082 serves the image.

@ktock ktock force-pushed the qemutcg branch 3 times, most recently from cf7b2d6 to 1082d13 Compare August 21, 2024 09:05
@ktock ktock force-pushed the qemutcg branch 4 times, most recently from c761a6b to 7dc254e Compare August 28, 2024 03:06
@ktock ktock added this to the v0.7.0 milestone Aug 28, 2024
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
@ktock ktock merged commit b31fe56 into main Sep 4, 2024
@ktock ktock deleted the qemutcg branch September 4, 2024 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant