What's the difference between the ROM and the kernel - Essential Phone Questions & Answers

I see installation instructions for a ROM (which is the Android OS, right?) and I see references to a kernel as well. What is the difference? Am I supposed to install both at the same time, or does the ROM carry the kernel, or how does it work?

Android is similar to mainstream linux operating systems in that the ROM is like the OS portion of a linux distro.
the Kernel is the portion that interfaces between the OS and the hardware.
Pretty much all Roms (there may be exceptions but I cant think of any) come prepackaged with a kernel as well.
so installing the ROM will install the kernel automatically and has the benefit of installing the kernel the developer intended.
There are separate Kernels available that have specific features you may prefer. (overclocking for CPU/GPU, specific modules loaded for emulation if running a linux distro within android etc.)
to install them you would install the rom (And its default kernel) then flash the kernel of your preference over it.
If you are just starting out I would just install the Rom and its default kernel unless you have a very specific use case.
hopefully that helps
There are often more pieces as well due to proprietary code:
ROM - the OS itself often either based on AOSP, the manufacturer software or Lineage (or a mix)
Kernel - refers to the open source linux kernel that controls hardware that it supports.
Firmware - includes manufacturer proprietary code for hardware that is not open source.
Modem - includes proprietary code for modem hardware.
it breaks down further but generally you will start with a stick manufacturer installation including all parts.
then you can flash a custom rom and kernel (Usally as a complete package)
Modem and firmware updates would still come from the manufacturer. (Most roms will tell you if a specific firmware or modem is needed, the modem usually doesnt matter as much anymore but in the early years it was important)

Thanks for the information!

Related

What is a kernel?

this might be a stupid question, but what is a kernel and how do u use them? i know what a rom is and how to install but not a kernel....
Wikipedia definition:
"In computing, the kernel is the central component of most computer operating systems; it is a bridge between applications and the actual data processing done at the hardware level. The kernel's responsibilities include managing the system's resources (the communication between hardware and software components).[1] Usually as a basic component of an operating system, a kernel can provide the lowest-level abstraction layer for the resources (especially processors and I/O devices) that application software must control to perform its function. It typically makes these facilities available to applicationprocesses through inter-process communication mechanisms and system calls."
Since Android is based on Linux: (don't know if this relevant)
"The Linux kernel is an operating system kernel used by the Linux family of Unix-like operating systems.[6] It is one of the most prominent examples of free and open source software.[7]
The Linux kernel is released under the GNU General Public License version 2 (GPLv2),[4] (plus some firmware images with various licenses), and is developed by contributors worldwide. Day-to-day development takes place on the Linux kernel mailing list.
The Linux kernel was initially conceived and created by Finnish computer science student[8] Linus Torvalds in 1991. Linux rapidly accumulated developers and users who adopted code from other free software projects for use with the new operating system.[9] The Linux kernel has received contributions from thousands of programmers.[10] Many Linux distributions have been released based upon the Linux kernel."
I have a question too.
When I boot ubuntu 10.04, the kernel comes up as 2.6.32, I think this is the same number as a previous android kernel. So how close is the android kernel to the linux kernel, us it a fork? When the new linux kernel comes out, will the android kernel be updated to reflect that?
What the little brown things are in a popcorn bag before you pop it XD
I thought it would be better to ask here than start a new thread but i have never installed a kernal before and was wondering how, do you just flash it in recovery? I have the desire rom and would like for my speaker to be a bit louder.
With kernels, I usually do ADB command.
liam.lah said:
So how close is the android kernel to the linux kernel, us it a fork?
Click to expand...
Click to collapse
It's the same with some Android and phone specific patches applied. A config file decides what architecture to build for and what drivers to include. That's what lets us bring in cutting edge features like compcache and BFS quickly.
Nice to think that your phone is running the exact same code that the world's fastest supercomputer is.

[Q] Question about the need for sources...

Hey guys,
As a software developer myself I feel a bit embarrassed that I need to ask this, but I really can't think of the answer myself. Here goes:
Why do we always need the latest sources from Samsung to be able to build an AOSP rom?
The way I see it, unless the kernel's internal APIs that Samsung's device drivers use have changed dramatically between, say, Froyo and Gingerbread, wouldn't it be possible to simply check out AOSP, paste the driver source files from Froyo into the appropriate folder in the kernel tree, and compile? Even if the kernel's internal APIs have changed a bit, they would be minor and well documented changes, so it should only be a moderately difficult task to fix the Froyo sources to work with Gingerbread. Sure, the drivers would still be "Froyo quality," but they seem to work pretty well to me. I'd be happy with a Gingerbread AOSP build w/ Froyo drivers.
It's kind of like what VMWare's tools do in a Linux guest OS - if you update your distro's kernel, the ABI is broken and you just recompile the modules. Same VMWare source code, different kernel, but it works.

[Q] What is a Kernel?

Just wondering what it does and what kernel everyone else has?. Only coz i been learning to install the different custom roms ...but in the "About Phone" options the Kernel Version never seems to change...even tho the custom roms i install say that they have added a new kernel?...
anyway my kernel version is 2.6.32.9-perf
thats what it says anyway...does that mean anything? should i update it somehow?
what are you using?
Thanks.
xxguestxx said:
Just wondering what it does and what kernel everyone else has?. Only coz i been learning to install the different custom roms ...but in the "About Phone" options the Kernel Version never seems to change...even tho the custom roms i install say that they have added a new kernel?...
anyway my kernel version is 2.6.32.9-perf
thats what it says anyway...does that mean anything? should i update it somehow?
what are you using?
Thanks.
Click to expand...
Click to collapse
m using franco's kernel..
i think kernel is related to power...
"In computing, the kernel is the central component of most computer operating systems; it is a bridge between applications and the actual data processing done at the hardware level. The kernel's responsibilities include managing the system's resources (the communication between hardware and software components). Usually as a basic component of an operating system, a kernel can provide the lowest-level abstraction layer for the resources (especially processors and I/O devices) that application software must control to perform its function. It typically makes these facilities available to application processes through inter-process communication mechanisms and system calls."
Wikipedia
AlexxxR said:
"In computing, the kernel is the central component of most computer operating systems; it is a bridge between applications and the actual data processing done at the hardware level. The kernel's responsibilities include managing the system's resources (the communication between hardware and software components). Usually as a basic component of an operating system, a kernel can provide the lowest-level abstraction layer for the resources (especially processors and I/O devices) that application software must control to perform its function. It typically makes these facilities available to application processes through inter-process communication mechanisms and system calls."
Wikipedia
Click to expand...
Click to collapse
if i upgrade from 2.3.3 to 2.3.5 can i keep using then old kernel with the new version 2.3.5 or not ?
You chudakkar
Sent from my Desire HD using xda premium

[Q][3/30/2013] Best Practices for Kernel flashaholics?

I note that:
- some kernel devs ship only a bare kernel which gets packaged up with the existing ramdisk
- some kernel devs ship a full boot partition image (kernel + ramdisk)
- some kernel devs do one or the other of the above PLUS mods to the /system mount point
(e.g. /system/etc/init.d scripts)
- other tweaks (any of them in /sdcard or /data?)
So, what I'm wondering is what kind of protocols users that frequently jump from kernel to kernel are using to avoid configuration ambiguities and collisions. It seems like if you choose some random ROM, flashing a full boot partition image possibly breaks dev mods in the ramdisk. And flashing kernel alfter kernel that writes startup scripts to /system/etc/init.d probably piles up a random collection of potentially mis-matched or conflicting scripts. (One dev's S99 might be another's S80).
Seems like at a minimum you would need to re-flash /system from a backup or the original ROM in preparation for a kernel flash if you had previously flashed some other kernel (that was not the original shipped with the ROM).
I realize there is that kernel flash clelanup script thread - do folks really use it? It seems like the developer would have to be constantly inspecting new kernel releases across all developers to make sure the cleanup script is actually deleting/reverting the right stuff. That seems like a big job and hard to keep it up-to-date.
Anyway - just curious.
Personally after having tried several kernel I found one that suits me and I do not change.
Of all the available kernels for N7, i try and stick to lean or motley as most of the ROMs out there work well with these two...i personally have not found kernel related issues while flashing when compared to Franco or faux...
I always prefer to wipe the grouper completely when a stable version of the ROM of my choice is released ...
Sent from my Nexus 7 using Tapatalk HD

[SOLVED!] Bluetooth doesn't work after compiling a kernel based on LOS 18.1 sources.

I'm kinda new here, so please excuse me if this is not the best place to ask and it should instead be posted in another section.
First, a bit of context: I recently bought a refurbished H910 to practice android development since it was fairly cheap, and after testing its features and unlocking the bootloader to install custom roms, i opted to start compiling a kernel of my own with some changes to begin involving myself with the development side of things. For now, i am using the Lineage OS 18.1 kernel sources on github as a base for the kernel, then after making sure that the kernel compiled, i flashed it into the phone and basically everything works with the only exception being the bluetooth, and maybe the IR Blaster, but that one is working just like the stock kernels on different Android 11 roms.
Now getting to the issue itself in more details... it boils down to the phone's bluetooth refusing to turn on while running that custom kernel of mine on any Android 11 ROM, be it Lighthouse, Superior OS Xcalibur or Lineage 18.1, the bluetooth tile gets stuck on the "Turning on..." icon animation for a while and then returns to the disabled state. Reverting to the stock kernels or even using other custom kernels like Lyb's or Gamma make the Bluetooth work again without needing a wipe, which tells me that the problem is definitely somewhere in my kernel. I could of course test it on some Android 10 ROMs, but the outcome will most likely be the same.
I even took some logcats via ADB Shell but they are kind of broad and mostly explain that the service had some problems with "com.android.bluetooth service has died: psvc PER", followed by a "scheduled restart of crashed service com.android.bluetooth...". Both of which never happen on those ROM's stock kernels, where the bluetooth works as expected. I looked around on Lyb/Gamma kernel sources on github, and there aren't any major differences to the defconfigs for example with the bluetooth driver configuration also being just about the same.
I'm not sure if this will be of any help, but as for the toolchains and compilers, i am using clang 11.0.2 383902b1 as the main compiler, gcc 4.9 as the ARM32 cross-compiler, and gcc from 4.9 up to 10.3 as the AARCH64 cross-compiler, all running on Manjaro. I also changed that combination dozens of times, but to no avail.
So am i missing something during the compilation process? With all those things i already checked, i keep getting a feeling that something really simple is going over my head. Also, i can post the link to my github repository here if needed, there's a branch made specifically to check the BT since it has only the changes made to assure that the kernel compiles.
Edit: The problem was solved!!! It actually comes down to using the exact toolchains provided by the lineage OS source tree for the device (that might be optional, but it's how i managed to get it working) and checking if everything has been installed correctly. It seems some files failed to download the last time i did a 'repo sync' on the source and that was what might have caused this.

Categories

Resources