Kernel: Add CommandLine option to disable or enable the PC speaker

By default, we disable the PC speaker as it's quite annoying when using
the text mode console.
This commit is contained in:
Liav A 2022-01-22 12:29:55 +02:00 committed by Linus Groh
commit 69f054616d
Notes: sideshowbarker 2024-07-17 20:24:57 +09:00
5 changed files with 19 additions and 0 deletions

View file

@ -155,6 +155,16 @@ UNMAP_AFTER_INIT bool CommandLine::is_legacy_time_enabled() const
return lookup("time"sv).value_or("modern"sv) == "legacy"sv;
}
bool CommandLine::is_pc_speaker_enabled() const
{
auto value = lookup("pcspeaker"sv).value_or("off"sv);
if (value == "on"sv)
return true;
if (value == "off"sv)
return false;
PANIC("Unknown pcspeaker setting: {}", value);
}
UNMAP_AFTER_INIT bool CommandLine::is_force_pio() const
{
return contains("force_pio"sv);