• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

man1/H06-Aug-2000-841698

man3/H25-Sep-2000-10,6428,777

man5/H03-May-2022-1,3371,157

man6/H06-Aug-2000-2,6512,308

man7/H03-May-2022-3,7123,205

man8/H06-Aug-2000-1713

0-READMEH A D03-Aug-1997868 3220

CHANGESH A D02-Jun-200136.9 KiB1,000769

CHANGES.mach64H A D11-Apr-19982.3 KiB7550

DESIGNH A D02-Aug-19974.7 KiB8772

Driver-programming-HOWTOH A D05-Jul-19998.4 KiB217173

MakefileH A D06-Aug-20003.1 KiB10386

NEWSH A D11-Feb-2000428 137

README.joystickH A D24-Mar-19982.8 KiB8465

README.kernel-2.4H A D16-Jan-2000242 54

README.keymapH A D05-Dec-19988.3 KiB173131

README.lrmiH A D11-Jun-1999460 148

README.patchingH A D31-Jul-19974.9 KiB141106

README.vesaH A D25-Sep-20002.2 KiB6249

TODOH A D12-Oct-20001.3 KiB3925

add_driverH A D12-Jul-1999112 75

svgalib.lsmH A D18-Dec-1999828 1918

tmanH A D03-Aug-1997152 1311

0-README

1Apart from a few readme's, this directory contains all man pages for svgalib.
2
3I case you want to see one prior to installing svgalib, you can use
4
5man -M. manpage
6
7to see the page if you man binary supports it. If not, and if you have
8nroff or groff the tman script in this directy can be used as:
9
10tman manpage
11
12tman will have problems with the compressed files. However, the error
13message will indicate at which manual page you should look instead.
14
15Finally,
16
17make ascii
18make lpr
19make dvi
20make ps
21
22will produce documentation files in these format for nice printouts in
23this directory. 'ascii' is an Ascii file to be viewed on a terminal.
24'lpr' is an ascii file too, but will contain <Backspace> characters
25to emulate bold and underlined on a line printer.
26
27make clean
28
29will remove these files again.
30
31The file ../0-README is actually an ascii printout of svgalib.7
32

README.joystick

1Hi!
2I wrote a set of SVGAlibish joystick routines while I played with porting
3DOSDoom to SVGAlib.
4It is compatible with both the older joystick driver for Linux 1.x and 2.0
5and the newer joystick driver that is in recent 2.1.x kernels.
6Some of the code is ripped from the userland tools joystick-0.6.7 and
7joystick-2.0.6 none of wich has any special license attaced to them.
8
9The files are:
10joydev.h:      my userland version of the kernel joystick.h
11vgajoystick.h: library include file analog to vgakeyboard.h and vgamouse.h
12joystick.c:    the library routines.
13joytest.c:     a simple test program/example
14
15I dunno how useful these will be, but I could at least use them in doom. (Not
16that joystick control in doom adds anything, I just implemented it for
17completeness.)
18
19BUGS:
20Only one joystick device at any time (but the new 2.1.x driver will let you
21map 4 axis and 4 buttons to one logical device).
22
23The routines:
24
25int joystick_init(const char *joydev, int verbose, FILE *file);
26This one inits the joystick routines and opens the device. Returna the
27filedescriptor of the joystick device if successfull or -1 if not.
28Outputs some messages to stdout id verbose is != 0. If file != NULL it will
29try to recalibrate the joystick and output the recalibration instructions to
30the struct file pointed to by file.
31E.g.
32
33if (-1 == joystick_init("/dev/js0, 1, stdout))
34{
35    printf("Joystick init failed\n");
36    exit(1);
37}
38
39void joystick_close(void);
40Shuts down the joystick.
41
42int joystick_update(void);
43Reads the joystick and calls the joystick handler if anything events are
44availible. Should be called every now and then.
45
46
47void joystick_sethandler(__joystick_handler jh);
48Install a user supplied joystick handler.
49
50A user supplied joystick handler would look like this.
51void joystick_handler(int event, int number, char value);
52int event - event type:
53  JOY_EVENTAXIS         an axis has moved
54  JOY_EVENTBUTTONDOWN   a button has been pushed
55  JOY_EVENTBUTTONUP     a button has been released
56int number - the axis or button number for this event 0=x axis or button 1, etc.
57char value - value for axis events (-128 .. 0 .. 127)
58
59void joystick_setdefaulthandler(void);
60Restore the default joystick handler.
61
62char joystick_getnumaxes(void);
63char joystick_getnumbuttons(void);
64Retrun the number of axes/buttons on the joystick.
65
66char joystick_getaxis(int a);
67char joystick_getbutton(int b);
68Querys the jostick state from the default joystick handler if it is used.
69
70The following macros calls joystick_getaxis() or joystick_getbutton().
71joystick_getb1() - Gets button 1
72joystick_getb2() - Gets button 2
73joystick_getb3() - Gets button 3
74joystick_getb4() - Gets button 4
75
76joystick_getx()  - Returns the X axis
77joystick_gety()  - Returns the Y axis
78joystick_getz()  - Returns the Z axis
79
80That all folks,
81
82Daniel Engstr�m
83daniel.engstrom@riksnett.no
84

README.kernel-2.4

1Background mode is not working with kernels in the 2.3 series (due to the
2removing of the possiblity to mmap /proc/self/mem).
3If you wish to use svgalib with kernel 2.3.27 or later, edit Makefile.cfg,
4and comment out the BACKGROUND = y line.
5

README.keymap

1** Svgalib keyboard scancode remapping: the Readme **
2
3** Introduction
4
5After a poll on Slashdot.org about keyboard layouts, I decided to switch from
6QWERTY to the Dvorak simplified keyboard. (Such is the power of Slashdot!) It
7was easy to switch the keymaps used by the console and X and even LILO, but
8svgalib programs that used raw keyboard weren't affected since they interpret
9the keyboard scancodes into characters themselves - often assuming a standard
10US keyboard with QWERTY layout.
11
12In order for my machine to present a ``unified front'' with a single consistent
13keyboard layout, I added to svgalib the ability to remap scancodes. This is
14done in keyboard_getevents(), before the event handler is called, so it will
15work whether or not a program provides its own handler. Programs that do not
16use raw keyboard are not affected, so by setting both the console and svgalib
17itself to use the same keymap a consistent keyboard layout is available to all
18svgalib programs.
19
20
21** Background
22
23When you press or release a key on your keyboard, it sends a byte of data to
24your computer. The top bit indicates whether the key was pressed or released,
25and the lower seven bits hold the scancode, a number that uniquely identifies
26the key. A program on the computer interprets these scancodes as representing
27characters (`A', `%', etc) or actions to be taken (`Page Up', `Back Space') or
28modifiers that alter the interpretation of other keys (`Shift', `Alt', etc).
29Most programs do not perform this interpretation themselves, but leave it up
30to some other piece of software: the system BIOS, or the operating system,
31or the graphical user interface system.
32
33On Linux this is normally done by the kernel or by the X server for X clients,
34but this doesn't meet the needs of some programs (especially games) which
35care more about whether a key is up or down than what it means and treat the
36modifiers the same way as other keys. These programs open the keyboard in `raw'
37mode and deal directly with scancodes.
38
39The problem comes because these programs often do need to interpret the keys
40into characters, or it is important for a certain key to be identifiable to
41the user as being associated with a certain key. For instance, a game player
42might need to type a description of a saved game or be directed to press a
43certain key to activate a game feature. Interpretation of keyboard scancodes
44can be difficult since there are many different keyboard layouts which do not
45have the same associations between scancodes, modifiers, characters, and
46commands. So the author of the program must choose between writing a complex
47and customizable conversion routine that can handle any layout the user might
48have, and a simple routine that is hard-coded to use a single layout. In the
49latter case, users of other keyboard layouts will encounter numerous
50discrepancies between what he or she tries to type and what the program
51interprets.
52
53
54** How it works
55
56Svgalib's scancode conversion is meant to at least partially fill this gap by
57converting the scancodes that the keyboard produces to equivalent, or nearly
58equivalent, scancodes for the keyboard layout that the program expects. The
59program then (hopefully) interprets the new scancode into the intended
60character.
61
62As an example, let us consider a US keyboard with Dvorak layout and the game
63Quake, which expects a US keyboard with QWERTY layout. Both layouts have the
64same scancodes for each physical key, but different characters are produced.
65For intance, the first row of letters produces the scancodes 16 through 27, but
66on QWERTY this produces the charaters qwertyuiop[] while Dvorak produces
67',.pyfgcrl/=. Thus when the Dvorak letter `p' is pressed, the scancode 19
68is interpreted by Quake as the letter `r', which occupies scancode 19 on the
69QWERTY layout.
70
71The solution lies in the fact that svgalib acts as an intermediary between the
72keyboard and the program and has the opportunity to present a different
73scancode to the program than the keyboard produced. In this case we tell Quake
74that the scancode was not 19 but rather 25, which is the letter `p' in the
75QWERTY layout, so when Quake interprets the scancode the correct character is
76produced.
77
78
79** The keymap files
80
81In order to know what scancodes to convert to what other scancodes, a keymap
82file is read which lists scancodes produced by the keyboard and their
83equivalents in the layout expected by the program.
84
85A program called svgakeymap is provided to generate these maps from the
86keytable files in /usr/lib/kbd/keytables; you must have perl for it to work.
87Creating a keymap file with svgakeymap is easy; to make a map to convert
88scancodes from a US Dvorak keyboard to a US QWERTY keyboard as for our example
89above:
90
91  svgakeymap dvorak us > dvorak-us.keymap
92
93The path and .map and .gz suffixes are automatically added if necessary. If
94your keytables are stored elsewhere, specify a complete path. If only one
95keytable is specified, a keymap is generated that performs no conversions but
96contains the correct key names so you can specify scancodes used by fake
97keyboard and mouse events by name instead of by number. If none are specified,
98this is done for the standard US QWERTY layout.
99
100dvorak-us.keymap and default.keymap (the US QWERTY layout) are provided with
101the svgalib distribution and can serve as an example if you wish to make your
102own keymap files manually or create an improved generator.
103
104
105** Configuration
106
107You can specify a keymap to use for all svgalib programs (keeping in mind that
108only those that use raw keyboard are affected) by putting a line like this into
109libvga.config or ~/.svgalibrc:
110
111  kbd_keymap /etc/vga/dvorak-us.keymap
112
113You must specify a complete path to the keymap file. If no keymap is specified,
114no conversion is performed.
115
116You can also override the global keymap by setting the environment variable
117SVGALIB_KEYMAP to point to the appropriate keymap file. This can be useful if
118some programs support alternate keymaps directly but not others, or if
119different users use their own keyboard layouts based on preference.
120
121
122** Security issues
123
124It can be dangerous to let users arbitrarily reassign keyboard scancodes; for
125instance all keys could be routed to an unused scancode, making the console
126unusable. To prevent this, put the option kbd_only_root_keymaps into
127libvga.config; only keymaps owned by root will be accepted, so the available
128keymaps can be limited to safe ones.
129
130
131** Bugs and limitations
132
133There are no known bugs, but there probably are some. If you find any please
134let me know at brion@pobox.com.
135
136Limitations however we definitely have. The scancode conversion performed is
137very simple, and can only achieve 100% success when the keyboard layouts being
138converted between differ _only_ in arrangement of keys while producing the same
139characters from each key. Example: the de facto standard Dvorak keyboard has
140the left and right brackets (`[' and `]') on separate keys, with the curly
141braces (`{' and `}') produced by those keys when shifted. The standard QWERTY
142keyboard produces those characters the same way, the only difference is that
143the keys are a row higher on Dvorak; switching the scancodes around results in
144proper character interpretation. However the official ANSI standard Dvorak
145layout has tho two brackets on _the same key_, one regular and one shifted.
146The curly braces similarly have their own key. These cannot be properly mapped
147by scancode to the QWERTY keyboard since they produce different characters
148in conjunction with modifiers, and the wrong character is produced by the
149program.
150
151This could be worked around by interpreting the modifiers in svgalib and
152simulating the proper modifier/character keypress/release sequences, but it
153would be very complex and would do nothing to help the situation where
154characters on the physical keyboard layout do not exist on the target layout
155(quite likely when dealing with national or language-specific keyboards);
156they cannot be converted into any key sequence since they do not exist.
157
158Ultimately it might be better to set up a ``medium-rare'' keyboard mode where
159keys are interpreted into characters but ``raw''-style non-interpreted key
160press and release events are available.
161
162
163** Further information
164
165There isn't really any further information right now unless you want to Use The
166Source... More to come in the future. If it does you'll find it at:
167
168  Brion Vibber's Svgalib Stuff - http://pobox.com/~brion/linux/svgalib.html
169
170
171-- brion vibber (brion@pobox.com)
172   3 July 1998
173

README.lrmi

1This is a modified version of Josh Vanderhoof's lrmi-0.5 package
2The original is available at http://www.planet.net/pjoshv/
3
4
5
6vbetest - show available modes, and test a mode
7
8mode3 - set mode using vesa bios. It can usually restore text mode after
9        svgalib leaves a non-working text-mode.
10
11vga_reset - call real mode c000:0003, which should be the video card's
12	initialization routine. Should work in some cases when mode3 fails to
13	restore text mode.
14

README.patching

1Patching svgalib
2
3Contents
4
50. Introduction
61. Indenting
72. Structure of the chipset drivers
8
90. Introduction
10
11	Here is some info on writing patches and/or adding support for
12	further chipsets. The info on the chipset drivers is outdated, but
13	better than nothing and get you started.
14
15	As a side note, other than a.out, ELF does not allow to have some
16	symbols global to svgalib which are not accessible to user
17	programs.
18
19	Because of that, if possible all the symbols and functions in your
20	program should be static. Those which can not be static should
21	have a name like: "__svgalib_*" to mark them as internals s.t.
22	people using them get what they deserve. Please do only add a new
23	function to the user interface if it is really unavoidable. Better
24	add some new parameters to an existing function.
25
26	Adding a new function would definitly result in loosing a.out
27	compatibility thus removing the chance to use new cards and such
28	with old a.out binaries where the source is not available (doom
29	comes to mind).
30
31	A new function should be really important to outweigh this draw
32	back.
33
341. Indenting
35
36	Due to some request (and I heard it b4) all the sources were now
37	automatically indentified.
38
39	There were some requests for indent -gnu but it looks painful. I
40	opted for -kr (there were requests for it as well) as it is not
41	only nicer but also what is done in the linux-kernel and this is
42	certainly a program only usable for linux.
43
44	I dunno if emacs is confused by -kr, but to be honest this is a
45	big all-in-one egg-giving-wool-milk-sow (as we say in german), and
46	you won't tell me that this several megs beast is unable to edit
47	this and I can't use -kr due to some restrictions of emacs. That
48	would be really ridiculous. If it is the case just make emacs
49	better.
50
51	The OneModeEntry macro is eaten by indent (I would say it is an
52	indent bug, I might send a bug report to them), please ensure (if
53	at all possible) that your code can be passed through indent (use
54	the INDENT-OFF comments as shown in some sources for
55	OneModeEntry).
56
57	You can use `make indent-gnu' (if you have a recent enough (I use
58	1.9.1) indent) to switch to your favorite style. But please ensure
59	your patches fit into this now declared as "official style"
60	sources. (Use `make indent' to reformat).
61
62	Do not use it too often though as most indent's tend to add empty
63	lines at certain places in the source.
64
652. Structure of the chipset drivers
66
67	The chipset specific registers saving function (saveregs) is only
68	used directly to save the textmode registers at initialization.
69
70	The chipset specific registers restoring function (setregs) is only
71	used directly to return to textmode, and when setting a VGA mode
72	after an SVGA mode.
73
74	The registers for each mode are stored like the ET4000 modes in
75	VGAlib 1.2, i.e. the extended registers at the end. The following
76	functions must be provided in a driver:
77
78	saveregs( unsigned char regs[] )
79		Saves the chipset-specific registers in regs, starting at
80		array index EXT (after the VGA registers).
81
82	setregs( unsigned char regs[] )
83		Sets the chipset-specific registers stored in regs from
84		index EXT.
85
86	modeavailable( int mode )
87		Returns nonzero if mode is available (should check video
88		memory).
89
90	getmodeinfo( vga_modeinfo *modeinfo )
91		Fills in chipset specific field of mode information
92		structure: maxlogicalwidth, startaddressrange (mask of
93		significant bits), and maxpixels (video memory divided by
94		the number of bytes per pixel). haveblit indicates whether
95		bitblt functions are available.
96		Note: providing extended info and an aperture with size
97		>= memory and setting bits 4 and 6 in flags will
98		automatically enable linear addressing support.
99
100
101	setmode( int mode, int previous_mode )
102		Sets all registers for a mode; returns nonzero if mode not
103		available. __vga_setregs can be called to set the VGA
104		registers.
105
106	unlock()
107		Unlocks chipset-specific registers.
108
109	lock()
110		Lock (protect) chipset-specific registers. Currently not
111		called.
112
113	test()
114		Identify chipset; initialize (check memory and type) and
115		return nonzero if detected.
116
117	setpage( int page )
118		Set 64K page number to be mapped at 0xa0000.
119
120	init( int force, int par1, ... )
121		Initialize memory and type; called by test. If force is 1,
122		the chiptype or the amount of memory can be forced (this
123		is pretty useless).
124
125	The following functions provide for things like page flipping
126	and hardware scrolling virtual desktops.
127
128	setdisplaystart( int address )
129		Sets the display start address in video memory in pixels.
130
131	setlogicalwidth( int width )
132		Sets the logical scanline length in bytes. Usually a
133		multiple of 8.
134
135	The function getchipset() in vga.c must call the test routine for
136	the chipset. The chipsetfunctionslist must be have a pointer
137	to the chipsetfunctions table for the chipset (which is the only
138	global symbol in a chipset driver). Also, vga.h contains a magic
139	number for each chipset. Also driver_names[] in vga.c has to
140	contain a name for each driver at the correct position.
141

README.vesa

1Notes for the VESA driver:
2
3The driver's autodetection is disabled by default, so in order to use it,
4the line
5chipset VESA
6must be added to the config file (usually /etc/vga/libvga.config).
7
8The error:
9Int 0x10 is not in rom (xxxx:xxxx)
10is usually caused by running linux using loadlin, after loading a dos tsr
11that changes the int 10 vector, or after windows 95, that does the same
12thing. The solution, is either to use lilo, or run loadlin after a clean
13dos boot.
14
15
16There is a new config file option that affects the vesa driver:
17VesaText
18If this option is used, the driver sets 80x25 text mode (using vesa bios)
19before setting any standard vga mode.
20
21This option was added in order to enable standard vga modes with the vesa
22driver on Matrox Millenium, but now it has the following effect:
23(read in a fixed width font)
24
25chipset              with VesaText          without VesaText
26
27CL-GD5446              works                leaves a messy font when
28                                            returning to text mode
29
30Riva 128             does not restore           works
31                     previous used text
32                     font, but reverts to
33                     ROM font.
34
35Matrox
36Millenium             works                 does not set standard vga
37                                            modes properly.
38
39A list of cards known to work with the VESA driver is:
40     * Riva128 (both on a STBV128 and a Viper330)
41     * RivaTNT
42     * Matrox Millenium 2
43     * Matrox Mystique
44     * Matrox Productiva G100
45     * Matrox Millenium G200
46     * Neomagic Magicgraph 128XD (in a Dell Inspiron laptop)
47     * S3 375 Virge/DX ( A "Trident Video Excel 3D Accelerator" )
48     * S3 Trio3D
49     * Cirrus Logic GD5446
50     * Rendition V1000 - Only modes up to 800x600 seem to work
51     * ATI Expression+ PC2TV 2MB (RageII chipset) - tested only modes up
52       to 800x600 resolution
53     * ATI Xpert 2000
54     * i740 (Diamond Stealth G460)
55     * Voodoo Banshee
56     * Alliance Technology AT24
57
58Please note that some of this cards have also failed to work in some
59cases, so it is _very_ configuration dependent.
60
61For Matrox cards, the advice is to upgrade to the latest bios from Matrox.
62