1
2
3
4
5
6
7
8 #ifndef BOOT_VESA_H
9 #define BOOT_VESA_H
10
11 typedef struct {
12 u16 off, seg;
13 } far_ptr;
14
15
16 struct vesa_general_info {
17 u32 signature;
18 u16 version;
19 far_ptr vendor_string;
20 u32 capabilities;
21 far_ptr video_mode_ptr;
22 u16 total_memory;
23
24 u8 reserved[236];
25 } __attribute__ ((packed));
26
27 #define VESA_MAGIC ('V' + ('E' << 8) + ('S' << 16) + ('A' << 24))
28
29 struct vesa_mode_info {
30 u16 mode_attr;
31 u8 win_attr[2];
32 u16 win_grain;
33 u16 win_size;
34 u16 win_seg[2];
35 far_ptr win_scheme;
36 u16 logical_scan;
37
38 u16 h_res;
39 u16 v_res;
40 u8 char_width;
41 u8 char_height;
42 u8 memory_planes;
43 u8 bpp;
44 u8 banks;
45 u8 memory_layout;
46 u8 bank_size;
47 u8 image_planes;
48 u8 page_function;
49
50 u8 rmask;
51 u8 rpos;
52 u8 gmask;
53 u8 gpos;
54 u8 bmask;
55 u8 bpos;
56 u8 resv_mask;
57 u8 resv_pos;
58 u8 dcm_info;
59
60 u32 lfb_ptr;
61 u32 offscreen_ptr;
62 u16 offscreen_size;
63
64 u8 reserved[206];
65 } __attribute__ ((packed));
66
67 #endif