* The boot loader (bios_ia32 only) now duplicates everything that goes to the
serial output, and puts it into the new kernel_args::debug_output field. * syslog_init() will now check if there is anything in kernel_args::debug_output and will put that into the syslog buffer. * dump_block() now also prints an offset. * Fixed warning in mmu.cpp. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23003 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2006, Axel Dörfler, [email protected].
|
* Copyright 2002-2007, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
||||||
@@ -70,6 +70,9 @@ typedef struct kernel_args {
|
|||||||
addr_range physical_buffer;
|
addr_range physical_buffer;
|
||||||
} frame_buffer;
|
} frame_buffer;
|
||||||
|
|
||||||
|
void *debug_output;
|
||||||
|
uint32 debug_size;
|
||||||
|
|
||||||
platform_kernel_args platform_args;
|
platform_kernel_args platform_args;
|
||||||
arch_kernel_args arch_args;
|
arch_kernel_args arch_args;
|
||||||
} kernel_args;
|
} kernel_args;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004, Axel Dörfler, [email protected].
|
* Copyright 2004-2007, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -12,9 +12,8 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
|
||||||
/** This works only after console_init() was called.
|
/*! This works only after console_init() was called.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
panic(const char *format, ...)
|
panic(const char *format, ...)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ mmu_free(void *virtualAddress, size_t size)
|
|||||||
if (address < KERNEL_BASE
|
if (address < KERNEL_BASE
|
||||||
|| address + size >= KERNEL_BASE + kMaxKernelSize) {
|
|| address + size >= KERNEL_BASE + kMaxKernelSize) {
|
||||||
panic("mmu_free: asked to unmap out of range region (%p, size %lx)\n",
|
panic("mmu_free: asked to unmap out of range region (%p, size %lx)\n",
|
||||||
address, size);
|
(void *)address, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// unmap all pages within the range
|
// unmap all pages within the range
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2004-2007, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -34,6 +34,9 @@ static const uint32 kSerialBaudRate = 115200;
|
|||||||
static int32 sSerialEnabled = 0;
|
static int32 sSerialEnabled = 0;
|
||||||
static uint16 sSerialBasePort = 0x3f8;
|
static uint16 sSerialBasePort = 0x3f8;
|
||||||
|
|
||||||
|
static char sBuffer[4096];
|
||||||
|
static uint32 sBufferPosition;
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
serial_putc(char c)
|
serial_putc(char c)
|
||||||
@@ -52,6 +55,11 @@ serial_puts(const char *string, size_t size)
|
|||||||
if (sSerialEnabled <= 0)
|
if (sSerialEnabled <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (sBufferPosition + size < sizeof(sBuffer)) {
|
||||||
|
memcpy(sBuffer + sBufferPosition, string, size);
|
||||||
|
sBufferPosition += size;
|
||||||
|
}
|
||||||
|
|
||||||
while (size-- != 0) {
|
while (size-- != 0) {
|
||||||
char c = string[0];
|
char c = string[0];
|
||||||
|
|
||||||
@@ -84,6 +92,20 @@ serial_enable(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" void
|
||||||
|
serial_cleanup(void)
|
||||||
|
{
|
||||||
|
if (sSerialEnabled <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
gKernelArgs.debug_output = kernel_args_malloc(sBufferPosition);
|
||||||
|
if (gKernelArgs.debug_output != NULL) {
|
||||||
|
memcpy(gKernelArgs.debug_output, sBuffer, sBufferPosition);
|
||||||
|
gKernelArgs.debug_size = sBufferPosition;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extern "C" void
|
extern "C" void
|
||||||
serial_init(void)
|
serial_init(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2004-2007, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef SERIAL_H
|
#ifndef SERIAL_H
|
||||||
#define SERIAL_H
|
#define SERIAL_H
|
||||||
|
|
||||||
@@ -14,6 +14,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void serial_init(void);
|
extern void serial_init(void);
|
||||||
|
extern void serial_cleanup(void);
|
||||||
|
|
||||||
extern void serial_puts(const char *string, size_t size);
|
extern void serial_puts(const char *string, size_t size);
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ platform_start_kernel(void)
|
|||||||
// or I don't see something important...
|
// or I don't see something important...
|
||||||
addr_t stackTop = gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size;
|
addr_t stackTop = gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size;
|
||||||
|
|
||||||
|
serial_cleanup();
|
||||||
mmu_init_for_kernel();
|
mmu_init_for_kernel();
|
||||||
smp_boot_other_cpus();
|
smp_boot_other_cpus();
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* Distributed under the terms of the NewOS License.
|
* Distributed under the terms of the NewOS License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* This file contains the debugger */
|
/*! This file contains the debugger and debug output facilities */
|
||||||
|
|
||||||
#include "blue_screen.h"
|
#include "blue_screen.h"
|
||||||
#include "gdb.h"
|
#include "gdb.h"
|
||||||
@@ -602,7 +602,7 @@ syslog_init_post_threads(void)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
syslog_init(void)
|
syslog_init(struct kernel_args *args)
|
||||||
{
|
{
|
||||||
status_t status;
|
status_t status;
|
||||||
|
|
||||||
@@ -628,6 +628,9 @@ syslog_init(void)
|
|||||||
sSyslogMessage->ident[0] = '\0';
|
sSyslogMessage->ident[0] = '\0';
|
||||||
//strcpy(sSyslogMessage->ident, "KERNEL");
|
//strcpy(sSyslogMessage->ident, "KERNEL");
|
||||||
|
|
||||||
|
if (args->debug_output != NULL)
|
||||||
|
syslog_write(args->debug_output, args->debug_size);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
err3:
|
err3:
|
||||||
@@ -748,7 +751,7 @@ debug_init_post_vm(kernel_args *args)
|
|||||||
if (sDebugScreenEnabled)
|
if (sDebugScreenEnabled)
|
||||||
blue_screen_enter(true);
|
blue_screen_enter(true);
|
||||||
|
|
||||||
syslog_init();
|
syslog_init(args);
|
||||||
|
|
||||||
return arch_debug_init(args);
|
return arch_debug_init(args);
|
||||||
}
|
}
|
||||||
@@ -1101,7 +1104,7 @@ dump_block(const char *buffer, int size, const char *prefix)
|
|||||||
for (i = 0; i < size;) {
|
for (i = 0; i < size;) {
|
||||||
int start = i;
|
int start = i;
|
||||||
|
|
||||||
dprintf(prefix);
|
dprintf("%s%04x ", prefix, i);
|
||||||
for (; i < start + DUMPED_BLOCK_SIZE; i++) {
|
for (; i < start + DUMPED_BLOCK_SIZE; i++) {
|
||||||
if (!(i % 4))
|
if (!(i % 4))
|
||||||
dprintf(" ");
|
dprintf(" ");
|
||||||
|
|||||||
Reference in New Issue
Block a user