Sun 20 Oct 15:08:44 CEST 2024

This commit is contained in:
sbosse 2024-10-20 15:09:45 +02:00
parent 7d2d673db2
commit e69804f971

42
webv86/makeit.sh Normal file
View File

@ -0,0 +1,42 @@
#!/bin/bash
mkdir web
wget https://github.com/copy/v86/releases/download/latest/libv86.js \
--directory-prefix web
wget https://github.com/copy/v86/releases/download/latest/v86.wasm \
--directory-prefix web
wget https://github.com/copy/v86/releases/download/latest/v86-fallback.wasm \
--directory-prefix web
wget https://github.com/copy/v86/archive/refs/tags/latest.tar.gz \
--output-document - \
| tar -xz --strip-components 2 --directory web \
v86-latest/bios/seabios.bin \
v86-latest/bios/vgabios.bin
cat >web/index.html <<EOF
<!DOCTYPE html>
<meta charset="utf8">
<title>Emulator</title>
<body bgcolor="#101010">
<div id="screen_container">
<div style="white-space: pre; font: 14px monospace; line-height: 14px"></div>
<canvas hidden></canvas>
</div>
<script src="/libv86.js"></script>
<script>
var emulator = new V86Starter({
wasm_path : "/v86.wasm",
memory_size : 64 * 1024 * 1024, // 64 MB memory ought to be enough for anyone
vga_memory_size : 2 * 1024 * 1024,
screen_container : screen_container,
bios : {url: "/seabios.bin"},
vga_bios : {url: "/vgabios.bin"},
cdrom : {url: "/basekernel.iso"},
filesystem : {},
autostart : true
})
</script>
EOF