Hi Kohei,

On 1/25/26 11:03 PM, Kohei Tokunaga wrote:
run-emscripten.mjs is a Node.js script to quickly test the Wasm-compiled
QEMU. This runs directly from the terminal using the node command so the
HTTP server or the browser isn't needed.

Node.js 24 or newer is needed to run wasm64 binaries. Also note that QEMU's
"quit" monitor command doesn't work as of now because of the Emscripten's
atexit issue [1]. Send SIGINT or SIGTERM to the node process to exit QEMU.

[1] https://github.com/emscripten-core/emscripten/issues/26040

Signed-off-by: Kohei Tokunaga <[email protected]>
---
  scripts/run-emscripten.mjs | 66 ++++++++++++++++++++++++++++++++++++++
  1 file changed, 66 insertions(+)
  create mode 100644 scripts/run-emscripten.mjs


I followed the instructions but could not get this running:

$ /usr/share/emscripten/tools/file_packager.py qemu-system-aarch64.data --preload pack/ > load.js $ ~/node-v24.13.0-linux-x64/bin/node ./scripts/run-emscripten.mjs --preload ./load.js ./qemu-system-aarch64.js -- -nographic -m 512M -L pack
file:///home/user/.work/qemu/scripts/run-emscripten.mjs:51
if (preloadModule) preloadModule.default(Module);
                                        ^
TypeError: preloadModule.default is not a function
    at file:///home/user/.work/qemu/scripts/run-emscripten.mjs:51:41
Node.js v24.13.0

I don't mind having a nodejs, or python script with browser. The point about using emrun was that it was easy to get something running, without fiddling with those kind of details.

If you offer a python script that automate the creation of details and spawn a server, it would be acceptable also.

Regards,
Pierrick

Reply via email to