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 void | vesafb_glyph (unsigned int character, uint8_t *glyph) |
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 to fill in |
Definition at line 145 of file vesafb.c.
References copy_from_real, vesafb::glyphs, index, offset, segoff::offset, segoff::segment, VESAFB_ASCII, VESAFB_CHAR_HEIGHT, and VESAFB_UNKNOWN.
Referenced by vesafb_font().
|
static |
Get font definition.
Definition at line 168 of file vesafb.c.
References __asm__(), __volatile__(), DBGC, vesafb::font, fbcon_font::glyph, vesafb::glyphs, fbcon_font::height, segoff::offset, REAL_CODE, 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 207 of file vesafb.c.
References __asm__(), __from_data16, __volatile__(), controller, copy_from_user(), DBGC, DBGC_HDA, EINVAL, ENOMEM, len, malloc(), NULL, rc, REAL_CODE, real_to_user(), 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 270 of file vesafb.c.
References __asm__(), __from_data16, __volatile__(), vbe_mode_info::bits_per_pixel, vbe_mode_info::blue_mask_size, DBGC, vbe_mode_info::green_mask_size, vbe_mode_info::memory_model, vbe_mode_info::mode_attributes, vbe_mode_info::number_of_image_pages, rc, REAL_CODE, vbe_mode_info::red_mask_size, vbe_mode_info::rsvd_mask_size, 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, vesafb_rc(), vbe_mode_info::x_resolution, and vbe_mode_info::y_resolution.
Referenced by vesafb_select_mode(), and vesafb_set_mode().
|
static |
Set video mode.
mode_number | Mode number |
rc | Return status code |
Definition at line 312 of file vesafb.c.
References __asm__(), __volatile__(), vbe_mode_info::bits_per_pixel, vbe_mode_info::blue_field_position, fbcon_colour_map::blue_lsb, vbe_mode_info::blue_mask_size, fbcon_colour_map::blue_scale, vbe_mode_info::bytes_per_scan_line, DBGC, vbe_mode_info::green_field_position, fbcon_colour_map::green_lsb, vbe_mode_info::green_mask_size, fbcon_colour_map::green_scale, fbcon_geometry::height, fbcon_geometry::len, vesafb::map, vbe_mode_info::phys_base_ptr, vesafb::pixel, rc, REAL_CODE, vbe_mode_info::red_field_position, fbcon_colour_map::red_lsb, vbe_mode_info::red_mask_size, fbcon_colour_map::red_scale, vesafb::start, status, strerror(), fbcon_geometry::stride, vbe_buf, VBE_SET_MODE, vesafb_mode_info(), vesafb_rc(), fbcon_geometry::width, vbe_mode_info::x_resolution, and vbe_mode_info::y_resolution.
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 361 of file vesafb.c.
References vbe_mode_info::bits_per_pixel, DBGC, ENOENT, INT_MAX, vbe_mode_info::memory_model, vbe_mode_info::mode_attributes, 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, vesafb_mode_info(), vbe_mode_info::x_resolution, and vbe_mode_info::y_resolution.
Referenced by vesafb_init().
|
static |
Restore video mode.
Definition at line 427 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 444 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, phys_to_user(), 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 498 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 512 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 523 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__ |