feat(boot): 内核启动命令行参数解析 (#969)

支持解析启动命令行参数,行为与Linux一致。具体见文档。

bbs链接:https://bbs.dragonos.org.cn/t/topic/362
issue: https://github.com/DragonOS-Community/DragonOS/issues/865

支持了三种参数:
- Arg (不带Value的参数)
- KV (正常的KV参数)
- EarlyKV (在内存管理初始化之前解析)

# TODO

- 支持在`/proc/cmdline`下面查看内核启动时的命令行参数。
- 支持回调函数,允许更加灵活的设置参数的值(目前用不到,就没写了)

Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
LoGin
2024-10-13 23:39:55 +08:00
committed by GitHub
parent c709f79fda
commit f9fe30be89
15 changed files with 781 additions and 49 deletions

View File

@ -126,9 +126,8 @@ cfg_content='set timeout=15
set default=0
insmod efi_gop
menuentry "DragonOS" {
multiboot2 /boot/kernel.elf "KERNEL_ELF"
multiboot2 /boot/kernel.elf init=/bin/dragonreach
}'
# 增加insmod efi_gop防止32位uefi启动报错
echo "echo '${cfg_content}' > ${boot_folder}/grub/grub.cfg" | sh
fi