EFI: Hand off bootloader log to the kernel.

Eventually, EFI should get support for the debug log ring_buffer
like bios_ia32 has for transparent handoffs, but this preserves
everything except for the pre-start MMU dump, which is an improvement.

Fixes #15455.
This commit is contained in:
Augustin Cavalier
2021-09-17 16:04:20 -04:00
parent 80519e78aa
commit 4d1c59078b
3 changed files with 36 additions and 0 deletions
+13
View File
@@ -10,6 +10,7 @@
#include <boot/stage2.h>
#include <boot/stdio.h>
#include "debug.h"
#include "efi_platform.h"
#include "serial.h"
@@ -70,6 +71,18 @@ panic(const char *format, ...)
}
void
debug_cleanup(void)
{
gKernelArgs.keep_debug_output_buffer = false;
gKernelArgs.debug_output = kernel_args_malloc(sBufferPosition);
if (gKernelArgs.debug_output != NULL) {
memcpy(gKernelArgs.debug_output, sBuffer, sBufferPosition);
gKernelArgs.debug_size = sBufferPosition;
}
}
char*
platform_debug_get_log_buffer(size_t *_size)
{
+20
View File
@@ -0,0 +1,20 @@
/*
* Copyright 2021, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef DEBUG_H
#define DEBUG_H
#ifdef __cplusplus
extern "C" {
#endif
void debug_cleanup(void);
#ifdef __cplusplus
}
#endif
#endif // DEBUG_H
+3
View File
@@ -25,6 +25,7 @@
#include "acpi.h"
#include "console.h"
#include "cpu.h"
#include "debug.h"
#ifdef _BOOT_FDT_SUPPORT
#include "dtb.h"
#endif
@@ -186,6 +187,8 @@ platform_start_kernel(void)
dprintf(" data: %#" B_PRIx64 ", %#" B_PRIx64 "\n", dataRegion.start, dataRegion.size);
dprintf(" entry: %#lx\n", kernelEntry);
debug_cleanup();
arch_mmu_init();
convert_kernel_args();