iPXE
|
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
int | putchar (int character) |
Write a single character to each console device. More... | |
static struct console_driver * | has_input (void) |
Check to see if any input is available on any console. More... | |
int | getchar (void) |
Read a single character from any console. More... | |
int | iskey (void) |
Check for available input on any console. More... | |
int | console_configure (struct console_configuration *config) |
Configure console. More... | |
Variables | |
int | console_usage = CONSOLE_USAGE_STDOUT |
Current console usage. More... | |
unsigned int | console_width = CONSOLE_DEFAULT_WIDTH |
Console width. More... | |
unsigned int | console_height = CONSOLE_DEFAULT_HEIGHT |
Console height. More... | |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
int putchar | ( | int | character | ) |
Write a single character to each console device.
character | Character to be written |
character | Character written |
The character is written out to all enabled console devices, using each device's console_driver::putchar() method.
Definition at line 28 of file console.c.
References CONSOLE_DISABLED_OUTPUT, console_usage, CONSOLES, console_driver::disabled, for_each_table_entry, putchar(), console_driver::putchar, and console_driver::usage.
Referenced by ansiscr_putc(), clrline(), eepro_poll(), epic100_open(), falcon_init_xmac(), get_eeprom_data(), int21(), monojob_clear(), print_user_string(), printf_putchar(), putchar(), readline_history(), and sync_console().
|
static |
Check to see if any input is available on any console.
console | Console device that has input available, or NULL |
All enabled console devices are checked once for available input using each device's console_driver::iskey() method. The first console device that has available input will be returned, if any.
Definition at line 54 of file console.c.
References CONSOLE_DISABLED_INPUT, CONSOLES, console_driver::disabled, for_each_table_entry, console_driver::iskey, and NULL.
int getchar | ( | void | ) |
Read a single character from any console.
character | Character read from a console. |
A character will be read from the first enabled console device that has input available using that console's console_driver::getchar() method. If no console has input available to be read, this method will block. To perform a non-blocking read, use something like
The character read will not be echoed back to any console.
Definition at line 85 of file console.c.
References cpu_nap(), console_driver::getchar, has_input(), and step().
Referenced by ansiscr_getc(), dbg_more(), dbg_pause(), getchar_timeout(), int21(), keypress_interrupted(), loopback_wait(), and monojob_wait().
int iskey | ( | void | ) |
Check for available input on any console.
is_available | Input is available on a console |
All enabled console devices are checked once for available input using each device's console_driver::iskey() method. If any console device has input available, this call will return true. If this call returns true, you can then safely call getchar() without blocking.
Definition at line 130 of file console.c.
References has_input().
Referenced by ansiscr_peek(), bios_inject(), getchar_timeout(), int21(), keypress_interrupted(), loopback_wait(), monojob_wait(), and pxe_menu_prompt_and_select().
int console_configure | ( | struct console_configuration * | config | ) |
Configure console.
config | Console configuration |
rc | Return status code |
The configuration is passed to all configurable consoles, including those which are currently disabled. Consoles may choose to enable or disable themselves depending upon the configuration.
If configuration fails, then all consoles will be reset.
Definition at line 146 of file console.c.
References console_driver::configure, CONSOLE_DEFAULT_HEIGHT, CONSOLE_DEFAULT_WIDTH, console_reset(), console_set_size(), CONSOLES, for_each_table_entry, and rc.
Referenced by console_exec(), and console_reset().
int console_usage = CONSOLE_USAGE_STDOUT |
Current console usage.
Definition at line 11 of file console.c.
Referenced by console_set_usage(), and putchar().
unsigned int console_width = CONSOLE_DEFAULT_WIDTH |
Console width.
Definition at line 14 of file console.c.
Referenced by bios_handle_ed(), and console_set_size().
unsigned int console_height = CONSOLE_DEFAULT_HEIGHT |
Console height.
Definition at line 17 of file console.c.
Referenced by bios_handle_ed(), and console_set_size().