Homebrew [Release] Linux for the 3DS

ParzivalWolfram

Well-Known Member
Member
Joined
Jun 28, 2017
Messages
294
Trophies
0
Age
54
XP
754
Country
United States
IR support sounds pretty useless because nobody really does have an IR receiver, and most modern TVs just use other protocols (I've mostly seen BLE recently). As for WiFi, the chip in the 3DS has already been identified (by the 3dbrew people) as an AR6014 that communicates through SDIO, but I haven't really confirmed this hardware, nor really managed to test it (whenever I added the chip to the device tree it just would pretend it wasn't there, and yes the driver was compiled into the kernel).

Really, right now I'm focusing more on SD performance and protocol improvements. I'm debating as to whether arm9linuxfw should just expose a dumb block device you can read/write from, or a full MMC interface to send commands to.

Block device pros:
- Simpler to implement in the ARM9 side
- Already well tested and known to work
- It can use DMA in the future to process requests asynchronously

Block device cons:
- It is it's own non-standard device (currently /dev/ctr_mmc_{a,b} for NAND and SD)
- It won't cache the data that was read for some reason (it used to do so in 4.20)
- Harder to implement and test in the ARM11 side
- Extremely hard to implement card hotplugging

MMC pros:
- Uses a standard device interface (/dev/mmcblk)
- Linux already has a ton of code to handle MMC cards, including proper timeouts
- Has the best SD card configuration possible
- Can easily detect card removal and insertion
- Can dump CSD/CID, could even be used to unlock password locked NANDs (GW bricked consoles) in place, using nothing more than an ntrboot card

MMC cons:
- Complex to implement in the ARM9 side, it would need a passthrough for every single functionality the MMC controller provides
- Every single command Linux wants to send to the card involves a PXI transaction (this could be mitigated a bit with some tricks)
- I'm not sure how well it would handle a single controller that handles both an eMMC chip and an SD card
- There isn't a single example / skeleton driver for MMC hosts, so I'd have to understand an existing driver (and the hardware it works with), and modify it to fit with the 3DS' chip (there is an existing TMIO driver, which is very close to the chip the 3DS uses, but Linux can't directly access it because it's gated by the ARM9)
Isn't the kernel on the ARM9 and the SDIO only visible on ARM11?

that's a problem, yes

I feel using it as an actual MMC device would be more useful too, so probably that?

I also meant later on, I was planning on focusing on bugfixes too.
 

Wolfvak

nyaa~
Member
Joined
Oct 25, 2015
Messages
918
Trophies
1
XP
3,486
Country
Uruguay
Isn't the kernel on the ARM9 and the SDIO only visible on ARM11?

that's a problem, yes

I feel using it as an actual MMC device would be more useful too, so probably that?

I also meant later on, I was planning on focusing on bugfixes too.

Um, no, actually there are two MMC controllers on the system, similar to the DSi. One is only mapped in the ARM9 address space and can access the eMMC and SD cards (regular MMC/SD protocol), the other is mapped to both CPUs, is used for WiFi and talks over SDIO.

The Linux kernel itself is running in the ARM11 core, if that's what you meant. And yeah, I plan to implement a full blown MMC controller, that way I can reuse code for NAND/SD and the WiFi controller (apparently they have exactly the same register layout, they only differ in how they can be accessed and how the hardware attached to them should be initialized). If anyone knows about a simple UART device that can simplify testing, that'd be super useful (preferably one that's not too invasive).
 

ParzivalWolfram

Well-Known Member
Member
Joined
Jun 28, 2017
Messages
294
Trophies
0
Age
54
XP
754
Country
United States
Tailor images to your needs, develop on the system and find bugs easier. Chainload images are limited in size due to RAM constraints, so they'd need to be tailored anyway.
 

ParzivalWolfram

Well-Known Member
Member
Joined
Jun 28, 2017
Messages
294
Trophies
0
Age
54
XP
754
Country
United States
I neglected to mention: the toolchain made by buildroot is compatible with the other pieces of Linux 3DS (except arm9linuxfw.) You will, however, have to edit the builder SH file for the Linux kernel to change the toolchain path.
 

Wolfvak

nyaa~
Member
Joined
Oct 25, 2015
Messages
918
Trophies
1
XP
3,486
Country
Uruguay
Yeah, @Wolfvak and I took it over, I work on the frontend and buildroot and such, @Wolfvak works on the bare-metal, hardware and kernel sides of things.

To be fair I didn't "take it over", since I never asked permission from xerpi or anything. I just forked his work, rewrote the ARM9 firmware that runs on the background and added a ton of new drivers (and fixed some old ones).

Someone still needs to build a proper distro for it, and I don't think buildroot will cut it for too long.
 
  • Like
Reactions: KidNezha

ParzivalWolfram

Well-Known Member
Member
Joined
Jun 28, 2017
Messages
294
Trophies
0
Age
54
XP
754
Country
United States
To be fair I didn't "take it over", since I never asked permission from xerpi or anything. I just forked his work, rewrote the ARM9 firmware that runs on the background and added a ton of new drivers (and fixed some old ones).

Someone still needs to build a proper distro for it, and I don't think buildroot will cut it for too long.
I've been thinking about that, actually. I need Wi-Fi access and a working mouse driver to do that, though...

--------------------- MERGED ---------------------------

I saw that, yeah. Not gonna change it, though.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    It needs fixing for other things but your pc I can fix
  • ZeroT21 @ ZeroT21:
    over 300+ virus/trojians/worms after scanning, what did I do to deserve this attention lol
  • ZeroT21 @ ZeroT21:
    tho I find it funny when i receive other people's pc/laptops in this state
  • ZeroT21 @ ZeroT21:
    i wont be upgrading unless I cant run the games i want anymore
  • K3Nv2 @ K3Nv2:
    Spill water on it good excuse
  • ZeroT21 @ ZeroT21:
    @K3Nv2 that's like a valid option if someone else is paying for ya
  • K3Nv2 @ K3Nv2:
    Daddy's wallet
  • K3Nv2 @ K3Nv2:
    Ngl hogwarts legacy has good pooping music
  • OctoAori20 @ OctoAori20:
    That's uh-
  • OctoAori20 @ OctoAori20:
    That's certainly a Dairy Queen sign lmao
  • K3Nv2 @ K3Nv2:
    You should see his help wanted signs
  • OctoAori20 @ OctoAori20:
    Ugh, so many sweat-dipwads in Sploon 3 Anarchy mode tonight
  • OctoAori20 @ OctoAori20:
    I didn't know this was "Make Octo never finish Fresh Season 2024 Catalog in Splatoon 3" month, good god
  • Veho @ Veho:
    What's the point of "confirming" games you know will get released. Like Nintendo "confirming" a Zelda sequel. "We can't be sure Nintendo is working on a new Zelda game, or if a new Zelda game will ever be released, until they officially confirm it."
    +1
  • Veho @ Veho:
    "There is literally no way to know if they will ever release a new Zelda game, it's wild speculation until they officially confirm it."
    +1
  • K3Nv2 @ K3Nv2:
    Black ops was the lesser shitter line in cock a poopoo tbf just a way to let people know it hasn't died or going a different route I guess
  • K3Nv2 @ K3Nv2:
    $70 DLC per 6 months is what it turned into
  • Psionic Roshambo @ Psionic Roshambo:
    She saw the sign and it opened up her mind lol
    +1
  • BigOnYa @ BigOnYa:
    All that she wants, is another storefront.
  • K3Nv2 @ K3Nv2:
    The homeless live in the compactors at Walmart
  • K3Nv2 @ K3Nv2:
    @BigOnYa, new south park releases at midnight sadly no leaks yet damn companies are learning
    K3Nv2 @ K3Nv2: @BigOnYa, new south park releases at midnight sadly no leaks yet damn companies are learning