diff --git a/Kernel/Arch/aarch64/Dummy.cpp b/Kernel/Arch/aarch64/Dummy.cpp index 9491d422d3a..585735772a6 100644 --- a/Kernel/Arch/aarch64/Dummy.cpp +++ b/Kernel/Arch/aarch64/Dummy.cpp @@ -37,9 +37,3 @@ void initialize() } } - -// kprintf.cpp -void set_serial_debug_enabled(bool) -{ - dbgln("FIXME: Add support for changing state of serial debugging"); -} diff --git a/Kernel/Arch/aarch64/kprintf.cpp b/Kernel/Arch/aarch64/kprintf.cpp deleted file mode 100644 index 1c907245456..00000000000 --- a/Kernel/Arch/aarch64/kprintf.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2022, Timon Kruiper - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#include -#include -#include -#include - -// FIXME: Merge the code in this file with Kernel/kprintf.cpp once the proper abstractions are in place. - -namespace Kernel { -extern Atomic g_boot_console; -} - -static void console_out(char ch) -{ - if (auto* boot_console = g_boot_console.load()) { - boot_console->write(ch, true); - } -} - -static void critical_console_out(char ch) -{ - if (auto* boot_console = g_boot_console.load()) { - boot_console->write(ch, true); - } -} - -void kernelputstr(char const* characters, size_t length) -{ - if (!characters) - return; - - auto& uart = Kernel::RPi::UART::the(); - uart.print_str(characters, length); - - for (size_t i = 0; i < length; ++i) - console_out(characters[i]); -} - -void kernelcriticalputstr(char const* characters, size_t length) -{ - if (!characters) - return; - - auto& uart = Kernel::RPi::UART::the(); - uart.print_str(characters, length); - - for (size_t i = 0; i < length; ++i) - critical_console_out(characters[i]); -} - -void kernelearlyputstr(char const* characters, size_t length) -{ - kernelputstr(characters, length); -} - -void dbgputstr(char const* characters, size_t length) -{ - kernelputstr(characters, length); -} - -void dbgputstr(StringView view) -{ - dbgputstr(view.characters_without_null_termination(), view.length()); -} - -void dbgputchar(char ch) -{ - kernelputstr(&ch, 1); -} diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index 54a2b95a0aa..8eebd7c646e 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -493,6 +493,8 @@ elseif("${SERENITY_ARCH}" STREQUAL "aarch64") ${RPI_SOURCES} ${SOURCES_RUNNING_WITHOUT_MMU} + kprintf.cpp + Arch/aarch64/Firmware/ACPI/StaticParsing.cpp Arch/aarch64/archctl.cpp @@ -503,7 +505,6 @@ elseif("${SERENITY_ARCH}" STREQUAL "aarch64") Arch/aarch64/FPUState.S Arch/aarch64/InterruptManagement.cpp Arch/aarch64/Interrupts.cpp - Arch/aarch64/kprintf.cpp Arch/aarch64/MainIdRegister.cpp Arch/aarch64/PageDirectory.cpp Arch/aarch64/Processor.cpp diff --git a/Meta/gn/secondary/Kernel/BUILD.gn b/Meta/gn/secondary/Kernel/BUILD.gn index 06966bae2ff..e832f5e02ab 100644 --- a/Meta/gn/secondary/Kernel/BUILD.gn +++ b/Meta/gn/secondary/Kernel/BUILD.gn @@ -382,7 +382,6 @@ source_set("arch_sources") { "Arch/aarch64/SmapDisabler.cpp", "Arch/aarch64/TrapFrame.cpp", "Arch/aarch64/boot.S", - "Arch/aarch64/kprintf.cpp", "Arch/aarch64/vector_table.S", ] } diff --git a/Meta/run.py b/Meta/run.py index a0ca81428ae..9e5fcbe78c4 100755 --- a/Meta/run.py +++ b/Meta/run.py @@ -723,6 +723,7 @@ def set_up_machine_devices(config: Configuration): config.ram_size = "1G" # The raspi3b machine only accepts 1G as a valid RAM size. config.vga_type = None config.display_device = None + config.kernel_cmdline.append("serial_debug") if config.machine_type != MachineType.CI: # FIXME: Windows QEMU crashes when we set the same display as usual here. config.display_backend = None