Android—Step by step - Compile kernel module for Samsung Galaxy S3 (Linux)

http://www.edv-huber.com/index.php/problemloesungen/20-step-by-step-compile-kernel-module-for-samsung-galaxy-s3-linux


1. Download the Source for your current kernel version from "http://opensource.samsung.com".





2. Extract the file "Kernel.tar.gz" (inside the downloaded zip) into a folder, for example "/home/<your_user_name>/androidkernel".

3. Open the README_Kernel.txt

4. Download the Android NDK containing the suggested toolchain, in our case "arm-eabi-4.4.3". The latest NDK package often does not contain older toolchains, so you have to make some experiments until you find the right one. All the NDKs are available from "http://developer.android.com/tools/sdk/ndk". Copy the URL and modify it according to the given version numbers.



5. For a 64bit operating system, you have to take the 64bit link, of course. Paste the URL into a text editor of your choice.



6. Now you have to find out, which NDK version contains the needed 4.4.3 toolchain. In our case, it is the version "8e".



7. Copy the modified link back to your browser and download the old NDK version.



8. Extract the archive, for example to "/home/<your_user_name>/androidbuild".

9. Modify "/home/<your_user_name>/androidkernel/Makefile" and change the following parts according to your environment. The "EXTRAVERSION" string has to be the one from your phone's system information.







10. Pay attention to the correct line ending "arm-linux-androideabi-". The build process will look for the compiler "gcc" inside the "bin" directory. The android NDK contains the compiler, but the filename always starts with "arm-linux-androideabi-". The NDK version, the toolchain version, and the system architecture (32/64bit) have to match your environment.

11. Move to the directory of your kernel in a command line interface, for example "cd /home/<your_user_name>/androidkernel/".

12. Enter "make arch=arm m0_00_defconfig".

13. Enter "make menuconfig".

14. Modify the kernel configuration according to your wishes. For example select "M" for "Device drivers -> Input device support -> Joystick interface" to create the module "joydev.ko".



15. Leave "menuconfig" and save.



14. Enter "make CFLAGS_MODULE=-fno-pic modules".

15. The modules will be compiled and stored in "/home/<your_user_name>/androidkernel/drivers/*/*.ko", according to each module's category.

16. If you like, you can comiple a completely new kernel for your phone with the command "make". The kernel image will be stored in "/home/<your_user_name>/androidkernel/arch/arm/boot/zImage" then.



<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(62) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值