FORUMS
Remove All Ads from XDA

[Linux] Porting native Linux to Galaxy Note9

1,022 posts
Thanks Meter: 915
 
Post Reply Email Thread
This thread is about starting native Linux on Samsung Galaxy Note9. This isn't my first attempt to do such thing. The history looks like Galaxy Spica -> Galaxy J1 (2016) -> Galaxy Note9. So I know what I'm doing

Later I'll post instructions how to install and run it.
Note9 isn't my main device, so I won't work on dualboot. If some wants to make it, feel free to build dualboot (kexec) recovery and post it here.

Source code.
Kernel: https://github.com/LONELY-WOLF/crownlte-linux-os
The Following 7 Users Say Thank You to -W_O_L_F- For This Useful Post: [ View ] Gift -W_O_L_F- Ad-Free
 
 
2nd June 2019, 03:12 PM |#2  
-W_O_L_F-'s Avatar
OP Senior Member
Flag Moscow
Thanks Meter: 915
 
More
First success
So, here is a first result.

With minor modifications to DECON (framebuffer) my Note9 is able to run Arch Linux form SD card.
So far it has no serial or USB console. I can't find a way to make UART JIG for Type-C Samsungs. USB gadgets are hardcoded and can't be easy changed to CDC ACM. This is not good and makes development harder.
Arch Linux says it started GUI but I don't know what happened to Xorg. It can be on back buffer or on another display (since Note9 has it via Type-C).
Attached Thumbnails
Click image for larger version

Name:	20190602_160150.jpg
Views:	1960
Size:	215.4 KB
ID:	4770227  
The Following 7 Users Say Thank You to -W_O_L_F- For This Useful Post: [ View ] Gift -W_O_L_F- Ad-Free
2nd June 2019, 09:56 PM |#3  
Senior Member
Thanks Meter: 68
 
More
This would be awesome for me during pen testing?!
Def following!
3rd June 2019, 03:40 PM |#4  
Senior Member
Thanks Meter: 62
 
More
Could install it on dualboot?
3rd June 2019, 05:51 PM |#5  
-W_O_L_F-'s Avatar
OP Senior Member
Flag Moscow
Thanks Meter: 915
 
More
Quote:
Originally Posted by giorgior.r

Could install it on dualboot?

Yes, it's possible. As for now kernel is inside phone memory and root FS is on SD card.
There are two ways to install it alongside Android:
  • Flash Linux kernel as recovery. So when you try to enter recovery it'll boot into Linux. You lose recovery in this case.
  • Install special dualboot/kexec recovery and start Linux from recovery menu. (If someone will make such recovery for Note9)

All Linux files (except kernel) are on SD card. SD has following partition scheme:
  1. Storage. That's what your Android sees as SD card. FAT32 or exFAT
  2. Apps2SD. Is someone still using it? However this partition can be 1MB in size.
  3. Linux rootfs. That's where Linux "ROM" lives.
So SD is also ready for daily use.
The Following 2 Users Say Thank You to -W_O_L_F- For This Useful Post: [ View ] Gift -W_O_L_F- Ad-Free
9th June 2019, 06:56 AM |#6  
Junior Member
Thanks Meter: 3
 
More
nice, have similar thing based on exynos-linux-stable and debian stretch wifi work but sound and usb not yet for me. how you enabled boot console? also need to swap red and blue channel because they are flipped on 24/32 bit colours
The Following User Says Thank You to Sisah For This Useful Post: [ View ] Gift Sisah Ad-Free
9th June 2019, 09:34 AM |#7  
-W_O_L_F-'s Avatar
OP Senior Member
Flag Moscow
Thanks Meter: 915
 
More
Quote:
Originally Posted by Sisah

nice, have similar thing based on exynos-linux-stable and debian stretch wifi work but sound and usb not yet for me. how you enabled boot console? also need to swap red and blue channel because they are flipped on 24/32 bit colours

For fbcon you need to patch decon driver. Take a look at my commits on GitHub.

Yes, RGB<->BGR is a common issue. I have it on J120F too. This hack work for J1. But it would be nice to find a source of the problem. I believe decon reports wrong color order.
WARNING! I had to disable fbcon on J1 because it messed up with Xorg.

Still no luck with USB. I try to configure it with configfs, but got error
Code:
Config c/1 of g1 needs at least one function
Looks like Samsung hardcoded something inside USB drivers.
The Following User Says Thank You to -W_O_L_F- For This Useful Post: [ View ] Gift -W_O_L_F- Ad-Free
9th June 2019, 09:27 PM |#8  
-W_O_L_F-'s Avatar
OP Senior Member
Flag Moscow
Thanks Meter: 915
 
More
Found out that USB configfs is heavily modified. That's the reason why Linux can't configure USB gadgets properly. Bring back compatibility seems to be a hard task.
10th June 2019, 01:06 AM |#9  
Member
Thanks Meter: 3
 
More
ho ho ho... so long time im not play dualboot
sorry i have diferent question, i see on youtube, normal windows 10 work on lumia 950 and 950xl, what its that ?
10th June 2019, 07:36 AM |#10  
-W_O_L_F-'s Avatar
OP Senior Member
Flag Moscow
Thanks Meter: 915
 
More
Quote:
Originally Posted by Ce Doresti

ho ho ho... so long time im not play dualboot
sorry i have diferent question, i see on youtube, normal windows 10 work on lumia 950 and 950xl, what its that ?

Since I'm a Windows Phone hacker, I can answer your question
That project is very similar to what I do here. Starting from Windows Phone 8, phone OS and desktop one have one (NT) kernel. Just like Android and desktop Linux do. Windows you see on NL950 on YouTube is "Windows for ARM". It looks like desktop but it can't run normal Windows EXEs because of different processor architecture. Maybe it can run desktop .NET applications (I've made proof-of-concept EXE that worked on both Windows Mobile 5.0 and Windows XP) but I'm not sure.
Linux is a better way to get desktop OS on mobile device. Open source nature of most Linux software makes it possible to use almost any program on any processor architecture. Take a look at single board computers (like Raspberry Pi) if you want to see what Linux can do on ARM architecture.
The Following User Says Thank You to -W_O_L_F- For This Useful Post: [ View ] Gift -W_O_L_F- Ad-Free
10th June 2019, 08:20 AM |#11  
Junior Member
Thanks Meter: 3
 
More
I think win 10 for arm have integrated x86 emulator, so it probably launch nearly anything.

If i can have one more question. How you refreshing screen? Refresh rate is set to 0 and my every attempt to configure screen with fbset result in black screen and hard reset, so i must use infinite loop that send "1" to /sys/class/graphics/fb0/rotate to refresh my screen
Post Reply Subscribe to Thread

Tags
linux, note9

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes