1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef BOOT_VIDEO_H
16#define BOOT_VIDEO_H
17
18#include <linux/types.h>
19
20
21
22
23
24
25
26
27
28
29#define VIDEO_FIRST_MENU 0x0000
30
31
32#define VIDEO_FIRST_BIOS 0x0100
33
34
35#define VIDEO_FIRST_VESA 0x0200
36
37
38#define VIDEO_FIRST_V7 0x0900
39
40
41#define VIDEO_FIRST_SPECIAL 0x0f00
42#define VIDEO_80x25 0x0f00
43#define VIDEO_8POINT 0x0f01
44#define VIDEO_80x43 0x0f02
45#define VIDEO_80x28 0x0f03
46#define VIDEO_CURRENT_MODE 0x0f04
47#define VIDEO_80x30 0x0f05
48#define VIDEO_80x34 0x0f06
49#define VIDEO_80x60 0x0f07
50#define VIDEO_GFX_HACK 0x0f08
51#define VIDEO_LAST_SPECIAL 0x0f09
52
53
54#define VIDEO_FIRST_RESOLUTION 0x1000
55
56
57#define VIDEO_RECALC 0x8000
58
59void store_screen(void);
60#define DO_STORE() store_screen()
61
62
63
64
65
66struct mode_info {
67 u16 mode;
68 u16 x, y;
69 u16 depth;
70};
71
72struct card_info {
73 const char *card_name;
74 int (*set_mode)(struct mode_info *mode);
75 int (*probe)(void);
76 struct mode_info *modes;
77 int nmodes;
78 int unsafe;
79 u16 xmode_first;
80 u16 xmode_n;
81};
82
83#define __videocard struct card_info __attribute__((used,section(".videocards")))
84extern struct card_info video_cards[], video_cards_end[];
85
86int mode_defined(u16 mode);
87
88
89#define ADAPTER_CGA 0
90#define ADAPTER_EGA 1
91#define ADAPTER_VGA 2
92
93extern int adapter;
94extern int force_x, force_y;
95extern int do_restore;
96extern int graphic_mode;
97
98
99static inline u8 in_idx(u16 port, u8 index)
100{
101 outb(index, port);
102 return inb(port+1);
103}
104
105static inline void out_idx(u8 v, u16 port, u8 index)
106{
107 outw(index+(v << 8), port);
108}
109
110
111static inline u8 tst_idx(u8 v, u16 port, u8 index)
112{
113 out_idx(port, index, v);
114 return in_idx(port, index);
115}
116
117
118u16 vga_crtc(void);
119
120#endif
121