Lab5
 All Data Structures Functions Variables Groups
vbe.h
1 #ifndef __VBE_H
2 #define __VBE_H
3 
4 #include <stdint.h>
5 
18 typedef struct {
19  /* Mandatory information for all VBE revisions */
20  uint16_t ModeAttributes;
21  uint8_t WinAAttributes;
22  uint8_t WinBAttributes;
23  uint16_t WinGranularity;
24  uint16_t WinSize;
25  uint16_t WinASegment;
26  uint16_t WinBSegment;
27  phys_bytes WinFuncPtr;
28  uint16_t BytesPerScanLine;
30  /* Mandatory information for VBE 1.2 and above */
31 
32  uint16_t XResolution;
33  uint16_t YResolution;
34  uint8_t XCharSize;
35  uint8_t YCharSize;
36  uint8_t NumberOfPlanes;
37  uint8_t BitsPerPixel;
38  uint8_t NumberOfBanks;
39  uint8_t MemoryModel;
40  uint8_t BankSize;
42  uint8_t Reserved1;
44  /* Direct Color fields (required for direct/6 and YUV/7 memory models) */
45 
46  uint8_t RedMaskSize; /* size of direct color red mask in bits */
47  uint8_t RedFieldPosition; /* bit position of lsb of red mask */
48  uint8_t GreenMaskSize; /* size of direct color green mask in bits */
49  uint8_t GreenFieldPosition; /* bit position of lsb of green mask */
50  uint8_t BlueMaskSize; /* size of direct color blue mask in bits */
51  uint8_t BlueFieldPosition; /* bit position of lsb of blue mask */
52  uint8_t RsvdMaskSize; /* size of direct color reserved mask in bits */
53  uint8_t RsvdFieldPosition; /* bit position of lsb of reserved mask */
54  uint8_t DirectColorModeInfo; /* direct color mode attributes */
55 
56  /* Mandatory information for VBE 2.0 and above */
57  phys_bytes PhysBasePtr;
58  uint8_t Reserved2[4];
59  uint8_t Reserved3[2];
61  /* Mandatory information for VBE 3.0 and above */
62  uint16_t LinBytesPerScanLine; /* bytes per scan line for linear modes */
63  uint8_t BnkNumberOfImagePages; /* number of images for banked modes */
64  uint8_t LinNumberOfImagePages; /* number of images for linear modes */
65  uint8_t LinRedMaskSize; /* size of direct color red mask (linear modes) */
66  uint8_t LinRedFieldPosition; /* bit position of lsb of red mask (linear modes) */
67  uint8_t LinGreenMaskSize; /* size of direct color green mask (linear modes) */
68  uint8_t LinGreenFieldPosition; /* bit position of lsb of green mask (linear modes) */
69  uint8_t LinBlueMaskSize; /* size of direct color blue mask (linear modes) */
70  uint8_t LinBlueFieldPosition; /* bit position of lsb of blue mask (linear modes ) */
71  uint8_t LinRsvdMaskSize; /* size of direct color reserved mask (linear modes) */
72  uint8_t LinRsvdFieldPosition; /* bit position of lsb of reserved mask (linear modes) */
73  uint32_t MaxPixelClock; /* maximum pixel clock (in Hz) for graphics mode */
74  uint8_t Reserved4[190]; /* remainder of ModeInfoBlock */
75 } __attribute__((packed)) vbe_mode_info_t;
76 
91 int vbe_get_mode_info(unsigned short mode, vbe_mode_info_t *vmi_p);
92 
95 #endif /* __VBE_H */