mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:58:11 +00:00
Kernel: Allow the user to specify the virtual console when booting
This commit is contained in:
parent
99eab4667a
commit
ab52108982
4 changed files with 17 additions and 2 deletions
|
@ -201,4 +201,13 @@ Vector<String> CommandLine::userspace_init_args() const
|
|||
return init_args;
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT size_t CommandLine::switch_to_tty() const
|
||||
{
|
||||
const auto default_tty = lookup("switch_to_tty").value_or("1");
|
||||
auto switch_tty_number = default_tty.to_uint();
|
||||
if (switch_tty_number.has_value() && switch_tty_number.value() >= 1) {
|
||||
return switch_tty_number.value() - 1;
|
||||
}
|
||||
PANIC("Invalid default tty value: {}", default_tty);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue