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:
@@ -10,6 +10,7 @@
|
|||||||
#include <boot/stage2.h>
|
#include <boot/stage2.h>
|
||||||
#include <boot/stdio.h>
|
#include <boot/stdio.h>
|
||||||
|
|
||||||
|
#include "debug.h"
|
||||||
#include "efi_platform.h"
|
#include "efi_platform.h"
|
||||||
#include "serial.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*
|
char*
|
||||||
platform_debug_get_log_buffer(size_t *_size)
|
platform_debug_get_log_buffer(size_t *_size)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "acpi.h"
|
#include "acpi.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
#include "debug.h"
|
||||||
#ifdef _BOOT_FDT_SUPPORT
|
#ifdef _BOOT_FDT_SUPPORT
|
||||||
#include "dtb.h"
|
#include "dtb.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -186,6 +187,8 @@ platform_start_kernel(void)
|
|||||||
dprintf(" data: %#" B_PRIx64 ", %#" B_PRIx64 "\n", dataRegion.start, dataRegion.size);
|
dprintf(" data: %#" B_PRIx64 ", %#" B_PRIx64 "\n", dataRegion.start, dataRegion.size);
|
||||||
dprintf(" entry: %#lx\n", kernelEntry);
|
dprintf(" entry: %#lx\n", kernelEntry);
|
||||||
|
|
||||||
|
debug_cleanup();
|
||||||
|
|
||||||
arch_mmu_init();
|
arch_mmu_init();
|
||||||
convert_kernel_args();
|
convert_kernel_args();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user