8222d2e6e0
restore memcpy comment delete all the things! fix jshint issues restore memcpy comment remove duplicate fxsave assignment Count cache drops Use already available physical address instead of calling read_imm8 Remove useless assertion Just move around to reduce later diff Run jit paging test with assertions enabled Run jit-paging test on CI Extend jit-paging test Fix deleting invalidated code across memory pages Add jit-paging test to gitlab ci Remove jit_in_progress Clean up old comments, use bool for jit_jump Fix state image not begin garbage collected Add ENABLE_PROFILER_TIMES to configure slow profiling times Move to jit_generate and jit_run_interpreted to separate function Add missing struct field Fix: Don't write jit cache entry until no more faults can happen Download image for jit paging test Add missing initialiser Mark jit_{generate,run_interpreted} as static Specify full path to profiler.h Clean up duplicate/missing declaration after rebase mmap error handling, line length and fix some warnings remove further unused code move js imports to single header file
64 lines
1.2 KiB
JavaScript
64 lines
1.2 KiB
JavaScript
"use strict";
|
|
|
|
/**
|
|
* A modem via UART, like https://github.com/ewiger/jsmodem
|
|
* Not particlarly useful for anything, superseded by network.js
|
|
*
|
|
* @constructor
|
|
*/
|
|
function ModemAdapter()
|
|
{
|
|
this.send_char = function() {};
|
|
|
|
this.enabled = true;
|
|
this.socket = new WebSocket("ws://localhost:2080");
|
|
|
|
this.socket.onopen = this.onopen.bind(this);
|
|
this.socket.onmessage = this.onmessage.bind(this);
|
|
this.socket.onclose = this.onclose.bind(this);
|
|
this.socket.onerror = this.onerror.bind(this);
|
|
|
|
this.opened = false;
|
|
}
|
|
|
|
ModemAdapter.prototype.onmessage = function(e)
|
|
{
|
|
console.log("onmessage", e);
|
|
};
|
|
|
|
ModemAdapter.prototype.onclose = function(e)
|
|
{
|
|
console.log("onclose", e);
|
|
this.opened = false;
|
|
};
|
|
|
|
ModemAdapter.prototype.onopen = function(e)
|
|
{
|
|
console.log("open", e);
|
|
this.opened = true;
|
|
};
|
|
|
|
ModemAdapter.prototype.onerror = function(e)
|
|
{
|
|
console.log("onerror", e);
|
|
};
|
|
|
|
ModemAdapter.prototype.init = function(code_fn)
|
|
{
|
|
this.destroy();
|
|
this.send_char = code_fn;
|
|
};
|
|
|
|
ModemAdapter.prototype.destroy = function()
|
|
{
|
|
};
|
|
|
|
ModemAdapter.prototype.put_chr = function(chr)
|
|
{
|
|
console.log("put_chr", chr);
|
|
if(this.opened)
|
|
{
|
|
this.socket.send(chr);
|
|
}
|
|
};
|