forked from copy/v86
-
Notifications
You must be signed in to change notification settings - Fork 0
/
async_load.html
43 lines (37 loc) · 1.2 KB
/
async_load.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!doctype html>
<title>Asynchronous loading of disk images</title>
<script src="../build/libv86.js"></script>
<script>
"use strict";
window.onload = function()
{
// Async loading of the iso image
// Note how the emulation starts without downloading the 50MB image
// Support of the "Range: bytes=..." header is required on the server, CORS
// is required if the server is on a different host
var emulator = new V86({
wasm_path: "../build/v86.wasm",
memory_size: 64 * 1024 * 1024,
vga_memory_size: 2 * 1024 * 1024,
screen_container: document.getElementById("screen_container"),
bios: {
url: "../bios/seabios.bin",
},
vga_bios: {
url: "../bios/vgabios.bin",
},
cdrom: {
url: "../images/dsl-4.11.rc2.iso",
async: true,
// size can be determined automatically, but costs an extra request
// and might not work reliably
size: 52824064,
},
autostart: true,
});
}
</script>
<div id="screen_container">
<div style="white-space: pre; font: 14px monospace; line-height: 14px"></div>
<canvas style="display: none"></canvas>
</div>