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
This commit is contained in:
Andreas Färber
2010-08-21 18:42:25 +00:00
parent 0dfe97ade1
commit 4d95518e60
@@ -1,5 +1,6 @@
/*
* Copyright 2003-2005, Axel Dörfler, [email protected].
* Copyright 2010 Andreas Färber <[email protected]>
* All rights reserved. Distributed under the terms of the MIT License.
*/
@@ -10,6 +11,7 @@
#include <SupportDefs.h>
#include <boot/stage2.h>
#include <platform/openfirmware/openfirmware.h>
#include <util/kernel_cpp.h>
@@ -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) {