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
  • No one is chatting at the moment.
  • SylverReZ @ SylverReZ:
    @Jayro, I don't see whats so special about the DS ML, its just a DS lite in a phat shell. At least the phat model had louder speakers, whereas the lite has a much better screen.
    +1
  • SylverReZ @ SylverReZ:
    They probably said "Hey, why not we combine the two together and make a 'new' DS to sell".
  • Veho @ Veho:
    It's a DS Lite in a slightly bigger DS Lite shell.
    +1
  • Veho @ Veho:
    It's not a Nintendo / iQue official product, it's a 3rd party custom.
    +1
  • Veho @ Veho:
    Nothing special about it other than it's more comfortable than the Lite
    for people with beefy hands.
    +1
  • Jayro @ Jayro:
    I have yaoi anime hands, very lorge but slender.
  • Jayro @ Jayro:
    I'm Slenderman.
  • Veho @ Veho:
    I have hands.
  • BakerMan @ BakerMan:
    imagine not having hands, cringe
    +1
  • AncientBoi @ AncientBoi:
    ESPECIALLY for things I do to myself :sad:.. :tpi::rofl2: Or others :shy::blush::evil:
    +1
  • The Real Jdbye @ The Real Jdbye:
    @SylverReZ if you could find a v5 DS ML you would have the best of both worlds since the v5 units had the same backlight brightness levels as the DS Lite unlockable with flashme
  • The Real Jdbye @ The Real Jdbye:
    but that's a long shot
  • The Real Jdbye @ The Real Jdbye:
    i think only the red mario kart edition phat was v5
  • BigOnYa @ BigOnYa:
    A woman with no arms and no legs was sitting on a beach. A man comes along and the woman says, "I've never been hugged before." So the man feels bad and hugs her. She says "Well i've also never been kissed before." So he gives her a kiss on the cheek. She says "Well I've also never been fucked before." So the man picks her up, and throws her in the ocean and says "Now you're fucked."
    +2
  • BakerMan @ BakerMan:
    lmao
  • BakerMan @ BakerMan:
    anyways, we need to re-normalize physical media

    if i didn't want my games to be permanent, then i'd rent them
    +1
  • BigOnYa @ BigOnYa:
    Agreed, that why I try to buy all my games on disc, Xbox anyways. Switch games (which I pirate tbh) don't matter much, I stay offline 24/7 anyways.
  • AncientBoi @ AncientBoi:
    I don't pirate them, I Use Them :mellow:. Like I do @BigOnYa 's couch :tpi::evil::rofl2:
    +1
  • cearp @ cearp:
    @BakerMan - you can still "own" digital media, arguably easier and better than physical since you can make copies and backups, as much as you like.

    The issue is DRM
  • cearp @ cearp:
    You can buy drm free games / music / ebooks, and if you keep backups of your data (like documents and family photos etc), then you shouldn't lose the game. but with a disk, your toddler could put it in the toaster and there goes your $60

    :rofl2:
  • cearp @ cearp:
    still, I agree physical media is nice to have. just pointing out the issue is drm
  • rqkaiju2 @ rqkaiju2:
    i like physical media because it actually feels like you own it. thats why i plan on burning music to cds
  • cearp @ cearp:
    It's nice to not have to have a lot of physical things though, saves space
    cearp @ cearp: It's nice to not have to have a lot of physical things though, saves space