RTEMS  5.0.0
vbe3.h
Go to the documentation of this file.
1 
15 /*
16  * Copyright (C) 2014 Jan Doležal (dolezj21@fel.cvut.cz)
17  * CTU in Prague.
18  *
19  * The license and distribution terms for this file may be
20  * found in the file LICENSE in this distribution or at
21  * http://www.rtems.org/license/LICENSE.
22  */
23 
24 #ifndef _VBE_H
25 #define _VBE_H
26 
27 #ifndef ASM /* ASM */
28 
29 #include <stdint.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34 
35 #include <rtems/score/basedefs.h>
36 
37 /* VESA BIOS EXTENSION (VBE) Core functions Standard
38  Version: 3.0 Date: September 16, 1998 */
39 
42 #define VBE_functionSupported 0x4F
43 
44 #define VBE_callSuccessful 0x00
45 
46 #define VBE_callFailed 0x01
47 
48 #define VBE_notSupportedInCurHWConf 0x02
49 
50 #define VBE_callInvalid 0x03
51 
52 /* VBE Mode Numbers */
54 #define VBE_modeNumberMask 0x01FF
55 #define VBE_modeNumberShift 0x00
56 
58 #define VBE_VESAmodeMask 0x0100
59 #define VBE_VESAmodeShift 0x08
60 /* D9-D10 = Reserved by VESA for future expansion (= 0) */
63 #define VBE_refreshRateCtrlMask 0x0800
64 #define VBE_refreshRateCtrlShift 0x0B
65 /* D12-13 = Reserved for VBE/AF (must be 0) */
68 #define VBE_linearFlatFrameBufMask 0x4000
69 #define VBE_linearFlatFrameBufShift 0x0E
70 
72 #define VBE_preserveDispMemMask 0x8000
73 #define VBE_preserveDispMemShift 0x0F
74 
75 /* Graphics modes */
77 #define VBE_R640x400C256 0x100
78 
79 #define VBE_R640x480C256 0x101
80 
81 #define VBE_R800x600C16 0x102
82 
83 #define VBE_b7R800x600C16 0x6A
84 
85 #define VBE_R800x600C256 0x103
86 
87 #define VBE_R1024x768C16 0x104
88 
89 #define VBE_R1024x768C256 0x105
90 
91 #define VBE_R1280x1024C16 0x106
92 
93 #define VBE_R1280x1024C256 0x107
94 
95 #define VBE_R320x200C32K 0x10D
96 
97 #define VBE_R320x200C64K 0x10E
98 
99 #define VBE_R320x200C17M 0x10F
100 
101 #define VBE_R640x480C32K 0x110
102 
103 #define VBE_R640x480C64K 0x111
104 
105 #define VBE_R640x480C17M 0x112
106 
107 #define VBE_R800x600C32K 0x113
108 
109 #define VBE_R800x600C64K 0x114
110 
111 #define VBE_R800x600C17M 0x115
112 
113 #define VBE_R1024x768C32K 0x116
114 
115 #define VBE_R1024x768C64K 0x117
116 
117 #define VBE_R1024x768C17M 0x118
118 
119 #define VBE_R1280x1024C32K 0x119
120 
121 #define VBE_R1280x1024C64K 0x11A
122 
123 #define VBE_R1280x1024C17M 0x11B
124 #define VBE_SpecialMode 0x81FF
125 
126 /* Text modes */
127 #define VBE_C80R60 0x108
128 #define VBE_C132R25 0x109
129 #define VBE_C132R43 0x10A
130 #define VBE_C132R50 0x10B
131 #define VBE_C132R60 0x10C
133 /* VBE function numbers - passed in AX register */
134 
135 #define VBE_RetVBEConInf 0x4F00
136 
137 #define VBE_RetVBEModInf 0x4F01
138 
139 #define VBE_SetVBEMod 0x4F02
140 
141 #define VBE_RetCurVBEMod 0x4F03
142 
143 #define VBE_SavResSta 0x4F04
144 
145 #define VBE_DisWinCon 0x4F05
146 
147 #define VBE_SetGetLogScaLinLen 0x4F06
148 
149 #define VBE_SetGetDisSta 0x4F07
150 
151 #define VBE_SetGetDACPalFor 0x4F08
152 
153 #define VBE_SetGetPalDat 0x4F09
154 
155 #define VBE_RetVBEProModInt 0x4F0A
156 
157 #define VBE_GetSetpixclo 0x4F0B
158 
159 #define VBE_PowManExt 0x4F10
160 
161 #define VBE_FlaPanIntExt 0x4F11
162 
163 #define VBE_AudIntExt 0x4F13
164 
165 #define VBE_OEMExt 0x4F14
166 
167 #define VBE_DisDatCha 0x4F15
168 
169 /* VBE subfunction numbers - passed in BL register */
170 #define VBE_RetVBESupSpeInf 0x00
172 /* *** Structures *** */
173 
176 typedef struct {
178  uint16_t offset;
181  uint16_t selector;
182 } RTEMS_PACKED VBE_far_pointer;
183 
187 typedef struct {
189  uint8_t Signature[4];
191  uint16_t EntryPoint;
193  uint16_t PMInitialize;
195  uint16_t BIOSDataSel;
197  uint16_t A0000Sel;
199  uint16_t B0000Sel;
201  uint16_t B8000Sel;
203  uint16_t CodeSegSel;
205  uint8_t InProtectMode;
207  uint8_t Checksum;
208 } RTEMS_PACKED VBE_protected_mode_info_block;
209 
211 #define VBE_SIGNATURE "VESA"
213 #define VBE20plus_SIGNATURE "VBE2"
215 #define VBE_STUB_VideoModeList 0xFFFF
216 #define VBE_END_OF_VideoModeList 0xFFFF
217 
220 typedef struct {
222  uint8_t VbeSignature[4];
224  uint16_t VbeVersion;
226  uint8_t *OemStringPtr;
228  uint8_t Capabilities[4];
230  uint32_t *VideoModePtr;
232  uint16_t TotalMemory;
233  /* Added for VBE 2.0+ */
235  uint16_t OemSoftwareRev;
237  uint8_t *OemVendorNamePtr;
239  uint8_t *OemProductNamePtr;
241  uint8_t *OemProductRevPtr;
243  uint8_t Reserved[222];
245  uint8_t OemData[256];
246 } RTEMS_PACKED VBE_vbe_info_block;
247 
251 typedef struct {
252  /* Mandatory information for all VBE revisions */
254  uint16_t ModeAttributes;
256  uint8_t WinAAttributes;
258  uint8_t WinBAttributes;
260  uint16_t WinGranularity;
262  uint16_t WinSize;
264  uint16_t WinASegment;
266  uint16_t WinBSegment;
268  uint32_t *WinFuncPtr;
270  uint16_t BytesPerScanLine;
271  /* Mandatory information for VBE 1.2 and above */
273  uint16_t XResolution;
275  uint16_t YResolution;
277  uint8_t XCharSize;
279  uint8_t YCharSize;
281  uint8_t NumberOfPlanes;
283  uint8_t BitsPerPixel;
285  uint8_t NumberOfBanks;
287  uint8_t MemoryModel;
289  uint8_t BankSize;
291  uint8_t NumberOfImagePages;
293  uint8_t Reserved0;
294  /* Direct Color fields (required for direct/6 and YUV/7 memory models) */
296  uint8_t RedMaskSize;
298  uint8_t RedFieldPosition;
300  uint8_t GreenMaskSize;
302  uint8_t GreenFieldPosition;
304  uint8_t BlueMaskSize;
306  uint8_t BlueFieldPosition;
308  uint8_t RsvdMaskSize;
310  uint8_t RsvdFieldPosition;
312  uint8_t DirectColorModeInfo;
313  /* Mandatory information for VBE 2.0 and above */
315  uint32_t *PhysBasePtr;
317  uint32_t Reserved1;
319  uint16_t Reserved2;
320  /* Mandatory information for VBE 3.0 and above */
322  uint16_t LinBytesPerScanLine;
324  uint8_t BnkNumberOfImagePages;
326  uint8_t LinNumberOfImagePages;
327  /* linear modes */
329  uint8_t LinRedMaskSize;
331  uint8_t LinRedFieldPosition;
333  uint8_t LinGreenMaskSize;
335  uint8_t LinGreenFieldPosition;
337  uint8_t LinBlueMaskSize;
339  uint8_t LinBlueFieldPosition;
341  uint8_t LinRsvdMaskSize;
343  uint8_t LinRsvdFieldPosition;
345  uint32_t MaxPixelClock;
347  uint8_t Reserved3[189];
348 } RTEMS_PACKED VBE_mode_info_block;
349 
353 typedef struct {
355  uint16_t HorizontalTotal;
357  uint16_t HorizontalSyncStart;
359  uint16_t HorizontalSyncEnd;
361  uint16_t VerticalTotal;
363  uint16_t VerticalSyncStart;
365  uint16_t VerticalSyncEnd;
367  uint8_t Flags;
369  uint32_t PixelClock;
371  uint16_t RefreshRate;
373  uint8_t Reserved[40];
374 } RTEMS_PACKED VBE_CRTC_info_block;
375 
379 typedef struct {
381  uint8_t Blue;
383  uint8_t Green;
385  uint8_t Red;
387  uint8_t Alignment;
388 } RTEMS_PACKED VBE_palette_entry;
389 
393 typedef struct {
395  uint8_t SupVbeSignature[7];
397  uint16_t SupVbeVersion;
399  uint8_t SupVbeSubFunc[8];
401  uint16_t OemSoftwareRev;
403  uint8_t *OemVendorNamePtr;
405  uint8_t *OemProductNamePtr;
407  uint8_t *OemProductRevPtr;
409  uint8_t *OemStringPtr;
411  uint8_t Reserved[221];
412 } RTEMS_PACKED VBE_supplemental_vbe_info_block;
413 
414 /* VBE_vbe_info_block Capabilities */
418 #define VBE_DACswitchableMask 0x0001
422 #define VBE_notVGAcompatibleMask 0x0002
427 #define VBE_specialRAMDACopMask 0x0004
431 #define VBE_hwStereoscopicMask 0x0008
435 #define VBE_supportEVCconnMask 0x0010
436 /* D5-31 = Reserved */
437 
438 /* VBE_mode_info_block ModeAttributes */
443 #define VBE_modSupInHWMask 0x0001
444 /* D1 = 1 (Reserved) */
449 #define VBE_TTYOutSupByBIOSMask 0x0004
454 #define VBE_ColorModeMask 0x0008
459 #define VBE_GraphicsModeMask 0x0010
464 #define VBE_VGACompModeMask 0x0020
469 #define VBE_VGACompWinMemModeMask 0x0040
474 #define VBE_LinFraBufModeAvaiMask 0x0080
479 #define VBE_DblScnModeAvaiMask 0x0100
484 #define VBE_InterlModeAvaiMask 0x0200
489 #define VBE_HWTripBufSupMask 0x0400
494 #define VBE_HWSterDispSupMask 0x0800
499 #define VBE_DualDispStAdrSupMask 0x1000
500 /* D13-D15 = Reserved */
501 
502 /* VBE_mode_info_block WinXAttributes */
506 #define VBE_RelocWinSupMask 0x01
510 #define VBE_WinReadableMask 0x02
514 #define VBE_WinWritableMask 0x04
515 /* D3-D7 = Reserved */
516 
517 /* VBE_mode_info_block MemoryModel */
518 #define VBE_TextMode 0x00
519 #define VBE_CGAGraphics 0x01
520 #define VBE_HerculesGraphics 0x02
521 #define VBE_Planar 0x03
522 #define VBE_PackedPixel 0x04
523 #define VBE_NonChain4Color256 0x05
524 #define VBE_DirectColor 0x06
525 #define VBE_YUV 0x07
526  /* 0x08-0x0F Reserved, to be defined by VESA */
527  /* 0x10-0xFF To be defined by OEM */
528 
529 /* VBE_mode_info_block DirectColorModeInfo */
533 #define VBE_ColRampProgMask 0x01
537 #define VBE_RsvdBitsUsableMask 0x02
539 /* VBE_CRTC_info_block Flags */
544 #define VBE_GrModeDblScanMask 0x01
549 #define VBE_GrModeInterlMask 0x02
554 #define VBE_HorSncPolNegMask 0x04
559 #define VBE_VerSncPolNegMask 0x08
561 
562 /* VESA BIOS Extensions/Display Data Channel Standard
563  Version: 1.1 November 18, 1999 */
564 
565 /* VBE/DDC subfunction numbers - passed in BL register */
567 #define VBEDDC_Capabilities 0x0
569 #define VBEDDC_ReadEDID 0x1
571 /* DDC Capabilities */
572 /* DDC level supported - returned in BL register */
574 #define VBEDDC_1SupportedMask 0x1
576 #define VBEDDC_2SupportedMask 0x2
579 #define VBEDDC_scrBlnkDatTrMs 0x4
581 
582 /* VESA BIOS Extensions/Serial Control Interface Standard
583  Version: 1.0 Revision: 2 Date: July 2, 1997 */
584 
585 /* VBE/SCI subfunction numbers - passed in BL register */
587 #define VBESCI_ReportCapabil 0x10
589 #define VBESCI_BegSCLSDACtrl 0x11
591 #define VBESCI_EndSCLSDACtrl 0x12
593 #define VBESCI_WrtSCLClkLine 0x13
595 #define VBESCI_WrtSDADatLine 0x14
597 #define VBESCI_RdySCLClkLine 0x15
599 #define VBESCI_RdySDADatLine 0x16
601 /* SCI Capabilities */
602 /* I2C level supported - returned in BL register */
604 #define VBESCI_capSCLwrtMask 0x1
606 #define VBESCI_capSDAwrtMask 0x2
608 #define VBESCI_capSCLrdyMask 0x4
610 #define VBESCI_capSDArdyMask 0x8
612 
613 #ifdef __cplusplus
614 }
615 #endif /* __cplusplus */
616 
617 #endif /* ASM */
618 
619 #endif /* _VBE_H */
Used for passing and retrieving registers content to/from real mode interrupt call.
Definition: realmode_int.h:43
Basic Definitions.