android lk机制介绍

                   (L)ittle (K)ernel based Android bootloader

First of all thanks to Travis Geiselbrecht, Brian Swetland and Dima Zavin for the initial work on (L)ittle (K)ernel project and open-sourcing the work on kernel.org <http://kernel.org>.

Our current version of Android apps processor bootloader is based on this LK work and the Android team at Qualcomm Innovation Center, Inc (QuIC) has added and opensourced features to the project.

We currently support variety of Qualcomm chipsets, including MSM7X25, MSM7X27, MSM7X30 and QSD8X50.  The bootloader does the basic task of hardware initialization, reading the Linux kernel & ramdisk from nand device and loading it up to RAM, setting up initial registers and command line arguments for Linux kernel and jumps to the kernel.

In context of support for Qualcomm chipsets and Android, the bootloader currently supports:

* Variety of nand devices for bootup

* USB driver to enable upgrading images over usb during development

* Keypad driver to enable developers enter ‘fastboot’ mode for image upgrades

* Display driver for debugging and splash screen

* Enable Android recovery image and image upgrades

Here is a list of FAQs that we get from OEMs to customize the bootloader for their projects:

Q1) How do I customize physical memory for use by Linux kernel?

A1) We currently have LK project is mapped to bootable/bootloader/lk under the Android tree.  The memory tags can be customized in lk/target/<target_name>/atags.c.  For example lk/target/msm7630_surf/atags.c has target_atag_mem which has this information for a 256M device.  This can be  modified to add another tag if OEM device supports additional memory.

Q2) How do I disable ‘fastboot’ for my commercial device?

A2) Personally, I would like to see commercial devices leave ‘fastboot’ enabled.  It goes in the spirit of Android Open Source Project where end users and developers have access to the source code to allow them to modify it and upgrade their device over usb using ‘fastboot’.  However, if OEMs or network providers want to lock down ‘fastboot’ it can be done by disabling the keypad and usb driver in bootloader.  This can be customized in the following files:

lk/app/aboot/fastboot.c

lk/app/aboot/aboot.c

Q3) Can we enable splash screen in the bootloader?

A3) In normal bootup, the task of the boot loader should be to perform hardware initializations and jump to Linux kernel as soon as possible.  Enabling a display driver and splash screen does go against that goal.  However, if an OEM wants to enable splash screen in bootloader, a display driver does exist in boot loader that can be used for splash screen.  You will at least have to enable DISPLAY_SPLASH_SCREEN feature.  During bootup, the bootloader will read the raw image from ’splash’ partition and copy it over to framebuffer.  This has been verified for MSM7X27 on LCDC display.  OEMs can work through this implementation if they want to enable the same for their own devices.

Q4) How do I customize flash partitions for my device?

A4) The bootloader defines the nand flash partitions and passes them over to Linux kernel.  These partitions are currently defined at board_part_list structure in lk/target/<target_name>/init.c.  The ‘userdata’ is defined as a VARIABLE_LENGTH partition, which allows this partition to take up all remaining nand blocks available on the device.  This and other partitions can be customized based on OEM’s nand device.

Feel free to write if you have additional questions in this area.  Also, if you have any MSM specific features or bug fixes, you are welcome to send over the patches so we can integrate it back to our tree.

 

Android LK启动流程如下: 1. 开机启动:当用户按下手机的电源键时,系统会进入LK小内核,LK会根据参数值来判断是正常开机启动。 2. recovery启动:当用户按下特定组合键(如音量加键+电源键)时,系统会进入恢复模式,也就是recovery模式。在这种模式下,用户可以进行系统恢复、刷机等操作。 3. fastboot启动:当用户按下特定组合键(如音量减键+电源键)时,系统会进入fastboot模式。在这种模式下,用户可以通过fastboot命令来进行系统的刷机、调试等操作。 4. ffbm启动:ffbm是Fast Factory Boot Mode的缩写,是一种工厂测试模式。在这种模式下,系统会进入工厂测试模式,用于生产线上的测试和调试。 在LK中,关键的函数是apps_init,它负责初始化和运行LK中的app。其中,aboot_init函数负责加载Android Linux内核。apps_init函数会调用所有app的init函数进行初始化,然后根据需要启动一些app。启动app的过程会创建一个线程,并调用相应的app_thread_entry函数来运行app。 总结起来,Android LK启动流程包括正常开机启动、recovery启动、fastboot启动和ffbm启动。在LK中,通过apps_init函数来初始化和运行app,其中aboot_init函数负责加载Android Linux内核。 #### 引用[.reference_title] - *1* *3* [Android lk启动流程](https://blog.csdn.net/zjy764219923/article/details/107997606)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Android 开发之 ---- bootloader (LK)](https://blog.csdn.net/jmq_0000/article/details/7378348)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值