Linux kernel内核配置解析(5)_Boot options(基于ARM64架构)
作者:wowo 发布于:2016-8-12 22:46 分类:Linux内核分析
1. 前言
本文将介绍ARM64架构下,Linux kernel和启动有关的配置项。
注1:本系列文章使用的Linux kernel版本是“X Project”所用的“Linux 4.6-rc5”,具体可参考“https://github.com/wowotechX/linux.git”。
2. Kconfig文件
ARM64架构中和Boot有关的配置项,非常简单,主要包括ACPI、命令行参数和UEFI几种。这些配置项位于“ arch/arm64/Kconfig”中,具体如下:
1: menu "Boot options"
2:3: config ARM64_ACPI_PARKING_PROTOCOL4: bool "Enable support for the ARM64 ACPI parking protocol"
5: depends on ACPI6: help7: Enable support for the ARM64 ACPI parking protocol. If disabled
8: the kernel will not allow booting through the ARM64 ACPI parking9: protocol even if the corresponding data is present in the ACPI
10: MADT table.11:12: config CMDLINE13: string "Default kernel command string"
14: default ""
15: help16: Provide a set of default command-line options at build time by17: entering them here. As a minimum, you should specify the the18: root device (e.g. root=/dev/nfs).19:20: config CMDLINE_FORCE21: bool "Always use the default kernel command string"
22: help23: Always use the default kernel command string, even if the boot24: loader passes other arguments to the kernel.25: This is useful if you cannot or don't want to change the
26: command-line options your boot loader passes to the kernel.27:28: config EFI_STUB29: bool30:31: config EFI32: bool "UEFI runtime support"
33: depends on OF && !CPU_BIG_ENDIAN34: select LIBFDT35: select UCS2_STRING36: select EFI_PARAMS_FROM_FDT37: select EFI_RUNTIME_WRAPPERS38: select EFI_STUB39: select EFI_ARMSTUB40: default y
41: help42: This option provides support for runtime services provided
43: by UEFI firmware (such as non-volatile variables, realtime
44: clock, and platform reset). A UEFI stub is also provided to
45: allow the kernel to be booted as an EFI application. This46: is only useful on systems that have UEFI firmware.47:48: config DMI49: bool "Enable support for SMBIOS (DMI) tables"
50: depends on EFI51: default y
52: help53: This enables SMBIOS/DMI feature for systems.
54:55: This option is only useful on systems that have UEFI firmware.56: However, even with this option, the resultant kernel should57: continue to boot on existing non-UEFI platforms.
58:59: endmenu
3. 配置项说明
注2:Linux kernel的配置项虽然众多,但大多使用默认值就可以。因此在kernel移植和开发的过程中,真正需要关心的并不是特别多。对于那些常用的、需要关心的配置项,我会在分析文章中用黄色背景标注。
3.1 ACPI有关的配置项
配置项 | 说明 | 默认值 |
CONFIG_ARM64_ACPI_
PARKING_PROTOCOL |
是否支持“ARM64 ACPI parking protocol”。关于ACPI和parking protocol,有机会的话我们会在其它文章中分析,这里不需要过多关注。 | 依赖于CONFIG_ACPI |
3.2 Kernel命令行参数有关的配置项
配置项 | 说明 | 默认值 |
CONFIG_CMDLINE | 内核默认的命令行参数。设置该参数后,可以不需要bootloader传递(开始porting kernel的时候比较有用,因为不能保证bootloader可以正确传递^_^) | 无 |
CONFIG_CMDLINE_FORCE | 强制使用内核默认的命令行参数(可以忽略bootloader传递来的);
一般在kernel开发的过程中,用来测试某些新的命令行参数(先不修修改bootloader传递的内容)。 |
无 |
注3:如果Kconfig没有通过“default”关键字为某个配置项指定默认值,那么生成的.config文件中就不会出现该配置项,也就是变相的“禁止”了。后同。
3.3 UEFI有关的配置项
配置项 | 说明 | 默认值 |
CONFIG_EFI_STUB | 用于支持EFI启动;
使能该配置项之后,会修改Kenrel bzImage header,把kernel Image变成一个可以被EFI运行的PE/COFF Image。 具体可参考Documentation/efi-stub.txt中的介绍。 |
无 |
CONFIG_EFI | 支持一些由UEFI Firmware提供的、运行时的服务,如RTC、reset等;
该配置项依赖Open Firmware(device tree),并且有很多的关联项(可以参考Kconfig文件中的select关键字); 另外,有意思的是(参考第2章Kconfig文件中的“depends on OF && !CPU_BIG_ENDIAN”),该配置项只能在小端CPU中才能使用。有空可以研究一下为什么。 |
y |
CONFIG_DMI | 用于控制是否支持“SMBIOS/DMI feature”,依赖于CONFIG_EFI;
需要注意的是,就算使能了该配置项,kernel也需要能够在其它非UEFI环境下正常启动。 |
y |
4. 参考文档
[1] UEFI,http://www.wowotech.net/armv8a_arch/UEFI.html
[3] SMBIOS/DMI,http://www.dmtf.org/cn/standards/smbios
原创文章,转发请注明出处。蜗窝科技,www.wowotech.net。
标签: Linux 内核 boot 配置项 menuconfig

评论:
功能
最新评论
- wangjing
写得太好了 - wangjing
写得太好了! - DRAM
圖面都沒辦法顯示出來好像掛點了。 - Simbr
bus至少是不是还有个subsystem? - troy
@testtest:只要ldrex-modify-strex... - gh
Linux 内核在 sparse 内存模型基础上实现了vme...
文章分类
随机文章
文章存档
- 2025年4月(5)
- 2024年2月(1)
- 2023年5月(1)
- 2022年10月(1)
- 2022年8月(1)
- 2022年6月(1)
- 2022年5月(1)
- 2022年4月(2)
- 2022年2月(2)
- 2021年12月(1)
- 2021年11月(5)
- 2021年7月(1)
- 2021年6月(1)
- 2021年5月(3)
- 2020年3月(3)
- 2020年2月(2)
- 2020年1月(3)
- 2019年12月(3)
- 2019年5月(4)
- 2019年3月(1)
- 2019年1月(3)
- 2018年12月(2)
- 2018年11月(1)
- 2018年10月(2)
- 2018年8月(1)
- 2018年6月(1)
- 2018年5月(1)
- 2018年4月(7)
- 2018年2月(4)
- 2018年1月(5)
- 2017年12月(2)
- 2017年11月(2)
- 2017年10月(1)
- 2017年9月(5)
- 2017年8月(4)
- 2017年7月(4)
- 2017年6月(3)
- 2017年5月(3)
- 2017年4月(1)
- 2017年3月(8)
- 2017年2月(6)
- 2017年1月(5)
- 2016年12月(6)
- 2016年11月(11)
- 2016年10月(9)
- 2016年9月(6)
- 2016年8月(9)
- 2016年7月(5)
- 2016年6月(8)
- 2016年5月(8)
- 2016年4月(7)
- 2016年3月(5)
- 2016年2月(5)
- 2016年1月(6)
- 2015年12月(6)
- 2015年11月(9)
- 2015年10月(9)
- 2015年9月(4)
- 2015年8月(3)
- 2015年7月(7)
- 2015年6月(3)
- 2015年5月(6)
- 2015年4月(9)
- 2015年3月(9)
- 2015年2月(6)
- 2015年1月(6)
- 2014年12月(17)
- 2014年11月(8)
- 2014年10月(9)
- 2014年9月(7)
- 2014年8月(12)
- 2014年7月(6)
- 2014年6月(6)
- 2014年5月(9)
- 2014年4月(9)
- 2014年3月(7)
- 2014年2月(3)
- 2014年1月(4)
2016-08-16 14:17