So you’ve finally seen the light, and decided to install Linux on your PC. Everything installs just fine, but you’re stuck with an unsupported display card, or one for which the supplied drivers don’t work properly. Worse, you could be stuck with a SiS 6215 card.
This can cause a serious problem. For one, many ex-Windows users get withdrawal symptoms if they’re not able to click a button or play Solitaire or Minesweeper. But the real issue is that many of the better configuration and management tools available for Linux demand a Graphical User Interface (GUI).
At Exocore Consulting, we run into cards like this almost everyday, and so–with a little help from the Linux India mailing list–have come up with an almost foolproof way of getting X running on such cards, using no software other than what can be found on a standard Red Hat Linux 6.1 CD. Here, we share this knowledge with our readers.
Background
Most display cards manufactured since 1996 support a display mode called FrameBuffer, accessed using standard BIOS calls using the VESA 2.0 standard. Even the infamous SiS cards support this mode.
Most recent Linux distributions include support for this mode of display, and ship with a FrameBuffer-aware X server. While the following technique applies to most Linux distributions, we’ll concentrate on the one shipped by PC Quest with the November 1999 issue–Red Hat Linux 6.1.
We assume that you’ve installed Linux correctly, and that you didn’t manage to install X properly (otherwise you wouldn’t be reading this article). We also assume that you’re using the stock Linux kernel from the CD and have not recompiled one of your own (all RHL 6.1 kernels have VESA FrameBuffer support compiled in).
Please note that the entire procedure requires you to be logged in as root.
Step 1:
Installing the software
Insert your November 1999 PCQ CD (or any Red Hat Linux 6.1 CD) and mount it
mount /mnt/cdrom
Now install the required packages (some of these may already be installed, so ignore any error messages about this fact). Pay attention to capital and lower case letters.
cd /mnt/cdrom/RedHat/RPMS
rpm -ivh XFree86-VGA16*.rpm
rpm -ivh XFree86-FBDev*.rpm
rpm -ivh Xconfigurator*.rpm
rpm -ivh fbset*.rpm
Step 2: Testing compatibility
You need to make sure that our technique will work for you, so you need to find out whether your display card has a VESA 2.0 BIOS.
To do this, reboot the system. At the LILO prompt, type the following command:
LILO: linux 3 vga=xxx
where “xxx” is a number taken from the table above.
A safe value would be 771, which means a resolution of 800x600 and 256 colors–most monitors and display card combinations should support this. Try 773 only if you’re sure that your card has at least 2 MB RAM, and that your monitor can support a resolution of 1,024x768.
Don’t try any higher combinations for now, you can always change things later.
After entering the command, for example “linux 3 vga=771”, hit Enter. What do you get? Did your screen blank out for a moment, and reappear with a little penguin in the top corner? Congratulations! You’re now in framebuffer mode, and the rest of this article should apply to you. By the way, even though you’re seeing text, you’re actually in graphics modes. So, text scrolling may be a bit slower than you’re used to, but as a compensation, you get more text on your screen.
If it didn’t work, then you either have a card with no VESA support or one that supports only VESA 1.2, or you aren’t using the default kernel shipped with Red Hat Linux 6.1. In either case, this technique won’t work for you.
If the screen blanks out or distorts, it probably means that
your card supports the setting, but your monitor doesn’t. Hit Ctrl-Alt-Del and
reboot the system (it might take a while, but is safe enough) and try a lower
resolution.
However, assuming that it did work, we’ll move to the next
step.
Step 3: Setting up LILO
Edit the file /etc/lilo.conf, and insert the following line before the first
"image" statement:
vga=xxx
where "xxx" is again the value you used while booting.
Save the file, and run the command
lilo -v
to update the LILO setup.
Reboot the system again to make sure it works–this time you
should get the penguin without having to type any commands at the LILO prompt.
Step 4: Setting up your monitor
Now we come to the more complicated part, so pay close attention.
First of all, you need to run Xconfigurator
Xconfigurator--server VGA16
Note that there are two hyphens before "server",
and no spaces between them or between them and the word "server". And
VGA16 is in capital alphabets.
This will set up X to use the generic VGA driver in 16-color
mode. Don’t worry, we aren’t going to leave it at that–the real objective
here is to specify your monitor, we’ll change the X server presently.
Xconfigurator will now prompt you for the specifications of
your monitor. If you can find the exact model you have, select that, otherwise
use the Custom Monitor setting. Don’t attempt to use a "similar"
model–it probably won’t work for you.
VGA settings in LILO |
||||
640x480 | 800x600 | 1,024x768 | 1,280x1,024 | |
256 colors |
768 | 771 | 773 | 775 |
32K colors |
784 | 787 | 790 | 793 |
64K colors |
785 | 788 | 791 | 794 |
16M colors |
786 | 789 | 792 | 795 |
If you found your exact monitor model, ignore the next few
paragraphs, and go to the paragraph that talks about probing.
If you used the Custom Monitor setting, you’ll be prompted
for some parameters about your monitor. This is a good time to have your monitor
manual at hand.
The first parameter is the horizontal sync value applicable
for your monitor. Most monitors can take Extended Super VGA 800x600, though you
can choose the value that’s applicable to your monitor. Check your monitor
manual for details.
Next you’ll be asked for the vertical sync range. Use the
values closest to the ones in your manual.
Now Xconfigurator will ask you whether it can probe for
screen resolution and color depth. Select "Don’t probe" here. Next,
you’ll be asked for the amount of screen memory you have. Don’t lie–select
the correct amount of video memory you have. If you aren’t sure, we suggest
that you select 1 MB, which is the least any card ships with today.
When asked about Clockchip Configuration, select "No
Clockchip Setting".
Select "Skip" when asked whether you wish to run
"X -probeonly".
Next you’ll be asked whether to test your X configuration.
Select "Skip" here, too.
Finally it will save the configuration.
Next, we need to make a few changes in the X configuration file.
cd /etc/X11
Here, we’ll first make a copy of the file XF86Config.
cp XF86Config XF86Config.backup
Now edit the file XF86Config using your favorite text editor.
Scroll down and locate the part of the file called
# *****************
# Screen sections
# *****************
Just below that, you should find a section that looks like
this
# The Color SVGA server
Section "Screen"
Driver "svga"
Device "Generic VGA"
Monitor "My Monitor"
Subsection "Display"
Depth 8
#Modes "640x480" "800x600" "1024x768"
"1152x864"
ViewPort 0 0
EndSubsection
EndSection
You might find a difference in the "Monitor"
setting–that’s okay.
Duplicate this entire section, and change it so that it looks
as follows:
# The FrameBuffer Device server
Section "Screen"
Driver "fbdev"
Device "Generic VGA"
#Device "My Video Card"
Monitor "My Monitor"
Subsection "Display"
#Depth 8
Modes "default"
ViewPort 0 0
EndSubsection
EndSection
Notice that we’ve changed the driver name from "svga"
to "fbdev". We’ve commented out the "Depth" setting, and
changed the Modes statement to
"default".
The important thing is that the "Monitor" setting
must not be changed.
Save the file.
Now we need to tell X to use the Framebuffer Device X server
instead of the generic VGA16 server. Run the following commands:
rm -f /etc/X11/X
ln -sf /usr/X11R6/bin/XF86_FBDev /etc/X11/X
Time to test things out. Run the command
X
Yes, that’s a single, capital alphabet–X.
Did your screen blank out, then reappear with a hatched
pattern on it, with an X-shaped mouse cursor in the center?
If so, congratulations! You have functional X. Now kill the X
server (Ctrl-Alt-Backspace), run
startx
and enjoy your functional X desktop.
If it didn’t work, there could a couple of reasons for
this.
-
The mode you selected for the VGA
setting in the LILO configuration may not be supported by X. In many cases,
we’ve found that you can only get 256 colors, and you may have specified a
higher color setting. Try the lower settings. Like we said, 800x600 at 256
colors is a safe enough value to try. -
Your monitor may not actually
support the resolution you’ve selected–try a lower resolution. -
You may have made a mistake
following the steps given here. Start again from the beginning, and be very
careful.
Remember, if the screen blanks out or distorts, you can kill
the X server with a Ctrl-Alt-Backspace. This is a sign that your card can take
the settings but that you’ve configured the monitor to a higher resolution
than it can take.
If, despite everything, it doesn’t work, take heart from
the fact that you’ve given it your best shot, and go and get yourself a
display card that’s supported. Most Cirrus Logic, Matrox, Intel i740, Trio64,
and other S3 cards will work just fine. Ask on the Linux India mailing list for
feedback before committing to a new card, or make sure that you test the card
with Linux and X before you pay for it.
Hopefully, this article will put to rest the raging debate
about supported video cards. There are very few cards that don’t support this
technique, and if you ever run into a friend who has an unsupported card (and
who is not a PC Quest reader), elevate yourself to new levels of "Gurudom"
by setting up X on his/her machine.
Best of luck!
Atul Chitnis is a technology consultant with Exocore Consulting <www.exocore.com>.
He regrets that he can’t reply to individual queries, but encourages you to
contact the Linux India mailing list <www.linux-india.org/subscribe.shtml>.