gpt4 book ai didi

assembly - 典型的嵌入式引导加载程序如何结束?

转载 作者:行者123 更新时间:2023-12-02 21:30:37 24 4
gpt4 key购买 nike

典型的嵌入式引导加载程序将使用什么指令或指令集来结束引导加载?请宽容地回答这个问题。我想知道启动加载是否真的结束,或者在将控制权转移到操作系统后是否存在某种无限循环。

最佳答案

一旦引导加载程序完成其初始化任务,它将系统的控制权转移给操作系统/系统。具体指令通常是跳转或分支,具体取决于特定的引导加载程序或体系结构。

既然你特别提到了操作系统,我将引用 Embedded Linux Primer :

Note that the bootm command is the death knell for U-Boot. This is an important concept. Unlike the BIOS in a desktop PC, most embedded systems are architected in such a way that when the Linux kernel takes control, the bootloader ceases to exist. The kernel claims any memory and system resources that the bootloader previously used. The only way to pass control back to the bootloader is to reboot the board.

然后查看AT91 Assembler Code Startup Sequence for C Code Applications Software我们可以看到它使用了bx,这是 THUMB Instruction Set 的分支和交换命令:

;---------------------------------------------------------------------------
;- Branch on C code Main function (with interworking)
;---------------------------------------------------------------------------
IMPORT __main

ldr r0, =__main
bx r0

END

关于assembly - 典型的嵌入式引导加载程序如何结束?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22404731/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com