diff --git a/src/system/boot/platform/raspberrypi_arm/serial.cpp b/src/system/boot/platform/raspberrypi_arm/serial.cpp index 6c6627a2a3..e0bb0ec080 100644 --- a/src/system/boot/platform/raspberrypi_arm/serial.cpp +++ b/src/system/boot/platform/raspberrypi_arm/serial.cpp @@ -21,8 +21,6 @@ UartPL011 gLoaderUART(uart_base_debug()); static int32 sSerialEnabled = 0; -static char sBuffer[16384]; -static uint32 sBufferPosition; static void @@ -38,12 +36,7 @@ serial_puts(const char* string, size_t size) if (sSerialEnabled <= 0) return; - if (sBufferPosition + size < sizeof(sBuffer)) { - memcpy(sBuffer + sBufferPosition, string, size); - sBufferPosition += size; - } - - while (size-- != 0) { + while (size-- > 0) { char c = string[0]; if (c == '\n') { @@ -86,7 +79,5 @@ serial_init(void) serial_enable(); - serial_putc('!'); - serial_puts("SER INIT", 8); + serial_puts("Serial startup\n", 15); } - diff --git a/src/system/boot/platform/raspberrypi_arm/start.c b/src/system/boot/platform/raspberrypi_arm/start.c index 258744af14..691952a8e2 100644 --- a/src/system/boot/platform/raspberrypi_arm/start.c +++ b/src/system/boot/platform/raspberrypi_arm/start.c @@ -44,6 +44,7 @@ clear_bss(void) static void call_ctors(void) { + #warning BUG: constructors don't get called! void (**f)(void); for (f = &__ctor_list; f < &__ctor_end; f++) { @@ -65,7 +66,7 @@ abort(void) uint32 platform_boot_options(void) { -#warning IMPLEMENT platform_boot_options + #warning IMPLEMENT platform_boot_options return 0; } @@ -73,7 +74,7 @@ platform_boot_options(void) void platform_start_kernel(void) { -#warning IMPLEMENT platform_start_kernel + #warning IMPLEMENT platform_start_kernel panic("kernel returned!\n"); } @@ -81,7 +82,7 @@ platform_start_kernel(void) void platform_exit(void) { -#warning IMPLEMENT platform_exit + #warning IMPLEMENT platform_exit } diff --git a/src/system/kernel/arch/arm/uart_pl011.cpp b/src/system/kernel/arch/arm/uart_pl011.cpp index 7eb6132114..916558a93b 100644 --- a/src/system/kernel/arch/arm/uart_pl011.cpp +++ b/src/system/kernel/arch/arm/uart_pl011.cpp @@ -104,7 +104,9 @@ void UartPL011::InitEarly() { // Perform special hardware UART configuration - // Raspberry Pi: Early gpio handled by gpio_init in platform code + + #warning Raspberry Pi Hack: Fix constructors not getting called in loader. + fUARTBase = uart_base_debug(); } @@ -135,7 +137,7 @@ int UartPL011::PutChar(char c) { if (fUARTEnabled == true) { - WriteUart(PL01x_DR, (unsigned int)c); + WriteUart(PL01x_DR, c); // Empty the transmit buffer FlushTx(); return 0; @@ -145,7 +147,6 @@ UartPL011::PutChar(char c) } -/* returns -1 if no data available */ int UartPL011::GetChar(bool wait) { @@ -158,7 +159,6 @@ void UartPL011::FlushTx() { while (ReadUart(PL01x_FR) & PL01x_FR_TXFF); - // wait for the last char to get out }