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
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
    +1
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
  • Psionic Roshambo @ Psionic Roshambo:
    @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87 cents. Free shipping from China... It arrived it works and honestly I don't understand how it was so cheap.
    +1
  • BakerMan @ BakerMan:
    fellas
  • BakerMan @ BakerMan:
    would you rather have a 9-5 desk job with poor pay or work for an intergalactic space militia with no guarantee of being paid?
  • BakerMan @ BakerMan:
    basically, normal boring job or halo and/or helldivers irl
    BakerMan @ BakerMan: basically, normal boring job or halo and/or helldivers irl