doc update

This commit is contained in:
minjaesong
2022-09-27 21:54:53 +09:00
parent 11214c0f7a
commit 09e4d04160
7 changed files with 62 additions and 31 deletions

3
.gitignore vendored
View File

@@ -51,6 +51,9 @@ tmp_*
*.out *.out
tsvmman.pdf tsvmman.pdf
*.toc *.toc
*.idx
*.ilg
*.ind
assets/disk0/home/basic/* assets/disk0/home/basic/*
assets/disk0/movtestimg/*.jpg assets/disk0/movtestimg/*.jpg

View File

@@ -17,6 +17,10 @@ else {
function greet() { function greet() {
if (!port) { if (!port) {
println("COM port not specified; please run 'listen [1|2|3|4]' to open a port first.") println("COM port not specified; please run 'listen [1|2|3|4]' to open a port first.")
println("In listening mode, any text entered will be sent right to the COM")
println("Hit Ctrl+A while listening to return to the prompt.")
println("On the prompt, enter 'pull' to pull the message.")
println("Enter 'exit' to exit.")
} }
} }
@@ -65,12 +69,13 @@ function sendMessage(line) {
if (line.charAt(line.length - 1) == '\\') if (line.charAt(line.length - 1) == '\\')
line = line.substring(0, line.length - 1) + '\x17' line = line.substring(0, line.length - 1) + '\x17'
com.sendMessage(port - 1, line) com.sendMessage(port - 1, line)
println(com.fetchResponse(port - 1)) com.waitUntilReady(port - 1)
println(com.pullMessage(port - 1))
} }
} }
function print_prompt_text() { function print_prompt_text() {
print(`${getFocusStr[focus]()}> `) print(`${getFocusStr[focus]()}>`)
} }
con.curs_set(1) con.curs_set(1)

View File

@@ -19,10 +19,11 @@
\indexentry{MMIO-graphics|hyperpage}{26} \indexentry{MMIO-graphics|hyperpage}{26}
\indexentry{boot process|hyperpage}{29} \indexentry{boot process|hyperpage}{29}
\indexentry{coreutils (DOS)|hyperpage}{30} \indexentry{coreutils (DOS)|hyperpage}{30}
\indexentry{applications (DOS)|hyperpage}{31} \indexentry{built-in apps (DOS)|hyperpage}{31}
\indexentry{pipe (DOS)|hyperpage}{34} \indexentry{user apps (DOS)|hyperpage}{33}
\indexentry{filesystem (DOS)|hyperpage}{36} \indexentry{pipe (DOS)|hyperpage}{35}
\indexentry{file descriptor (DOS)|hyperpage}{36} \indexentry{filesystem (DOS)|hyperpage}{37}
\indexentry{device file|hyperpage}{38} \indexentry{file descriptor (DOS)|hyperpage}{37}
\indexentry{input (DOS)|hyperpage}{40} \indexentry{device file|hyperpage}{39}
\indexentry{gl (DOS)|hyperpage}{41} \indexentry{input (DOS)|hyperpage}{41}
\indexentry{gl (DOS)|hyperpage}{43}

View File

@@ -1,6 +1,6 @@
This is makeindex, version 2.16 [TeX Live 2022] (kpathsea + Thai support). This is makeindex, version 2.16 [TeX Live 2022] (kpathsea + Thai support).
Scanning input file tsvmman.idx....done (28 entries accepted, 0 rejected). Scanning input file tsvmman.idx....done (29 entries accepted, 0 rejected).
Sorting entries....done (137 comparisons). Sorting entries....done (142 comparisons).
Generating output file tsvmman.ind....done (61 lines written, 0 warnings). Generating output file tsvmman.ind....done (62 lines written, 0 warnings).
Output written in tsvmman.ind. Output written in tsvmman.ind.
Transcript written in tsvmman.ilg. Transcript written in tsvmman.ilg.

View File

@@ -1,12 +1,9 @@
\begin{theindex} \begin{theindex}
\item applications (DOS), \hyperpage{31}
\indexspace
\item base64 (library), \hyperpage{13} \item base64 (library), \hyperpage{13}
\item block communication, \hyperpage{16} \item block communication, \hyperpage{16}
\item boot process, \hyperpage{29} \item boot process, \hyperpage{29}
\item built-in apps (DOS), \hyperpage{31}
\indexspace \indexspace
@@ -19,22 +16,22 @@
\indexspace \indexspace
\item device file, \hyperpage{38} \item device file, \hyperpage{39}
\indexspace \indexspace
\item file descriptor (DOS), \hyperpage{36} \item file descriptor (DOS), \hyperpage{37}
\item filesystem (DOS), \hyperpage{36} \item filesystem (DOS), \hyperpage{37}
\indexspace \indexspace
\item gl (DOS), \hyperpage{41} \item gl (DOS), \hyperpage{43}
\item graphics (library), \hyperpage{26} \item graphics (library), \hyperpage{26}
\item gzip (library), \hyperpage{12} \item gzip (library), \hyperpage{12}
\indexspace \indexspace
\item input (DOS), \hyperpage{40} \item input (DOS), \hyperpage{41}
\indexspace \indexspace
@@ -51,11 +48,15 @@
\indexspace \indexspace
\item pipe (DOS), \hyperpage{34} \item pipe (DOS), \hyperpage{35}
\indexspace \indexspace
\item stdio (library), \hyperpage{9} \item stdio (library), \hyperpage{9}
\item sys (library), \hyperpage{13} \item sys (library), \hyperpage{13}
\indexspace
\item user apps (DOS), \hyperpage{33}
\end{theindex} \end{theindex}

View File

@@ -52,9 +52,9 @@ Variables can be set or changed using \textbf{SET} commands.
\chapter{Applications} \chapter{Built-in Apps}
\index{applications (DOS)}Applications are the programs shiped with the standard distribution of \thedos\ that is written for users' convenience. \index{built-in apps (DOS)}Built-in Applications are the programs shipped with the standard distribution of \thedos\ that is written for users' convenience.
This chapter will only briefly list and describe the applications. This chapter will only briefly list and describe the applications.
@@ -77,7 +77,20 @@ This chapter will only briefly list and describe the applications.
\chapter{Invoking Coreutils on JS} \chapter{Writing Your Own Apps}
\index{user apps (DOS)}User-made Applications are basically a standard Javascript program, but \thedos\ provides DOS extensions for convenience.
User apps are invoked through \thedos\ to inject the command-line arguments and some necessary functionalities.
\section{Command-line Arguments}
The command line arguments are given via the array of strings named `exec\_args`.
Index zero holds the name used to invoke the app, and the rest hold the actual arguments.
\section{Invoking Coreutils on the user Apps}
DOS coreutils and some of the internal functions can be used on Javascript program. DOS coreutils and some of the internal functions can be used on Javascript program.
@@ -91,6 +104,12 @@ To invoke the coreutils, use \code{\_G.shell.coreutils.*}
\end{outline} \end{outline}
\section{Termination Check Injection}
Due to the non-preemptive nature of the virtual machine, the termination\footnote{Default key combination: Shift+Ctrl+T+R} signal must be explicitly captured by the app, and taking care of it by yourself can be extremely tedious. Fortunately \thedos\ parses the user-written program and injects those checks accordingly.
While- and For-loops are always have such checks injected, but the `read()` is not checked for the termination.
\chapter{Pipes} \chapter{Pipes}
@@ -195,10 +214,10 @@ Functions:
\end{outline} \end{outline}
\chapter{DOS Libraries}
\chapter{Input Event Handling}
\section{Input} \thedos\ provides the library for handling the keyboard and mouse events.
\dosnamespaceis{Input}{input} \dosnamespaceis{Input}{input}
@@ -229,7 +248,9 @@ Input events are Javascript array of: $$ [\mathrm{event\ name,\ arg_1,\ arg_2 \c
\2\argsynopsis{\argN{5}}{Y-position of the mouse cursor on the previous frame} \2\argsynopsis{\argN{5}}{Y-position of the mouse cursor on the previous frame}
\end{outline} \end{outline}
\section{GL} \chapter{The Graphics Library}
\thedos\ provides the library for drawing pixels to the screen.
\dosnamespaceis{Graphics}{gl} \dosnamespaceis{Graphics}{gl}

View File

@@ -14,8 +14,8 @@ public class AppLoader {
public static String appTitle = "tsvm"; public static String appTitle = "tsvm";
public static Lwjgl3ApplicationConfiguration appConfig; public static Lwjgl3ApplicationConfiguration appConfig;
public static int WIDTH = 1080;//810;//720; public static int WIDTH = 1080;//640;
public static int HEIGHT = 436;//360;//480; public static int HEIGHT = 436;//480;
public static void main(String[] args) { public static void main(String[] args) {
ShaderProgram.pedantic = false; ShaderProgram.pedantic = false;
@@ -38,7 +38,7 @@ public class AppLoader {
// VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{OEMBios.INSTANCE, BasicRom.INSTANCE}); // VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{OEMBios.INSTANCE, BasicRom.INSTANCE});
VM vm = new VM("./assets", 64 << 10, new TheRealWorld(), new VMProgramRom[]{TandemBios.INSTANCE, BasicRom.INSTANCE}, 2); VM vm = new VM("./assets", 64 << 10, new TheRealWorld(), new VMProgramRom[]{TandemBios.INSTANCE, BasicRom.INSTANCE}, 2);
// VM vm = new VM(128 << 10, new TheRealWorld(), new VMProgramRom[]{BasicBios.INSTANCE, WPBios.INSTANCE}); // VM vm = new VM(128 << 10, new TheRealWorld(), new VMProgramRom[]{BasicBios.INSTANCE, WPBios.INSTANCE});
// VM vm = new VM("./assets", 8192 << 10, new TheRealWorld(), new VMProgramRom[]{TsvmBios.INSTANCE}); // VM vm = new VM("./assets", 8192 << 10, new TheRealWorld(), new VMProgramRom[]{TsvmBios.INSTANCE}, 8);
// VM vm = new VM("./assets", 8192 << 10, new TheRealWorld(), new VMProgramRom[]{OpenBios.INSTANCE}, 8); // VM vm = new VM("./assets", 8192 << 10, new TheRealWorld(), new VMProgramRom[]{OpenBios.INSTANCE}, 8);
// VM pipvm = new VM("./assets", 4096, new TheRealWorld(), new VMProgramRom[]{PipBios.INSTANCE, PipROM.INSTANCE}, 8); // VM pipvm = new VM("./assets", 4096, new TheRealWorld(), new VMProgramRom[]{PipBios.INSTANCE, PipROM.INSTANCE}, 8);