I have experimented with different ROMs and two versions of TWRP, and have installed the fff bootloader. (I have two working cracked-glass KF's that I picked up cheap in addition to a like-new one, so I can try different ROMs, etc., at the same time.)
I had presumed until recently that the kernel was a part of the ROM that was locked in by the ROM developer. It appears, though, judging by the two lengthy threads about a kernel 3.0, that users can install different combinations of kernel and ROM.
Can somebody explain, or point to an explanation of, the relationship between a kernel and a ROM and how one installs a desired combination of the two? Can one install a new kernel over an existing ROM, install the kernel and then a ROM, or is it necessary to do something else, such as editing a .zip file before installing it?
I realize that if I were to read a few hundred messages in a few threads, I might come up with the answers myself, but I might also transition from being a still-coherent old guy to one with senile dementia before I got to that point. Aside from my personal needs, though, it seems that an explanation of this matter deserves to be someplace where it can be easily found.
The kernel is the main component of the operating system (ROM). The kernel is essentially the middle man between the applications and the processing being executed at a hardware level. Basically the kernel is the communicator between software and hardware.
With that said, ROM developers will use a specific kernel with their ROM. You are not locked in to use the kernel which came with "x" ROM. A new kernel can be installed. You want to make certain if you are using an ICS ROM you parallel it with an ICS kernel. If you flash an incompatible kernel that could be a problem. Some kernels work better with some ROMS. Different combinations produce different bugs. It's just a matter of tinkering until you find the combination which suits you best. Hash's latest 3.0 kernel (http://forum.xda-developers.com/showthread.php?t=1591850) is popular and seems to be mostly stable with the ICS ROMS for the KF.
Installing a kernel is just like flashing a ROM although you don't need to wipe anything. Just boot in to recovery and select the kernel you've downloaded.
Should the custom kernel be installed after the ROM? It would seem that that would be necessary if the ROM itself comes with a kernel, as it apparently does.
Also:
? Are both the kernel and the rest of the ROM installed into the system partition, /dev/block/mmcblk0p9? If not there, then where?
? Does the kernel include the compiled code for all the standard linux commands, or only the system-level ones? Does it include the Dalvik interpreter?
aarons510 said:
Should the custom kernel be installed after the ROM? It would seem that that would be necessary if the ROM itself comes with a kernel, as it apparently does.
Also:
? Are both the kernel and the rest of the ROM installed into the system partition, /dev/block/mmcblk0p9? If not there, then where?
? Does the kernel include the compiled code for all the standard linux commands, or only the system-level ones? Does it include the Dalvik interpreter?
Click to expand...
Click to collapse
1. boot.img
2. Kernel come with system calls, or API, the commands you mentioned is binutils (most popular is GNU's). In Android you can install busybox to get these commands.
Gửi từ Kindle Lửa của tôi qua Tapatalk 2
linktohack said:
1. boot.img
Click to expand...
Click to collapse
What part of my question is this an answer to? I'm guessing that it's meant to answer the questions in the third paragraph of my original post, but it's a bit cryptic, to say the least. I do want to confirm that the new kernel gets installed after the ROM is installed, if that is indeed the case.
2. Kernel come with system calls, or API, the commands you mentioned is binutils (most popular is GNU's). In Android you can install busybox to get these commands.
Click to expand...
Click to collapse
I just checked the version of ICS I have installed on one KF and the CM7 installation I have on another. On both of them, the system calls seem to be in /system/bin while the file manipulation and document processing commands are in /system/xbin. Most of the latter are, indeed, symlinks to busybox while many of the former are symlinks to toolbox.
So, when one installs a new kernel, is one just over-writing /system/bin and maybe other directories with a new set of system calls, or is something else going on? And where does the dalvik interpreter fit in? Is it part of the kernel, part of the ROM, or neither?
aarons510 said:
What part of my question is this an answer to?
Click to expand...
Click to collapse
I think he meant to tell you that the kernel is usually distributed as boot.img in the ROM zips.
aarons510 said:
I do want to confirm that the new kernel gets installed after the ROM is installed, if that is indeed the case.
Click to expand...
Click to collapse
The kernel is installed along with whatever ROM you install. Let's say you pick MadeUpRom and it features kernel #8 with it. You'd have to flash kernel #11 after installing said ROM.
aarons510 said:
So, when one installs a new kernel, is one just over-writing /system/bin and maybe other directories with a new set of system calls, or is something else going on? And where does the dalvik interpreter fit in? Is it part of the kernel, part of the ROM, or neither?
Click to expand...
Click to collapse
Kernels are installed to the boot partition, which is separate from the ROM's /system partition. Installing a new kernel will overwrite the existing one. For the dalvik, read this to understand it better: http://stackoverflow.com/questions/7541281/what-is-dalvik-and-dalvik-cache
aarons510 said:
What part of my question is this an answer to? I'm guessing that it's meant to answer the questions in the third paragraph of my original post, but it's a bit cryptic, to say the least. I do want to confirm that the new kernel gets installed after the ROM is installed, if that is indeed the case.
I just checked the version of ICS I have installed on one KF and the CM7 installation I have on another. On both of them, the system calls seem to be in /system/bin while the file manipulation and document processing commands are in /system/xbin. Most of the latter are, indeed, symlinks to busybox while many of the former are symlinks to toolbox.
So, when one installs a new kernel, is one just over-writing /system/bin and maybe other directories with a new set of system calls, or is something else going on? And where does the dalvik interpreter fit in? Is it part of the kernel, part of the ROM, or neither?
Click to expand...
Click to collapse
In Android world, a kernel is an image contains a Linux kernel and a ramdisk which is named *boot.img* and will be *write* (byte copy) to the boot partition.
A complete ROM is a singed zip file contains at least /system files and a kernel. When you flash a ROM, it will unpack and *copy* file of /system to the system partition (that's why we wipe the system partiton aka. factory reset before we flash a new ROM) then *write* boot.img to boot partition.
Usually, a kernel needs external modules, offen reside at /system/lib/modules, so developer create an *uncomplete* ROM, which contains only kernel and these external files. This flashable kernel looks like a ROM, but it's really small size compare to complete ROM.
Like I said above, files in /system/bin/ and /system/xbin/ is not related to kernel (boot.img). They are just binaries, compiled to use system calls that kernel (and modules) offer.
--- Dev only ---
System calls is not binaries, they are CPU interupt instructions. Your programs need to be compiled to call them.
In linux, system calls are called through interupt *0x80*
Related
Simple question, I can only hope the answer can be as easy as the question...
I've got a rooted rom, nand unlocked, etc...I try editing the boot scripts and it saves, but upon reboot they are reverted.
It would seem they are being generated on each boot, is there any way to (permanently) modify these scripts or stop them from being regenerated?
I do believe DamageLess has done it with his latest rom.
I asked this and the topic got moved here: http://forum.xda-developers.com/showthread.php?t=704433
Neotelos_com said:
Simple question, I can only hope the answer can be as easy as the question...
I've got a rooted rom, nand unlocked, etc...I try editing the boot scripts and it saves, but upon reboot they are reverted.
It would seem they are being generated on each boot, is there any way to (permanently) modify these scripts or stop them from being regenerated?
I do believe DamageLess has done it with his latest rom.
Click to expand...
Click to collapse
init.rc is part of the ramdisk. ramdisk which is bundled with the kernel. it gets reloaded on every boot.
i also posted an answer in the other thread linked to above before it was moved ...
like the person above me said, those files are part of the ramdisk and not the actual kernel. but, it's all packaged into a boot.img when you flash a rom. there's a method where someone created a script to split the ramdisk and actual kernel, which i've tried before. google "split ramdisk and kernel android" and you might find what you want.
problem is, when i did that for the hero, it never compiled right. maybe you'll have more luck?
I've tried searching for these things, but all the info seems to be very fragmented.
If someone can give me a simple answer, I would greatly appreciate it.
Kernel - Do I need to flash a new one when installing a new ROM, or is it already in there? Do I just flash it by having a .zip on my sdcard?
Recovery - is this just a shell for bootloader (terminology from the winmo days i guess)? Are there differences, one better than another?
I'd like to install the stock 2.2 ROM that netarchy released, but there is a lot of talk about kernels as related to wifi and FPS, so I wanted to see what that's all about.
Thanks.
Kernel Answers:
No. When flashing a new rom a kernel is included. Kernels are packaged up in the boot.img files inside the rom.zip. Now, with HTC Sense phones there are two types of kernels. HTC kernels and Android kernels. HTC builds their phones in such a way that a standard Android kernel will not work. This is why we need to wait for the kernel source code from them. It also depends what OS is on the device. If you have a stock Sense rom it will use a different kernel than an AOSP rom such as CyanogenMod. So as an example, you are unable to use any CM6 kernel with Sense or vice versa.
My point is this. Be careful. If you want a modified kernel make sure it is for your rom or is compatible with your rom.
Recovery Answers:
No. Recovery is different than the bootloader. Recovery is a mode built into the phone so that, assuming something goes wrong and Android doesn't boot, you can boot into recovery and flash different files. This is only meant for HTC employees however at XDA we always find a way to use this recovery for our own purposes. We take HTC's recovery, erase it and flash our own recovery over it. This allows us to backup and restore our phones, flash new files to it, wipe it, etc.
So for your question. You can use the Stock 2.2 rom and Netarchy's kernel and it should work fine. Just be careful because it is a 2.6.29 kernel. The stock kernel now is 2.6.32 so some things may or may not work properly with it as FroYo was designed to run on a 2.6.32 kernel.
Thanks a bunch for the info!
So if I do the "Volume Down + Power" thing, that goes into phones native recovery menu?
Also, if the phone is rooted (via toast's or simple root), will it then have a different recovery process?
EDIT: As has been pointed out, this thread maybe better served in the Q&A section. Mods, please move this if you feel it's necessary.
I have done some searching and found that I need to install a custom kernel on my EVO to get native CIFS/SMB support (ie so Rockplayer can play movies on my NAS: one of my endgames).
I have already rooted my phone (unrevoked), and have started looking around for a ROM to load (haven't picked one yet).
I have not been able to find non-developer instructions for doing anything with a custom kernel besides that it will be needed for custom drivers (why not have drivers like on a desktop where they don't need a kernel recompile???). I mention this because I plan to start with a compiled kernel, not be in a development environment creating a new kernel.
Do custom ROMs typically come with a kernel at all? I'm not clear where the two separate in terms of deployment, but I think the answer is that custom ROMs do not have to include a kernel of any kind, but it is possible to bundle them somehow.
I am looking for a n00b friendly guide to install a custom kernel (ie boot to fastloader, select the kernel, tell it go, and reboot, run this command, do happy dance), maybe a recommendation for a specific custom kernel, and hopefully a reference to a ROM that comes with a custom kernel that has CIFS/SMB support already baked in.
I looked in my fastboot/bootloader and I didn't see an option for kernel, but I'm not sure what it might be called in that scenario if it isn't called "load kernel"
You'll be flashing kernels the same way you flash roms. Boot into recovery using Rom Manager, wipe cache and dalvik, flash zip from sd, reboot. All the custom roms you find here will come with a kernel baked in. Most of the Sense Roms are using HTC #15 or some version of Netarch. Savaged Zen kernels are great for AOSP roms. Every phone responds a little differently to different types of kernels. Just play around until you find something that works for your particular application.
In flashing roms, I notice that devs are including kernels in the .zip. It appears each dev has their favorites. Without debating which kernel is the "best", my question is can I switch a Zimage (which I assume is the kernel) with another of my liking? Or, if I'm running a particular kernel of my liking, can I flash the Rom without the included Zimage?
.....
Vegasden said:
In flashing roms, I notice that devs are including kernels in the .zip. It appears each dev has their favorites. Without debating which kernel is the "best", my question is can I switch a Zimage (which I assume is the kernel) with another of my liking? Or, if I'm running a particular kernel of my liking, can I flash the Rom without the included Zimage?
.....
Click to expand...
Click to collapse
You should be able to flash a kernel, either through CWM or ODIN without problem.
sk63 said:
You should be able to flash a kernel, either through CWM or ODIN without problem.
Click to expand...
Click to collapse
I realize that. My question was in reference to flashing a rom (which all have a kernel included). Can you switch the Zimage inside the rom .zip prior to flashing...or can I just delete the Zimage inside the rom and flash it without one? I'm trying to avoid the two steps of flashing a rom, then flashing a kernel I prefer.
Ah, I've always just flashed the ROM, then flashed the kernel then rebooted out of CWM. Be nice if there was a utility where you give it kernel and rom and tell it to go, might be a nice feature for ROM Manager to add.
Anybody got this working? saw on the google play store there are a lot of apps that don't support samsung unfortunately because of the way things are partitioned.
What apps don't support Samsung?
Sent from my GT-N7105 using xda app-developers app
If by dual boot you mean booting two roms its not working on the note II yet AFAIK. Here is the progress thread http://forum.xda-developers.com/showthread.php?t=2153211&highlight=dual
mrevankyle said:
If by dual boot you mean booting two roms its not working on the note II yet AFAIK. Here is the progress thread http://forum.xda-developers.com/showthread.php?t=2153211&highlight=dual
Click to expand...
Click to collapse
That is correct, having 2 roms in memory and being able to switch between the two, with ease.
I saw that someone already had it working via Aroma on the Original Galaxy note.
BigBison420 said:
That is correct, having 2 roms in memory and being able to switch between the two, with ease.
I saw that someone already had it working via Aroma on the Original Galaxy note.
Click to expand...
Click to collapse
Ya k that's what i thought. You cant do that yet on the Note II but it is being worked on
mrevankyle said:
Ya k that's what i thought. You cant do that yet on the Note II but it is being worked on
Click to expand...
Click to collapse
Just figured I would give a "bump" to this Q&A since this dual-booting Samsung & AOSP is working well at this point. There are a few caveats and I am compiling a FAQ on just this topic. DerTeufel's thread is here and the OP references my FAQ > http://forum.xda-developers.com/showthread.php?t=2239453
Nand secondary?
RichMD said:
Just figured I would give a "bump" to this Q&A since this dual-booting Samsung & AOSP is working well at this point. There are a few caveats and I am compiling a FAQ on just this topic. DerTeufel's thread is here and the OP references my FAQ > http://forum.xda-developers.com/showthread.php?t=2239453
Click to expand...
Click to collapse
That would be nice, because I can't figure out how this DB recovery works. I have 2 ROMs on my phone right now. I appear to be able to do anything I want to my primary ROM, but I cannot figure out how to back-up my secondary.
The DB recovery is a useful idea. I have a custom 4.2.2 as primary and a sammy 4.1.2 as secondary. Both ROMs work was expected. Primary does not have to have devil kernel, but I believe secondary needs it in order to survive.
I am still new at this DB recovery thing. Has anyone figured out how to nand the secondary ROM? I have noticed that I can flash TWRP and I don't lose either ROM, as long as I DO NOT factory reset. I just have to flash DB Recovery again to access the other ROM. I have also noticed that some data is shared between the two ROMs. Robo TD shares the same back-up file on sdcard0, which is delightful
Today I am going to try a dirtly ROM flash on primary. Wish me luck.
floykoe said:
That would be nice, because I can't figure out how this DB recovery works. I have 2 ROMs on my phone right now. I appear to be able to do anything I want to my primary ROM, but I cannot figure out how to back-up my secondary.
The DB recovery is a useful idea. I have a custom 4.2.2 as primary and a sammy 4.1.2 as secondary. Both ROMs work was expected. Primary does not have to have devil kernel, but I believe secondary needs it in order to survive.
I am still new at this DB recovery thing. Has anyone figured out how to nand the secondary ROM? I have noticed that I can flash TWRP and I don't lose either ROM, as long as I DO NOT factory reset. I just have to flash DB Recovery again to access the other ROM. I have also noticed that some data is shared between the two ROMs. Robo TD shares the same back-up file on sdcard0, which is delightful
Today I am going to try a dirtly ROM flash on primary. Wish me luck.
Click to expand...
Click to collapse
The kernel is "shared" between them. If you flash another ROM to primary, it replaces the dual boot kernel. You are correct that the other ROM is not affected but other kernels can not boot the secondary ROM which is stored in a custom location. Creating a nandroid of (or restoring to) the secondary partition only requires you to go into the dual-boot selection and choose "enable secondary". Then all commands such as factory reset, bacup, restore, wipe cache, etc pertain to the secondary ROM until you reboot or reload recovery. You could choose backup and when it completes you coul go into dual-boot again and select "enable primary". Then all the commands would pertain to the primary ROM - again until you reboot or reload recovery.
Sent from my BNTV600 using Tapatalk 2
RichMD said:
The kernel is "shared" between them. If you flash another ROM to primary, it replaces the dual boot kernel. You are correct that the other ROM is not affected but other kernels can not boot the secondary ROM which is stored in a custom location. Creating a nandroid of (or restoring to) the secondary partition only requires you to go into the dual-boot selection and choose "enable secondary". Then all commands such as factory reset, bacup, restore, wipe cache, etc pertain to the secondary ROM until you reboot or reload recovery. You could choose backup and when it completes you coul go into dual-boot again and select "enable primary". Then all the commands would pertain to the primary ROM - again until you reboot or reload recovery.
Sent from my BNTV600 using Tapatalk 2
Click to expand...
Click to collapse
This is all very interesting and essential information to those of us trying to figure out this DB Recovery system. I suspect this is yet the tip of the iceberg.
So, with a DB set-up, both ROMs need to be installed with the Devil Kernel. For instance, Primary is installed first with Devil in place, then the same for secondary (or vice-verse), because you can't install a ROM with no kernel; but it turns into one kernel in the end. Is this correct? Only one kernel can exist with DB system. If secondary has devil and primary has trinity, secondary is (&cked. In other words, you still only have a single boot system with a secondary ROM installed that has no recovery capabilities.
OK, assuming that all that is correct (or at least parts of it), you get a big fat thank you.
Now earn another. Do both ROMs (sharing the same kernel) have to also share the same governor, I/O, clock, and voltage settings? Custom can handle more than sammy and different ROMs like different settings.
floykoe said:
This is all very interesting and essential information to those of us trying to figure out this DB Recovery system. I suspect this is yet the tip of the iceberg.
So, with a DB set-up, both ROMs need to be installed with the Devil Kernel. For instance, Primary is installed first with Devil in place, then the same for secondary (or vice-verse), because you can't install a ROM with no kernel; but it turns into one kernel in the end. Is this correct? Only one kernel can exist with DB system. If secondary has devil and primary has trinity, secondary is (&cked. In other words, you still only have a single boot system with a secondary ROM installed that has no recovery capabilities.
OK, assuming that all that is correct (or at least parts of it), you get a big fat thank you.
Now earn another. Do both ROMs (sharing the same kernel) have to also share the same governor, I/O, clock, and voltage settings? Custom can handle more than sammy and different ROMs like different settings.
Click to expand...
Click to collapse
I can post a more detailed answer later on today. However, the phone will always only have one kernel. When your phone boots up the kernel is loaded first. At that point, if you have the dual boot kernel, it has the capability to boot one or the other ROM. The secondary ROM is stored in a separate location on the internal SD card. If you flash a new ROM to either the primary or secondary partition, it will replace the kernel. At that point, both ROMs are still okay, but whatever the new kernel is, it can only boot the primary rom. Additionally, if you flashed directly to the secondary rom and the new kernel is not compatible ( AOSP vs. TW) with the pre-existing primary rom, you must flash the dual boot kernel again or the primary rom will not boot up properly. If you flashed to the primary rom, you don't technically need to reflash the dual boot kernel until you want to be able to boot up the secondary ROM again.
Sent from my GT-N7105 using Tapatalk 4 Beta
What if you were to delete the second rom off the internal or is there a way that it can be corrupted causing the phone not to boot after the primary kernel? can an ODIN restore to stock fix this (since it will repartition for only one boot)