|
iPXE
|
VESA frame buffer console. More...
#include <stdlib.h>#include <errno.h>#include <limits.h>#include <realmode.h>#include <ipxe/console.h>#include <ipxe/io.h>#include <ipxe/ansicol.h>#include <ipxe/fbcon.h>#include <ipxe/vesafb.h>#include <config/console.h>Go to the source code of this file.
Data Structures | |
| struct | vesafb |
| A VESA frame buffer. More... | |
| union | vbe_buffer |
| Base memory buffer used for VBE calls. More... | |
Macros | |
| #define | EIO_FAILED __einfo_error ( EINFO_EIO_FAILED ) |
| #define | EINFO_EIO_FAILED |
| #define | EIO_HARDWARE __einfo_error ( EINFO_EIO_HARDWARE ) |
| #define | EINFO_EIO_HARDWARE |
| #define | EIO_MODE __einfo_error ( EINFO_EIO_MODE ) |
| #define | EINFO_EIO_MODE |
| #define | EIO_VBE(code) EUNIQ ( EINFO_EIO, (code), EIO_FAILED, EIO_HARDWARE, EIO_MODE ) |
| #define | CONSOLE_VESAFB ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG ) |
| #define | VESAFB_CHAR_HEIGHT 16 |
| Character height. More... | |
| #define | VESAFB_FONT VBE_FONT_8x16 |
| Font corresponding to selected character width and height. More... | |
| #define | VESAFB_ASCII 128 |
| Number of ASCII glyphs within the font. More... | |
| #define | VESAFB_UNKNOWN 0xfe |
| Glyph to render for non-ASCII characters. More... | |
| #define | vbe_buf __use_data16 ( vbe_buf ) |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static union vbe_buffer | __bss16 (vbe_buf) |
| static int | vesafb_rc (unsigned int status) |
| Convert VBE status code to iPXE status code. More... | |
| static const uint8_t * | vesafb_glyph (unsigned int character) |
| Get character glyph. More... | |
| static void | vesafb_font (void) |
| Get font definition. More... | |
| static int | vesafb_mode_list (uint16_t **mode_numbers) |
| Get VBE mode list. More... | |
| static int | vesafb_mode_info (unsigned int mode_number) |
| Get video mode information. More... | |
| static int | vesafb_set_mode (unsigned int mode_number) |
| Set video mode. More... | |
| static int | vesafb_select_mode (const uint16_t *mode_numbers, unsigned int min_width, unsigned int min_height, unsigned int min_bpp) |
| Select video mode. More... | |
| static void | vesafb_restore (void) |
| Restore video mode. More... | |
| static int | vesafb_init (struct console_configuration *config) |
| Initialise VESA frame buffer. More... | |
| static void | vesafb_fini (void) |
| Finalise VESA frame buffer. More... | |
| static void | vesafb_putchar (int character) |
| Print a character to current cursor position. More... | |
| static int | vesafb_configure (struct console_configuration *config) |
| Configure console. More... | |
Variables | |
| struct console_driver | bios_console |
| struct console_driver vesafb_console | __console_driver |
| VESA frame buffer console driver. More... | |
| struct vesafb | __attribute__ |
| static struct vesafb | vesafb |
| The VESA frame buffer. More... | |
VESA frame buffer console.
Definition in file vesafb.c.
| #define EIO_FAILED __einfo_error ( EINFO_EIO_FAILED ) |
| #define EINFO_EIO_FAILED |
| #define EIO_HARDWARE __einfo_error ( EINFO_EIO_HARDWARE ) |
| #define EINFO_EIO_HARDWARE |
| #define EIO_MODE __einfo_error ( EINFO_EIO_MODE ) |
| #define EINFO_EIO_MODE |
| #define EIO_VBE | ( | code | ) | EUNIQ ( EINFO_EIO, (code), EIO_FAILED, EIO_HARDWARE, EIO_MODE ) |
| #define CONSOLE_VESAFB ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG ) |
| #define VESAFB_FONT VBE_FONT_8x16 |
| #define VESAFB_ASCII 128 |
| #define VESAFB_UNKNOWN 0xfe |
| #define vbe_buf __use_data16 ( vbe_buf ) |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
|
static |
Convert VBE status code to iPXE status code.
| status | VBE status code |
| rc | Return status code |
Definition at line 130 of file vesafb.c.
References code, EIO_VBE, ENOTSUP, and status.
Referenced by vesafb_mode_info(), vesafb_mode_list(), and vesafb_set_mode().
|
static |
Get character glyph.
| character | Unicode character |
| glyph | Character glyph |
Definition at line 145 of file vesafb.c.
References vesafb::glyphs, index, VESAFB_ASCII, VESAFB_CHAR_HEIGHT, and VESAFB_UNKNOWN.
Referenced by vesafb_font().
|
static |
Get font definition.
Definition at line 165 of file vesafb.c.
References __asm__(), __volatile__(), DBGC, vesafb::font, fbcon_font::glyph, vesafb::glyphs, fbcon_font::height, segoff::offset, REAL_CODE, real_to_virt(), segoff::segment, vbe_buf, VBE_GET_FONT, VESAFB_CHAR_HEIGHT, VESAFB_FONT, and vesafb_glyph().
Referenced by vesafb_init().
|
static |
Get VBE mode list.
| mode_numbers | Mode number list (terminated with VBE_MODE_END) |
| rc | Return status code |
The caller is responsible for eventually freeing the mode list.
Definition at line 206 of file vesafb.c.
References __asm__(), __from_data16, __volatile__(), controller, DBGC, DBGC_HDA, EINVAL, ENOMEM, len, malloc(), memcpy(), NULL, rc, REAL_CODE, real_to_virt(), status, strerror(), vbe_buf, VBE_CONTROLLER_INFO, VBE_CONTROLLER_SIGNATURE, VBE_MODE_END, vesafb_rc(), and video_mode_ptr.
Referenced by vesafb_init().
|
static |
Get video mode information.
| mode_number | Mode number |
| rc | Return status code |
Definition at line 267 of file vesafb.c.
References __asm__(), __from_data16, __volatile__(), DBGC, mode, rc, REAL_CODE, status, strerror(), vbe_buf, VBE_MODE_ATTR_GRAPHICS, VBE_MODE_ATTR_LINEAR, VBE_MODE_ATTR_SUPPORTED, VBE_MODE_ATTR_TRIPLE_BUF, VBE_MODE_ATTR_TTY, VBE_MODE_INFO, and vesafb_rc().
Referenced by vesafb_select_mode(), and vesafb_set_mode().
|
static |
Set video mode.
| mode_number | Mode number |
| rc | Return status code |
Definition at line 309 of file vesafb.c.
References __asm__(), __volatile__(), fbcon_colour_map::blue_lsb, fbcon_colour_map::blue_scale, DBGC, fbcon_colour_map::green_lsb, fbcon_colour_map::green_scale, fbcon_geometry::height, fbcon_geometry::len, vesafb::map, mode, vesafb::pixel, rc, REAL_CODE, fbcon_colour_map::red_lsb, fbcon_colour_map::red_scale, vesafb::start, status, strerror(), fbcon_geometry::stride, vbe_buf, VBE_SET_MODE, vesafb_mode_info(), vesafb_rc(), and fbcon_geometry::width.
Referenced by vesafb_init().
|
static |
Select video mode.
| mode_numbers | Mode number list (terminated with VBE_MODE_END) |
| min_width | Minimum required width (in pixels) |
| min_height | Minimum required height (in pixels) |
| min_bpp | Minimum required colour depth (in bits per pixel) |
| mode_number | Mode number, or negative error |
Definition at line 358 of file vesafb.c.
References DBGC, ENOENT, INT_MAX, mode, rc, vbe_buf, VBE_MODE_ATTR_GRAPHICS, VBE_MODE_ATTR_LINEAR, VBE_MODE_ATTR_SUPPORTED, VBE_MODE_END, VBE_MODE_LINEAR, VBE_MODE_MODEL_DIRECT_COLOUR, and vesafb_mode_info().
Referenced by vesafb_init().
|
static |
Restore video mode.
Definition at line 424 of file vesafb.c.
References __asm__(), __volatile__(), DBGC, REAL_CODE, vesafb::saved_mode, vbe_buf, and VBE_SET_VGA_MODE.
Referenced by vesafb_fini(), and vesafb_init().
|
static |
Initialise VESA frame buffer.
| config | Console configuration, or NULL to reset |
| rc | Return status code |
Definition at line 441 of file vesafb.c.
References __asm__(), __volatile__(), DBGC, console_configuration::depth, vesafb::fbcon, fbcon_fini(), fbcon_init(), vesafb::font, free, console_configuration::height, vesafb::map, vesafb::pixel, rc, REAL_CODE, vesafb::saved_mode, vesafb::start, vbe_buf, VBE_GET_VGA_MODE, vesafb_font(), vesafb_mode_list(), vesafb_restore(), vesafb_select_mode(), vesafb_set_mode(), and console_configuration::width.
Referenced by vesafb_configure().
|
static |
Finalise VESA frame buffer.
Definition at line 495 of file vesafb.c.
References vesafb::fbcon, fbcon_fini(), and vesafb_restore().
Referenced by vesafb_configure().
|
static |
Print a character to current cursor position.
| character | Character |
Definition at line 509 of file vesafb.c.
References vesafb::fbcon, and fbcon_putchar().
|
static |
Configure console.
| config | Console configuration, or NULL to reset |
| rc | Return status code |
Definition at line 520 of file vesafb.c.
References ansicol_reset_magic(), ansicol_set_magic_transparent(), bios_console, CONSOLE_DISABLED, CONSOLE_DISABLED_OUTPUT, console_driver::disabled, console_configuration::height, NULL, console_configuration::pixbuf, rc, vesafb_fini(), vesafb_init(), and console_configuration::width.
| struct console_driver bios_console |
Definition at line 45 of file vesafb.c.
Referenced by bios_inject(), and vesafb_configure().
| struct console_driver vesafb_console __console_driver |
VESA frame buffer console driver.
| struct vesafb __attribute__ |
1.8.15