当前位置: 代码迷 >> 综合 >> 3.2-3.3对设备树中运行时配置信息的处理
  详细解决方案

3.2-3.3对设备树中运行时配置信息的处理

热度:71   发布时间:2023-10-16 01:29:09.0

 

设备树仅仅起到信息传递的作用,对配置信息的处理相对来说比较简单,即从设备树中将信息提取出来,然后赋给内核中的某一变量。

函数调用过程:
start_kernel // init/main.csetup_arch(&command_line);  // arch/arm/kernel/setup.cmdesc = setup_machine_fdt(__atags_pointer);  // arch/arm/kernel/devtree.cearly_init_dt_scan_nodes();      // drivers/of/ftd.c/* 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);

设备树中运行时的配置信息有哪些?
在根节点中它有一个字节点chosen,在其里面有个bootargs。这个就是内核启动时的命令行参数。在里面可以指定根文件系统在哪里,第一个运行的应用程序是哪一个?

  相关解决方案