Question Porting the kernel source code, from OnePlus 9 Help - Realme GT

I am using the kernel source code of oneplus9 https://github.com/OnePlusOSS/android_kernel_oneplus_sm8350
The kernel compiled with the default configuration can start twrp and use adb normally, but the screen driver is not working, I hope it can help me, the following is the kernel log

log

The issue is that it js not registering in msm vidc, mdp or dsi, why? Im not so sure? Maybe a dtb configuration issue? Or the realme panel code is required.
Please be careful, using incorrect code or kernel can damage hardware.

Related

Need help - Kernel from Source not booting

Hi,
i am owner of a FAEA F1
This is the tech specs of my device: http://www.faeamobile.com/faea-f1-techspec
i am searching for a working kernel source for my device for several month now and found a kernel source on codeaurora. (source on tag M8625QSOSKMLYA31201C)
i already recieved help over irc from laufersteppenwolf - he made the source from codeaurora compileable for me.
Compiling runs fine! (using the f1_defconfig)
the config is pulled from my /proc/config.gz so it should be fine
here is what he made for me: https://github.com/laufersteppenwolf/kernel_msm8625q_f1
It just does not boot at all - when starting the kernel from fastboot it just stays at the FAEA logo.
A compiled CWM recovery with integrated kernel building will not start - screen stays black.
There is no ADB connection available.
Could you give me some advice how to debug the kernel?
Is is neccesary to remove or add modules from kernel?
right now i got no clue where to start as i dont got any logs.
I would apreciate any help!
Greets - Astrali
bump
bump

[Q] Where to start for Android Kernel Development?

Hello Guys,
I see a lot of threads for starting with android rom development, but can anyone give me pointers for kernel development? I would like to start kernel development and do not know where to start. I am not interested in rom development at the moment, but that is because I assume that the android rom is like a user space app over the kernel. Please correct me if I am wrong. It would be great if you guys could point me to some beginner friendly kernel development tutorials. I am looking through Linux Device Drivers (LDD) book but am having a hard time comparing that with android. I have cloned mediatek 6589 source from android repository. I am submitting partial url cos I am not allowed to submit full url yet. URL(android.googlesource.com/kernel/mediatek/+/android-5.1.0_r0.2) since I am running a mtk6589 device (Walton X1/ Gionee Dream D1) and would like to understand where to start coding kernels for android. Any help would be greatly appreciated.
Oh and I would like mediatek specific help if possible. I have gone through some of the general kernel building and overclocking tutorials. I want to do some more enhancements if possible. Since mediatek seems to be the mysterious one with bare minimum source availability, I would like to take up that challenge
Thanks.
I don't have a tutorial for you but a small checklist. You need:
* Kernel source tree
* A config for your device (e.g. arch/arm/configs/*defconfig*)
* A cross compiler toolchain to generate ARM code (you can use the precompiled one from the Android source tree)
* A way to package your kernel into a boot image for your device - usually an Android boot image contains a compiled kernel (zImage), a compressed ramdisk for the root filesystem, and probably a device tree binary (dtb). Mediatek may do things differently.
* A way to install that boot image on your device - this requires an unlocked bootloader that allows custom boot images to be installed and started. Most devices use the fastboot tool for this.
Your first step should be to build a working kernel from unmodified sources. When you got that working, you can think about starting actual coding.
Thanks for the Pointer Mate
_that said:
I don't have a tutorial for you but a small checklist. You need:
* Kernel source tree
* A config for your device (e.g. arch/arm/configs/*defconfig*)
* A cross compiler toolchain to generate ARM code (you can use the precompiled one from the Android source tree)
* A way to package your kernel into a boot image for your device - usually an Android boot image contains a compiled kernel (zImage), a compressed ramdisk for the root filesystem, and probably a device tree binary (dtb). Mediatek may do things differently.
* A way to install that boot image on your device - this requires an unlocked bootloader that allows custom boot images to be installed and started. Most devices use the fastboot tool for this.
Your first step should be to build a working kernel from unmodified sources. When you got that working, you can think about starting actual coding.
Click to expand...
Click to collapse
Thanks man. Really appreciate the pointers. I do have some of the checklists done. Like
* Kernel source tree
** A cross compiler toolchain to generate ARM code (using the precompiled one)
* A way to install that boot image on your device
Now the problem is, my device still does not have its source code available. I got the general source tree from google which is not my device's so I dont have the defconfig. Is there a way to rip it out from a compiled kernel? Like using some sort of a decompiler? Also I will look around for zimage packaging tools. Thanks mate. Mediatek is apparently one hell of a problem child XD
syko_kickass said:
Now the problem is, my device still does not have its source code available. I got the general source tree from google which is not my device's so I dont have the defconfig. Is there a way to rip it out from a compiled kernel? Like using some sort of a decompiler? Also I will look around for zimage packaging tools.
Click to expand...
Click to collapse
If you're lucky, your existing kernel exposes its config in the file /proc/config.gz. If not, I don't know how to get a matching config - best is to avoid buying anything from GPL violators.

Driver development for a stock kernel possible?

Hello,
I've been trying to compile a driver to the stock kernel of my S3. I've ensured that I have the correct kernel version and have done a modinfo on the compiled driver to check the version magic string is correct. However I can't insmod the driver. I am root on the device when I try to do so.
I've managed to do this on other brands of phone which leads me to wonder if the S3 default kernel config from the open source repository correctly reflects .config that was actually used for the release kernel on the phone.
Is it possible to develop drivers for the stock kernel? (3.0.31-2788594, build number JSS15J.I9300XXUGNJ2 in my case). Does anyone have a correct .config for this kernel build?
regards,
Rob

Porting drivers to a clean kernel?

How can I port the vendor's kernel drivers for my model phone from their open-source kernel code to a clean kernel of a similar version number?
They are using 4.4.78 perf+ so presumably that would port to a generic android 4.4 kernel?
Is there any books or guides available to provide an overview of which parts of the android kernel get changed during development of a new model?
The reason I need to port the kernel source drivers to a clean kernel is because I cannot replicate the vendor's environment and have failed to make their source code standalone compilable - so it fails to build even some basic modules.
Bump - haven't found any info on how to work the Android Linux kernel in terms of the boot loader and drivers.
Bump!
Bump!

Need help with errors when compiling kernel from source.

So, I recently got a ASUS Zenfone 4 Selfie Pro, the phone is stuck on android 7.1 and doesn't have any roms, nothing, just TWRP. So I'm on a journey trying to build stuff for this device from the ground up, I already made a device tree based on Zenfone 3 (which has the same SoC) and I tried to build lineage/cyanogenmod 14.1 for it and got a lot of kernel errors, so I went to try to compile the kernel from the source ASUS gave on their website and uploaded it to my github. In this past 3 days was able to fix and workaround some of the errors I got while building, but now I'm stuck on this one: https://hastebin.com/iqisuzegeg.coffeescript | any help would be greatly apreciated .
For easier access to the kernel source I uploaded it to my github and made some fixes/workarounds for some errors: https://github.com/2003Frost/android_kernel_asus_Z01M_stock
I'm using Linaro 7.5.0 as arm64 toolchain.
I'm using Zorin OS 15.2 as OS.
If any more information is needed I'll be glad to give out.
0
Seppppx said:
Hmm. There is probably no definition for 'drivers/platform' and 'drivers/platform/msm' . But there is a reference (probably). Also have you tried to build the kernel with the defconfig "the manual way". If there is something wrong with the kernel I have almost no way of helping you because I'm not a real developer.
EDIT : There is a kernel source for your phone that on a developer's github https://github.com/shakalaca/android_kernel_asus_zd552kl . That is also the person who is the maintainer for official twrp. He has some large commits on the kernel so his kernel should build.
Click to expand...
Click to collapse
I already tried his kernel and got the same exact error :/
I didn't understand fully what you said with "the manual way" but I'm trying to compile the kernel outside the rom build environment, by using my device's defconfig and compiling with linaro.
0
Seppppx said:
By the manual way I mean the with the defconfig. Also I made a pull request to your Device Tree (adds persist partition and Shakalaca's kernel).
Also if you're trying to build with defconfig there is a tutorial by google. https://source.android.com/setup/build/building-kernels-deprecated .
After that you will have to put it to the boot image. Another guide for that. https://source.android.com/setup/build/building-kernels#embedding-into-Android .
Edit : Isn't the Android kernel build with the defconfig when you run a source build? I think it actually builds the kernel when you build android so you don't build the kernel separately.
Click to expand...
Click to collapse
I accepted your pull request. Yes when you build a rom from source it also compiles the kernel, but I wasn't able to build the rom because it gave me kernel errors, so I went and started compiling separately because it's easier to fix kernel errors like this.
I am not using Google's tutorial, I'm following one that has almost the same steps and I'm using the same toolchain.
0
Seppppx said:
By toolchain you mean tools that you need to compile a kernel? Why doesn't one just install the tools needed to compile a kernel source.
The guide I linked doesn't specify any toolchain (thus idk if I need one). It also doesn't have anything to do with build.sh script used to compile a kernel. Instead it uses the defconfig. The commands are actually very simple.
cd kernel-source_code
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-android-
make ZD552KL-Phoenix_defconfig
make
Also have you tried to build another kernel that you are sure builds? If another kernel builds. The issues have to do something with the kernel itself. If it does not it's most likely something else.
Click to expand...
Click to collapse
To compile a kernel from source you need something a cross compiler or toolchain in my case I'm actually using the exact same commands you commented with linaro toolchain/cross compiler (aarch64-linux-android). As far as I know you need that to compile a kernel and I don't think the toolchain is the problem but the kernel itself. I can try another kernel later to see if it compiles.
0
Seppppx said:
Okay thanks!
If you manage to compile the kernel for your device make sure to mention/quote me. I would like to contribute. I'm on my way to make another pull request (now about cameras).
Click to expand...
Click to collapse
If you want to talk to me more quickly you can message me on telegram https://t.me/Frost_2003
0

Categories

Resources