mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Kernel: Panic early if the kernel gets too big for its memory slot
Let's help our future selves find this problem sooner next time it happens. Hopefully we'll come up with a nicer loader before then, but who knows. :^)
This commit is contained in:
parent
c7cf56421a
commit
98f08a8bad
Notes:
sideshowbarker
2024-07-18 21:57:09 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/98f08a8badc
1 changed files with 7 additions and 0 deletions
|
@ -88,6 +88,8 @@ extern "C" u8* end_of_safemem_text;
|
|||
extern "C" u8* start_of_safemem_atomic_text;
|
||||
extern "C" u8* end_of_safemem_atomic_text;
|
||||
|
||||
extern "C" FlatPtr end_of_kernel_image;
|
||||
|
||||
multiboot_module_entry_t multiboot_copy_boot_modules_array[16];
|
||||
size_t multiboot_copy_boot_modules_count;
|
||||
|
||||
|
@ -120,6 +122,11 @@ static Processor s_bsp_processor; // global but let's keep it "private"
|
|||
|
||||
extern "C" UNMAP_AFTER_INIT [[noreturn]] void init()
|
||||
{
|
||||
if ((FlatPtr)&end_of_kernel_image >= 0xc1000000u) {
|
||||
// The kernel has grown too large again!
|
||||
asm volatile("cli;hlt");
|
||||
}
|
||||
|
||||
setup_serial_debug();
|
||||
|
||||
// We need to copy the command line before kmalloc is initialized,
|
||||
|
|
Loading…
Reference in a new issue