1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:07:36 +00:00

Kernel: Fix panic loop when encountering an unknown boot_mode

The kernel panic handler now parses the kernels boot_mode to decide how
to handle the panic. So the previous logic could end up in an panic loop
until we blew out the kernel stack.

Instead only validate the kernel's boot mode once per boot, after
initializing the kernel command line.
This commit is contained in:
Brian Gianforcaro 2021-08-08 12:40:45 -07:00 committed by Gunnar Beutner
parent 312946059b
commit 8e93815846
2 changed files with 15 additions and 4 deletions

View file

@ -16,7 +16,8 @@ namespace Kernel {
enum class BootMode {
NoFramebufferDevices,
SelfTest,
Graphical
Graphical,
Unknown,
};
enum class HPETMode {
@ -48,6 +49,11 @@ public:
static void early_initialize(const char* cmd_line);
static void initialize();
enum class Validate {
Yes,
No,
};
[[nodiscard]] const String& string() const { return m_string; }
Optional<String> lookup(const StringView& key) const;
[[nodiscard]] bool contains(const StringView& key) const;
@ -62,7 +68,7 @@ public:
[[nodiscard]] bool is_no_framebuffer_devices_mode() const;
[[nodiscard]] bool is_force_pio() const;
[[nodiscard]] AcpiFeatureLevel acpi_feature_level() const;
[[nodiscard]] BootMode boot_mode() const;
[[nodiscard]] BootMode boot_mode(Validate should_validate = Validate::No) const;
[[nodiscard]] HPETMode hpet_mode() const;
[[nodiscard]] bool disable_physical_storage() const;
[[nodiscard]] bool disable_ps2_controller() const;