iPXE
vesafb.h
Go to the documentation of this file.
00001 #ifndef _IPXE_VESAFB_H
00002 #define _IPXE_VESAFB_H
00003 
00004 /** @file
00005  *
00006  * VESA frame buffer console
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <stdint.h>
00013 #include <realmode.h>
00014 
00015 /** INT 10,4f00: return controller information */
00016 #define VBE_CONTROLLER_INFO 0x4f00
00017 
00018 /** VBE controller information */
00019 struct vbe_controller_info {
00020         /** VBE signature */
00021         uint32_t vbe_signature;
00022         /** VBE minor version */
00023         uint8_t vbe_minor_version;
00024         /** VBE major version */
00025         uint8_t vbe_major_version;
00026         /** Pointer to OEM string */
00027         struct segoff oem_string_ptr;
00028         /** Capabilities of graphics controller */
00029         uint32_t capabilities;
00030         /** Pointer to video mode list */
00031         struct segoff video_mode_ptr;
00032         /** Number of 64kB memory blocks */
00033         uint16_t total_memory;
00034         /** VBE implementation software revision */
00035         uint16_t oem_software_rev;
00036         /** Pointer to vendor name string */
00037         struct segoff oem_vendor_name_ptr;
00038         /** Pointer to product name string */
00039         struct segoff oem_product_name_ptr;
00040         /** Pointer to product revision string */
00041         struct segoff oem_product_rev_ptr;
00042         /** Reserved for VBE implementation scratch area */
00043         uint8_t reserved[222];
00044         /* VBE2.0 defines an additional 256-byte data area for
00045          * including the OEM strings inline within the VBE information
00046          * block; we omit this to reduce the amount of base memory
00047          * required for VBE calls.
00048          */
00049 } __attribute__ (( packed ));
00050 
00051 /** VBE controller information signature */
00052 #define VBE_CONTROLLER_SIGNATURE \
00053         ( ( 'V' << 0 ) | ( 'E' << 8 ) | ( 'S' << 16 ) | ( 'A' << 24 ) )
00054 
00055 /** VBE mode list end marker */
00056 #define VBE_MODE_END 0xffff
00057 
00058 /** INT 10,4f01: return VBE mode information */
00059 #define VBE_MODE_INFO 0x4f01
00060 
00061 /** VBE mode information */
00062 struct vbe_mode_info {
00063         /** Mode attributes */
00064         uint16_t mode_attributes;
00065         /** Window A attributes */
00066         uint8_t win_a_attributes;
00067         /** Window B attributes */
00068         uint8_t win_b_attributes;
00069         /** Window granularity */
00070         uint16_t win_granularity;
00071         /** Window size */
00072         uint16_t win_size;
00073         /** Window A start segment */
00074         uint16_t win_a_segment;
00075         /** Window B start segment */
00076         uint16_t win_b_segment;
00077         /** Pointer to window function */
00078         struct segoff win_func_ptr;
00079         /** Bytes per scan line */
00080         uint16_t bytes_per_scan_line;
00081         /** Horizontal resolution in pixels or characters */
00082         uint16_t x_resolution;
00083         /** Vertical resolution in pixels or characters */
00084         uint16_t y_resolution;
00085         /** Character cell width in pixels */
00086         uint8_t x_char_size;
00087         /** Character cell height in pixels */
00088         uint8_t y_char_size;
00089         /** Number of memory planes */
00090         uint8_t number_of_planes;
00091         /** Bits per pixel */
00092         uint8_t bits_per_pixel;
00093         /** Number of banks */
00094         uint8_t number_of_banks;
00095         /** Memory model type */
00096         uint8_t memory_model;
00097         /** Bank size in kB */
00098         uint8_t bank_size;
00099         /** Number of images */
00100         uint8_t number_of_image_pages;
00101         /** Reserved for page function */
00102         uint8_t reserved_1;
00103         /** Size of direct colour red mask in bits */
00104         uint8_t red_mask_size;
00105         /** Bit position of LSB of red mask */
00106         uint8_t red_field_position;
00107         /** Size of direct colour green mask in bits */
00108         uint8_t green_mask_size;
00109         /** Bit position of LSB of green mask */
00110         uint8_t green_field_position;
00111         /** Size of direct colour blue mask in bits */
00112         uint8_t blue_mask_size;
00113         /** Bit position of LSB of blue mask */
00114         uint8_t blue_field_position;
00115         /** Size of direct colour reserved mask in bits */
00116         uint8_t rsvd_mask_size;
00117         /** Bit position of LSB of reserved mask */
00118         uint8_t rsvd_field_position;
00119         /** Direct colour mode attributes */
00120         uint8_t direct_colour_mode_info;
00121         /** Physical address for flat memory frame buffer */
00122         uint32_t phys_base_ptr;
00123         /** Pointer to start of off-screen memory */
00124         uint32_t off_screen_mem_offset;
00125         /** Amount of off-screen memory in 1kB units */
00126         uint16_t off_screen_mem_size;
00127         /** Reserved */
00128         uint8_t reserved_2[206];
00129 } __attribute__ (( packed ));
00130 
00131 /** VBE mode attributes */
00132 enum vbe_mode_attributes {
00133         /** Mode supported in hardware */
00134         VBE_MODE_ATTR_SUPPORTED = 0x0001,
00135         /** TTY output functions supported by BIOS */
00136         VBE_MODE_ATTR_TTY = 0x0004,
00137         /** Colour mode */
00138         VBE_MODE_ATTR_COLOUR = 0x0008,
00139         /** Graphics mode */
00140         VBE_MODE_ATTR_GRAPHICS = 0x0010,
00141         /** Not a VGA compatible mode */
00142         VBE_MODE_ATTR_NOT_VGA = 0x0020,
00143         /** VGA compatible windowed memory mode is not available */
00144         VBE_MODE_ATTR_NOT_WINDOWED = 0x0040,
00145         /** Linear frame buffer mode is available */
00146         VBE_MODE_ATTR_LINEAR = 0x0080,
00147         /** Double scan mode is available */
00148         VBE_MODE_ATTR_DOUBLE = 0x0100,
00149         /** Interlaced mode is available */
00150         VBE_MODE_ATTR_INTERLACED = 0x0200,
00151         /** Hardware triple buffering support */
00152         VBE_MODE_ATTR_TRIPLE_BUF = 0x0400,
00153         /** Hardware stereoscopic display support */
00154         VBE_MODE_ATTR_STEREO = 0x0800,
00155         /** Dual display start address support */
00156         VBE_MODE_ATTR_DUAL = 0x1000,
00157 };
00158 
00159 /** VBE mode memory models */
00160 enum vbe_mode_memory_model {
00161         /** Text mode */
00162         VBE_MODE_MODEL_TEXT = 0x00,
00163         /** CGA graphics mode */
00164         VBE_MODE_MODEL_CGA = 0x01,
00165         /** Hercules graphics mode */
00166         VBE_MODE_MODEL_HERCULES = 0x02,
00167         /** Planar mode */
00168         VBE_MODE_MODEL_PLANAR = 0x03,
00169         /** Packed pixel mode */
00170         VBE_MODE_MODEL_PACKED_PIXEL = 0x04,
00171         /** Non-chain 4, 256 colour mode */
00172         VBE_MODE_MODEL_NON_CHAIN_4 = 0x05,
00173         /** Direct colour mode */
00174         VBE_MODE_MODEL_DIRECT_COLOUR = 0x06,
00175         /** YUV mode */
00176         VBE_MODE_MODEL_YUV = 0x07,
00177 };
00178 
00179 /** INT 10,4f02: set VBE mode */
00180 #define VBE_SET_MODE 0x4f02
00181 
00182 /** VBE linear frame buffer mode bit */
00183 #define VBE_MODE_LINEAR 0x4000
00184 
00185 /** INT 10,1130: get font information */
00186 #define VBE_GET_FONT 0x1130
00187 
00188 /** Font sets */
00189 enum vbe_font_set {
00190         /** 8x14 character font */
00191         VBE_FONT_8x14 = 0x0200,
00192         /** 8x8 double dot font */
00193         VBE_FONT_8x8_DOUBLE = 0x0300,
00194         /** 8x8 double dot font (high 128 characters) */
00195         VBE_FONT_8x8_DOUBLE_HIGH = 0x0400,
00196         /** 9x14 alpha alternate font */
00197         VBE_FONT_9x14_ALPHA_ALT = 0x0500,
00198         /** 8x16 font */
00199         VBE_FONT_8x16 = 0x0600,
00200         /** 9x16 alternate font */
00201         VBE_FONT_9x16_ALT = 0x0700,
00202 };
00203 
00204 /** INT 10,00: set VGA mode */
00205 #define VBE_SET_VGA_MODE 0x0000
00206 
00207 /** INT 10,0f: get VGA mode */
00208 #define VBE_GET_VGA_MODE 0x0f00
00209 
00210 #endif /* _IPXE_VESAFB_H */