Skip to content

trustytrojan/nds-shell

Repository files navigation

nds-shell

Build

A POSIX-like shell & environment for the Nintendo DS.

Click here to get the latest GitHub Actions build. Check the issues tab to see all currently known issues. Report new issues there if you find any.

Join the Discord server!

Synopsis

Although it may seem like it, the scope of this project is not to be an operating system. That has been attempted several times before, not to mention the existence of DSLinux, which has been long abandoned. Thanks to the devkitPro team, turning the DS into a general-purpose computer is a lot easier than it was back then. That's what this project aims to do: make the work of libnds fully interactive, while adding some fun features on top!

Features

  • sh-like features: cursor navigation, I/O redirection, environment variables, variable substitution, command history
    • Command history is now saved to your sdcard at /.ndsh_history!
    • Like .bashrc for Bash, .ndshrc at the root of your sdcard is automatically run upon shell startup
  • Filesystem manipulation using typical POSIX shell commands: ls, cd, cat, etc
  • Networking commands: wifi, dns, tcp, curl, ssh, telnet, ws
  • Lua interpreter, with an API to make your scripts feel just like builtin commands!
    • With a fetch() HTTP API and WebSocket class, resembling the JS/browser equivalents!
    • I didn't know about the Pico-8 or the TIC-80 before... turns out I've unknowingly been creating just that, but for real hardware!
  • HTTPS/SSL support with cURL and MbedTLS!

Dependencies

Building

Windows

  1. Download the latest version of the devkitPro installer and select the nds option during installation
  2. Open the MSys2 shell from your start menu after installation and uninstall libnds with pacman -Rdd libnds note: if you already have msys2 installed make sure you open the one that is exactly called MSys2, this is the one installed by devkitPro
  3. Clone, build and install my libnds fork:
    git clone https://github.com/trustytrojan/libnds -b console-rework
    cd libnds
    make install -j$(nproc)
  4. Clone this repo and build with $DEVKITPRO/tools/bin/catnip -Tnds

Linux

  1. Get devkitPro pacman on your system
  2. Install the nds-dev metapackage (explained in the link above)
  3. Uninstall libnds with sudo (dkp-)pacman -Rdd libnds
  4. Clone, build, and install my libnds fork:
    git clone https://github.com/trustytrojan/libnds -b console-rework
    cd libnds
    sudo -E make install -j$(nproc)
  5. Clone this repo and build with $DEVKITPRO/tools/bin/catnip -Tnds -j$(nproc)

For both Windows and Linux remains:

  • Do NOT run CMake. You MUST run catnip.

Lua scripting notes

  • For JSON support, I recommend rxi/json.lua. It's extremely lightweight.
  • Remember that the lua command runs under a shell's thread. In your scripts when performing work in a loop, you should call libnds.threadYield() to yield the current thread so others can run.
    • The Lua standard library for coroutines is available for use, however Lua coroutines are NOT the same as system-level threads. They all exist inside the Lua interpreter itself with no connection to the system thread running the lua command running your script.

About

A POSIX-like shell & environment for the Nintendo DS

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •