Linux内核配置解析 - Boot options
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_PROTOCOL
4: bool "Enable support for the ARM64 ACPI parking protocol"
5: depends on ACPI
6: help
7: Enable support for the ARM64 ACPI parking protocol. If disabled
8: the kernel will not allow booting through the ARM64 ACPI parking
9: protocol even if the corresponding data is present in the ACPI
10: MADT table.
11:
12: config CMDLINE
13: string "Default kernel command string"
14: default ""
15: help
16: Provide a set of default command-line options at build time by
17: entering them here. As a minimum, you should specify the the
18: root device (e.g. root=/dev/nfs).
19:
20: config CMDLINE_FORCE
21: bool "Always use the default kernel command string"
22: help
23: Always use the default kernel command string, even if the boot
24: 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_STUB
29: bool
30:
31: config EFI
32: bool "UEFI runtime support"
33: depends on OF && !CPU_BIG_ENDIAN
34: select LIBFDT
35: select UCS2_STRING
36: select EFI_PARAMS_FROM_FDT
37: select EFI_RUNTIME_WRAPPERS
38: select EFI_STUB
39: select EFI_ARMSTUB
40: default y
41: help
42: 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. This
46: is only useful on systems that have UEFI firmware.
47:
48: config DMI
49: bool "Enable support for SMBIOS (DMI) tables"
50: depends on EFI
51: default y
52: help
53: 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 should
57: 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有关的配置项
DMI
| 配置项 | 说明 | 默认值 |
| 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
Linux内核配置解析 - Boot options的更多相关文章
- Linux内核配置解析 - 概述(基于ARM64架构)
1. 前言 对刚接触Linux kernel的同学来说,遇到的第一个问题就是:我该从哪里入手?. 话说Linux kernel的打开方式是多种多样的:从简单的设备驱动入手:从源代码的目录结构入手:从k ...
- Linux内核配置机制(make menuconfig 、Kconfig、Makefile)讲解【转】
本文转载自:http://www.codexiu.cn/linux/blog/34801/ 前面我们介绍模块编程的时候介绍了驱动进入内核有两种方式:模块和直接编译进内核,并介绍了模块的一种编译方式—— ...
- Linux 内核配置和编译
Linux 内核配置和编译 一.配置内核 (1). 为什么要配置内核 1. 硬件需求 2. 软件需求 选出需要的,去掉不要的 (2). 如何配置内核 1. make config 基于文本模式的交互 ...
- Linux 内核配置机制(make menuconfig、Kconfig、makefile)讲解
前面我们介绍模块编程的时候介绍了驱动进入内核有两种方式:模块和直接编译进内核,并介绍了模块的一种编译方式--在一个独立的文件夹通过makefile配合内核源码路径完成 那么如何将驱动直接编译进内核呢? ...
- linux内核配置 kbuild
Linux 内核配置机制 http://blog.csdn.net/dianhuiren/article/details/6917132 linux kbuild文档 http://blog.chin ...
- Linux内核配置编译及基本调试方法
一.Linux内核配置编译 1. 交叉编译设置:make ARCH=arm CROSS_COMPILE=arm-linux- 注:也可以直接修改顶层Makefile ARCH ?= arm CROSS ...
- Tiny4412 Linux 内核配置流程
1.配置交叉编译器 默认情况下,内核构建的是与宿主机相同的体系架构镜像.如果要交叉编译,需要设置两个变量ARCH和CORSS_COMPILE. ①ARCH:指明目标体系架构,如x86.arm.mips ...
- Linux内核配置选项
http://blog.csdn.net/wdsfup/article/details/52302142 http://www.manew.com/blog-166674-12962.html Gen ...
- [国嵌攻略][099][Linux内核配置与编译]
为什么要配置内核 基于硬件和软件的需求选出需要的功能,去掉不要的功能. 内核配置的方法 make config:基于文本交互的配置. make menuconfig:基于图形菜单的配置. make m ...
随机推荐
- 图解vue中 v-for 的 :key 的作用,虚拟dom Diff算法
其实不只是vue,react中在执行列表渲染时也会要求给每个组件添加上key这个属性. 要解释key的作用,不得不先介绍一下虚拟DOM的Diff算法了. 我们知道,vue和react都实现了一套虚拟D ...
- 手写一个自己的LocalCache - 基于LinkedHashMap实现LRU
功能目标 实现一个全局范围的LocalCache,各个业务点使用自己的Namespace对LocalCache进行逻辑分区.所以在LocalCache中进行读写採用的key为(namespa ...
- mybatis如何根据mapper接口生成其实现类(springboot)
序 mybatis里头给sqlSession指定执行哪条sql的时候,有两种方式,一种是写mapper的xml的namespace+statementId,如下: public Student fin ...
- 免费的Bootstrap等待页面的应用模板
在线演示 本地下载 这是一款适合移动设备的网页模板,它页面干净小巧.有很多新元素在其中,可以自定义动画和特效.非常酷!
- 在自己的服务器上部署 GitLab 社区版
GitLab 简介 因为我的个人网站 restran.net 已经启用,博客园的内容已经不再更新.这篇文章是在 Gitlab 7.4 的环境下配置的,相关内容可能已经过时. 后续做了一次迁移,将 Gi ...
- Java从零开始学八(循环结构)
一.循环结构 循环结构则是根据判断条件的成立与否,决定程序段落的执行次数,而这个程序段落就称为循环主体.
- Hessian整合Spring
含实例源码博客推荐:http://blog.csdn.net/julyness/article/details/49023581 简介: Hessian是一个简单的连接Web服务的二进制协议. 客户端 ...
- 使用 Spring 2.5 TestContext 测试框架
Spring 2.5 TestContext 测试框架用于测试基于 Spring 的程序,TestContext 测试框架和低版本 Spring 测试框架没有任何关系,是一个全新的基于注解的测试框架, ...
- mavern安装方法
Installation Instructions Maven is a Java tool, so you must have Java installed in order to proceed. ...
- vb sendmessage 详解1
SendMessage函数的常用消息及其应用(有点长,希望能对大家有所帮助)函数原型: Declare Function SendMessage Lib "user32" Alia ...