Homebrew [Release] Linux for the 3DS

ParzivalWolfram

Well-Known Member
Member
Joined
Jun 28, 2017
Messages
294
Trophies
0
Age
54
XP
753
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,386
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
753
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
753
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,386
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
753
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
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    We just question @AncientBoi
  • ZeroT21 @ ZeroT21:
    it wasn't a question, it was fact
  • BigOnYa @ BigOnYa:
    He said he had 3 different doctors apt this week, so he prob there. Something about gerbal extraction, I don't know.
    +1
  • ZeroT21 @ ZeroT21:
    bored, guess i'll spread more democracy
  • LeoTCK @ LeoTCK:
    @K3Nv2 one more time you say such bs to @BakerMan and I'll smack you across the whole planet
  • K3Nv2 @ K3Nv2:
    Make sure you smack my booty daddy
    +1
  • LeoTCK @ LeoTCK:
    telling him that my partner is luke...does he look like someone with such big ne
    eds?
  • LeoTCK @ LeoTCK:
    do you really think I could stand living with someone like luke?
  • LeoTCK @ LeoTCK:
    I suppose luke has "special needs" but he's not my partner, did you just say that to piss me off again?
  • LeoTCK @ LeoTCK:
    besides I had bigger worries today
  • LeoTCK @ LeoTCK:
    but what do you know about that, you won't believe me anyways
  • K3Nv2 @ K3Nv2:
    @BigOnYa can answer that
  • BigOnYa @ BigOnYa:
    BigOnYa already left the chat
  • K3Nv2 @ K3Nv2:
    Biginya
  • BigOnYa @ BigOnYa:
    Auto correct got me, I'm on my tablet, i need to turn that shit off
  • K3Nv2 @ K3Nv2:
    With other tabs open you perv
  • BigOnYa @ BigOnYa:
    I'm actually in my shed, bout to cut 2-3 acres of grass, my back yard.
  • K3Nv2 @ K3Nv2:
    I use to have a guy for that thanks richard
  • BigOnYa @ BigOnYa:
    I use my tablet to stream to a bluetooth speaker when in shed. iHeartRadio, FlyNation
  • K3Nv2 @ K3Nv2:
    While the victims are being buried
  • K3Nv2 @ K3Nv2:
    Grave shovel
  • BigOnYa @ BigOnYa:
    Nuh those goto the edge of the property (maybe just on the other side of)
  • K3Nv2 @ K3Nv2:
    On the neighbors side
    +1
  • BigOnYa @ BigOnYa:
    Yup, by the weird smelly green bushy looking plants.
    BigOnYa @ BigOnYa: Yup, by the weird smelly green bushy looking plants.