- 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
- In my case:
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
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
)
git clone https://github.com/xerpi/linux_3ds.git
- Copy
buildroot/output/images/rootfs.cpio.gz
tolinux_3ds/
- Run
./make_3ds.sh
- Copy
arch/arm/boot/zImage
tosd:/linux/
- Copy
arch/arm/boot/dts/nintendo3ds_ctr.dtb
tosd:/linux/
Step 4: Build arm9linuxfw (optional, but needed for SD card support)
git clone https://github.com/xerpi/arm9linuxfw
- Run
make
- Copy
arm9linuxfw.bin
tosd:/linux/
Step 5: Build FIRM Linux Loader
git clone https://github.com/xerpi/firm_linux_loader
- Run
make
- Copy
firm_linux_loader.firm
tosd:/luma/payloads/
(the payload folder Luma3DS will look for)
- Power on the 3DS pressing
START
(or the button you have assocciated with the FIRM Linux Loader Luma3DS payload)
Neat! I was able to boot this on my new 3DS XL. Here's what I did differently.
Skip step 1, use clang to cross compile (but did need binutils; I couldn't get LLD to link a working arm9linuxfw).
sudo apt install binutils-arm-linux-gnueabi
.Skip step 2, use prebuilt images from https://github.com/ClangBuiltLinux/boot-utils/blob/main/images/arm/rootfs.cpio.zst. Clone, decompress
zstd -d rootfs.cpio.zstd
, recompress as gzipgzip -9 rootfs.cpio
.Step 3: build kernel with clang
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make LLVM=1 LLVM_IAS=1 -j72
. Needed to modify the DTS since using a custom initrd:Step 4:
modify arm9linuxfw to build with clang and llvm-objcopy, still use GNU BFD linker rather than LLD (todo: see why LLD won't put
.text.start
at 0x08080000llvm-objdump -dr -j .text.start arm9linuxfw.elf | less
).step 5: just use latest release