Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #ifndef _IPXE_FBCON_H
  2. #define _IPXE_FBCON_H
  3. /** @file
  4. *
  5. * Frame buffer console
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <stdint.h>
  10. #include <ipxe/ansiesc.h>
  11. #include <ipxe/uaccess.h>
  12. #include <ipxe/console.h>
  13. /** Character width, in pixels */
  14. #define FBCON_CHAR_WIDTH 9
  15. /** Bold colour modifier (RGB value) */
  16. #define FBCON_BOLD 0x555555
  17. /** Transparent background magic colour (raw colour value) */
  18. #define FBCON_TRANSPARENT 0xffffffff
  19. /** A font glyph */
  20. struct fbcon_font_glyph {
  21. /** Row bitmask */
  22. uint8_t bitmask[0];
  23. };
  24. /** A font definition */
  25. struct fbcon_font {
  26. /** Character height (in pixels) */
  27. unsigned int height;
  28. /**
  29. * Get character glyph
  30. *
  31. * @v character Character
  32. * @v glyph Character glyph to fill in
  33. */
  34. void ( * glyph ) ( unsigned int character, uint8_t *glyph );
  35. };
  36. /** A frame buffer geometry
  37. *
  38. * The geometry is defined in terms of "entities" (which can be either
  39. * pixels or characters).
  40. */
  41. struct fbcon_geometry {
  42. /** Width (number of entities per displayed row) */
  43. unsigned int width;
  44. /** Height (number of entities per displayed column) */
  45. unsigned int height;
  46. /** Length of a single entity */
  47. size_t len;
  48. /** Stride (offset between vertically adjacent entities) */
  49. size_t stride;
  50. };
  51. /** A frame buffer margin */
  52. struct fbcon_margin {
  53. /** Left margin */
  54. unsigned int left;
  55. /** Right margin */
  56. unsigned int right;
  57. /** Top margin */
  58. unsigned int top;
  59. /** Bottom margin */
  60. unsigned int bottom;
  61. };
  62. /** A frame buffer colour mapping */
  63. struct fbcon_colour_map {
  64. /** Red scale (right shift amount from 24-bit RGB) */
  65. uint8_t red_scale;
  66. /** Green scale (right shift amount from 24-bit RGB) */
  67. uint8_t green_scale;
  68. /** Blue scale (right shift amount from 24-bit RGB) */
  69. uint8_t blue_scale;
  70. /** Red LSB */
  71. uint8_t red_lsb;
  72. /** Green LSB */
  73. uint8_t green_lsb;
  74. /** Blue LSB */
  75. uint8_t blue_lsb;
  76. };
  77. /** A frame buffer text cell */
  78. struct fbcon_text_cell {
  79. /** Foreground colour */
  80. uint32_t foreground;
  81. /** Background colour */
  82. uint32_t background;
  83. /** Character */
  84. unsigned int character;
  85. };
  86. /** A frame buffer text array */
  87. struct fbcon_text {
  88. /** Stored text cells */
  89. userptr_t start;
  90. };
  91. /** A frame buffer background picture */
  92. struct fbcon_picture {
  93. /** Start address */
  94. userptr_t start;
  95. };
  96. /** A frame buffer console */
  97. struct fbcon {
  98. /** Start address */
  99. userptr_t start;
  100. /** Length of one complete displayed screen */
  101. size_t len;
  102. /** Pixel geometry */
  103. struct fbcon_geometry *pixel;
  104. /** Character geometry */
  105. struct fbcon_geometry character;
  106. /** Margin */
  107. struct fbcon_margin margin;
  108. /** Indent to first character (in bytes) */
  109. size_t indent;
  110. /** Colour mapping */
  111. struct fbcon_colour_map *map;
  112. /** Font definition */
  113. struct fbcon_font *font;
  114. /** Text foreground raw colour */
  115. uint32_t foreground;
  116. /** Text background raw colour */
  117. uint32_t background;
  118. /** Bold colour modifier raw colour */
  119. uint32_t bold;
  120. /** Text cursor X position */
  121. unsigned int xpos;
  122. /** Text cursor Y position */
  123. unsigned int ypos;
  124. /** ANSI escape sequence context */
  125. struct ansiesc_context ctx;
  126. /** Text array */
  127. struct fbcon_text text;
  128. /** Background picture */
  129. struct fbcon_picture picture;
  130. /** Display cursor */
  131. int show_cursor;
  132. };
  133. extern int fbcon_init ( struct fbcon *fbcon, userptr_t start,
  134. struct fbcon_geometry *pixel,
  135. struct fbcon_colour_map *map,
  136. struct fbcon_font *font,
  137. struct console_configuration *config );
  138. extern void fbcon_fini ( struct fbcon *fbcon );
  139. extern void fbcon_putchar ( struct fbcon *fbcon, int character );
  140. #endif /* _IPXE_FBCON_H */