booting entirely from the bios

This commit is contained in:
minjaesong
2020-10-31 22:23:26 +09:00
parent ca906d8606
commit 055b825cca
7 changed files with 86 additions and 60 deletions

View File

@@ -300,9 +300,23 @@ function println(s) {
else
sys.println(s);
}
function printerr(s) {
print("\x1B[31m"+s+"\x1B[m");
}
function printerrln(s) {
println("\x1B[31m"+s+"\x1B[m");
}
function read() {
return sys.read();
}
String.prototype.trimNull = function() {
let cnt = this.length - 1
while (cnt >= 0) {
if (this.charCodeAt(cnt) != 0) break;
cnt -= 1;
}
return this.slice(0, cnt + 1);
}
// ncurses-like terminal control
var con = {};
con.getch = function() {