diff --git a/assets/!BOOTSEC b/assets/!BOOTSEC index ae46bb5..13336dc 100644 --- a/assets/!BOOTSEC +++ b/assets/!BOOTSEC @@ -1 +1 @@ -let p=_BIOS.FIRST_BOOTABLE_PORT;com.sendMessage(p[0], "DEVRST\x17");com.sendMessage(p[0],'OPENR"tvdos/TVDOS.SYS",'+p[1]);let r=com.getStatusCode(p[0]);if(0==r)if(com.sendMessage(p[0],"READ"),r=com.getStatusCode([0]),0==r){let g=com.pullMessage(p[0]);eval(g)}else println("I/O Error");else println("TVDOS.SYS not found"); \ No newline at end of file +let p=_BIOS.FIRST_BOOTABLE_PORT;com.sendMessage(p[0], "DEVRST\x17");com.sendMessage(p[0],'OPENR"tvdos/TVDOS.SYS",'+p[1]);let r=com.getStatusCode(p[0]);if(0==r)if(com.sendMessage(p[0],"READ"),r=com.getStatusCode([0]),0==r){let g=com.pullMessage(p[0]);eval(g)}else println("I/O Error");else println("TVDOS.SYS not found");println("Shutting down...");println("It is now safe to turn off the power"); \ No newline at end of file diff --git a/assets/tvdos/command.js b/assets/tvdos/command.js index 744ff51..c64295c 100644 --- a/assets/tvdos/command.js +++ b/assets/tvdos/command.js @@ -108,6 +108,21 @@ shell.coreutils = { } shell_pwd = args[1].split("\\"); + }, + cls: function(args) { + con.clear(); + }, + exit: function(args) { + cmdExit = true; + }, + ver: function(args) { + println(welcome_text); + }, + echo: function(args) { + if (args[1] !== undefined) { + args.forEach(function(it,i) { if (i > 0) print(it+" ") }); + } + println(); } }; Object.freeze(shell.coreutils); @@ -133,7 +148,8 @@ greet(); let cmdHistory = []; // zeroth element is the oldest let cmdHistoryScroll = 0; // 0 for outside-of-buffer, 1 for most recent -while (true) { +let cmdExit = false; +while (!cmdExit) { print_prompt_text(); let cmdbuf = "";