void __init __no_sanitize_address setup_arch(char **cmdline_p) { //init_mm是init进程(0号进程)的内存描述符 //初始化内核的mm结构体的代码段、数据段和栈的结束地址 setup_initial_init_mm(_stext, _etext, _edata, _end); //cmdline_p指向boot启动参数 *cmdline_p = boot_command_line; kas...
此函数根据构架而异,对于ARM构架的详细分析如下:void __init setup_arch(char **cmdline_p){ struct machine_desc ... 在分析start_kernel函数的时候,其中有构架相关的初始化函数setup_arch。 此函数根据构架而异,对于ARM构架的详细分析如下: void __init setup_arch(char**cmdline_p) { struct machine_desc*...
strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE); *cmdline_p = cmd_line; 点击(此处)折叠或打开 将boot_command_line复制到cmd_line中。这里关键是要知道系统启动的时候的cmdline是如何传递的。 parse_early_param(); 点击(此处)折叠或打开 处理在 struct obs_kernel_param 中定义为early的启动参数...
void __init setup_arch(char **cmdline_p) { struct tag *tags = (struct tag *)&init_tags; struct machine_desc *mdesc; char *from = default_command_line; 编译内核时配置的Boot Options unwind_init(); setup_processor(); mdesc = setup_machine(machine_arch_type); machine_name = mdesc->na...
void __init setup_arch(char **cmdline_p) { char *from = default_command_line; //定义了一个指向default_command_line的指针 … //这里可能存在一些对from操作的machine-dep的函数 … memcpy(saved_command_line, from, COMMAND_LINE_SIZE);
void __init setup_arch(char **cmdline_p) { struct tag *tags = (struct tag *)&init_tags; struct machine_desc *mdesc; char *from = default_command_line; 编译内核时配置的Boot Options unwind_init(); setup_processor(); mdesc = setup_machine(machine_arch_type); ...
void__init setup_arch(char**cmdline_p) { structtag*tags=(structtag*)&init_tags; structmachine_desc*mdesc; char*from=default_command_line; ROOT_DEV=MKDEV(0,255);//ROOT_DEV = 0xff; //见《浅析armlinux-setup_arch()->setup_processor()函数1》[] ...
函数做的事情(MIPS,x86,ARM)根据体系架构的不同,初始化也有所不同! Mips: void__initsetup_arch(char**cmdline_p){cpu_probe();prom_init();#ifdef CONFIG_EARLY_PRINTKsetup_early_printk();#endifcpu_report();check_bugs_early();#if defined(CONFIG_VT)#if defined(CONFIG_VGA_CONSOLE)conswitchp=...
void __init setup_arch(char **cmdline_p) { char *from = default_command_line; //定义了一个指向default_command_line的指针 … //这里可能存在一些对from操作的machine-dep的函数 … memcpy(saved_command_line, from, COMMAND_LINE_SIZE);
setup_arch函数分析 setup_arch函数分析 在⽂件 arch/arm/boot/compressed/head.S[2]中 start 为zImage 的起始点,部分代码如下:start:mov r7, r1 mov r8, r2 …...mov r0, r4 mov r3, r7 bl decompress_kernel b call_kernel call_kernel:……mov r0, #0 mov r1, r7 mov r2, r8 mov pc, ...