What follows are instructions for (i) installing and running TSION's ECHOLD server on a Nintendo DS and (ii) installing and running other TinyScheme code on the DS.
TinyScheme in DeSmuME -|
Click image to enlarge
The TinyScheme executable (see Running other Scheme Code) and TSION executable were built using the devkitPro tool chain (devkitARM installation instructions). TinyScheme and TSION run as standard I/O (i.e., dumb terminal) applications on the Nintendo DS. Output is written to the top screen; input, when requested by the program, is read from a pop-up keyboard on the bottom screen.
On start-up, both executables look for a configuration file,
/etc/program.conf", that defines (i) any
environment variables needed by the program and (ii) a UNIX-like
command line with arguments for the program. If there is no configuration
file or if there is no command line in the file, the program prompts you
for the command-line arguments. Hit "Rtrn" on the keyboard and you'll be
met by the TinyScheme "
> " prompt. If you can manage entering
more than a few keystrokes without frustration, more power to you!
tsiond.nds, would be ideal for use on a DS. However, to work with TinyScheme's output mechanism, the client's socket must be converted into a buffered standard I/O (FILE *) stream. For some reason, this doesn't work on the DS - no output is generated despite explicit calls to
fflush(3)- although it seems to work successfully on other platforms.
etc" directory in the root directory ("/") of your DS. Then copy these files to "
init.scm- TinyScheme's initialization file. TinyScheme is partially implemented in C and then the remainder is implemented by the definitions in
init.scm. Environment variable TINYSCHEMEINIT, set in the following file, the TSION configuration file, points to the initialization file, "
tsion.conf- the start-up configuration file for TSION. This file defines (i) an environment variable needed by TinyScheme and (ii) the TSION command line, which tells TSION to load the "
Simply select "
tsion.nds" and run it. The program will pick up
its environment variable and command line from "
Per the configuration file, TSION will load and execute the echo daemon code
The line-oriented echo daemon listens at port 10234 for connection requests from clients; e.g., telnet(1). Assuming you know the IP address of the DS, invoke telnet as follows to connect to ECHOLD on the DS:
% telnet IP-address 10234
A connection should be established with ECHOLD and then, anything you type into telnet, should be echoed back to telnet. You can try running telnet from several windows to show how ECHOLD handles multiple clients simultaneously.
The TSION executable, "
tsion.nds", is not limited to running
only the echo daemon. To run your own Scheme code, just copy the Scheme
file(s) into the DS root directory and modify the command line in
/etc/tsion.conf" to load your main file instead of
If you're not interested in the networking extensions provided by TSION,
you can run the vanilla TinyScheme executable,
tinyscheme.nds". In this case,
TinyScheme looks for configuration file "
containing a command line, "
(as well as the definition of environment variable
Building the basic TinyScheme for the Nintendo DS is a fairly simple job:
StdIONDS.cinto the target directory.
make -f Makefile.nds".
The Make command builds (i) the "
library needed by TSION and (ii) the "
executable needed to run on your Nintendo DS. Done!