From: Charles Hedrick (hedrick@dumas.rutgers.edu)
Date: 06/28/92


From: hedrick@dumas.rutgers.edu (Charles Hedrick)
Subject: Re: Getting X running...
Date: 29 Jun 1992 01:26:36 GMT

liebgold@mott.seas.ucla.edu (Dan M. Liebgold) writes:

>I apologize if this is a FAQ, but the info did not seem to be readily
>available.

>I have everything installed (I think) correctly for X to run (shared libs,
>binaries, etc). When I type startx, X386 displays the version number
>and the configuration briefly, then the screen is cleared, and the system
>freezes.

I've just spent the weekend playing with X11 on Linux. I'm no expert,
but in the course of experiments I've seen lots of different failure
modes. So I thought I'd tell you what I learned. First, you imply
that you're using Xconfig as is. That's unlikely to work, because
there's too much stuff in it. I recommend producing a minimal
Xconfig, all of whose lines you understand.

As far as the display portion of Xconfig goes, you can find the
information needed in vga.dbase, which is included in the doc
subdirectory. Find your SGVA card in the first section of vga.dbase,
and use that to construct a "clocks" line. E.g. my card is a
Cardinal. It's listed in the file with a line

  ET4000 1024 1024 768 25 28 38 36 40 45 32 0 "1024x768" Legend

The 8 numbers in the middle are the clocks, resulting in a command of

  Clocks 25 28 38 36 40 45 32 0

in the configuration file. If your card isn't listed, use clocks.exe
(whereever it is -- I didn't see it) under DOS to produce this line,
or omit the Clocks line and let X11 figure it out. Next, look for you
monitor in the second section of vga.dbase. The lines there can
probably be used as is in the Xconfig file. However you'll want to
choose only the lines that match clock speeds your card has. I
believe it can confuse X to have lines that don't match clock speeds.
E.g. I have a NEC Multisync II. It is listed as follows:

 "640x480" 28 640 676 776 812 480 480 485 505
 "752x564" 36 752 788 916 952 564 564 569 594
 "800x600" 40 800 864 1000 1056 600 600 605 631

I put those lines as is in the ModeDB section, after verifying that I
have clocks for 28, 36, and 40. Suppose I had 35 but not 36. I'd
still try all three lines, but I'd change the 36 in the second line to
a 35, so that the speeds match. You should always be able to use a
slower clock, though it may cause flicker if the difference is
significant. You may also be able to use a faster clock, though if
you go much faster, you'll probably exceeed the monitor's ability to
sync the signal and get hash. If you change the clock speed in theory
you may need slight changes in the other numbers to get the image
exactly centered on the screen, etc. But that's a second-order
correction you can worry about later (or with my monitor, you can fix
it by using the controls on the monitor).

Finally, make sure that the Modes specification matches one of those
lines. E.g. I use

  Modes "752x564"

I could also use "640x480" or "800x600". I chose this rather than
800x600 because the refresh rate is higher and I was afraid I was
sensitive to flicker at the 60 Hz refresh rate implied by the 800x600
entry. This may be wrong.

Normally when the screen goes black and the system hangs, the Modes
command didn't match any of the lines in ModeDB, but I believe it can
also be caused by having clocks not match. Once you've done this, you
should see at least something on your screen, even if it's hash. If
you see multiple images, add the line

  Vendor "hiclock"

to the vga256 section. If things don't sync, the lines in the ModeDB
section are probably wrong. Hopefully this won't happen if you take
lines from vga.dbase, as those should be tested, but of course
nobody's perfect.

Once I got things working, I tried tweaking the speeds. E.g. I found
that 752x564 actually worked with a clock of 38 as well as 36. This
results in a slightly higher refresh rate, which should make the image
somewhat nicer to look at. That is, I changed the 36 to 38 in

 "752x564" 36 752 788 916 952 564 564 569 594

If I try to take it up to 40, the monitor loses sync and produces
hash. Just for grins, I decided to see how much resolution I could
get. I found I could push the Multisync to 896x696, using a line

 "896x696" 45 896 966 1120 1176 696 696 701 730

However this implies a refresh rate of 52 Hz. Not surprisingly, it
flickers. To compute the refresh rate, divide the clock rate (which
is in MHz, so 45 becomes 45000000) by the product of the horizontal
and vertical sizes, the last numbers in the two groups. In this case,

  45000000 / ( 1176 * 730 ) = 52