1 /* Etherboot routines for PCBIOS firmware.
3 * Body of routines taken from old pcbios.S
11 /**************************************************************************
12 bios_putchar - Print a character on console
13 **************************************************************************/
14 static void bios_putchar ( int character ) {
15 REAL_EXEC ( rm_console_putc,
17 "movb $0x0e, %%ah\n\t"
22 OUT_CONSTRAINTS ( "=a" ( character ) ),
23 IN_CONSTRAINTS ( "a" ( character ) ),
24 CLOBBER ( "ebx", "ecx", "edx", "ebp", "esi", "edi" ) );
26 /* NOTE: %eax may be clobbered, so must be specified as an output
27 * parameter, even though we don't then do anything with it.
31 /**************************************************************************
32 bios_getchar - Get a character from console
33 **************************************************************************/
34 static int bios_getchar ( void ) {
37 REAL_EXEC ( rm_console_getc,
43 OUT_CONSTRAINTS ( "=a" ( character ) ),
45 CLOBBER ( "ebx", "ecx", "edx", "ebp", "esi", "edi" ) );
47 return ( character & 0xff );
50 /**************************************************************************
51 bios_iskey - Check for keyboard interrupt
52 **************************************************************************/
53 static int bios_iskey ( void ) {
56 REAL_EXEC ( rm_console_ischar,
64 OUT_CONSTRAINTS ( "=a" ( flags ) ),
66 CLOBBER ( "ebx", "ecx", "edx", "ebp", "esi", "edi" ) );
68 return ( ( flags & ZF ) == 0 );
71 static struct console_driver bios_console __console_driver = {
72 .putchar = bios_putchar,
73 .getchar = bios_getchar,