1svgalib.faq(7) Svgalib User Manual svgalib.faq(7)
2
3
4
6 svgalib.faq - frequently asked questions about svgalib
7
8
10 I (Matan Ziv-Av), added/changed some of the answers in this file, so
11 some answers are mine, and some are Michael's.
12
13 List of (recently) frequently asked questions about svgalib. Esp. about
14 it's status and future. Please note that as of now all answers are just
15 written by me, Michael Weller <eowmob@exp-math.uni-essen.de>. I'd like
16 this to change. So email your suggestion (best of all: question and the
17 answer).
18
19 Also, most questions deal with the status and future and my ideas about
20 it. Necessarily they contain my own private opinions on this. People
21 may disagree and I'm sure I don't have the best ideas about it or may
22 even be completely wrong. I don't want to force anyone to agree with
23 me.
24
25 Also, I was asked about MY opinions, so I'm just presenting them here.
26
27
29 Q 1) I want to write some svgalib application. Where is the documen‐
30 tation?
31
32 Q 2) My board is not supported. What now?
33
34 Q 3) I get:
35
36 You must be the owner of the current console to use svgalib.
37 Not running in a graphics capable console, and unable to find
38 one.
39
40 However, though logged in not directly from the linux console, I
41 am the owner of the console.
42
43 Q 4) Is svgalib dead?
44
45 Q 5) There are so many Xfree drivers, why not just use them.
46
47 Q 6) Why not just use the VGA BIOS?.
48
49 Q 7) What about GGI?
50
51 Q 8) Why not just use X11?
52
53 Q 9) Now, again, what about the future of svgalib?
54
55 Q 10) Ok, just for completeness, what are your plans about svgalib
56 anyway?
57
58 Q 11) Nice plan. But will it become true?
59
61 Q 1)
62 I want to write some svgalib application. Where is the documentation?
63
64
65 A a)
66 Well, did you really look at everything? The 0-README file in the top
67 level directory contains all function prototypes and explanations on
68 how to call them.
69
70 Yes, the documentation is short and/or confusing. Sorry, English is not
71 my native tongue. Many people complain and want to write some better
72 documentation. You are welcome to do so! However, up to now, either
73 people found the documentation sufficient once they looked at the cor‐
74 rect files or they just gave up. At least, I never heard from these
75 people again.
76
77 Also, svgalib comes with source. If in doubt: read it.
78
79 Finally: Linux distributions include svgalib, but not the source and
80 README's (or hide them so good noone finds them). Well, no problem, get
81 full svgalib source, demos, readme's from svgalib-*.tar.gz on any Linux
82 FTP server in your vicinity. Even if you don't dare to install or com‐
83 pile it, it contains the readme's.
84
85 Oh yes, there are some simple demos in the demos/ subdir. They should
86 get you started.
87
88 When someone writes man(1) manual pages, a distribution might just
89 install them. Please do not complain, write them, mail them to me.
90
91
92 A b)
93 Finally, I, Michael Weller wrote the manpages. Looking at svgalib(7)
94 should get you started. Additions and corrections are still welcome, of
95 course.
96
97
98 Q 2)
99 My board is not supported. What now?
100
101
102 A)
103 Simple:
104
105
106 a) Contact the maintainers (see other README's) and check out if
107 someone is working on a driver.
108
109
110 b) If so, contact them if you like and announce you'd be willing to
111 test things or even help coding.
112
113
114 c) If not, write a driver. Get as many docs on your card as you
115 can, then read and understand the internals of svgalib (again
116 read the README's carefully!).
117
118 Please understand that this is a free project. I will not go and buy a
119 similar card and write a driver for you. I already wrote support for
120 the hardware I have! I just do this as a hobby. Because I don't get
121 paid for this I can not just buy card & docu and spend much much time
122 supporting whatever graphics card on earth exists.
123
124 Also read below on the future of svgalib.
125
126 If you don't feel able to write a driver for whatever reason, please do
127 not complain if other people don't do it for you (because you are not
128 better than they are).
129
130
131 Q 3)
132 I get:
133
134 You must be the owner of the current console to use svgalib.
135 Not running in a graphics capable console, and unable to find one.
136
137 However, though logged in not directly from the linux console, I am the
138 owner of the console.
139
140
141 A)
142 Alas, some programs use their suid root privilege and become a full
143 root owned process. svgalib thinks they are run by root which does not
144 own the current console. Defining ROOT_VC_SHORTCUT in Makefile.cfg and
145 recompiling will allow svgalib to allocate a new VC. However, it will
146 allow any person which is able to exec that program to start in on a
147 new console. Even if not logged in from the console at all. Thus, for
148 security, you need to explicitly enable that root feature.
149
150
151 Q 4)
152 Is svgalib dead?
153
154
155 A)
156 This question comes up frequently esp. in recent times.
157
158 The answer is, of course, no.
159
160
161 Q 5)
162 There are so many Xfree drivers, why not just use them.
163
164
165 A)
166 Well, actually much of the code in there is actually already used by
167 svgalib. Xfree coders worked on svgalib and vice versa. But honestly,
168 do not expect that a driver from Xfree can just be used for svgalib.
169 The internal structures of Xfree and svgalib (and GGI) are just too
170 different. As a source of knowledge and for one or the other subrou‐
171 tine, the Xfree sources are invaluable however.
172
173
174 Q 6)
175 Why not just use the VGA BIOS?.
176
177
178 A)
179 Actually, we do. There is now, thanks to Josh Vanderhoof, a VESA
180 driver. The VESA driver does not work on all cards, even though it
181 should. It does not even work on all cards where vbetest works. If
182 vbetest does not work it means the bios writers assumed it would always
183 run in DOS, and used tricks (for delay, etc.) that can't work under
184 Linux. If vbetest works, but the VESA driver does not, I (Matan Ziv-Av)
185 believe it is due to the following reason: The driver use VESA function
186 4 (save/restore video state). This function can't be used in a single‐
187 tasking environment (DOS) and as such, some bios writers failed to
188 implement it properly, and all the tests (which are run under DOS)
189 failed to discover this.
190
191 The VESA driver does work with many cards though.
192
193
194 Q 7)
195 What about GGI?
196
197
198 A)
199 Yes, GGI. Another long story. At first: Yes, I like the idea of an in
200 kernel graphics driver. I like it very much. And, yes, this is a bit
201 weird because I am the svgalib maintainer and a working GGI will make
202 svgalib obsolete. Again, I already said above: I did not invent svgalib
203 nor do I promote it as the solution (now compare this to GGI). It just
204 does what it does and works for me and some other people.
205
206 I liked this idea so much, I even started coding a frame buffer device
207 once. After a short time, other people came out with the GGI idea.
208 Right from their beginning they claimed to be the only source of wis‐
209 dom. I tried to join our efforts, but failed. In general we have the
210 same goals (read the GGI project pages for that).
211
212 Anyhow, at that time a flame war started. I don't really know why. I
213 don't see I did anything else than offering my opinions, work and expe‐
214 rience. But that should be judged by others.
215
216 Well, after some time I stopped bothering them. I was satisfied to
217 learn later though that they actually came up with some conclusions I
218 proposed first but weeks or months later. But let us leave the past
219 alone.
220
221
222 When intending to contribute to svgalib, you should think about what
223 you really want. I don't see that GGI is becoming available soon. GGI
224 people told me the opposite again and again, ok, I still don't see it.
225 Still out of a sudden, everything might be GGI infested, so you might
226 consider contributing to GGI instead.
227
228 With svgalib you might be able to use your fruits earlier. And anyone
229 (with supported hardware) can just use it right away without rein‐
230 stalling kernel/X11 what else (maybe being unable to use something he
231 did before).
232
233
234 Q 8)
235 Why not just use X11?
236
237 Yes, this is what many people say. This is the common Unix way to do
238 it. X does it.
239
240 But X has some drawbacks:
241
242
243 i) It uses many resources. Admittedly this is becoming of lesser
244 importance now, where you can run a sensible X11 Linux system on
245 8MB (16 MB for heaven like performance) which is the absolute
246 minimum to get a simple text editor running under M$ windows.
247
248 Still, an advantage of Linux is the ability to use old hardware
249 for mission critical background jobs on the net
250 (servers/routers/firewalls) on low price or otherwise even unus‐
251 able hardware.
252
253
254 ii) X has a nice API with draw commands for any kind of 'command
255 oriented' screen output. I mean with that: Select a color, draw
256 a line, polygon, etc.
257
258 This imposes a bunch of overhead. If you just want access to the
259 screen memory, it slows things down as hell. If you want just to
260 use above's draw commands, it is ok!
261
262
263 iii) One can now circumvent the API restrictions by getting direct
264 screen access using a special Xfree extension. Basically Xfree
265 just setups the screen and gives you shared memory access to the
266 screen memory. IMHO, this is not much different from the shared
267 memory X11 extension by MIT (which is probably why it was added
268 so easily). Still it needs quite some overhead, at least when
269 the card does not allow for a linear frame buffer.
270
271 However, you cannot change screen modes and rez as easily. This
272 is IMHO THE drawback of X. For a picture viewer, you want 256
273 color high/true color modes on a per picture basis (also, insert
274 any other application you like: movie viewers, a special game, a
275 drawing program). Also, you want a small picture use a low rez
276 s.t. it does not appear as a thumbnail, maybe use a high rez
277 mode for a huge picture which you don't want to use on a perma‐
278 nent basis because it flickers like hell (and you don't want to
279 use a panning virtual desktop too, I hated them at best).
280
281 This latter restriction can of course be circumvented by enlarg‐
282 ing the picture. But this will need much time for a picture
283 viewer already and certainly too much for smooth video or game
284 animations.
285
286
287 iv) Finally, the problem how X11 itself accesses the screen is not
288 solved. Security is usually no concern because X11 does it, is
289 a trusted executable and a firewall between applications and the
290 hardware.
291
292 Alas, there might be security holes, also the stability and per‐
293 formance issues (IRQ driven accelerator queue, CPU support for
294 VGA memory paging) still exist, though one can expect an Xserver
295 to be a generally well coded application.
296
297
298 Q 9)
299 Now, again, what about the future of svgalib?
300
301 For console graphics, svgalib is still the only solution for most peo‐
302 ple, and as such it should go on for a while. Compared to the other
303 console graphics options (kgi and kernel fb device), writing svgalib
304 driver is the simplest (at least, this is my experience), and so it
305 makes sense to believe that svgalib will work on all cards where there
306 is someone interested enough in that support.
307
308
309 Q 10)
310 Ok, just for completeness, what are your plans about svgalib anyway?
311
312 First, make svgalib cooperate nicely with kernel fb device. Then (and
313 it should be very similiar) make svgalib work on a secondary vga card.
314
315 A rewrite of the code for memory handling and virtual console handling
316 is necessary for the previous goals, but is also necessary in itself,
317 and so will be done also.
318
319 I do intend to maintain complete binary compatibility, so that older
320 programs will go on working.
321
322 As internal changes are made, the drivers have to be changed as well.
323 For some of the older drivers (ali, ark, ati, et3000, et4000, gvga,
324 oak), I no longer get any reports, so I don't know if they still work.
325 Some features are also lost, for example, linear frame buffer on non-
326 PCI cards. This should not be a very big problem, as users with such
327 cards can go on using 1.3.1, as most changes are not applicable for
328 older machines.
329
330
332 svgalib(7), libvga.config(5).
333
334
336 This file was written by Michael Weller <eowmob@exp-math.uni-essen.de>,
337 And later changed by Matan Ziv-Av.
338
339
340
341Svgalib 1.4.1 10 Jun 1999 svgalib.faq(7)