Skip to content

Commit

Permalink
[serial] Use new UART abstraction in serial console driver
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jun 29, 2015
1 parent 5e622dc commit 2a696ab
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 282 deletions.
23 changes: 10 additions & 13 deletions src/arch/i386/interface/syslinux/comboot_call.c
Expand Up @@ -41,8 +41,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/image.h>
#include <ipxe/version.h>
#include <usr/imgmgmt.h>
#include "config/console.h"
#include "config/serial.h"

/** The "SYSLINUX" version string */
static char __bss16_array ( syslinux_version, [32] );
Expand Down Expand Up @@ -261,8 +259,10 @@ static __asmcall void int21 ( struct i386_all_regs *ix86 ) {
break;

case 0x04: /* Write Character to Serial Port */
serial_putc ( ix86->regs.dl );
ix86->flags &= ~CF;
if ( serial_console.base ) {
uart_transmit ( &serial_console, ix86->regs.dl );
ix86->flags &= ~CF;
}
break;

case 0x09: /* Write DOS String to Console */
Expand Down Expand Up @@ -455,15 +455,12 @@ static __asmcall void int22 ( struct i386_all_regs *ix86 ) {
break;

case 0x000B: /* Get Serial Console Configuration */
#if defined(CONSOLE_SERIAL) && !defined(COMPRESERVE)
ix86->regs.dx = COMCONSOLE;
ix86->regs.cx = 115200 / COMSPEED;
ix86->regs.bx = 0;
#else
ix86->regs.dx = 0;
#endif

ix86->flags &= ~CF;
if ( serial_console.base ) {
ix86->regs.dx = ( ( intptr_t ) serial_console.base );
ix86->regs.cx = serial_console.divisor;
ix86->regs.bx = 0;
ix86->flags &= ~CF;
}
break;

case 0x000E: /* Get configuration file name */
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.c
Expand Up @@ -55,7 +55,7 @@ PROVIDE_REQUIRING_SYMBOL();
REQUIRE_OBJECT ( bios_console );
#endif
#ifdef CONSOLE_SERIAL
REQUIRE_OBJECT ( serial_console );
REQUIRE_OBJECT ( serial );
#endif
#ifdef CONSOLE_DIRECT_VGA
REQUIRE_OBJECT ( video_subr );
Expand Down
5 changes: 0 additions & 5 deletions src/config/serial.h
Expand Up @@ -13,11 +13,6 @@

FILE_LICENCE ( GPL2_OR_LATER );

#define COM1 0x3f8
#define COM2 0x2f8
#define COM3 0x3e8
#define COM4 0x2e8

#define COMCONSOLE COM1 /* I/O port address */

/* Keep settings from a previous user of the serial port (e.g. lilo or
Expand Down

0 comments on commit 2a696ab

Please sign in to comment.