Add externs to avoid multiple definitions, and then add missing definitions.
[rrq/maintain_lilo.git] / readme / README.bitmaps
1         Notes on the use of Bitmap boot screens
2                 LILO 22.3 -- 11-Apr-2002
3
4
5 SUMMARY OF CHANGES (LILO 22.3)
6 ==============================
7
8 LILO 22.3 no longer requires placement parameters in the configuration
9 file (/etc/lilo.conf).  Instead, text menu size, placement, and colors
10 may be edited into the bitmap file header using "lilo -E file.bmp".  The
11 parameters may also be saved from the bitmap file header to a companion
12 configuration file, "file.dat", as an option to the edit command. Param-
13 eters may be transferred from the companion '.dat' file to the bitmap
14 file header using the command "lilo -E file.dat".  LILO 22.3 still rec-
15 ognizes bitmap file formating commands in '/etc/lilo.conf'.
16
17 This change allows bitmap graphics to be exchanged among users without the
18 tedious need to exchange the color/positioning information separately.
19
20
21
22 MOTIVATION
23 ==========
24
25 The makers of several Linux distributions which include LILO as the boot
26 loader have issued patched versions which support graphical screens for
27 kernel selection.  However, each distribution seems to have chosen a
28 different screen resolution, and different file-type to implement the
29 graphical (bitmapped) background.  In order to try to bring some order
30 to this array of different implementations, and to support common code
31 across all Linux distributions, I submit the following implementation of
32 a graphical background and menu driven interface (cursor keys only) for
33 kernel selection.
34
35 The choice then was to have the implementation run on the widest array
36 of graphics hardware in use today.  VGA is the common standard, and this
37 dictates a choice of two color modes:  320x200x256 and 640x480x16.  The
38 VGA/VESA standard extends the modes to add 640x400x256, 640x480x256, and
39 800x600x256 as possible choices.  However, most high-end graphics cards
40 provide graphics acceleration through other means than the VESA standard;
41 and, in actual fact, are moving away from supporting the full spectrum of
42 VESA modes.  Older VGA systems often do not have VESA extensions in ROM
43 BIOS, so the choice narrows to the two modes in the original IBM VGA BIOS.
44
45 Character generation in the 320x200x256 mode is generally limited to an
46 8x8 character cell, and is not visually appealing.  The 640x480x16 mode
47 uses an 8x16 character cell, and is acceptable.  The question was the
48 limitations to 16 colors.  This is less of a restriction than one might
49 think it is.  There are the 16 EGA-compatible colors, which are the BIOS
50 defaults on all systems; but the VGA palette is programmable with 6 bits
51 alloted to each primary color.  Some experimentation with graphics images
52 convinced me that very appealing logos could easily be generated, as long
53 as the graphics editor in use would allow ANY 16 colors to be chosen from
54 among the 256K available.  Good dithering algorithms exist, and the screens
55 that I produced with dithered 16-color images, in my opinion, were more
56 acceptable than 256-color images.  In these latter cases, as a color area
57 transitions from one shade to another, the stepping effect is more notice-
58 able, and more objectionable, than a good dither.
59
60 With this said, the choice of VGA 640x480x16 (mode 0x12) was settled upon.
61
62 Then the choice of a graphics screen file format had to be settled.  It
63 had to be universally supported, be well documented, allow for image
64 compression, and allow for easy decompression.  File formats considered
65 included PCX, GIF, and BMP.  The last was chosen because it is understand-
66 able, and the run-length compression is very easy to expand.
67
68
69 USAGE
70 =====
71
72 Update (22.3):  The three keywords 'bmp-table', 'bmp-colors', and 'bmp-timer'
73 are now primarily to be used in the configuration file used as a companion
74 to a bitmap file.  The bitmap file must have the filename extension ".bmp",
75 and the companion configuration file must have the filename extension
76 ".dat".
77
78 Four keywords are added to 'lilo.conf' to allow the usage of bitmap screens:
79
80         bitmap     =            #specifies the bitmap file to be used as
81                                 #a background
82
83         bmp-table  =            #specifies the location of the table of
84                                 #image/other names, and its layout
85
86         bmp-colors =            #specifies the color attributes of the table
87                                 #entries, normal & highlighted
88
89         bmp-timer  =            #specifies the position and color attributes
90                                 #of the timeout timer
91
92         install = bmp           #specify the boot loader with bitmap
93                                 #graphics capability
94
95 'bitmap=' specifies the graphic file to be used as a background screen.  It
96 must be 640 x 480 x 16 colors, and may be saved as an uncompressed bitmap
97 file (153718 bytes), run-length encoded (compressed) bitmap file, or an OS2
98 bitmap file (153674 bytes).  It is suggested that you use the smallest,
99 which will probably be the RLE (compressed) file.  When a 'bitmap=' file is
100 in use, 'message=' may not be used, and vice versa.
101
102 'bmp-table=<list>' specifies the position and table layout of the boot 
103 selection menu.  The list is a series of up to 5 decimal values, separated
104 by commas, and containing no spaces.  Values may be omitted in order to use
105 default values, but the comma separators are required as placeholders.  In
106 designing the bmp-table layout, consideration must be given to the upper
107 limit on kernel image/other names.  LILO guarantees that up to 16 may be
108 specified, and the current implementation allows up to 19.  It is suggested
109 that the table layout design allow for 18 entries.
110
111   bmp-table = [x],[y],[ncol],[nrow],[xspc],[spill]
112
113         [x]     specifies the column position [1..80] of the first column
114                 of the table.  Character addressing is assumed, unless the
115                 coordinate is suffixed with 'p', in which case pixel ad-
116                 dressing will be used [0p..632p].
117
118         [y]     specifies the row position [1..30] of the top row of the
119                 table.  All screen text is placed on a 30 row grid.  Pixel
120                 addressing [0p..464p] is allowed.
121
122         [ncol]  specifies the number of columns used for the display of the
123                 kernel image/other entries.  The current implementation
124                 requires the number of columns to be in the range [1..4].
125
126         [nrow]  specifies the number of rows in each column; i.e., the
127                 height of each column in the table.
128
129         [xspc]  specifies the column spacing from the beginning of one
130                 column to the beginning of the next column.  Since names in
131                 the table are up to 15 characters, plus 2 spacers, 17 is an
132                 absolute minimum for this value.  The column spacing
133                 increases as this value is increased.  Too large a value may
134                 spill characters beyond the edge of the screen.  Pixel
135                 addressing is allowed, if the value is suffixed with a 'p'.
136
137         [spill] specifies the number of entries which may fill a column
138                 before the column spills to the next column.  The default
139                 value for this is 4 entries.  (LILO 22.3)
140
141
142 'bmp-colors=<list>' specifies a list of six color numbers, each in the range
143 [0..15].  The first three specify the color attributes of normal text in the
144 boot selection table, and the second three specify the color attributes of
145 the highlighted text in the menu.  The list is comma or semicolon separated,
146 with no spaces.  However, default values may be indicated by omitting a
147 numerical value altogether.  Each of the two triples consists of a fore-
148 ground color, background color, and a shadow color.  The foreground color is
149 the color used to display the letter or numeral.  The background color is
150 the fill-color of the 8x16 box which encloses the character.  If the back-
151 ground color value is omitted from the list, then "transparent" is assumed.
152 The shadow color is the color used to display a character shadow displaced
153 one pixel in both X & Y toward the lower right.  If shadows are used, they
154 generally specify a color of low luminance.
155
156   bmp-colors = [fg],[bg],[sh];[h-fg],[h-bg],[h-sh]
157
158         [fg]    specifies the foreground color for normal text.
159
160         [bg]    specifies the background color for normal text.  If omitted,
161                 the background is taken to be transparent, and the
162                 underlying bitmap color shows through.
163
164         [sh]    specifies the shadow color for the character.  If omitted,
165                 no shadow is displayed.
166
167         [h-fg]  specifies the foreground color for the line of highlighted
168                 text.
169
170         [h-bg]  specifies the background color for highlighted text.  If
171                 omitted, the highlighted background is taken to be
172                 transparent.
173
174         [h-sh]  specifies the shadow color for highlighted text.  If
175                 omitted, no shadow is displayed.
176
177                 Note:  in the list specification above, the semicolon has
178                 no special significance; it could have been a comma.  Its
179                 use is suggested merely for distinguishing the two triples,
180                 as spaces (blanks) are not allowed in the list.
181
182
183 'bmp-timer=<list>' specifies the position at which the 'timeout=' timer will
184 be displayed, as well as the color attributes of the characters in the
185 display.  If the line 'bmp-timer=' is not used, then no timer will be
186 displayed.  If the <list> is specified as "none", then no timer (as speci-
187 fied in the bitmap file header) will be displayed.
188
189   bmp-timer = [tx],[ty];[t-fg],[t-bg],[t-sh]
190
191         [tx]    specifies the column at which the first of five characters
192                 in the timer display will be positioned.  It must be in the
193                 range [1..80], or [0p..632p] if pixel addresses are used.
194
195         [ty]    specifies the character row position of the timer display. 
196                 It must be in the range [1..30], or [0p..464p] if pixel
197                 addresses are used.
198
199         [t-fg]  specifies the foreground color of the timer characters.  If
200                 omitted, the normal foreground text color will be used.
201
202         [t-bg]  specifies the background color of the timer character
203                 display.  If omitted, color '0' will be used.  It is not
204                 possible to have a transparent timer background.
205
206         [t-sh]  specifies the shadow color for timer display characters.  If
207                 omitted, no shadow is displayed.
208
209                 Note:  the semicolon in the list specification is for
210                 readability only; a comma could have been used as well.
211
212
213
214 EXAMPLE
215 =======
216
217 The following is excerpted from 'bmp.conf', a LILO configuration file which
218 has been used during the development of the bitmap-capable boot loader.
219
220 File:  bmp.conf (substitute for 'lilo.conf'):
221
222         ...
223         #
224         #  The following parameters select appropriate colors
225         #  and proper screen positions for the 'logo64a.bmp' graphic.
226         #
227         bitmap=logo64a.bmp
228         bmp-colors=6,9,0;15,9,0
229         bmp-table=59,5,1,19,
230         bmp-timer=66,28,6,8,0
231         ...
232
233 Update (22.3):  If the color information and screen positions specified on
234 the last three lines above have been transferred to the LILO sub-header in
235 the bitmap file "logo64a.bmp", then the entry in 'lilo.conf' can be
236 shortened to:
237
238         ...
239         #
240         #  Select the bitmap file to display.  Text positioning information
241         #  is in the LILO subheader in the bitmap file.
242         #
243         bitmap=logo64a.bmp
244         ...
245
246
247         ...
248         #
249         #  The following parameters select appropriate colors
250         #  and proper screen positions for the 'ins64a.bmp' graphic.
251         #
252         bitmap=ins64a.bmp
253         bmp-colors=14,11,;15,9,0        # omit this line for lilo 22.3
254         bmp-table=21,287p,2,4,175p      #  ditto
255         bmp-timer=73,29,12,8,0          #  ditto
256         ...
257
258 Both bitmap files are available in the source code tarball at:
259
260         http://lilo.go.dyndns.org/pub/linux/lilo
261
262 They are located in the 'sample' subdirectory, along with companion
263 '.dat' configuration files.
264
265
266 USAGE COMMAND
267 =============
268
269 With version 22.3, '/sbin/lilo' becomes, in addition to the boot installer,
270 the bitmap file header editor.  A single switch, '-E' is added to accomplish
271 this new task.  It has two uses:
272
273         lilo -E filename.bmp
274                 or
275         lilo -E filename.dat
276
277 In the first case, if the bitmap file is fresh out of a graphics editor, it
278 will have no LILO sub-header.  The first edit command is used to alter the
279 default values for color and positioning information, and to save the new
280 values to the LILO sub-header in the bitmap file.  The editor is
281 interactive, and allows you to change one parameter at a time.  When you
282 write out the updated bitmap file, you are given the chance to create a
283 companion text configuration file, 'filename.dat', which contains a readable
284 copy of all of the text color and positioning information in the header.
285
286 In the second case, the abbreviated configuration file, 'filename.dat',
287 contains only the commands:  "bitmap=", "bmp-table=", "bmp-colors=", or
288 "bmp-timer="; all are optional.  If "bitmap=" is omitted, then
289 'filename.dat' is taken to correspond to the bitmap file 'filename.bmp';
290 i.e., same name, diffenent file extension.  Otherwise, the configuartion
291 file corresponds to the bitmap file specified by the "bitmap=" option.  The
292 color, positioning, and timer information in the configuration file is
293 transferred to the LILO header in the bitmap file.  If no such header
294 exists, one is created.
295
296 The primary use for the '.dat' file is to save the LILO header information,
297 so that the bitmap graphic may be edited with a graphics editor.  No
298 graphichs editor recognizes the LILO header, so an updated bitmap graphic
299 file will be without the LILO header.  The second form of the edit command
300 allows the header to be recreated very quickly, exacltly as it was before.
301
302
303 TRADEMARKS
304 ==========
305
306 Windows is a trademark of Microsoft Corporation.
307 OS/2 and OS2 are trademarks of IBM Corporation.
308
309 (end)
310 written 05/07/2001 -- John Coffman <johninsd@san.rr.com>
311 updated 05/10/2001 -- John Coffman
312 updated 11/25/2001 -- John Coffman (typos corrected)
313 updated 04/11/2002 -- John Coffman (update to LILO 22.3)
314