coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
vbe.h
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (c) 2004, 2008 IBM Corporation
3
* Copyright (c) 2009 Pattrick Hueper <phueper@hueper.net>
4
* All rights reserved.
5
* This program and the accompanying materials
6
* are made available under the terms of the BSD License
7
* which accompanies this distribution, and is available at
8
* http://www.opensource.org/licenses/bsd-license.php
9
*
10
* Contributors:
11
* IBM Corporation - initial implementation
12
*****************************************************************************/
13
#ifndef VBE_H
14
#define VBE_H
15
16
#include <
stdint.h
>
17
18
// these structs are for input from and output to OF
19
typedef
struct
{
20
u8
display_type
;
// 0 = NONE, 1 = analog, 2 = digital
21
u16
screen_width
;
22
u16
screen_height
;
23
u16
screen_linebytes
;
// bytes per line in framebuffer, may be more
24
// than screen_width
25
u8
color_depth
;
// color depth in bits per pixel
26
u32
framebuffer_address
;
27
u8
edid_block_zero[128];
28
}
__packed
screen_info_t;
29
30
typedef
struct
{
31
u8
signature[4];
32
u16
size_reserved
;
33
u8
monitor_number
;
34
u16
max_screen_width
;
35
u8
color_depth
;
36
}
__packed
screen_info_input_t;
37
38
typedef
struct
{
39
u16
mode_attributes
;
// 00
40
u8
win_a_attributes
;
// 02
41
u8
win_b_attributes
;
// 03
42
u16
win_granularity
;
// 04
43
u16
win_size
;
// 06
44
u16
win_a_segment
;
// 08
45
u16
win_b_segment
;
// 0a
46
u32
win_func_ptr
;
// 0c
47
u16
bytes_per_scanline
;
// 10
48
u16
x_resolution
;
// 12
49
u16
y_resolution
;
// 14
50
u8
x_charsize
;
// 16
51
u8
y_charsize
;
// 17
52
u8
number_of_planes
;
// 18
53
u8
bits_per_pixel
;
// 19
54
u8
number_of_banks
;
// 20
55
u8
memory_model
;
// 21
56
u8
bank_size
;
// 22
57
u8
number_of_image_pages
;
// 23
58
u8
reserved_page
;
59
u8
red_mask_size
;
60
u8
red_mask_pos
;
61
u8
green_mask_size
;
62
u8
green_mask_pos
;
63
u8
blue_mask_size
;
64
u8
blue_mask_pos
;
65
u8
reserved_mask_size
;
66
u8
reserved_mask_pos
;
67
u8
direct_color_mode_info
;
68
u32
phys_base_ptr
;
69
u32
offscreen_mem_offset
;
70
u16
offscreen_mem_size
;
71
u8
reserved[206];
72
}
__packed
vesa_mode_info_t;
73
74
typedef
struct
{
75
u16
video_mode
;
76
union
{
77
vesa_mode_info_t
vesa
;
78
u8
mode_info_block[256];
79
};
80
// our crap
81
//u16 attributes;
82
//u16 linebytes;
83
//u16 x_resolution;
84
//u16 y_resolution;
85
//u8 x_charsize;
86
//u8 y_charsize;
87
//u8 bits_per_pixel;
88
//u8 memory_model;
89
//u32 framebuffer_address;
90
}
vbe_mode_info_t
;
91
92
typedef
struct
{
93
u8
port_number
;
// i.e. monitor number
94
u8
edid_transfer_time
;
95
u8
ddc_level
;
96
u8
edid_block_zero[128];
97
}
vbe_ddc_info_t
;
98
99
#define VESA_GET_INFO 0x4f00
100
#define VESA_GET_MODE_INFO 0x4f01
101
#define VESA_SET_MODE 0x4f02
102
103
void
vbe_set_graphics
(
void
);
104
void
vbe_textmode_console
(
void
);
105
106
/**
107
* Returns the mode_info struct from the vbe context,
108
* if initialized. NULL on invalid mode_infos.
109
*/
110
const
vbe_mode_info_t
*
vbe_mode_info
(
void
);
111
112
#endif
// VBE_H
color_depth
color_depth
Definition:
edp.h:577
stdint.h
u32
uint32_t u32
Definition:
stdint.h:51
u16
uint16_t u16
Definition:
stdint.h:48
u8
uint8_t u8
Definition:
stdint.h:45
__packed
Definition:
x86.c:23
__packed::green_mask_size
u8 green_mask_size
Definition:
vbe.h:61
__packed::win_func_ptr
u32 win_func_ptr
Definition:
vbe.h:46
__packed::max_screen_width
u16 max_screen_width
Definition:
vbe.h:34
__packed::mode_attributes
u16 mode_attributes
Definition:
vbe.h:39
__packed::bank_size
u8 bank_size
Definition:
vbe.h:56
__packed::offscreen_mem_offset
u32 offscreen_mem_offset
Definition:
vbe.h:69
__packed::bits_per_pixel
u8 bits_per_pixel
Definition:
vbe.h:53
__packed::memory_model
u8 memory_model
Definition:
vbe.h:55
__packed::red_mask_size
u8 red_mask_size
Definition:
vbe.h:59
__packed::display_type
u8 display_type
Definition:
vbe.h:20
__packed::x_resolution
u16 x_resolution
Definition:
vbe.h:48
__packed::monitor_number
u8 monitor_number
Definition:
vbe.h:33
__packed::bytes_per_scanline
u16 bytes_per_scanline
Definition:
vbe.h:47
__packed::screen_height
u16 screen_height
Definition:
vbe.h:22
__packed::green_mask_pos
u8 green_mask_pos
Definition:
vbe.h:62
__packed::win_size
u16 win_size
Definition:
vbe.h:43
__packed::win_granularity
u16 win_granularity
Definition:
vbe.h:42
__packed::y_resolution
u16 y_resolution
Definition:
vbe.h:49
__packed::blue_mask_size
u8 blue_mask_size
Definition:
vbe.h:63
__packed::color_depth
u8 color_depth
Definition:
vbe.h:25
__packed::win_a_segment
u16 win_a_segment
Definition:
vbe.h:44
__packed::framebuffer_address
u32 framebuffer_address
Definition:
vbe.h:26
__packed::y_charsize
u8 y_charsize
Definition:
vbe.h:51
__packed::x_charsize
u8 x_charsize
Definition:
vbe.h:50
__packed::reserved_page
u8 reserved_page
Definition:
vbe.h:58
__packed::size_reserved
u16 size_reserved
Definition:
vbe.h:32
__packed::number_of_banks
u8 number_of_banks
Definition:
vbe.h:54
__packed::number_of_image_pages
u8 number_of_image_pages
Definition:
vbe.h:57
__packed::win_b_attributes
u8 win_b_attributes
Definition:
vbe.h:41
__packed::phys_base_ptr
u32 phys_base_ptr
Definition:
vbe.h:68
__packed::offscreen_mem_size
u16 offscreen_mem_size
Definition:
vbe.h:70
__packed::blue_mask_pos
u8 blue_mask_pos
Definition:
vbe.h:64
__packed::win_a_attributes
u8 win_a_attributes
Definition:
vbe.h:40
__packed::screen_linebytes
u16 screen_linebytes
Definition:
vbe.h:23
__packed::reserved_mask_pos
u8 reserved_mask_pos
Definition:
vbe.h:66
__packed::win_b_segment
u16 win_b_segment
Definition:
vbe.h:45
__packed::number_of_planes
u8 number_of_planes
Definition:
vbe.h:52
__packed::direct_color_mode_info
u8 direct_color_mode_info
Definition:
vbe.h:67
__packed::red_mask_pos
u8 red_mask_pos
Definition:
vbe.h:60
__packed::reserved_mask_size
u8 reserved_mask_size
Definition:
vbe.h:65
__packed::screen_width
u16 screen_width
Definition:
vbe.h:21
vbe_ddc_info_t
Definition:
vbe.h:92
vbe_ddc_info_t::port_number
u8 port_number
Definition:
vbe.h:93
vbe_ddc_info_t::edid_transfer_time
u8 edid_transfer_time
Definition:
vbe.h:94
vbe_ddc_info_t::ddc_level
u8 ddc_level
Definition:
vbe.h:95
vbe_mode_info_t
Definition:
vbe.h:74
vbe_mode_info_t::video_mode
u16 video_mode
Definition:
vbe.h:75
vbe_mode_info_t::vesa
vesa_mode_info_t vesa
Definition:
vbe.h:77
vbe_textmode_console
void vbe_textmode_console(void)
vbe_mode_info
const vbe_mode_info_t * vbe_mode_info(void)
Returns the mode_info struct from the vbe context, if initialized.
vbe_set_graphics
void vbe_set_graphics(void)
src
include
vbe.h
Generated by
1.9.1