[Q] Kernels - what is there to know about them ? - Galaxy S II Q&A, Help & Troubleshooting

OK, so here's the thing... I'm kind of new in the Android acknowledgement, so I hope that here will be the place where I will get my answers. So here's what I know...
At first I didn't know that Android was Java-based, using a modified Linux kernel which we all know it's C-based (entirely). After a while, I found that there were different firmwares (ROMs) from the original ones, called Stock ones and also different kernels. After reading lots of info about how things actually are, I've decided to root my stock and then I moved to a custom MIUI for my SGSII with a JB implementation. At first it was great, but I had some issues which left me disappointed. Then I moved on to the official MIUI (China - English one). Things got better after I got used to it. The major bugs disappeared, only small ones left and a few crashes, but in time most of them got fixed. Later it crossed my mind, "Why are there so many different kernels and which is the best one for my phone or ROM to be precise?" Well this is where I need your help. I've read some topics that siyah kernel is probably the best kernel, which fits the MIUI rom. The pointing of concrete kernels isn't the kind of answer I was actually searching for. To be honest, I need answers to questions like:
How many kernels are there ?
Which ones are safe ? (I've read that there are badly written ones, so yeah, it needs to be asked)
Statistically, which is the best kernel and is it for the MIUI rom ?
How can I tell that it's suitable for the MIUI rom ? (Since I've read that not all are)
What are the risks of changing the kernel?
How can you test the kernel's behaviour, an app which makes statistics in time or some other methods ?
Believe me, as annoying this topic might seem, lots of us (the newbie users) are burning up the google servers, just to find these answers. I'm really hoping for a reply spam with answers (if possible , spare the trolling ones). Thanks for reading my annoying topic, anyway

Since most of the source is available, basically anyone can build their own kernel at home, so it is hard to tell how many kernels are there.
what isn`t available as open source are most of the OEM-specific drivers. Samsung, for one, doesn`t make most of the drivers' source publicly available, so kernel developers have to make a binary kernel around the binary drivers and literally pray their work well together.
Siyah is safe, but I prefer the stock kernel (I like the stock ROM... go figure). The stock kernel is the only one that is sure to work properly with all the hardware in the phone, because it is the only built from sources for the drivers as well (read my previous paragraph).
Which ones are safe (other than stock and Siyah): you gotta try them for yourself, read other users' remarks and feedbacks, and so on.
Risks:
Very low. As long as the bootloader is good, if the kernel totally malfunctions, just reboot in download mode and flash something else.
Some app may work very well in one kernel and bomb in another. It may crash in some kernels. It is very empyrical.
The problem is that custom kernels don't undergo the same type of quality testing as stock kernels. Developers have very limited resources to do that, and some developers are more interested in having a short time-to-market than a quality product (well, many large corporations act like that as well). At the end of the day we - power users - are the beta testing and quality assurance teams for the kernel developers.

Related

[Q] Are any/many of the custom kernels updated with newer 2.6.32 base code?

As part of my self-teaching experience with kernels and roms here, I'm currently experimenting with upgrades to the 2.6.32.9 base kernel code. Taking it slow so far, my first attempt at jumping from 2.6.32.9 all the way to 2.6.32.37 (at the time) didn't go well
Anyhow, my question is ... is this something that the devs commonly do, or is it more typical to just leave well enough alone and back-port interesting things (like EXT4/scheduler enhancements) from later kernels?
I already learned the hard way that unless you really want to start replacing things, you have to leave the kernel version number at "2.6.32.9", so it's unclear to me how often base code updates are actually performed.
If I do make it all the way to 2.6.32.39 successfully and it still boots, I can share if there is interest. I'm pretty sure bluetooth will need work, if it works at all. Call it a hunch based on how many modifications I see that Samsung made coupled with the chances of me properly merging that code multiple times.
Thanks in advance ... just working to try and be smarter with the hopes of participating more actively on my next device!
Good luck. I tried patching, and it successfully builds, and it will even start to boot, but it gets bootloops. From the looks of things, the latest stable .32 kernel is .32.28. Here is my patched tree if you want to play around with it: https://github.com/imnuts/linux-2.6-fascinate/tree/patched
imnuts said:
Good luck. I tried patching, and it successfully builds, and it will even start to boot, but it gets bootloops. From the looks of things, the latest stable .32 kernel is .32.28. Here is my patched tree if you want to play around with it: https://github.com/imnuts/linux-2.6-fascinate/tree/patched
Click to expand...
Click to collapse
Thank you for the link sir! I've been moving forward slowly, first just .9->.10 then .10->.15, I'm in the middle of .15-.25 , but I think I'll just bump it to .28 next and compare where I am with where you were.
It's nice to have a reference, and much appreciated. I'll let you know if I make it past .28. It's tedious work, and I'm afraid not work that will bear much if any fruit other than knowing how
Yeah, at this point, I think it's just easier to pull in specific patches from upstream rather than patching the whole kernel tree. If you have any success with it though, I'm sure that others around here would be interested.

[Q] How come that specific userlands do require a certain kernel to work?

I'm very new to Android as an OS with the Linux kernel at its heart, but fairily proficient with GNU/Linux and a plethora of its distributions for what has been more than a decade by now. So, what I (amongst other things) find a bit bewildering is that very many of custom firmware images seem to require a very specific kernel version or build for handsets to actually work. For my Xperia Mini (Smultron), there are ROM images based on CyanogenMod that won't work with the "vanilla" CM7 kernel, for instance.
With a proper GNU/Linux system, you don't have that kind close coupling of userspace and kernel versions at all. Barring some minor incompatibilities between certain (old) releases of udev and modern releases of the Linux kernel (and vice versa), there's very little (if anything) that stops you from supplanting your three years old distro's kernel with something that Linus released a few days ago.
However, whenever I've come across a guide how to install/set up this and that ROM for some kind of phone, and someone (more or less prominently) states that that image will require a specific kernel build, I've _never_ been so lucky to have been offered a technicial explanation as to why exactly this is the case. Can anyone reading this thread tell me, or point me to where I can find out more about the underlying reasons for these subtle incompatibilities?
I refuse to believe noone can answer that question...
Some features are not available in stock kernel, that are needed for custom ROM.
I am personally not fully familiar with kernels.

[Q] how to port ics (serious learner)

Lemme get some things out of the way.. I am a noob. I have searched. I have read some of the results from the search. I am overwhelmed by the 20+ pages of results (lol). I am not 100% sure this is the correct forum for this (not sure where else would be ).. I believe this is one of those things where I need help based on my situation.. Ok, so here I go.
I wish to start porting ICS to my phone. That's my goal. I have general understanding of how linux works, but I do not know much about the android specifics of how they work, or what needs to be modified for this to work. I do not plan to use the kitchen tool as I wish to learn this the hard way. I believe this will help me become more understanding in what I am doing. However, at this point I don't and that's why I'm here. My phone model is irrelevant almost because its prepaid and usually the communities don't even recognize their existence.. at least that's how I feel about it. But I digress. My phone is the zte warp by boost mobile and I am here to learn hopefully the things that will get me started on porting ICS to this phone. I right now believe that the best thing for me to learn is how the android related files work because as it is, I only looked at guides on how linux works and I understand most of it. I'm not sure that's the best thing that will help me port ics, but I'm certain it is important.
Please help me figure out where I should start in learning how to port ICS to my phone basically.
Thanks XDA
anyone? I am quite serious about wanting to do and go into this but I have yet one thread that anyone's ever replied to.. (or post iirc) which puts a damper on me
Snake X said:
Lemme get some things out of the way.. I am a noob. I have searched. I have read some of the results from the search. I am overwhelmed by the 20+ pages of results (lol). I am not 100% sure this is the correct forum for this (not sure where else would be ).. I believe this is one of those things where I need help based on my situation.. Ok, so here I go.
I wish to start porting ICS to my phone. That's my goal. I have general understanding of how linux works, but I do not know much about the android specifics of how they work, or what needs to be modified for this to work. I do not plan to use the kitchen tool as I wish to learn this the hard way. I believe this will help me become more understanding in what I am doing. However, at this point I don't and that's why I'm here. My phone model is irrelevant almost because its prepaid and usually the communities don't even recognize their existence.. at least that's how I feel about it. But I digress. My phone is the zte warp by boost mobile and I am here to learn hopefully the things that will get me started on porting ICS to this phone. I right now believe that the best thing for me to learn is how the android related files work because as it is, I only looked at guides on how linux works and I understand most of it. I'm not sure that's the best thing that will help me port ics, but I'm certain it is important.
Please help me figure out where I should start in learning how to port ICS to my phone basically.
Thanks XDA
Click to expand...
Click to collapse
From my limited knowledge, I think it is a huge task undertaking, you can download Android source code from Google, the hard part will be the device driver development and porting for Linux kernel (and maybe portion of Android). If you are lucky, you can use the existing phone bootloader (or you have to port one). Understanding the inner of the phone (different chip set may need different device driver) will be another challenging task.
by the device driver development, you mean all the libs that go into the phone? Couldn't I just copy/paste the pre-existing libs that are already made for the phone? Also the phone im working with is a bit strange really.. noone has been able to compile the kernel from its source and get it to boot yet.. when it was compiled the zImage was different than that of the stock one.
And yeah, I have downloaded the aosp source.. I just need to know where to start at and the processes involved really
Snake X said:
by the device driver development, you mean all the libs that go into the phone? Couldn't I just copy/paste the pre-existing libs that are already made for the phone? Also the phone im working with is a bit strange really.. noone has been able to compile the kernel from its source and get it to boot yet.. when it was compiled the zImage was different than that of the stock one.
And yeah, I have downloaded the aosp source.. I just need to know where to start at and the processes involved really
Click to expand...
Click to collapse
To answer you question no the drivers and lib files are different for aosp based rooms then they are for the stock OEM from. The first step will be to get a working kernel. Without anything you do will be pointless
I'm somewhat interested in the same thing, and from what I've gathered, you'll need to do these things to begin ROM development:
1. Read every page on the AOSP site and grab a copy of the AOSP source. It probably wouldn't hurt to read the regular Android developer wiki as well.
2. Learn about Linux driver development:
http://lwn.net/Kernel/LDD3/ (this is apparently considered THE BOOK on Linux driver development)
http://www.freesoftwaremagazine.com/articles/drivers_linux
3. Learn pretty much every detail about your phone and its hardware, especially when it comes to how ROMs are installed on it. For example, my phone (the Droid X2) has a locked bootloader, so 2nd init has to be used to boot new ROMs, and this makes it so that we cannot update the kernel.
You can usually find this sort of information on your phone manufacturer's website. Sometimes they even post the source code to their phone's drivers, which is helpful.
4. Look at other ROMs (preferably for your phone) and see how they work. The source code is freely available for most popular ROMs.
For example: CyanogenMod keeps their source code in a public git repository: https://github.com/cyanogenmod
5. Get to work on porting!
I would highly recommend starting with something smaller, however, just as a start. One good jumping-off point is probably this guide: http://forum.xda-developers.com/showthread.php?t=1272270
If any part of this was wrong, or if I left something out, somebody feel free to correct me, I'm still a noob.
Thank you so much for your direction, however,, android kitchen.. im not sure about that because isnt that only ment for htc devices? My phone is made by zte
what device do you even have?
if it's stuck officialy on 2.1 or 2.2 there's no hope that if you even port it that it'll work
its the zte warp from boost mobile (prepaid). Btw if I compile an aosp ics launcher and put that on my phone whats the chances of that working?
edit: it uses 2.3.5
Well Sebastian responded on android forums, apparently zte is very bad at version control with their kernel sources. So when they complete one project, they use the same source for the next project, and what they release could be for anything. Apparently the blade source had the same issues, it took him a while to get them to correct the source
Sent from my N860 using Tapatalk
Yeah I noticed that there were ppl saying there were things similar but I'm not sure what will work or what won't.. guess its time to start a petition on zte to release the source code lol
edit: seems like zte's bein a bad company and violated the GNU GPL license for not providing a complete source code.. I compiled an email and sent it to someone who can proof read it and send it to the right person for this kinda thing.. danggit zte

[Q] Kernels and Android Versions

I'm not understanding how kernels and ROMs connect. Can someone give me some extra insight?
[Hardware] <-- Unique to every phone
--
[Kernel] <--- Tells the OS how to talk to the hardware
--
[ROM] <--- Slightly confused. Is the OS in the Read only Memory, or has this term changed its "street" meaning?
I understand that most ROMs (e.g. CM7 and CM9) include both the kernel and the ROM, but can you flash these separately too?
I have a 1.5 year old thunderbolt that's rooted, and has CM7 which is based on gingerbread. I believe HTC has also released the kernel as open source, which is probably the reason I have CM7
Anyway, I guess what I'm looking for is an answer/guide/forum that explains why I can't install newer versions of android onto the already working/open source kernel I'm already running. Is it accurate to view the kernel as all the phone's drivers, or just the CPU driver? If that statement is true, why can't I load ICS or Jelly Bean onto my already existing set of drivers?
I'm thinking about starting a Wiki on this if 1) it doesn't already exist, and 2) I can wrap my brain around it enough to share with others!
Thanks to anyone with a response!
shadowrelic said:
I'm not understanding how kernels and ROMs connect. Can someone give me some extra insight?
[Hardware] <-- Unique to every phone
--
[Kernel] <--- Tells the OS how to talk to the hardware
--
[ROM] <--- Slightly confused. Is the OS in the Read only Memory, or has this term changed its "street" meaning?
I understand that most ROMs (e.g. CM7 and CM9) include both the kernel and the ROM, but can you flash these separately too?
I have a 1.5 year old thunderbolt that's rooted, and has CM7 which is based on gingerbread. I believe HTC has also released the kernel as open source, which is probably the reason I have CM7
Anyway, I guess what I'm looking for is an answer/guide/forum that explains why I can't install newer versions of android onto the already working/open source kernel I'm already running. Is it accurate to view the kernel as all the phone's drivers, or just the CPU driver? If that statement is true, why can't I load ICS or Jelly Bean onto my already existing set of drivers?
I'm thinking about starting a Wiki on this if 1) it doesn't already exist, and 2) I can wrap my brain around it enough to share with others!
Thanks to anyone with a response!
Click to expand...
Click to collapse
You are correct about the ROM, but ROMs also include the kernel (if it didn't, or no kernel was flashed separately, the device would not boot). Yes, other kernels can be flashed on your existing ROM, but it's not necessarily going to be compatible.
Sort of, but there's a lot more than that. See here and here. Later versions of Android will require newer drivers,etc. which the existing kernel won't provide (they'll be outdated). Back porting and additional coding is theoretically possible, but insanely difficult (many times). Even after this some things may still not work.
Thanks for the insight, I was able to get a lot deeper into this with those links. For anyone else wandering down a similar path, you might as well stop now! Here are a few links:
http://forum.xda-developers.com/showthread.php?t=1039217&page=2#17
http://www.cs.uwc.ac.za/~mmotlhabi/avmk.pdf
http://www.iteachandroid.com/2012/01/what-is-firmware-rom-and-firmware.html
So, if anyone else is still listening, I do have two more questions:
Do any phones have truly open source drivers? (a.k.a. higher probability of allowing old hardware to work with new android OS)
Is there any way to determine which phones will be supported by the custom-ROM community early on? I know the Nexus line doesn't have vendor modified code, is that the direction which would have the highest probability to stay at top of the Custom ROM curve without upgrading devices every year?
Thanks again for any insight! I hope I'm posting this in a Newb-Friendly forum!
shadowrelic said:
Thanks for the insight, I was able to get a lot deeper into this with those links. For anyone else wandering down a similar path, you might as well stop now! Here are a few links:
http://forum.xda-developers.com/showthread.php?t=1039217&page=2#17
http://www.cs.uwc.ac.za/~mmotlhabi/avmk.pdf
http://www.iteachandroid.com/2012/01/what-is-firmware-rom-and-firmware.html
So, if anyone else is still listening, I do have two more questions:
Do any phones have truly open source drivers? (a.k.a. higher probability of allowing old hardware to work with new android OS)
Is there any way to determine which phones will be supported by the custom-ROM community early on? I know the Nexus line doesn't have vendor modified code, is that the direction which would have the highest probability to stay at top of the Custom ROM curve without upgrading devices every year?
Thanks again for any insight! I hope I'm posting this in a Newb-Friendly forum!
Click to expand...
Click to collapse
For both your questions, the Nexus-line devices would be the way to go. They usually have everything working on new Android versions the soonest, and Google always releases their code, etc.
Hi
i can use linux kernel (zimage) to update android kernel if yes ,how ?
thnx

[noob questions] ROM/Kernel - building/porting

I’ll start by admiting that, in the arts of cooking/building/porting android innards, I’m closer to being a complete noob than na intermediate user.
I own a Newman K1S, JB 4.2.2, MT6592, 2Gb/16Gb, 720p, and, sadly for me, it looks like the manufacturer (Newman Mobile, or Newsmy, who knows) pretty much disavows any knowledge of this model ever being built or sold. No reference to it, no community, no android updates or ROM releases.
Taking into account some MediaTek source codes for KitKat were made available earlier this year (even if unofficially), I was wondering:
So, question number 1 – Is it possible to build android 4.4 for my device straight from said sources? Or are they unreliable and it would be best not to attempt it?
And question number 2 – Being at the noob level, should I stay away from such a task? And, in this case, would I be better off porting a 4.4 ROM from a similar spec’ed device?
Also, while browsing needrom, I noticed that a 4.4 “official” ROM was posted for my device. However, having flashed it, I found that it produces no sounds from the external speaker (although with headphones it works fine). Same thing was experienced by other users, and there is no fix so far.
Which takes me to question number 3 – What may I try, in order to fix an issue like this? Does KK use the same sound drivers as JB, and maybe it’s only a matter of replacing them? (if so, I believe this is within my grasp, even if I must unpack the IMG files to reach the drivers)
Lastly, Newman K1S has a severe overheating problem when pushed, which I believe would be easily solved by underclocking it to 1.3 or 1.5, or maybe implementing an optimized kernel.
Final question – How do I manage to underclock with my current kernel, or, better yet, how do I port a custom, optimized kernel to my device?
Congratulations to everyone who managed to read this far, and thank you in advance for any help provided. I’ve spent the last few days reading tutorials and guides, only to become even more confused… I did manage to get android kitchen running on my Windows laptop, though!
Links to recent/updated guides that might be useful are appreciated, too.

Categories

Resources