From 9b70622dca130614da8fb8bab971928a15af6322 Mon Sep 17 00:00:00 2001
From: Andreas Faerber <andreas.faerber@web.de>
Date: Tue, 1 Jun 2010 18:37:46 +0200
Subject: [PATCH 3/4] OpenFirmware: Prepare frame buffer support
---
src/system/boot/platform/openfirmware/console.cpp | 4 ++++
src/system/boot/platform/openfirmware/video.cpp | 12 +++++++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/system/boot/platform/openfirmware/console.cpp b/src/system/boot/platform/openfirmware/console.cpp
index a639fea..9a9b5ac 100644
a
|
b
|
|
8 | 8 | #include <string.h> |
9 | 9 | #include <platform/openfirmware/openfirmware.h> |
10 | 10 | #include <util/kernel_cpp.h> |
| 11 | #include <boot/stage2.h> |
11 | 12 | |
12 | 13 | #include "Handle.h" |
13 | 14 | #include "console.h" |
… |
… |
ConsoleHandle::WriteAt(void */*cookie*/, off_t /*pos*/, const void *buffer,
|
69 | 70 | { |
70 | 71 | const char *string = (const char *)buffer; |
71 | 72 | |
| 73 | if (gKernelArgs.frame_buffer.enabled) |
| 74 | return bufferSize; |
| 75 | |
72 | 76 | // be nice to our audience and replace single "\n" with "\r\n" |
73 | 77 | |
74 | 78 | while (bufferSize > 0) { |
diff --git a/src/system/boot/platform/openfirmware/video.cpp b/src/system/boot/platform/openfirmware/video.cpp
index 6dbe494..a2ff181 100644
a
|
b
|
|
4 | 4 | */ |
5 | 5 | |
6 | 6 | |
| 7 | #include <boot/stage2.h> |
7 | 8 | #include <boot/platform.h> |
8 | 9 | |
9 | 10 | |
10 | 11 | extern "C" void |
11 | 12 | platform_switch_to_logo(void) |
12 | 13 | { |
| 14 | // in debug mode, we'll never show the logo |
| 15 | if ((platform_boot_options() & BOOT_OPTION_DEBUG_OUTPUT) != 0) |
| 16 | return; |
| 17 | |
13 | 18 | // ToDo: implement me |
14 | 19 | } |
15 | 20 | |
… |
… |
platform_switch_to_logo(void)
|
17 | 22 | extern "C" void |
18 | 23 | platform_switch_to_text_mode(void) |
19 | 24 | { |
20 | | // ToDo: implement me |
| 25 | if (!gKernelArgs.frame_buffer.enabled) |
| 26 | return; |
| 27 | |
| 28 | gKernelArgs.frame_buffer.enabled = 0; |
21 | 29 | } |
22 | 30 | |
23 | 31 | |
24 | 32 | extern "C" status_t |
25 | 33 | platform_init_video(void) |
26 | 34 | { |
| 35 | gKernelArgs.frame_buffer.enabled = 0; |
| 36 | |
27 | 37 | // ToDo: implement me |
28 | 38 | return B_OK; |
29 | 39 | } |