You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vesafb.h 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. #ifndef _IPXE_VESAFB_H
  2. #define _IPXE_VESAFB_H
  3. /** @file
  4. *
  5. * VESA frame buffer console
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <stdint.h>
  10. #include <realmode.h>
  11. /** INT 10,4f00: return controller information */
  12. #define VBE_CONTROLLER_INFO 0x4f00
  13. /** VBE controller information */
  14. struct vbe_controller_info {
  15. /** VBE signature */
  16. uint32_t vbe_signature;
  17. /** VBE minor version */
  18. uint8_t vbe_minor_version;
  19. /** VBE major version */
  20. uint8_t vbe_major_version;
  21. /** Pointer to OEM string */
  22. struct segoff oem_string_ptr;
  23. /** Capabilities of graphics controller */
  24. uint32_t capabilities;
  25. /** Pointer to video mode list */
  26. struct segoff video_mode_ptr;
  27. /** Number of 64kB memory blocks */
  28. uint16_t total_memory;
  29. /** VBE implementation software revision */
  30. uint16_t oem_software_rev;
  31. /** Pointer to vendor name string */
  32. struct segoff oem_vendor_name_ptr;
  33. /** Pointer to product name string */
  34. struct segoff oem_product_name_ptr;
  35. /** Pointer to product revision string */
  36. struct segoff oem_product_rev_ptr;
  37. /** Reserved for VBE implementation scratch area */
  38. uint8_t reserved[222];
  39. /* VBE2.0 defines an additional 256-byte data area for
  40. * including the OEM strings inline within the VBE information
  41. * block; we omit this to reduce the amount of base memory
  42. * required for VBE calls.
  43. */
  44. } __attribute__ (( packed ));
  45. /** VBE controller information signature */
  46. #define VBE_CONTROLLER_SIGNATURE \
  47. ( ( 'V' << 0 ) | ( 'E' << 8 ) | ( 'S' << 16 ) | ( 'A' << 24 ) )
  48. /** VBE mode list end marker */
  49. #define VBE_MODE_END 0xffff
  50. /** INT 10,4f01: return VBE mode information */
  51. #define VBE_MODE_INFO 0x4f01
  52. /** VBE mode information */
  53. struct vbe_mode_info {
  54. /** Mode attributes */
  55. uint16_t mode_attributes;
  56. /** Window A attributes */
  57. uint8_t win_a_attributes;
  58. /** Window B attributes */
  59. uint8_t win_b_attributes;
  60. /** Window granularity */
  61. uint16_t win_granularity;
  62. /** Window size */
  63. uint16_t win_size;
  64. /** Window A start segment */
  65. uint16_t win_a_segment;
  66. /** Window B start segment */
  67. uint16_t win_b_segment;
  68. /** Pointer to window function */
  69. struct segoff win_func_ptr;
  70. /** Bytes per scan line */
  71. uint16_t bytes_per_scan_line;
  72. /** Horizontal resolution in pixels or characters */
  73. uint16_t x_resolution;
  74. /** Vertical resolution in pixels or characters */
  75. uint16_t y_resolution;
  76. /** Character cell width in pixels */
  77. uint8_t x_char_size;
  78. /** Character cell height in pixels */
  79. uint8_t y_char_size;
  80. /** Number of memory planes */
  81. uint8_t number_of_planes;
  82. /** Bits per pixel */
  83. uint8_t bits_per_pixel;
  84. /** Number of banks */
  85. uint8_t number_of_banks;
  86. /** Memory model type */
  87. uint8_t memory_model;
  88. /** Bank size in kB */
  89. uint8_t bank_size;
  90. /** Number of images */
  91. uint8_t number_of_image_pages;
  92. /** Reserved for page function */
  93. uint8_t reserved_1;
  94. /** Size of direct colour red mask in bits */
  95. uint8_t red_mask_size;
  96. /** Bit position of LSB of red mask */
  97. uint8_t red_field_position;
  98. /** Size of direct colour green mask in bits */
  99. uint8_t green_mask_size;
  100. /** Bit position of LSB of green mask */
  101. uint8_t green_field_position;
  102. /** Size of direct colour blue mask in bits */
  103. uint8_t blue_mask_size;
  104. /** Bit position of LSB of blue mask */
  105. uint8_t blue_field_position;
  106. /** Size of direct colour reserved mask in bits */
  107. uint8_t rsvd_mask_size;
  108. /** Bit position of LSB of reserved mask */
  109. uint8_t rsvd_field_position;
  110. /** Direct colour mode attributes */
  111. uint8_t direct_colour_mode_info;
  112. /** Physical address for flat memory frame buffer */
  113. uint32_t phys_base_ptr;
  114. /** Pointer to start of off-screen memory */
  115. uint32_t off_screen_mem_offset;
  116. /** Amount of off-screen memory in 1kB units */
  117. uint16_t off_screen_mem_size;
  118. /** Reserved */
  119. uint8_t reserved_2[206];
  120. } __attribute__ (( packed ));
  121. /** VBE mode attributes */
  122. enum vbe_mode_attributes {
  123. /** Mode supported in hardware */
  124. VBE_MODE_ATTR_SUPPORTED = 0x0001,
  125. /** TTY output functions supported by BIOS */
  126. VBE_MODE_ATTR_TTY = 0x0004,
  127. /** Colour mode */
  128. VBE_MODE_ATTR_COLOUR = 0x0008,
  129. /** Graphics mode */
  130. VBE_MODE_ATTR_GRAPHICS = 0x0010,
  131. /** Not a VGA compatible mode */
  132. VBE_MODE_ATTR_NOT_VGA = 0x0020,
  133. /** VGA compatible windowed memory mode is not available */
  134. VBE_MODE_ATTR_NOT_WINDOWED = 0x0040,
  135. /** Linear frame buffer mode is available */
  136. VBE_MODE_ATTR_LINEAR = 0x0080,
  137. /** Double scan mode is available */
  138. VBE_MODE_ATTR_DOUBLE = 0x0100,
  139. /** Interlaced mode is available */
  140. VBE_MODE_ATTR_INTERLACED = 0x0200,
  141. /** Hardware triple buffering support */
  142. VBE_MODE_ATTR_TRIPLE_BUF = 0x0400,
  143. /** Hardware stereoscopic display support */
  144. VBE_MODE_ATTR_STEREO = 0x0800,
  145. /** Dual display start address support */
  146. VBE_MODE_ATTR_DUAL = 0x1000,
  147. };
  148. /** VBE mode memory models */
  149. enum vbe_mode_memory_model {
  150. /** Text mode */
  151. VBE_MODE_MODEL_TEXT = 0x00,
  152. /** CGA graphics mode */
  153. VBE_MODE_MODEL_CGA = 0x01,
  154. /** Hercules graphics mode */
  155. VBE_MODE_MODEL_HERCULES = 0x02,
  156. /** Planar mode */
  157. VBE_MODE_MODEL_PLANAR = 0x03,
  158. /** Packed pixel mode */
  159. VBE_MODE_MODEL_PACKED_PIXEL = 0x04,
  160. /** Non-chain 4, 256 colour mode */
  161. VBE_MODE_MODEL_NON_CHAIN_4 = 0x05,
  162. /** Direct colour mode */
  163. VBE_MODE_MODEL_DIRECT_COLOUR = 0x06,
  164. /** YUV mode */
  165. VBE_MODE_MODEL_YUV = 0x07,
  166. };
  167. /** INT 10,4f02: set VBE mode */
  168. #define VBE_SET_MODE 0x4f02
  169. /** VBE linear frame buffer mode bit */
  170. #define VBE_MODE_LINEAR 0x4000
  171. /** INT 10,1130: get font information */
  172. #define VBE_GET_FONT 0x1130
  173. /** Font sets */
  174. enum vbe_font_set {
  175. /** 8x14 character font */
  176. VBE_FONT_8x14 = 0x0200,
  177. /** 8x8 double dot font */
  178. VBE_FONT_8x8_DOUBLE = 0x0300,
  179. /** 8x8 double dot font (high 128 characters) */
  180. VBE_FONT_8x8_DOUBLE_HIGH = 0x0400,
  181. /** 9x14 alpha alternate font */
  182. VBE_FONT_9x14_ALPHA_ALT = 0x0500,
  183. /** 8x16 font */
  184. VBE_FONT_8x16 = 0x0600,
  185. /** 9x16 alternate font */
  186. VBE_FONT_9x16_ALT = 0x0700,
  187. };
  188. /** INT 10,00: set VGA mode */
  189. #define VBE_SET_VGA_MODE 0x0000
  190. /** INT 10,0f: get VGA mode */
  191. #define VBE_GET_VGA_MODE 0x0f00
  192. #endif /* _IPXE_VESAFB_H */