Skip to content

Instantly share code, notes, and snippets.

@xerpi
Last active March 27, 2024 12:02
Show Gist options
  • Save xerpi/3c720d345820691a2985502fcd80268f to your computer and use it in GitHub Desktop.
Save xerpi/3c720d345820691a2985502fcd80268f to your computer and use it in GitHub Desktop.
3DS Linux build instructions

Step 1: Compiling or Downloading the toolchain

Step 1.a: If you choose to download a pre-compiled toolchain (only for Linux x86-64)

  • Go to https://toolchains.bootlin.com
  • Select arch: armv6-eabihf
  • Select libc: glibc
  • Download bleeding-edge
  • Uncompress it (for example to /opt)
  • Add the bin/directory of the toolchain to $PATH
    • In my case: export PATH=$PATH:/opt/armv6-eabihf--glibc--bleeding-edge-2020.08-1

Step 1.b: If you choose to compile the toolchain yourself:

  • git clone https://github.com/crosstool-ng/crosstool-ng.git
  • Run: autoconf && ./configure --enable-local && make install
  • Run ./ct-ng ct-ng menuconfig
  • Go to Target options
  • Target Architecture -> Select arm
  • Floating point -> Select Hardware (FPU)
  • Emit assembly for CPU -> Write mpcore
  • Exit -> Exit -> Save? -> Yes
  • Run ./ct-ng build

Step 2: Build buildroot (to generate a rootfs)

  • git clone https://github.com/buildroot/buildroot.git
  • Download Buildroot .config to buildroot/.config
  • (You can add your custom scripts to output/target/)
    • Acutally, this is deprecated. Better to use the "filesystem overlay" option of Buildroot to add custom files to the rootfs.
  • Set toolchain path (in my case /opt/armv6-eabihf--glibc--bleeding-edge-2020.02-2/):
    • make menuconfig
    • Navigate to Toolchain --->
    • Properly set the Toolchain path, save and exit
  • Run make (-j N)

Step 3: Build Linux

  • git clone https://github.com/xerpi/linux_3ds.git
  • Copy buildroot/output/images/rootfs.cpio.gz to linux_3ds/
  • Run ./make_3ds.sh
  • Copy arch/arm/boot/zImage to sd:/linux/
  • Copy arch/arm/boot/dts/nintendo3ds_ctr.dtb to sd:/linux/

Step 4: Build arm9linuxfw (optional, but needed for SD card support)

  • git clone https://github.com/xerpi/arm9linuxfw
  • Run make
  • Copy arm9linuxfw.bin to sd:/linux/

Step 5: Build FIRM Linux Loader

  • git clone https://github.com/xerpi/firm_linux_loader
  • Run make
  • Copy firm_linux_loader.firm to sd:/luma/payloads/ (the payload folder Luma3DS will look for)

Step 6: Run Linux!

  • Power on the 3DS pressing START (or the button you have assocciated with the FIRM Linux Loader Luma3DS payload)
@BBGS11
Copy link

BBGS11 commented May 20, 2023

Will installing Linux delete my files already saved like digital games, save data ect. or will I be able to switch between linux and "normal" 3ds

@ParzivalWolfram
Copy link

ParzivalWolfram commented May 20, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment