forked from copy/v86
-
Notifications
You must be signed in to change notification settings - Fork 1
/
debian-filer.html
105 lines (87 loc) · 3.26 KB
/
debian-filer.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!doctype html>
<title>Debian</title>
<script src="https://unpkg.com/filer"></script>
<!-- XXX: button assumed in libv86.js crashes without this -->
<button id="start_emulation" hidden>Start Emulation</button>
<script>
"use strict";
var CORE_FILES =
"const.js config.js log.js lib.js buffer.js cpu.js debug.js " +
"io.js main.js ide.js pci.js floppy.js " +
"memory.js dma.js pit.js vga.js ps2.js pic.js rtc.js uart.js acpi.js apic.js ioapic.js hpet.js sb16.js " +
"ne2k.js state.js virtio.js bus.js elf.js kernel.js";
var BROWSER_FILES = "main.js screen.js keyboard.js mouse.js speaker.js serial.js network.js starter.js worker_bus.js print_stats.js filestorage.js";
var LIB_FILES = "";
// jor1k stuff
LIB_FILES += " jor1k.js 9p-filer.js filesystem.js marshall.js utf8.js";
var BUILD_FILES = "capstone-x86.min.js libwabt.js";
var to_load = [];
load_scripts(CORE_FILES, "/src/");
load_scripts(BROWSER_FILES, "/src/browser/");
load_scripts(LIB_FILES, "/lib/");
load_scripts(BUILD_FILES, "/build/");
function load_scripts(resp, path) {
var files = resp.split(" ");
for (var i = 0; i < files.length; i++) {
if (!files[i]) {
continue;
}
to_load.push(path + files[i]);
}
}
load_next();
function load_next() {
let s = to_load.shift();
if (!s) {
return;
}
var script = document.createElement("script");
script.src = s;
script.onload = load_next;
script.onerror = function () {
console.warn("trying to ignore script " + s + ", which failed to load");
load_next();
};
document.head.appendChild(script);
}
</script>
<script>
"use strict";
window.onload = function () {
var fs = new Filer.FileSystem({
name: "anura-mainContext",
provider: new Filer.FileSystem.providers.IndexedDB()
});
var Path = Filer.Path;
var Buffer = Filer.Buffer;
var sh = new fs.Shell();
window.fs = fs;
window.sh = sh
window.path = Path;
window.Buffer = Buffer;
var emulator = new V86Starter({
wasm_path: "../build/v86.wasm",
memory_size: 512 * 1024 * 1024,
vga_memory_size: 8 * 1024 * 1024,
screen_container: document.getElementById("screen_container"),
bios: {url: "../bios/seabios.bin"},
vga_bios: {url: "../bios/vgabios.bin"},
// cdrom: {url: "../images/v86-linux.iso"},
filesystem: {fs, sh, Path, Buffer},
autostart: true,
// bzimage_initrd_from_filesystem: true,
bzimage: {
url: "/images/buildroot-bzimage.bin",
size: 5166352,
async: false,
},
// cdrom: {url: "/images/linux.iso"},
cmdline: "tsc=reliable mitigations=off random.trust_cpu=on"
});
};
</script>
<!-- A minimal structure for the ScreenAdapter defined in browser/screen.js -->
<div id="screen_container">
<div style="white-space: pre; font: 14px monospace; line-height: 14px"></div>
<canvas style="display: none"></canvas>
</div>