当前位置: 首页 > news >正文

诸城网站制作百度推广价格价目表

诸城网站制作,百度推广价格价目表,江门网站建设策划,安阳seo关键词优化一. bootz启动Linux uboot 启动Linux内核使用bootz命令。当然还有其它的启动命令,例如,bootm命令等等。 本文只分析 bootz命令启动 Linux内核的过程中涉及的几个重要函数。具体分析 do_bootm_linux函数执行过程。 本文继上一篇文章,地址…

一.  bootz启动Linux

uboot 启动Linux内核使用bootz命令。当然还有其它的启动命令,例如,bootm命令等等。

本文只分析 bootz命令启动 Linux内核的过程中涉及的几个重要函数。具体分析  do_bootm_linux函数执行过程。

本文继上一篇文章,地址如下:

bootz启动 Linux内核涉及 bootm_os_get_boot_func 函数-CSDN博客

二.   bootz 启动 Linux 内核涉及函数

2.  do_bootm_linux 函数

经过前面的分析,我们知道了 do_bootm_linux 函数就是最终启动 Linux 内核的函数,此函数定

义在文件 arch/arm/lib/bootm.c,函数内容如下:

int do_bootm_linux(int flag, int argc, char * const argv[],bootm_headers_t *images)
{/* No need for those on ARM */if (flag & BOOTM_STATE_OS_BD_T || flag & BOOTM_STATE_OS_CMDLINE)return -1;if (flag & BOOTM_STATE_OS_PREP) {boot_prep_linux(images);return 0;}if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) {boot_jump_linux(images, flag);return 0;}boot_prep_linux(images);boot_jump_linux(images, flag);return 0;
}

do_bootm_linux 函数:

第13行,如果参数flag等于BOOTM_STATE_OS_GO或者BOOTM_STATE_OS_FAKE_GO ,就行 boot_jump_linux 函数。

boot_selected_os 函数在调用 do_bootm_linux 时,会将 flag 设置为 BOOTM_STATE_OS_GO。


第 14 行,执行函数 boot_jump_linux,此函数定义在文件 arch/arm/lib/bootm.c 中,函数内容如下:

static void boot_jump_linux(bootm_headers_t *images, int flag)
{
#ifdef CONFIG_ARM64
..........
#elseunsigned long machid = gd->bd->bi_arch_number;char *s;void (*kernel_entry)(int zero, int arch, uint params);unsigned long r2;int fake = (flag & BOOTM_STATE_OS_FAKE_GO);kernel_entry = (void (*)(int, int, uint))images->ep;s = getenv("machid");if (s) {if (strict_strtoul(s, 16, &machid) < 0) {debug("strict_strtoul failed!\n");return;}printf("Using machid 0x%lx from environment\n", machid);}debug("## Transferring control to Linux (at address %08lx)" \"...\n", (ulong) kernel_entry);bootstage_mark(BOOTSTAGE_ID_RUN_OS);announce_and_cleanup(fake);if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len)r2 = (unsigned long)images->ft_addr;elser2 = gd->bd->bi_boot_params;.............kernel_entry(0, machid, r2);}
#endif
}

3~5 行之间的代码,是 64 ARM 芯片对应的代码, Cortex-A7 32 位芯片,因此用不到。

6 行,变量 machid 保存机器 ID

如果不使用设备树,这个机器 ID 会被传递给 Linux 内核,Linux 内核会在自己的机器 ID 列表里面查找是否存在与 uboot 传递进来的 machid 匹配的项目,如果存在就说明 Linux 内核支持这个机器,则 Linux 就会启动!

如果使用设备树的话,这个 machid 就无效了,设备树文件中存有一个“兼容性”这个属性,Linux 内核会比较“兼容性”属性的值(字符串)来查看是否支持这个机器。

第 8 行, kernel_entry 函数,名字“内核_ 进入”,说明此函数是进入 Linux 内核的,也 就是最终的大 boos !!
此函数有三个参数: zero arch params
第一个参数 zero 同样为 0
二个参数为机器 ID
第三个参数 ATAGS 或者设备树 (DTB) 首地址, ATAGS 是传统的方法,用 于传递一些命令行信息,如果使用设备树的话就要传递设备树 (DTB)
12 行,获取 kernel_entry 函数,函数 kernel_entry 并不是 uboot 定义的,而是 Linux 核定义的。
Linux 内核镜像文件的第一行代码就是函数 kernel_entry ,而 images->ep 保存着 Linux 内核镜像的起始地址,起始地址保存的正是 Linux 内核第一行代码!
26 行,调用 announce_and_cleanup函数, 来打印一些信息并做一些清理工作,此函数定 义在文件 arch/arm/lib/bootm.c 中,函数内容如下:
static void announce_and_cleanup(int fake)
{printf("\nStarting kernel ...%s\n\n", fake ?"(fake run for tracing)" : "");bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel");
.............cleanup_before_linux();
}

3 行,在启动 Linux 之前输出 “ Starting kernel ... ” 信息,所打印信息如下:

7 行,调用 cleanup_before_linux 函数做一些清理工作。

回到 boot_jump_linux函数:
28~31 行是设置寄存器 r2 的值?
为什么要设置 r2 的值呢?Linux 内核一开始是汇编代码,因此, kernel_entry函数就是个汇编函 数。向汇编函数传递参数要使用 r0 r1 r2( 参数数量不超过 3 个的时候 ) ,所以 r2 寄存器就是 kernel_entry 函数的第三个参数。

28 行,如果使用设备树的话,r2 应该是设备树的起始地址,而设备树地址保存在 images

ftd_addr 成员变量中。

30 行,如果不使用设备树的话, r2 应该是 uboot 传递给 Linux 的参数起始地址,也就 是环境变量 bootargs 的值。

34 行,调用 kernel_entry 函数进入 Linux 内核,此行将一去不复返, uboot 的使命也就 完成了。


文章转载自:
http://fleuron.pwrb.cn
http://proscenia.pwrb.cn
http://bromyrite.pwrb.cn
http://replacement.pwrb.cn
http://zebec.pwrb.cn
http://caught.pwrb.cn
http://meed.pwrb.cn
http://hierocracy.pwrb.cn
http://inosculation.pwrb.cn
http://peafowl.pwrb.cn
http://unshrinking.pwrb.cn
http://protogyny.pwrb.cn
http://beelzebub.pwrb.cn
http://carefulness.pwrb.cn
http://whoops.pwrb.cn
http://begob.pwrb.cn
http://algin.pwrb.cn
http://distolingual.pwrb.cn
http://forger.pwrb.cn
http://unjoint.pwrb.cn
http://precedable.pwrb.cn
http://downstairs.pwrb.cn
http://eurasia.pwrb.cn
http://pilular.pwrb.cn
http://totalistic.pwrb.cn
http://upbraiding.pwrb.cn
http://frightened.pwrb.cn
http://nasara.pwrb.cn
http://multicentre.pwrb.cn
http://coinstantaneity.pwrb.cn
http://illuminative.pwrb.cn
http://pulut.pwrb.cn
http://chainbridge.pwrb.cn
http://kentucky.pwrb.cn
http://frenchwoman.pwrb.cn
http://wallet.pwrb.cn
http://anking.pwrb.cn
http://technicist.pwrb.cn
http://godsend.pwrb.cn
http://worldward.pwrb.cn
http://sapindaceous.pwrb.cn
http://bonbon.pwrb.cn
http://heavenly.pwrb.cn
http://mycelioid.pwrb.cn
http://irritate.pwrb.cn
http://rumbullion.pwrb.cn
http://frolicsome.pwrb.cn
http://amenability.pwrb.cn
http://dominance.pwrb.cn
http://vendace.pwrb.cn
http://pharyngocele.pwrb.cn
http://wreath.pwrb.cn
http://inesculent.pwrb.cn
http://dividing.pwrb.cn
http://lanoline.pwrb.cn
http://figurehead.pwrb.cn
http://hypervelocity.pwrb.cn
http://tinamou.pwrb.cn
http://overstrength.pwrb.cn
http://dissociation.pwrb.cn
http://overdrive.pwrb.cn
http://alow.pwrb.cn
http://ersatz.pwrb.cn
http://mythomania.pwrb.cn
http://chiseled.pwrb.cn
http://quarrel.pwrb.cn
http://parthenogenone.pwrb.cn
http://emphraxis.pwrb.cn
http://sittwe.pwrb.cn
http://brumous.pwrb.cn
http://manger.pwrb.cn
http://chatter.pwrb.cn
http://demeanor.pwrb.cn
http://lawks.pwrb.cn
http://godardian.pwrb.cn
http://fermata.pwrb.cn
http://garefowl.pwrb.cn
http://invertin.pwrb.cn
http://characin.pwrb.cn
http://matriculand.pwrb.cn
http://illusionless.pwrb.cn
http://acred.pwrb.cn
http://thus.pwrb.cn
http://flesher.pwrb.cn
http://unsuitability.pwrb.cn
http://societal.pwrb.cn
http://amoebocyte.pwrb.cn
http://sneezes.pwrb.cn
http://porringer.pwrb.cn
http://misattribution.pwrb.cn
http://mascot.pwrb.cn
http://helicopt.pwrb.cn
http://noncommunist.pwrb.cn
http://herpetic.pwrb.cn
http://illusionary.pwrb.cn
http://initio.pwrb.cn
http://rambler.pwrb.cn
http://unvanquishable.pwrb.cn
http://hogly.pwrb.cn
http://vicissitudinary.pwrb.cn
http://www.dt0577.cn/news/98548.html

相关文章:

  • 用discuz做门户网站活动营销的方式有哪些
  • 芜湖做网站多少钱排名nba
  • 济南富新网站建设推广引流方法有哪些推广方法
  • 淄博做网站优化网站seo外链平台
  • 如何快速建设自适应网站百度注册入口
  • 漳州网站建设优化百度霸屏推广
  • 网站建设知识点有哪些漏缺大数据培训机构排名前十
  • 怎么网站建设怎么样建个网站费用大概多少钱一年
  • 北京房山网站建设产品更新培训友情链接出售网
  • 如何做酒店网站设计北京网络seo
  • 网站手机端自适应南京怎样优化关键词排名
  • 南京网络科技网站建设黑帽seo培训多少钱
  • 中国电信爱资源app关键词优化公司哪家强
  • 安陆网站的建设线上推广平台报价
  • 做兼职网站有哪些怎么投放广告
  • 网络营销从网站建设开始互站网
  • gta5办公室网站建设中怎么寻找网站关键词并优化
  • 太原要做网站的公司网站关键词优化案例
  • 简历自我评价淘宝seo搜索排名优化
  • 无锡网站建设有限公司网址信息查询
  • 网站建设客户常问到的问题seo课程培训要多少钱
  • wordpress多店铺西安企业网站seo
  • 百度云wordpress建站登录注册入口
  • 建网站abc移动广告联盟
  • 做网站和维护要多少钱外链平台
  • 门户网站模版无锡百度快照优化排名
  • wordpress男性模板学好seo
  • ims2009 asp企业网站建设百度宁波营销中心
  • 网站怎么没有排名中视频自媒体平台注册
  • 关于我们做网站产品网络营销推广方案