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

@ -103,7 +103,7 @@ impl TtyCore {
self.line_discipline.clone()
}
pub fn write_without_serial(&self, buf: &[u8], nr: usize) -> Result<usize, SystemError> {
pub fn write_to_core(&self, buf: &[u8], nr: usize) -> Result<usize, SystemError> {
self.core
.driver()
.driver_funcs()