* The EDID info is now only dumped if TRACE_VIDEO is defined (currently the

default).
* Enlarged the serial buffer that is handed over to the kernel to 8192 bytes.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27067 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-08-19 18:37:30 +00:00
parent 5aa001b423
commit 60642f8781
2 changed files with 19 additions and 13 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
@ -34,7 +34,7 @@ static const uint32 kSerialBaudRate = 115200;
static int32 sSerialEnabled = 0;
static uint16 sSerialBasePort = 0x3f8;
static char sBuffer[4096];
static char sBuffer[8192];
static uint32 sBufferPosition;
@ -50,7 +50,7 @@ serial_putc(char c)
extern "C" void
serial_puts(const char *string, size_t size)
serial_puts(const char* string, size_t size)
{
if (sSerialEnabled <= 0)
return;
@ -110,9 +110,11 @@ extern "C" void
serial_init(void)
{
// copy the base ports of the optional 4 serial ports to the kernel args
// 0x0000:0x0400 is the location of that information in the BIOS data segment
uint16 *ports = (uint16 *)0x400;
memcpy(gKernelArgs.platform_args.serial_base_ports, ports, sizeof(uint16) * MAX_SERIAL_PORTS);
// 0x0000:0x0400 is the location of that information in the BIOS data
// segment
uint16* ports = (uint16*)0x400;
memcpy(gKernelArgs.platform_args.serial_base_ports, ports,
sizeof(uint16) * MAX_SERIAL_PORTS);
// only use the port if we could find one, else use the standard port
if (gKernelArgs.platform_args.serial_base_ports[0] != 0)
@ -120,10 +122,12 @@ serial_init(void)
uint16 divisor = uint16(115200 / kSerialBaudRate);
out8(0x80, sSerialBasePort + SERIAL_LINE_CONTROL); /* set divisor latch access bit */
out8(0x80, sSerialBasePort + SERIAL_LINE_CONTROL);
// set divisor latch access bit
out8(divisor & 0xf, sSerialBasePort + SERIAL_DIVISOR_LATCH_LOW);
out8(divisor >> 8, sSerialBasePort + SERIAL_DIVISOR_LATCH_HIGH);
out8(3, sSerialBasePort + SERIAL_LINE_CONTROL); /* 8N1 */
out8(3, sSerialBasePort + SERIAL_LINE_CONTROL);
// 8N1
#ifdef ENABLE_SERIAL
serial_enable();

View File

@ -267,13 +267,13 @@ vesa_get_edid(edid1_info *info)
regs.edi = 0;
call_bios(0x10, &regs);
dprintf("EDID1: %lx\n", regs.eax);
TRACE(("EDID1: %lx\n", regs.eax));
// %ah contains the error code
// %al determines wether or not the function is supported
if (regs.eax != 0x4f)
return B_NOT_SUPPORTED;
dprintf("EDID2: ebx %lx\n", regs.ebx);
TRACE(("EDID2: ebx %lx\n", regs.ebx));
// test if DDC is supported by the monitor
if ((regs.ebx & 3) == 0)
return B_NOT_SUPPORTED;
@ -288,15 +288,17 @@ vesa_get_edid(edid1_info *info)
regs.es = ADDRESS_SEGMENT(&edidRaw);
regs.edi = ADDRESS_OFFSET(&edidRaw);
call_bios(0x10, &regs);
dprintf("EDID3: %lx\n", regs.eax);
TRACE(("EDID3: %lx\n", regs.eax));
if (regs.eax != 0x4f)
return B_NOT_SUPPORTED;
// retrieved EDID - now parse it
dprintf("Got EDID!\n");
edid_decode(info, &edidRaw);
#ifdef TRACE_VIDEO
edid_dump(info);
#endif
return B_OK;
}
@ -349,7 +351,7 @@ vesa_get_vbe_info_block(vbe_info_block *info)
info->oem_string = SEGMENTED_TO_LINEAR(info->oem_string);
info->mode_list = SEGMENTED_TO_LINEAR(info->mode_list);
dprintf("oem string: %s\n", (const char *)info->oem_string);
dprintf("OEM string: %s\n", (const char *)info->oem_string);
return B_OK;
}