Assemble kernel on client

This commit is contained in:
2026-03-18 14:23:37 +00:00
parent 6ee4adfea5
commit c91f46be88
2 changed files with 22 additions and 3 deletions

9
emu.js
View File

@@ -11,6 +11,7 @@ const RXBUF_SIZE = 32;
const PERIPHS_SIZE = 81;
const POLL_INTERVAL_MS = 20;
const DOT_INTERVAL_MS = 120;
const COLS = 80;
const TAB_WIDTH = 8;
@@ -50,8 +51,14 @@ class Emulator {
document.addEventListener('keydown', (e) => this.handle_keydown(e));
window.addEventListener('resize', () => this.handle_resize());
this.worker = new Worker('boot.js');
this.print("Assembling kernel ");
const dots = setInterval(() => this.print("."), DOT_INTERVAL_MS);
this.worker = new Worker('boot.js', { type: 'module' });
this.worker.postMessage(this.mem);
this.worker.onmessage = (e) => {
clearInterval(dots);
this.print(" done\n");
};
fetch('prelude.f')
.then(res => res.text())