From 75b481f2a4fbda23fff51861b6bbbc1867414b82 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Tue, 27 Nov 2012 22:36:35 +0100 Subject: [PATCH] Attach frame_buffer_console and initialize/enter blue_screen. This enables early on-screen debug output on the raspberry pi. --- .../boot/platform/raspberrypi_arm/Jamfile | 1 + .../boot/platform/raspberrypi_arm/video.cpp | 35 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/system/boot/platform/raspberrypi_arm/Jamfile b/src/system/boot/platform/raspberrypi_arm/Jamfile index c9c481a10a..538ac0f615 100644 --- a/src/system/boot/platform/raspberrypi_arm/Jamfile +++ b/src/system/boot/platform/raspberrypi_arm/Jamfile @@ -2,6 +2,7 @@ SubDir HAIKU_TOP src system boot platform raspberrypi_arm ; SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform $(TARGET_BOOT_PLATFORM) ; SubDirHdrs $(HAIKU_TOP) src system boot arch $(TARGET_ARCH) ; +SubDirHdrs $(HAIKU_TOP) src system kernel debug ; UsePrivateHeaders [ FDirName kernel disk_device_manager ] ; UsePrivateHeaders [ FDirName graphics common ] ; diff --git a/src/system/boot/platform/raspberrypi_arm/video.cpp b/src/system/boot/platform/raspberrypi_arm/video.cpp index 8aa249e037..8931b58f80 100644 --- a/src/system/boot/platform/raspberrypi_arm/video.cpp +++ b/src/system/boot/platform/raspberrypi_arm/video.cpp @@ -8,7 +8,19 @@ #include "arch_framebuffer.h" +#include "blue_screen.h" +#include "frame_buffer_console.h" + ArchFramebuffer *gFramebuffer = NULL; +static bool sOnScreenDebugOutputAvailable = false; + + +extern "C" void +platform_video_puts(const char* string) +{ + if (sOnScreenDebugOutputAvailable) + blue_screen_puts(string); +} extern "C" void @@ -49,6 +61,27 @@ platform_init_video(void) if (result != B_OK) return result; - return gFramebuffer->SetDefaultMode(); + result = gFramebuffer->SetDefaultMode(); + if (result != B_OK) + return result; + + result = frame_buffer_update(gFramebuffer->Base(), gFramebuffer->Width(), + gFramebuffer->Height(), gFramebuffer->Depth(), + gFramebuffer->BytesPerRow()); + if (result != B_OK) + return result; + + result = blue_screen_init(); + if (result != B_OK) + return result; + + result = blue_screen_enter(false); + if (result != B_OK) + return result; + + blue_screen_clear_screen(); + blue_screen_puts("Welcome to very early on-screen debug output on rPi!\n"); + sOnScreenDebugOutputAvailable = true; + return B_OK; }