DragonOS/docs/kernel/boot/bootloader.md
LoGin 2b7818e80e
feat: 添加对内核引导协议的抽象 (#913)
* 添加multiboot header

* head.S传参增加bootloader类型

* feat: 添加引导加载协议的抽象,并为multiboot2实现这个抽象.

* 把framebuffer的映射地址改为从early ioremap和mmio pool分配

* riscv64能运行
2024-09-05 21:12:20 +08:00

30 lines
1000 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 引导加载程序
## X86_64
- [x] multiboot2
## RISC-V 64
DragonOS在RISC-V 64上启动流程为
opensbi --> uboot --> DragonStub --> kernel
这个启动流程使得DragonOS内核与具体的硬件板卡解耦能够以同一个二进制文件在不同的硬件板卡上启动运行。
## 内核启动回调
DragonOS对内核引导加载程序进行了抽象体现为`BootCallbacks`这个trait。
不同的引导加载程序实现对应的callback初始化内核bootParams或者是其他的一些数据结构。
内核启动时,自动根据引导加载程序的类型,注册回调。并且在适当的时候,会调用这些回调函数。
## 参考资料
- [Multiboot2 Specification](http://git.savannah.gnu.org/cgit/grub.git/tree/doc/multiboot.texi?h=multiboot2)
- [GNU GRUB Manual 2.06](https://www.gnu.org/software/grub/manual/grub/grub.html)
- [UEFI/Legacy启动 - yujianwu - DragonOS社区](https://bbs.dragonos.org/forum.php?mod=viewthread&tid=46)