Homebrew [Release] Linux for the 3DS

TheCyberQuake

Certified Geek
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,432
Country
United States
Doesn't this mean we can theoretically make our own OSes on the 3DS in firm format?
We technically could have with a9lh. But from what I've heard brahma payloads have some limitations that make larger projects like that hard. The firm format is a lot easier from what I've heard and had most of those previous restrictions removed. So it may be easier to do a fully custom OS if someone wanted to do it.
 

nl255

Well-Known Member
Member
Joined
Apr 9, 2004
Messages
3,000
Trophies
2
XP
2,791
Country
We technically could have with a9lh. But from what I've heard brahma payloads have some limitations that make larger projects like that hard. The firm format is a lot easier from what I've heard and had most of those previous restrictions removed. So it may be easier to do a fully custom OS if someone wanted to do it.

Though wouldn't it have been possible to get around that by using a brahma/a9lh payload to load a larger second stage loader which then loads the kernel/OS?
 

goose121

Member
Newcomer
Joined
Aug 29, 2016
Messages
7
Trophies
0
Age
22
XP
79
Country
Canada
How did you fix this?
I don't quite remember, honestly; I think that I was trying to use the old method of a button as a filename prefix, then holding down the button during boot, when I actually had to hold the start button during boot and select the payload
 

ShadowEO

Well-Known Member
Member
Joined
Mar 31, 2009
Messages
542
Trophies
0
Age
32
Location
Ohio, USA
XP
446
Country
United States
Would be nice if it did. Old 3DS has 128 MB; New 3DS has 256 MB.

Wayland would be better on 3DS than X11, though even with Wayland, applications like Firefox would have difficulty fitting into 256 MB.

Thinking back, where the hell did I get that info from. I think I accidentally pulled that from my ass while typing that post, I remembered searching so I could verify, but I think I got too wrapped up in my post to actually look at what I found. My apologies! ^_^;
 

TheLukeGuy

Member
Newcomer
Joined
Apr 17, 2017
Messages
10
Trophies
0
XP
63
Country
United States
I don't quite remember, honestly; I think that I was trying to use the old method of a button as a filename prefix, then holding down the button during boot, when I actually had to hold the start button during boot and select the payload
Ah, alright.
 

BGC592

Member
Newcomer
Joined
Dec 29, 2015
Messages
22
Trophies
0
Location
Somewhere
XP
117
Country
Australia
After I typed "halt", weston stopped and the screen got stuck. Is it a bug or something?
From what I understand, halt is supposed to shut down a system (hence it's name). Usually if it were on a computer it would also power down the hardware, which doesn't appear to be the case on the 3ds (sorta like on older computer systems where you had to manually power down the hardware). The screen getting stuck would be a side effect of this. Maybe this is a bug or maybe 3ds linux doesn't have the proper permissions to do a hardware power off.
 

uyjulian

Homebrewer
Member
Joined
Nov 26, 2012
Messages
2,567
Trophies
2
Location
United States
Website
sites.google.com
XP
3,881
Country
United States
From what I understand, halt is supposed to shut down a system (hence it's name). Usually if it were on a computer it would also power down the hardware, which doesn't appear to be the case on the 3ds (sorta like on older computer systems where you had to manually power down the hardware). The screen getting stuck would be a side effect of this. Maybe this is a bug or maybe 3ds linux doesn't have the proper permissions to do a hardware power off.
Edit: MCU-poweroff support is implemented in arm9linuxfw, but it just looks at a button combination and decides if it is going to power off.
https://github.com/xerpi/arm9linuxfw/blob/7506e8143d2dd8f784ea158cac94c1562d3c3338/source/main.c#L17
The proper way to do a power-off would be to send the power button command to the linux side, and linux can decide to send a power off command to the arm9 (with the power button command or shutdown -h now), which then forwards it to the MCU. I'm not sure if MCU is accessible from arm11.
Power button detection:
Code:
i2cReadRegister(I2C_DEV_MCU, 0x10) == 0x01;
Original post:
I don't think MCU support is implemented, so halt just halts the system.

It looks like GodMode9 has code for doing a MCU-poweroff and handling the power button, however.

https://github.com/d0k3/GodMode9/blob/d0c4e11badf9aec4d8c2219076c863debcfe0083/source/main.c

Relavant:
Reboot:
Code:
i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 2);
Power off:
Code:
i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 0);
 
Last edited by uyjulian,
  • Like
Reactions: BGC592

superl2

New Member
Newbie
Joined
Jun 2, 2017
Messages
1
Trophies
0
Age
20
XP
51
Country
The latest commit, which adds a touch keyboard, causes an error at compilation. "nintendo3ds_bottom_lcd_draw_text" is being called with an extra argument. I looked at the source, and there were five arguments in the function, but 6 were called.

drivers/input/misc/nintendo3ds_codec_hid.c:137:5: error: too many arguments to function 'nintendo3ds_bottom_lcd_draw_text'
nintendo3ds_bottom_lcd_draw_text(vkb->font, vkb->x_offsets[row][col], row * vkb->font->height * 2, color, COLOR_BLACK,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/input/misc/nintendo3ds_codec_hid.c:19:0:
arch/arm/mach-nintendo3ds/include/mach/bottom_lcd.h:38:5: note: declared here
int nintendo3ds_bottom_lcd_draw_text(const struct font_desc *font, int x, int y, unsigned int color, const char *text);

Also, not sure why, but my new 3ds xl crashes when running /sdmount.sh.

Another side note: How hard is it to port android over?
 
Last edited by superl2,

xerpi

Well-Known Member
OP
Member
Joined
Dec 25, 2011
Messages
212
Trophies
1
Age
28
Location
Barcelona
XP
1,329
Country
The latest commit, which adds a touch keyboard, causes an error at compilation. "nintendo3ds_bottom_lcd_draw_text" is being called with an extra argument. I looked at the source, and there were five arguments in the function, but 6 were called.

drivers/input/misc/nintendo3ds_codec_hid.c:137:5: error: too many arguments to function 'nintendo3ds_bottom_lcd_draw_text'
nintendo3ds_bottom_lcd_draw_text(vkb->font, vkb->x_offsets[row][col], row * vkb->font->height * 2, color, COLOR_BLACK,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/input/misc/nintendo3ds_codec_hid.c:19:0:
arch/arm/mach-nintendo3ds/include/mach/bottom_lcd.h:38:5: note: declared here
int nintendo3ds_bottom_lcd_draw_text(const struct font_desc *font, int x, int y, unsigned int color, const char *text);

Also, not sure why, but my new 3ds xl crashes when running /sdmount.sh.

Another side note: How hard is it to port android over?

I've just fixed the compilation error, there were some changes from paulguy missing.
About sdmount.sh crashing, yeah I'm aware, I'll try to fix it but I'm busy these days so that will have to wait.

EDIT: I've ported all the 3ds changes into a single patch to Linux upstream.
 
Last edited by xerpi,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Well start walking towards them