Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

patch differences between android kernel and vanilla linux kernel

What I have been trying to do is patch or merge the differences in the android kernel to a linux kernel for a specific board. I am having trouble successfully merging the 2 though. I have tried to merge the kernel using these commands to make a patch file: 1st: I tried to find the point in time where the vanilla linux kernel was merged with the android tree.

 git log --pretty=oneline --format="%Cgreen%h %Creset%s" \
            --grep="Linux 3." -n 20 

Then I make the patch:

git diff c16fa4f HEAD > 3.4-to-android.patch

The patch was huge ~200MB , But when I apply the patch I get a long string of errors. I am following this site: http://blogs.arm.com/software-enablement/498-from-zero-to-boot-porting-android-to-your-arm-platform/

I appreciate any help you may have. (Just trying to learn something new. :-) )

like image 863
domsl Avatar asked Nov 04 '22 23:11

domsl


1 Answers

There are lots of differences between Android kernel and Vanilla kernel:

http://www.linaro.org/blog/android-blog/androidization-of-linux-kernel/

CONFIG_ASHMEM=y
CONFIG_STAGING=y
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_LOGGER=y
CONFIG_ANDROID_RAM_CONSOLE=y
CONFIG_ANDROID_LOW_MEMORY_KILLER=y

To overcome a lot of the IPC problems, Android does not have any of the normal IPC mechanism (and so the kernel does not implement it) found in normal Linux: shared memory, named pipes, semaphores etc. All of these can be done just by Android BINDER instead.

Here is another link that shows the porting logic:

http://community.arm.com/groups/android-community/blog/2013/09/18/from-zero-to-boot-porting-android-to-your-arm-platform

There is another effort to build Android compability layer in vanilla kernel (like Ubuntu / Fedora etc) so that you can play with the Android Apps on your PC:

https://lkml.org/lkml/2013/12/4/469

like image 157
Peter Teoh Avatar answered Nov 07 '22 23:11

Peter Teoh