当前位置:网站首页>cmdline -[command line,__fdt_pointer,initial_boot_params] boot_command_line 获取
cmdline -[command line,__fdt_pointer,initial_boot_params] boot_command_line 获取
2022-08-03 05:23:00 【SEVENTHD7】
[boot_command_line,cmdline,commandline,devicetree地址]
head.S->start_kernel(), head.S 中主要是获取dt的地址:
str_l x21, __fdt_pointer, x5 // Save FDT pointer
>>start_kernel() -- main.c
>>setup_arch() --setup.c
>>setup_machine_fdt()
>>early_init_dt_scan() --fdt.c
>>early_init_dt_verify() --fdt.c ;check __fdt_pointer后,赋给initial_boot_params
>>early_init_dt_scan_nodes() --fdt.c ;最终获取devicetree参数
>>early_init_dt_scan_chosen --fdt.c; 获取command line 参数
setup_arch(&command_line);
command_line 是对 全局变量boot_command_line的一个引用
setup_machine_fdt()
__fdt_pointer 经过fixmap_remap_fdt(dt_phys) 映射后,往下传参
early_init_dt_scan_nodes
获取 command_line参数,给boot_command_line 赋值
获取memory参数
int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
int depth, void *data)
{
int l;
const char *p;pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
if (depth != 1 || !data ||
(strcmp(uname, "chosen") != 0 && strcmp(uname, "[email protected]") != 0))
return 0;early_init_dt_check_for_initrd(node);
/* Retrieve command line */
p = of_get_flat_dt_prop(node, "bootargs", &l);
if (p != NULL && l > 0)
strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); //拷贝到 boot_command_line/*
* CONFIG_CMDLINE is meant to be a default in case nothing else
* managed to set the command line, unless CONFIG_CMDLINE_FORCE
* is set in which case we override whatever was found earlier.
*/
#ifdef CONFIG_CMDLINE
#if defined(CONFIG_CMDLINE_EXTEND)
strlcat(data, " ", COMMAND_LINE_SIZE);
strlcat(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
#elif defined(CONFIG_CMDLINE_FORCE)
strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
#else
/* No arguments from boot loader, use kernel's cmdl*/
if (!((char *)data)[0])
strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
#endif
#endif /* CONFIG_CMDLINE */pr_debug("Command line is: %s\n", (char*)data);
/* break now */
return 1;
}
void __init early_init_dt_scan_nodes(void)
{
/* Retrieve various information from the /chosen node */
of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);/* Initialize {size,address}-cells info */
of_scan_flat_dt(early_init_dt_scan_root, NULL);/* Setup memory, calling early_init_dt_add_memory_arch */
of_scan_flat_dt(early_init_dt_scan_memory, NULL);
}
边栏推荐
- 速来围观,17个运维实用技巧
- UPC-Longest X
- Qlik Sense 聚合函数及范围详解(Sum、Count、All、ToTaL、{1})
- MySQL 安装报错的解决方法
- Oracle count(1)、count(*)、count(列) 区别详解
- 进程间通信IPC - 信号量
- 中国融资租赁行业市场投资分析与前景战略规划建议报告2022~2028年
- 解决Gradle Download缓慢的百种方法
- Hook初探索
- 自监督论文阅读笔记DisCo: Remedy Self-supervised Learning on Lightweight Models with Distilled Contrastive
猜你喜欢

自监督论文阅读笔记 Self-supervised Label Augmentation via Input Transformations

opencv透视变化

当奈飞的NFT忘记了web2的业务安全

Makefile

自监督论文阅读笔记 Self-Supervised Visual Representation Learning with Semantic Grouping

解决Gradle Download缓慢的百种方法

Oracle 密码策略详解

二叉树常见的问题和解决思路

MySQL 安装报错的解决方法

自监督论文阅读笔记Reading and Writing: Discriminative and Generative Modelingfor Self-Supervised Text Recogn
随机推荐
卷积神经网络入门
自监督论文阅读笔记 DetCo: Unsupervised Contrastive Learning for Object Detection
【DC-5靶场渗透】
Sentinel初次使用Demo测试
Sqli-labs-master靶场1-23关通关详细教程(基础篇)
3559. 围圈报数
损失函数(第五周)
controller层到底能不能用@Transactional注解?
mysql 客户端SSL错误2026 (HY000)
【源码解读】火爆的二舅币真的跑路了吗?
中国生物反应器行业市场投资分析及前景预测报告2022~2028年
中国石油行业并购重组趋势与投资战略规划建议报告2022~2028年
中国生产力促进中心”十四五”规划与发展规模分析报告2022~2028年
spark sql 报错 Can‘t zip RDDs with unequal numbers of partitions
【 command execution and middleware loopholes 】
中国生物降解塑料行业市场运营态势及发展趋势研究报告2022~2028年
速来围观,17个运维实用技巧
动漫:海贼王女
自监督论文阅读笔记 Self-supervised Learning in Remote Sensing: A Review
[CSRF, SSRF, XXE, PHP deserialization, Burpsuite]