mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
command.js print motd
This commit is contained in:
@@ -5,4 +5,4 @@ set PATH=\tvdos\tuidev;$PATH
|
||||
set KEYBOARD=us_colemak
|
||||
|
||||
rem this line specifies which shell to be presented after the boot precess:
|
||||
command
|
||||
command /fancy
|
||||
|
||||
19
assets/disk0/COPYING
Normal file
19
assets/disk0/COPYING
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2020-2022 CuriousTorvald
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
7
assets/disk0/etc/motd
Normal file
7
assets/disk0/etc/motd
Normal file
@@ -0,0 +1,7 @@
|
||||
Welcome to TVDOS Installer!
|
||||
|
||||
With this Live Boot environment you can freely try out the DOS without actual installation. The disk is write-protected so all the important files are safe.
|
||||
|
||||
To install the TVDOS to your disk, simply run 'install'.
|
||||
|
||||
TVDOS is provided "as is", without warranty of any kind; in no event shall the authors or copyright holders be liable for any claim, damages or other liabilities. Run 'less COPYING' for more information.
|
||||
19
assets/disk0/root.bootable/COPYING
Normal file
19
assets/disk0/root.bootable/COPYING
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2020-2022 CuriousTorvald
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
1
assets/disk0/root.live/!BOOTSEC
Normal file
1
assets/disk0/root.live/!BOOTSEC
Normal file
@@ -0,0 +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(p[0]),0==r){let g=com.pullMessage(p[0]);eval(g)}else println("The Installation Medium seems to be damaged. Please contact your reseller or system administrators.");else println("TVDOS.SYS not found");println();println("Remove the Installation Medium, close the tray (if any), then shut off and restart the computer to finish the installation.");
|
||||
8
assets/disk0/root.live/AUTOEXEC.BAT
Normal file
8
assets/disk0/root.live/AUTOEXEC.BAT
Normal file
@@ -0,0 +1,8 @@
|
||||
echo "Starting TVDOS Installation Medium..."
|
||||
|
||||
rem put set-xxx commands here:
|
||||
rem e.g. set PATH=\home\my-cool-project;$PATH
|
||||
set KEYBOARD=us_qwerty
|
||||
|
||||
rem this line specifies which shell to be presented after the boot precess:
|
||||
command /fancy
|
||||
19
assets/disk0/root.live/COPYING
Normal file
19
assets/disk0/root.live/COPYING
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2020-2022 CuriousTorvald
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
7
assets/disk0/root.live/etc/motd
Normal file
7
assets/disk0/root.live/etc/motd
Normal file
@@ -0,0 +1,7 @@
|
||||
Welcome to TVDOS Live Boot Medium!
|
||||
|
||||
With the Live Media you can freely try out the DOS without actual installation. The disk is write-protected so all the important files are safe.
|
||||
|
||||
To install the TVDOS to your disk, simply run 'install'.
|
||||
|
||||
TVDOS is provided "as is", without warranty of any kind; in no event shall the authors or copyright holders be liable for any claim, damages or other liabilities. Run 'less COPYING' for more information.
|
||||
@@ -67,6 +67,60 @@ function greet() {
|
||||
println(welcome_text)
|
||||
}
|
||||
|
||||
function printmotd() {
|
||||
let motdFile = files.open("A:/etc/motd")
|
||||
if (!motdFile.exists) return
|
||||
let motd = motdFile.sread().trim()
|
||||
let width = con.getmaxyx()[1]
|
||||
|
||||
|
||||
if (goFancy) {
|
||||
let margin = 4
|
||||
let internalWidth = width - 2*margin
|
||||
|
||||
con.video_reverse()
|
||||
|
||||
let [cy, cx] = con.getyx()
|
||||
|
||||
con.mvaddch(cy, 4, 16);con.curs_right();print(' ')
|
||||
|
||||
let tcnt = 0
|
||||
let pcx = margin - 1
|
||||
while (tcnt <= motd.length) {
|
||||
let char = motd.charAt(tcnt)
|
||||
|
||||
if (char != '\n') {
|
||||
print(motd.charAt(tcnt))
|
||||
pcx += 1
|
||||
}
|
||||
|
||||
if ('\n' == char || pcx % internalWidth == 0 && pcx != 0 || tcnt == motd.length) {
|
||||
// current line ending
|
||||
let [_, ncx] = con.getyx()
|
||||
for (let k = 0; k < width - margin - ncx + 1; k++) print(' ')
|
||||
con.addch(17);println()
|
||||
|
||||
if (tcnt == motd.length) break
|
||||
|
||||
// next line header
|
||||
let [ncy, __] = con.getyx()
|
||||
con.mvaddch(ncy, 4, 16);con.curs_right();print(' ')
|
||||
pcx = margin - 1
|
||||
}
|
||||
|
||||
tcnt += 1
|
||||
}
|
||||
|
||||
con.video_reverse()
|
||||
}
|
||||
else {
|
||||
println()
|
||||
println(motd)
|
||||
}
|
||||
|
||||
println()
|
||||
}
|
||||
|
||||
/*uninterruptible*/ function sendLcdMsg(s) {
|
||||
// making it uninterruptible
|
||||
sys.poke(-1025, (s === undefined) ? 0 : s.charCodeAt(0)|0)
|
||||
@@ -761,6 +815,7 @@ let cmdExit = false
|
||||
if (goInteractive) {
|
||||
con.curs_set(1)
|
||||
greet()
|
||||
printmotd()
|
||||
|
||||
let cmdHistory = [] // zeroth element is the oldest
|
||||
let cmdHistoryScroll = 0 // 0 for outside-of-buffer, 1 for most recent
|
||||
|
||||
Reference in New Issue
Block a user