puter/incubator/x86emu/www/index.html

97 lines
2.8 KiB
HTML
Raw Normal View History

2024-04-02 23:25:21 +08:00
<!doctype html>
<html>
<head>
<script src="./third-party/libv86.js"></script>
<link rel="stylesheet" href="./third-party/xterm.css" />
<script src="./third-party/xterm.js"></script>
<script type="module" defer>
"use strict";
import InstanceManager from "./js/InstanceManager.mjs"
document.addEventListener("DOMContentLoaded", () => {
window.manager = new InstanceManager({spawnRoot: document.body, screen: true});
});
// var term = new Terminal({
// allowTransparency: true,
// });
// term.open(document.getElementById('terminal'));
// term.write("Now booting emu, please stand by ...");
// var emulator = new V86({
// // network_relay_url: "ws://localhost:8080/",
// wasm_path: "./lib/v86.wasm",
// preserve_mac_from_state_image: true,
// memory_size: 1024 * 1024 * 1024,
// vga_memory_size: 8 * 1024 * 1024,
// initial_state: {url: "./images/image.bin"},
// filesystem: {baseurl: "./images/9p-rootfs/"},
// autostart: true,
// });
// emulator.add_listener("emulator-started", function () {
// // emulator.serial0_send("\nsh networking.sh > /dev/null 2>&1 &\n\n");
// // emulator.serial0_send("clear\n");
// term.write("Welcome to psl!");
// emulator.serial0_send("\n");
// });
// emulator.add_listener("serial0-output-byte", function (byte) {
// var chr = String.fromCharCode(byte);
// if (chr <= "~") {
// term.write(chr);
// }
// });
// term.onData(data => {
// emulator.serial0_send(data);
// });
// var termt = new Terminal({
// allowTransparency: true,
// });
// termt.open(document.getElementById('second_terminal'));
// termt.write("Now booting, please stand by ...");
// var emulatort = new V86({
// // network_relay_url: "ws://localhost:8080/",
// wasm_path: "./lib/v86.wasm",
// preserve_mac_from_state_image: true,
// memory_size: 512 * 1024 * 1024,
// vga_memory_size: 8 * 1024 * 1024,
// initial_state: {url: "./images/image.bin"},
// filesystem: {baseurl: "./images/9p-rootfs/"},
// autostart: true,
// });
// emulatort.add_listener("emulator-started", function () {
// // emulatort.serial0_send("\nsh networking.sh > /dev/null 2>&1 &\n\n");
// // emulatort.serial0_send("clear\n");
// termt.write("Welcome to psl!");
// emulatort.serial0_send("\n");
// });
// emulatort.add_listener("serial0-output-byte", function (byte) {
// var chr = String.fromCharCode(byte);
// if (chr <= "~") {
// termt.write(chr);
// }
// });
// termt.onData(data => {
// emulatort.serial0_send(data);
// });
// emulator.add_listener("net0-send", function (data) {
// emulatort.bus.send("net0-receive", data);
// });
// emulatort.add_listener("net0-send", function (data) {
// emulator.bus.send("net0-receive", data);
// });
</script>
</head>
<body>
<div id="terminal"></div>
<div id="second_terminal"></div>
</body>
</html>