iPXE
Defines | Functions | Variables
debugcon.c File Reference

Debug port console. More...

#include <stdint.h>
#include <ipxe/io.h>
#include <ipxe/console.h>
#include <ipxe/init.h>
#include <config/console.h>

Go to the source code of this file.

Defines

#define DEBUG_PORT   0xe9
 Debug port.
#define DEBUG_PORT_CHECK   0xe9
 Debug port installation check magic value.
#define CONSOLE_DEBUGCON   ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_TUI )

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static void debugcon_putchar (int character)
 Print a character to debug port console.
static void debugcon_init (void)
 Initialise debug port console.
struct init_fn debugcon_init_fn __init_fn (INIT_EARLY)
 Debug port console initialisation function.

Variables

struct console_driver
debugcon_console 
__console_driver
 Debug port console driver.

Detailed Description

Debug port console.

The debug port is supported by bochs (via the "port_e9_hack" configuration file directive) and by qemu (via the "-debugcon" command-line option).

Definition in file debugcon.c.


Define Documentation

#define DEBUG_PORT   0xe9

Debug port.

Definition at line 42 of file debugcon.c.

Referenced by debugcon_init(), and debugcon_putchar().

#define DEBUG_PORT_CHECK   0xe9

Debug port installation check magic value.

Definition at line 45 of file debugcon.c.

Referenced by debugcon_init().

Definition at line 50 of file debugcon.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static void debugcon_putchar ( int  character) [static]

Print a character to debug port console.

Parameters:
characterCharacter to be printed

Definition at line 58 of file debugcon.c.

References DEBUG_PORT, and outb().

                                               {

        /* Write character to debug port */
        outb ( character, DEBUG_PORT );
}
static void debugcon_init ( void  ) [static]

Initialise debug port console.

Definition at line 74 of file debugcon.c.

References CONSOLE_DISABLED, DBG, DEBUG_PORT, DEBUG_PORT_CHECK, and inb().

                                   {
        uint8_t check;

        /* Check if console is present */
        check = inb ( DEBUG_PORT );
        if ( check != DEBUG_PORT_CHECK ) {
                DBG ( "Debug port not present; disabling console\n" );
                debugcon_console.disabled = CONSOLE_DISABLED;
        }
}
struct init_fn debugcon_init_fn __init_fn ( INIT_EARLY  ) [read]

Debug port console initialisation function.


Variable Documentation

struct console_driver debugcon_console __console_driver
Initial value:
 {
        .putchar = debugcon_putchar,
        .usage = CONSOLE_DEBUGCON,
}

Debug port console driver.

Definition at line 65 of file debugcon.c.