From 4d95518e6096da06ce66215034b61b177b5c7a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sat, 21 Aug 2010 18:42:25 +0000 Subject: [PATCH] boot_loader_openfirmware: Avoid console interference with frame buffer Debug output calls OpenFirmware methods writing text into the frame buffer. Depending on the screen mode this leads to garbled display or parts of the screen overwritten, so mute the output during frame buffer use for now. A better solution would be to redirect the output elsewhere (e.g., #6168), so that ConsoleHandle::WriteAt() is not called for the problematic handle in the first place. That does not work inside the kernel yet. Part of ticket #6105. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38300 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/openfirmware/console.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/system/boot/platform/openfirmware/console.cpp b/src/system/boot/platform/openfirmware/console.cpp index 8ec53a96ad..45fed8a8c8 100644 --- a/src/system/boot/platform/openfirmware/console.cpp +++ b/src/system/boot/platform/openfirmware/console.cpp @@ -1,5 +1,6 @@ /* * Copyright 2003-2005, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2010 Andreas Färber * All rights reserved. Distributed under the terms of the MIT License. */ @@ -10,6 +11,7 @@ #include +#include #include #include @@ -72,6 +74,11 @@ ConsoleHandle::WriteAt(void */*cookie*/, off_t /*pos*/, const void *buffer, { const char *string = (const char *)buffer; + // If the frame buffer is enabled, don't write to the chosen stdout. + // On Apple's OpenFirmware this would overwrite parts of the frame buffer. + if (gKernelArgs.frame_buffer.enabled) + return bufferSize; + // be nice to our audience and replace single "\n" with "\r\n" while (bufferSize > 0) {