mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:17:45 +00:00
Kernel/riscv64: Get the kernel command line from the device tree
This also hides the fdt dump by default now, it can be activated by adding `dump_fdt` to the kernel command line
This commit is contained in:
parent
51b841b4b2
commit
3941277940
3 changed files with 15 additions and 3 deletions
|
@ -32,6 +32,13 @@ void dump_fdt()
|
|||
MUST(DeviceTree::dump(header, fdt));
|
||||
}
|
||||
|
||||
ErrorOr<StringView> get_command_line_from_fdt()
|
||||
{
|
||||
auto& header = *bit_cast<DeviceTree::FlattenedDeviceTreeHeader*>(&s_fdt_storage[0]);
|
||||
auto fdt = ReadonlyBytes(s_fdt_storage, header.totalsize);
|
||||
return TRY(DeviceTree::slow_get_property("/chosen/bootargs"sv, header, fdt)).as_string();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DeviceTree::DeviceTree const& DeviceTree::get()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue