[haiku-commits] r38300 - haiku/trunk/src/system/boot/platform/openfirmware

  • From: andreas.faerber@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 21 Aug 2010 20:42:25 +0200 (CEST)

Author: andreasf
Date: 2010-08-21 20:42:25 +0200 (Sat, 21 Aug 2010)
New Revision: 38300
Changeset: http://dev.haiku-os.org/changeset/38300
Ticket: http://dev.haiku-os.org/ticket/6168
Ticket: http://dev.haiku-os.org/ticket/6105

Modified:
   haiku/trunk/src/system/boot/platform/openfirmware/console.cpp
Log:
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.


Modified: haiku/trunk/src/system/boot/platform/openfirmware/console.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/openfirmware/console.cpp       
2010-08-21 17:42:28 UTC (rev 38299)
+++ haiku/trunk/src/system/boot/platform/openfirmware/console.cpp       
2010-08-21 18:42:25 UTC (rev 38300)
@@ -1,5 +1,6 @@
 /*
  * Copyright 2003-2005, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx
+ * Copyright 2010 Andreas Färber <andreas.faerber@xxxxxx>
  * 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 @@
 {
        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) {


Other related posts:

  • » [haiku-commits] r38300 - haiku/trunk/src/system/boot/platform/openfirmware - andreas . faerber