vesa.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* ----------------------------------------------------------------------- *
  2. *
  3. * Copyright 1999-2007 H. Peter Anvin - All Rights Reserved
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
  8. * Boston MA 02111-1307, USA; either version 2 of the License, or
  9. * (at your option) any later version; incorporated herein by reference.
  10. *
  11. * ----------------------------------------------------------------------- */
  12. #ifndef BOOT_VESA_H
  13. #define BOOT_VESA_H
  14. typedef struct {
  15. u16 off, seg;
  16. } far_ptr;
  17. /* VESA General Information table */
  18. struct vesa_general_info {
  19. u32 signature; /* 0 Magic number = "VESA" */
  20. u16 version; /* 4 */
  21. far_ptr vendor_string; /* 6 */
  22. u32 capabilities; /* 10 */
  23. far_ptr video_mode_ptr; /* 14 */
  24. u16 total_memory; /* 18 */
  25. u8 reserved[236]; /* 20 */
  26. } __attribute__ ((packed));
  27. #define VESA_MAGIC ('V' + ('E' << 8) + ('S' << 16) + ('A' << 24))
  28. struct vesa_mode_info {
  29. u16 mode_attr; /* 0 */
  30. u8 win_attr[2]; /* 2 */
  31. u16 win_grain; /* 4 */
  32. u16 win_size; /* 6 */
  33. u16 win_seg[2]; /* 8 */
  34. far_ptr win_scheme; /* 12 */
  35. u16 logical_scan; /* 16 */
  36. u16 h_res; /* 18 */
  37. u16 v_res; /* 20 */
  38. u8 char_width; /* 22 */
  39. u8 char_height; /* 23 */
  40. u8 memory_planes; /* 24 */
  41. u8 bpp; /* 25 */
  42. u8 banks; /* 26 */
  43. u8 memory_layout; /* 27 */
  44. u8 bank_size; /* 28 */
  45. u8 image_planes; /* 29 */
  46. u8 page_function; /* 30 */
  47. u8 rmask; /* 31 */
  48. u8 rpos; /* 32 */
  49. u8 gmask; /* 33 */
  50. u8 gpos; /* 34 */
  51. u8 bmask; /* 35 */
  52. u8 bpos; /* 36 */
  53. u8 resv_mask; /* 37 */
  54. u8 resv_pos; /* 38 */
  55. u8 dcm_info; /* 39 */
  56. u32 lfb_ptr; /* 40 Linear frame buffer address */
  57. u32 offscreen_ptr; /* 44 Offscreen memory address */
  58. u16 offscreen_size; /* 48 */
  59. u8 reserved[206]; /* 50 */
  60. } __attribute__ ((packed));
  61. #endif /* LIB_SYS_VESA_H */