RTEMS 6.1-rc4
Loading...
Searching...
No Matches
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
32extern "C" {
33#endif /* __cplusplus */
34
36
37/* VESA BIOS EXTENSION (VBE) Core functions Standard
38 Version: 3.0 Date: September 16, 1998 */
39
42#define VBE_functionSupported 0x4F
44#define VBE_callSuccessful 0x00
46#define VBE_callFailed 0x01
48#define VBE_notSupportedInCurHWConf 0x02
50#define VBE_callInvalid 0x03
51
52/* VBE Mode Numbers */
54#define VBE_modeNumberMask 0x01FF
55#define VBE_modeNumberShift 0x00
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
72#define VBE_preserveDispMemMask 0x8000
73#define VBE_preserveDispMemShift 0x0F
74
75/* Graphics modes */
77#define VBE_R640x400C256 0x100
79#define VBE_R640x480C256 0x101
81#define VBE_R800x600C16 0x102
83#define VBE_b7R800x600C16 0x6A
85#define VBE_R800x600C256 0x103
87#define VBE_R1024x768C16 0x104
89#define VBE_R1024x768C256 0x105
91#define VBE_R1280x1024C16 0x106
93#define VBE_R1280x1024C256 0x107
95#define VBE_R320x200C32K 0x10D
97#define VBE_R320x200C64K 0x10E
99#define VBE_R320x200C17M 0x10F
101#define VBE_R640x480C32K 0x110
103#define VBE_R640x480C64K 0x111
105#define VBE_R640x480C17M 0x112
107#define VBE_R800x600C32K 0x113
109#define VBE_R800x600C64K 0x114
111#define VBE_R800x600C17M 0x115
113#define VBE_R1024x768C32K 0x116
115#define VBE_R1024x768C64K 0x117
117#define VBE_R1024x768C17M 0x118
119#define VBE_R1280x1024C32K 0x119
121#define VBE_R1280x1024C64K 0x11A
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 */
135#define VBE_RetVBEConInf 0x4F00
137#define VBE_RetVBEModInf 0x4F01
139#define VBE_SetVBEMod 0x4F02
141#define VBE_RetCurVBEMod 0x4F03
143#define VBE_SavResSta 0x4F04
145#define VBE_DisWinCon 0x4F05
147#define VBE_SetGetLogScaLinLen 0x4F06
149#define VBE_SetGetDisSta 0x4F07
151#define VBE_SetGetDACPalFor 0x4F08
153#define VBE_SetGetPalDat 0x4F09
155#define VBE_RetVBEProModInt 0x4F0A
157#define VBE_GetSetpixclo 0x4F0B
159#define VBE_PowManExt 0x4F10
161#define VBE_FlaPanIntExt 0x4F11
163#define VBE_AudIntExt 0x4F13
165#define VBE_OEMExt 0x4F14
167#define VBE_DisDatCha 0x4F15
168
169/* VBE subfunction numbers - passed in BL register */
170#define VBE_RetVBESupSpeInf 0x00
172/* *** Structures *** */
176typedef struct {
178 uint16_t offset;
181 uint16_t selector;
182} RTEMS_PACKED VBE_far_pointer;
183
187typedef 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;
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
220typedef 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+ */
243 uint8_t Reserved[222];
245 uint8_t OemData[256];
246} RTEMS_PACKED VBE_vbe_info_block;
247
251typedef struct {
252 /* Mandatory information for all VBE revisions */
262 uint16_t WinSize;
264 uint16_t WinASegment;
266 uint16_t WinBSegment;
268 uint32_t *WinFuncPtr;
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;
287 uint8_t MemoryModel;
289 uint8_t BankSize;
293 uint8_t Reserved0;
294 /* Direct Color fields (required for direct/6 and YUV/7 memory models) */
296 uint8_t RedMaskSize;
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 */
327 /* linear modes */
347 uint8_t Reserved3[189];
348} RTEMS_PACKED VBE_mode_info_block;
349
353typedef struct {
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
379typedef struct {
381 uint8_t Blue;
383 uint8_t Green;
385 uint8_t Red;
387 uint8_t Alignment;
388} RTEMS_PACKED VBE_palette_entry;
389
393typedef struct {
395 uint8_t SupVbeSignature[7];
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
538
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
560
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
570
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
580
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
600
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
611
612
613#ifdef __cplusplus
614}
615#endif /* __cplusplus */
616
617#endif /* ASM */
618
619#endif /* _VBE_H */
This header file provides basic definitions used by the API and the implementation.
Used for passing and retrieving registers content to/from real mode interrupt call.
Definition: realmode_int.h:43
uint8_t RedMaskSize
Definition: vbe3.h:296
uint8_t BnkNumberOfImagePages
Definition: vbe3.h:324
uint32_t * WinFuncPtr
Definition: vbe3.h:268
uint16_t HorizontalSyncEnd
Definition: vbe3.h:359
uint8_t RsvdMaskSize
Definition: vbe3.h:308
uint8_t Checksum
Definition: vbe3.h:207
uint8_t LinBlueMaskSize
Definition: vbe3.h:337
uint16_t HorizontalSyncStart
Definition: vbe3.h:357
uint32_t PixelClock
Definition: vbe3.h:369
uint8_t GreenFieldPosition
Definition: vbe3.h:302
uint16_t WinBSegment
Definition: vbe3.h:266
uint8_t Green
Definition: vbe3.h:383
uint8_t MemoryModel
Definition: vbe3.h:287
uint16_t OemSoftwareRev
Definition: vbe3.h:235
uint16_t VerticalSyncEnd
Definition: vbe3.h:365
uint8_t XCharSize
Definition: vbe3.h:277
uint8_t LinNumberOfImagePages
Definition: vbe3.h:326
uint16_t BIOSDataSel
Definition: vbe3.h:195
uint8_t GreenMaskSize
Definition: vbe3.h:300
uint32_t * VideoModePtr
Definition: vbe3.h:230
uint8_t BankSize
Definition: vbe3.h:289
uint32_t MaxPixelClock
Definition: vbe3.h:345
uint8_t * OemStringPtr
Definition: vbe3.h:226
uint16_t PMInitialize
Definition: vbe3.h:193
uint16_t LinBytesPerScanLine
Definition: vbe3.h:322
uint16_t WinASegment
Definition: vbe3.h:264
uint16_t VbeVersion
Definition: vbe3.h:224
uint8_t Reserved0
Definition: vbe3.h:293
uint16_t VerticalSyncStart
Definition: vbe3.h:363
uint16_t VerticalTotal
Definition: vbe3.h:361
uint32_t * PhysBasePtr
Definition: vbe3.h:315
uint16_t offset
Offset to segment described by selector.
Definition: vbe3.h:178
uint16_t A0000Sel
Definition: vbe3.h:197
uint16_t BytesPerScanLine
Definition: vbe3.h:270
uint8_t LinRedMaskSize
Definition: vbe3.h:329
uint16_t RefreshRate
Definition: vbe3.h:371
uint8_t WinAAttributes
Definition: vbe3.h:256
uint32_t Reserved1
Definition: vbe3.h:317
uint8_t NumberOfBanks
Definition: vbe3.h:285
uint8_t LinRsvdMaskSize
Definition: vbe3.h:341
uint16_t ModeAttributes
Definition: vbe3.h:254
uint8_t Blue
Definition: vbe3.h:381
uint8_t * OemProductNamePtr
Definition: vbe3.h:239
uint8_t BitsPerPixel
Definition: vbe3.h:283
uint8_t NumberOfPlanes
Definition: vbe3.h:281
uint8_t LinRsvdFieldPosition
Definition: vbe3.h:343
uint16_t B8000Sel
Definition: vbe3.h:201
uint8_t DirectColorModeInfo
Definition: vbe3.h:312
uint8_t LinRedFieldPosition
Definition: vbe3.h:331
uint16_t SupVbeVersion
Definition: vbe3.h:397
uint8_t Red
Definition: vbe3.h:385
uint16_t Reserved2
Definition: vbe3.h:319
uint16_t CodeSegSel
Definition: vbe3.h:203
uint8_t Flags
Definition: vbe3.h:367
uint8_t RsvdFieldPosition
Definition: vbe3.h:310
uint8_t * OemVendorNamePtr
Definition: vbe3.h:237
uint8_t YCharSize
Definition: vbe3.h:279
uint8_t NumberOfImagePages
Definition: vbe3.h:291
uint8_t InProtectMode
Definition: vbe3.h:205
uint16_t YResolution
Definition: vbe3.h:275
uint16_t selector
Selector or Segment depending on whether this is used from 16bit protected mode or from real mode.
Definition: vbe3.h:181
uint8_t LinBlueFieldPosition
Definition: vbe3.h:339
uint8_t WinBAttributes
Definition: vbe3.h:258
uint8_t * OemProductRevPtr
Definition: vbe3.h:241
uint8_t LinGreenMaskSize
Definition: vbe3.h:333
uint16_t XResolution
Definition: vbe3.h:273
uint16_t WinGranularity
Definition: vbe3.h:260
uint8_t LinGreenFieldPosition
Definition: vbe3.h:335
uint16_t HorizontalTotal
Definition: vbe3.h:355
uint16_t WinSize
Definition: vbe3.h:262
uint8_t BlueMaskSize
Definition: vbe3.h:304
uint16_t B0000Sel
Definition: vbe3.h:199
uint8_t BlueFieldPosition
Definition: vbe3.h:306
uint8_t RedFieldPosition
Definition: vbe3.h:298
uint8_t Alignment
Definition: vbe3.h:387
uint16_t TotalMemory
Definition: vbe3.h:232
uint16_t EntryPoint
Definition: vbe3.h:191