[Release] Linux for the 3DS

Discussion in '3DS - Homebrew Development and Emulators' started by xerpi, Dec 29, 2015.

Dec 29, 2015

[Release] Linux for the 3DS by xerpi at 11:39 AM (64,375 Views / 67 Likes) 302 replies

  1. xerpi
    OP

    Member xerpi GBAtemp Regular

    Joined:
    Dec 25, 2011
    Messages:
    151
    Location:
    Barcelona
    Country:
    Spain
    Currently the environment is very simple, you have Busybox (which "simulates" some programs like ls, cat, top, etc) and Weston (the Wayland compositor) plus a few Weston clients demos.

    DOWNLOAD

    https://drive.google.com/open?id=0ByXgF-rsC8PTTThtV25zeEZZb3M

    Installation:

    1) Copy the linux folder to the root of the SD card
    2) Copy 'a9lh_linux_loader.bin' to your a9lh payloads folder
    3) Run a9lh_linux_loader.bin
    4) Profit!

    Linux login:

    * User: root
    * Pass: root

    Other stuff:

    * You can start Weston by running:
    # /start-weston.sh
    * You can mount the SD card (read-only) to /media/sd by running:
    # /sdmount.sh
    * You can change the input mode (keybord, mouse) by pressing SELECT

    OLD DOWNLOADS:

    Other downloads:

    Sources:
    * Linux: https://github.com/xerpi/linux_3ds
    * Buildroot: https://github.com/buildroot/buildroot
    * arm9loaderhax Linux loader: https://github.com/xerpi/a9lh_linux_loader
    *(OLD) Linux 3DS Loader: https://github.com/xerpi/3DS-Linux-Loader

    Note: Currently the SD card support is read-only.

    How to compile it yourself
    • Step 1: Compiling or Downloading the toolchain
      • Step 1.a: Downloading the toolchain if you have Linux x86-64
        • Download the Precompiled ARM toolchain
        • Uncompress it to /opt/x-tools/arm-unknown-linux-gnueabihf
      • Step 1.b: Compiling the ARM toolchain (if you have installed the precompiled toolchain you can skip this step)
        • 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 3: Build Linux
      • Git clone https://github.com/xerpi/linux_3ds.git
      • Copy buildroot/output/images/rootfs.cpio.gz to the linux_3ds folder
      • Run sh make_3ds.sh
        • (you can edit the script and change -j3 to the value you want to speedup the compilation)
      • Copy linux/arch/arm/boot/zImage to the linux folder of your SD card
      • Copy linux/arch/arm/boot/dts/nintendo3ds_ctr.dtb to the linux folder of your SD card
    • Step 4: Build arm9linuxfw (optional, but needed for SD card support)
    • Step 5: Copy Linux to the SD
      • Copy linux/arch/arm/boot/zImage to the linux folder of your SD card
      • Copy linux/arch/arm/boot/dts/nintendo3ds_ctr.dtb to the linux folder of your SD card
    • Step 6: Build and copy the 3DS Linux Loader to the SD
    Screenshots:

    [​IMG]
     
    Last edited by xerpi, Sep 27, 2016
    satan89, Robz8, Shicky256 and 64 others like this.


  2. ihaveamac

    Member ihaveamac GBAtemp Guru

    Joined:
    Apr 20, 2015
    Messages:
    5,116
    Location:
    Tigard, OR
    Country:
    United States
    nice job!

    I actually made a video using the last release you made in the "Linux for 3DS" thread, but I didn't do that much in it. is this build any different to it?

    I should try out the client demos...
     
    sl0ps likes this.
  3. xerpi
    OP

    Member xerpi GBAtemp Regular

    Joined:
    Dec 25, 2011
    Messages:
    151
    Location:
    Barcelona
    Country:
    Spain
    Yeah it's a bit different! I've changed the compression format and now it's muuuch faster, it will only take 3 seconds to boot :D
    I've also improved the keyboard and the mouse virtual input methods.
    And as you already know I've added Weston clients.

    Nice video btw, thanks :)
     
    Last edited by xerpi, Dec 29, 2015
    ihaveamac likes this.
  4. ihaveamac

    Member ihaveamac GBAtemp Guru

    Joined:
    Apr 20, 2015
    Messages:
    5,116
    Location:
    Tigard, OR
    Country:
    United States
    I will get on trying it out right now

    any way we could put our own files into the filesystem? I want to try doing that even if it means building my own version

    — Posts automatically merged - Please don't double post! —

    I just noticed you edited some things into the post on how to build.
     
  5. TR_mahmutpek

    Member TR_mahmutpek GBAtemp Advanced Fan

    Joined:
    Jul 28, 2015
    Messages:
    609
    Country:
    Turkey
    Thanks for the tutorial but what we can do with linux on 3ds?
     
    SLiV3R likes this.
  6. xerpi
    OP

    Member xerpi GBAtemp Regular

    Joined:
    Dec 25, 2011
    Messages:
    151
    Location:
    Barcelona
    Country:
    Spain
    You'll need to follow the Building instructions until you have built buildroot.
    When you have the buildroot/output/images/rootfs.cpio.gz file generated, you can add your files to buildroot/output/target/ and then run make again, buildroot will regenerate the rootfs.cpio.gz with your files inside.
     
    ihaveamac likes this.
  7. mironicurse

    Member mironicurse GBAtemp Regular

    Joined:
    Sep 28, 2015
    Messages:
    102
    Country:
    Russia
    xerpi, i know you was on gp2x forums pretty often. Tell me, is it possible to port Ginge to 3dslinux?
     
    wsh1994 likes this.
  8. AtlasFontaine

    Member AtlasFontaine GBAtemp Maniac

    Joined:
    Jul 18, 2015
    Messages:
    1,021
    Location:
    Venezuela-Zulia.
    Country:
    Venezuela
    Will you fix the screen rotation? or is that supposed to look like that? GJ Tho.
     
  9. MarcusD

    Member MarcusD svcWait♂

    Joined:
    Oct 16, 2015
    Messages:
    928
    Location:
    not 'Murica
    Country:
    Hungary
    It looks like that, becaue that's how the 3DS's screen physically is. That's why I have to export the images rotated 90degrees to the right, so it'll be in the "correct" orientation for the user.
     
    AtlasFontaine likes this.
  10. william341

    Member william341 Last remaining VinsClone

    Joined:
    Dec 26, 2014
    Messages:
    383
    Country:
    United States
    Quick question: Wouldn't it be better to use the Circle Pad to move the mouse?
     
    MegaSuperab2 likes this.
  11. JerwuQu

    Newcomer JerwuQu Advanced Member

    Joined:
    Feb 15, 2015
    Messages:
    55
    Country:
    Sweden
    Really cool! But why does it need ARM9 access? :o
     
  12. VeryCrushed

    Member VeryCrushed Devious Prorammer

    Joined:
    Dec 26, 2014
    Messages:
    451
    Location:
    The Programmers Den
    Country:
    United States
    ARM9 will grant access to SD, WiFi, Touchscreen, etc. I'm pretty sure its also required to even boot it which is why its 9.2 and below.
     
  13. laharl22

    Member laharl22 GBAtemp Maniac

    Joined:
    Dec 19, 2014
    Messages:
    1,341
    Country:
    France
    Anyone can post a precompiled version ?
     
  14. ihaveamac

    Member ihaveamac GBAtemp Guru

    Joined:
    Apr 20, 2015
    Messages:
    5,116
    Location:
    Tigard, OR
    Country:
    United States
    laharl22 likes this.
  15. laharl22

    Member laharl22 GBAtemp Maniac

    Joined:
    Dec 19, 2014
    Messages:
    1,341
    Country:
    France
    This project is very good i dont know why linux was never come to the psp
     
  16. Rosselman

    Member Rosselman Spooky Skeleton

    Joined:
    Oct 29, 2015
    Messages:
    453
    Location:
    Santiago
    Country:
    Chile
    You have Wayland running on a 3DS? That's impressive, even if it's only a novelty for now.

    Typing console commands with the PSP controls seems like a torture. Besides, it was weak, and the MIPS architecture doesn't make the porting easier, unlike ARM.
     
  17. SLiV3R

    Member SLiV3R 3DS Friend Code: 0473-9069-2206

    Joined:
    Jan 9, 2006
    Messages:
    2,061
    Country:
    Sweden
    Very cool! But what can the average user do with this? :)
     
    TR_mahmutpek likes this.
  18. ihaveamac

    Member ihaveamac GBAtemp Guru

    Joined:
    Apr 20, 2015
    Messages:
    5,116
    Location:
    Tigard, OR
    Country:
    United States
    nothing really, it's kind of just a toy to play with.
     
    SLiV3R likes this.
  19. SLiV3R

    Member SLiV3R 3DS Friend Code: 0473-9069-2206

    Joined:
    Jan 9, 2006
    Messages:
    2,061
    Country:
    Sweden
    Ok. But in the future then?
     
  20. ihaveamac

    Member ihaveamac GBAtemp Guru

    Joined:
    Apr 20, 2015
    Messages:
    5,116
    Location:
    Tigard, OR
    Country:
    United States
    I think it's kind of impractical to use Linux on the 3DS for anything serious when you could just, you know, make a native homebrew program. but who knows?
     

Share This Page