Skip to content

Commit 781ebf3

Browse files
committed
Expose 4 Terminals
1 parent 603fd6d commit 781ebf3

File tree

3 files changed

+156
-178
lines changed

3 files changed

+156
-178
lines changed

examples/simple/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
</head>
88
<body>
99
<div id="screen"></div>
10-
<div id="serial"></div>
10+
<div id="terminal0"></div>
11+
<div id="terminal1"></div>
1112

1213
<button id="save">Save state</button>
1314
</body>

examples/simple/script.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ const shell = new LinuxBrowserShell(
66
bios: "./v86/seabios.bin",
77
vga_bios: "./v86/vgabios.bin",
88
cdrom: "./v86/image.iso",
9-
//initial_state: "./v86/initial-state.bin.zst",
9+
initial_state: "./v86/initial-state.bin.zst",
1010
},
1111
document.getElementById("screen"),
12-
document.getElementById("serial"),
1312
)
14-
shell.boot()
13+
14+
let tty0 = shell.getTerminal(0)
15+
let tty1 = shell.getTerminal(1)
16+
17+
tty0.attach(document.getElementById("terminal0"))
18+
tty1.attach(document.getElementById("terminal1"))
19+
20+
shell.boot().then(() => {
21+
console.log("Booted")
22+
})
1523

1624
document.getElementById("save").onclick = async function () {
1725
shell.downloadState()

0 commit comments

Comments
 (0)