热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

用5个简单的步骤编译我们自己的安卓内核

用5个简单的步骤编译我们自己的安卓内核原文:https://

用 5 个简单的步骤编译我们自己的安卓内核

原文:https://www . geeksforgeeks . org/编译-我们自己的-安卓-5 步内核-简单/

安卓内核帮助应用程序与设备的硬件组件进行通信。

比如:


  1. Most of us are familiar with game mode . Its function is to instruct the processor and graphics processing unit to run at the maximum frequency.

  2. Another example is power saving mode . It instructs the processor and graphics processing unit to run at their minimum frequency.

需要编译我们自己的内核: 编译我们自己的内核可能会非常有用,因为:


  • Use our own kernel.

  • The user experience can be further optimized as needed, which is also helpful for open source development .

编译我们自己的内核的步骤:


  1. Prerequisites: The following are prerequisites for compiling our own Android kernel:


    • Ubuntu or any other Linux-based OS

    • Familiar with basic Linux command

    • 阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金·阿金 Github

    • Equipment [Source code [T2】 T30 Open the terminal and paste it as follows:

      java
      sudo apt-get install
           git ccache automake flex lzop bison \
           gperf build-essential zip curl
               zlib1g-dev zlib1g-dev:i386 \
           g++-multilib python-networkx 
               libxml2-utils bzip2 libbz2-dev \
           libbz2-1.0 libghc-bzlib-dev 
               squashfs-tools pngcrush \
           schedtool dpkg-dev liblz4-tool 
               make optipng maven libssl-dev \
           pwgen libswitch-perl policycoreutils 
               minicom libxml-sax-base-perl \
           libxml-simple-perl bc
               libc6-dev-i386 lib32ncurses5-dev \
           x11proto-core-dev libx11-dev 
               lib32z-dev libgl1-mesa-dev xsltproc unzip
      ](https://www.geeksforgeeks.org/language-processors-assembler-compiler-and-interpreter/)
      * Download required documents:
      * Clone the device source on the local disk:

      ```java
      mkdir mykernel
        git clone {link to your device kernel source}
      ```



      • Download a compatible GCC tool chain. In this paper, GCC of AOSP is used.

        java
        cd mykernel
           git clone https://android.googlesource.com/platform/
                     prebuilts/gcc/linux-x86/aarch64/
                     aarch64-linux-android-4.9
           toolchain


      • Download a compatible CLANG tool chain. This paper uses Clang of AOSP.


      • Move the downloaded file to the mykernel folder , and then use the following command to extract it:

        java
        tar vxzf linux-x86-android-9.0.0_r48-clang-4691093.tar.gz




    • 编译内核:

      ```java
      cd mykernel
      rm -rf out
      mkdir out
      export ARCH=arm64
      export SUBARCH=arm64
      export DTC_EXT=dtc

      make O=out ARCH=arm64 {device defconfig}

      PATH="${PWD}/bin:${PWD}/toolchain/bin:${PATH}" \
      make -j$(nproc --all) O=out \
                            ARCH=arm64 \
                            CC=clang \
                            CLANG_TRIPLE=aarch64-linux-gnu- \
                            CROSS_COMPILE=aarch64-linux-android-
                            | tee kernel.log
      ```

      在这里,将{device defconfig}替换为您的配置文件的名称。您可以在/arch/arm64/configs 文件夹中找到它。


    • Boot the compiled kernel:


      • Browse to /out/arch/ARM64/boot , find image-DTB file (compiled zImage) and copy it.

      • Download Android mirror kitchen and decompile your stock boot image. Once you decompile it, you will find the stock code in the decompiled folder. Replace it with the previously copied one and recompile the boot image.

      • Flash Fast boot uses the following commands:

        java
        fastboot flash boot mykernel.img




    • Error encountered in processing: A kernel.log file will be generated in mykernel folder. Find the wrong line and find a solution. Also, please don't forget to attach the log file when posting for help in the forum.




这将是基本的内核,一旦它成功启动,可以添加更多的功能。


推荐阅读
  • 本文探讨了如何在给定整数N的情况下,找到两个不同的整数a和b,使得它们的和最大,并且满足特定的数学条件。 ... [详细]
  • 本文介绍了如何利用JavaScript或jQuery来判断网页中的文本框是否处于焦点状态,以及如何检测鼠标是否悬停在指定的HTML元素上。 ... [详细]
  • This guide provides a comprehensive step-by-step approach to successfully installing the MongoDB PHP driver on XAMPP for macOS, ensuring a smooth and efficient setup process. ... [详细]
  • 本文详细介绍了如何在Linux系统上安装和配置Smokeping,以实现对网络链路质量的实时监控。通过详细的步骤和必要的依赖包安装,确保用户能够顺利完成部署并优化其网络性能监控。 ... [详细]
  • 前言--页数多了以后需要指定到某一页(只做了功能,样式没有细调)html ... [详细]
  • 本文详细介绍了Akka中的BackoffSupervisor机制,探讨其在处理持久化失败和Actor重启时的应用。通过具体示例,展示了如何配置和使用BackoffSupervisor以实现更细粒度的异常处理。 ... [详细]
  • 扫描线三巨头 hdu1928hdu 1255  hdu 1542 [POJ 1151]
    学习链接:http:blog.csdn.netlwt36articledetails48908031学习扫描线主要学习的是一种扫描的思想,后期可以求解很 ... [详细]
  • 尽管使用TensorFlow和PyTorch等成熟框架可以显著降低实现递归神经网络(RNN)的门槛,但对于初学者来说,理解其底层原理至关重要。本文将引导您使用NumPy从头构建一个用于自然语言处理(NLP)的RNN模型。 ... [详细]
  • 本文详细记录了在基于Debian的Deepin 20操作系统上安装MySQL 5.7的具体步骤,包括软件包的选择、依赖项的处理及远程访问权限的配置。 ... [详细]
  • 本文介绍了如何使用JQuery实现省市二级联动和表单验证。首先,通过change事件监听用户选择的省份,并动态加载对应的城市列表。其次,详细讲解了使用Validation插件进行表单验证的方法,包括内置规则、自定义规则及实时验证功能。 ... [详细]
  • 如何配置Unturned服务器及其消息设置
    本文详细介绍了Unturned服务器的配置方法和消息设置技巧,帮助用户了解并优化服务器管理。同时,提供了关于云服务资源操作记录、远程登录设置以及文件传输的相关补充信息。 ... [详细]
  • 在给定的数组中,除了一个数字外,其他所有数字都是相同的。任务是找到这个唯一的不同数字。例如,findUniq([1, 1, 1, 2, 1, 1]) 返回 2,findUniq([0, 0, 0.55, 0, 0]) 返回 0.55。 ... [详细]
  • 在 Swift 编程中,遇到错误提示“一元运算符 '!' 不能应用于 '()' 类型的操作数”,通常是因为尝试对没有返回值的方法或函数应用逻辑非运算符。本文将详细解释该错误的原因,并提供解决方案。 ... [详细]
  • 深入解析三大范式与JDBC集成
    本文详细探讨了数据库设计中的三大范式,并结合Java数据库连接(JDBC)技术,讲解如何在实际开发中应用这些概念。通过实例和图表,帮助读者更好地理解范式理论及其在数据操作中的重要性。 ... [详细]
  • 深入探讨CPU虚拟化与KVM内存管理
    本文详细介绍了现代服务器架构中的CPU虚拟化技术,包括SMP、NUMA和MPP三种多处理器结构,并深入探讨了KVM的内存虚拟化机制。通过对比不同架构的特点和应用场景,帮助读者理解如何选择最适合的架构以优化性能。 ... [详细]
author-avatar
爱你一辈子2502860605
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有