7 #define PACKED __attribute__((packed))
12 #define VBE_ATTR_LFB (1 << 7)
13 #define VBE_MODE_LFB (1 << 14)
15 #pragma pack (push, 0)
20 uint8_t caps[4]; /* capabilities */
21 uint32_t vid_mode_ptr; /* vbefarptr to video mode list */
22 uint16_t total_mem; /* num of 64k mem blocks */
23 uint16_t oem_sw_rev; /* VBE implementation software revision */
24 uint32_t oem_vendor_name_ptr;
25 uint32_t oem_product_name_ptr;
26 uint32_t oem_product_rev_ptr;
27 uint8_t reserved[222];
28 uint8_t oem_data[256];
31 struct vbe_mode_info {
33 uint8_t wina_attr, winb_attr;
34 uint16_t win_gran, win_size;
35 uint16_t wina_seg, winb_seg;
37 uint16_t scanline_bytes;
39 /* VBE 1.2 and above */
41 uint8_t xcharsz, ycharsz;
46 uint8_t bank_size; /* bank size in KB */
47 uint8_t num_img_pages;
50 /* direct color fields */
51 uint8_t rmask_size, rpos;
52 uint8_t gmask_size, gpos;
53 uint8_t bmask_size, bpos;
54 uint8_t xmask_size, xpos;
55 uint8_t cmode_info; /* direct color mode attributes */
57 /* VBE 2.0 and above */
58 uint32_t fb_addr; /* physical address of the linear framebuffer */
62 uint8_t reserved4[206];
66 struct vbe_info *vbe_get_info(void);
67 struct vbe_mode_info *vbe_get_mode_info(int mode);
69 int vbe_set_mode(int mode);
71 int vbe_set_palette_bits(int bits);
72 void vbe_set_palette(int idx, int *col, int count, int bits);
74 void print_mode_info(FILE *fp, struct vbe_mode_info *modei);