< Back to index

DSLinux is a port of the Linux operating system to the Nintendo DS.

How to Run Code on the DS



Flash carts for the Game Boy Advance (GBA) are available, and running code from flash carts inserted into the GBA slot of the DS is possible.

To circumvent Nintendo's RSA signature protection that is supposed to disallow execution of arbitrary code, either WiFiMe, PassMe or FlashMe can be used. WifiMe exploits the wireless multi-player mode of the Nintendo DS to run unsigned code. PassMe is a hardware device that allows execution of unsigned code, by providing a valid signature from an original Nintendo DS game but running code from another location, such as a flash card. FlashMe flashes the DS's firmware with an officially unsupported homebrew version of the firmware that allows execution of unsigned code from the GBA Slot without special hardware.

One of these methods has to be used in order to run DSLinux.-->

Software



DSLinux runs a modified uClinux kernel. It is currently based on uCLinux 2.6.14 (Linux-2.6.14-hsc0). It only runs in textmode and nano-x which is displayed via a custom framebuffer console driver. Input is done via a keyboard displayed on the touchscreen of the Nintendo DS.

DSLinux is compiled using a GCC-based cross-compilation toolchain for ARM processors.

Ncurses has been ported, so DSLinux is in theory capable of running any application that has an ncurses-based user interface. It also runs basic shell applications provided by BusyBox. The C-library is uClibc.

DSLinux has no package management facilities. Instead, DSLinux builds are distributed as a single tar archive.

Memory Limitations



The Nintendo DS does not have a memory management unit (MMU), and has only 4 MiB of RAM. Userspace XIP and SLOB memory allocation were the first techniques used to increase the amount of available RAM a little. Later, support for the internal RAM present on some add-on hardware devices, such as the SuperCard or M3, has been added, offering an extra 32MB of memory. Adding support for external RAM was not trivial, as the GBA slot bus only supports 16-bit writes. If only 8 bits are sent over the bus, the result ending up in memory is garbage. A DSLinux developer called Amadeus found a workaround for this, which involved replacing "strb" (store byte) ARM assembly instructions with "swpb" (swap byte) instructions. The swpb instruction results in a cache hit, causing a whole 16-bit wide cache line to be written back to memory over the bus, instead of a single byte, thus eliminating all 8-bit writes over the bus. Amadeus modified the GCC code generator for ARM so that all applications compiled for DSLinux now use swpb instead of strb instructions. Assembly code in the Linux kernel had to be adapted manually.

Supported Hardware



All hardware inside the Nintendo DS is supported by DSLinux, including wireless networking and sound (except sound input).

DSLinux supports storing files on a variety of add-on hardware devices, none of which officially endorsed by Nintendo. DSLinux can store files in SRAM memory found in GBA Flash Carts and CompactFlash and SD cards, which can be used with any of the following adaptors: GBAMP, M3, or SuperCard.
This entry uses material from from Wikipedia, the leading user-contributed encyclopedia. It is licensed under the GNU Free Documentation License. Disclaimer.