Configuring XGA Under Linux (7 June 1997 version) ================================================= Overview ======== This amounts to having the right things in the file /etc/X11/XF86Config. Here I just mention things specific to XGA (or XGA-2) and PS/2. There's a lot of other stuff such as monitor settings (don't screw those up, please), font locations, and pointer configurations that are covered elsewhere. But first, a disclaimer. This is what I've done to get my XGA-1 system working. It works, it hasn't blown a monitor, and I'm happy. However, configuration XFree86 is more of an art than a science. It's rare, but people have been known to damage hardware doing it. It's even easier with the fixed frequency monitors that are common in the PS/2 line. So, if it's not already obvious, I'm not taking responsibility for anything that happens to your hardware, software, or sanity. It works for me (except maybe the sanity part), your mileage may vary. /etc/X11/XF86Config =================== In the "Pointer" section, specify Protocol "PS/2". You may also want to enable "Emulate3Buttons" since most PS/2 mice only have 2 buttons (I use a Logitech MouseMan, which has three. Buy it. It's good). The section "Device" is critical. The values to be filled here are calculated from the XGA POS registers. There are two ways to figure this stuff out - you can calculate them by hand (yeah, right), or you can use the xgapos.c program for this purpose. If you want to do it by hand, the formulas are in the part 6 of "Notes on AGX server", by Henry Worth, dated 24 June 1995, found in file XFree86/doc/README.agx (XFree version 3.1.2). One thing that Henry forgot to mention there is that the instance is in bits 3-1 of POS register 2 (POS registers are counted from 0 to 7). The formulas are also described in detail in the "Update" manual from IBM which is mentioned in the ibmmca.c file. You can get the XGA POS registers from /proc/mca/pos. xgapos.c is by far the easiest, unless you can get the modifed xf86config working for your machine. Just run xgapos.c and copy the output directly into your XF86Config. Once the device section is calculated, you have to enter your monitor settings. The best way to do this is find another XF86Config that uses the same monitor and steal the settings. There's a bunch of different monitor settings in /usr/lib/X11/docs, and there's a few common PS/2 configurations available on glycerine. If you're not absolutely sure what you're doing, stay conservative and go with standard settings (i.e. 640x480 with VESA timings is a good start). Example ======= My /proc/mca/pos has the following line for the XGA-1 adapter: Slot 5: db 8f 1d 5e fd c0 00 00 Running xgapos produces the following: CHIPSET "XGA-1" Instance 6 IObase 0x2160 COPbase 0xc3f00 MEMbase 0xfd800000 BIOSbase 0xc2000 In some cases, xgapos might confuse the chipset (i.e. think XGA-1 is XGA-2). Make absolutely sure that the chipset line is correct. Anyhow, this plugs in to my Device section as follows: Section "Device" Identifier "XGA" VendorName "IBM" BoardName "XGA-1" VideoRam 1024 Clocks 28.322 25.175 41.539 44.9 CHIPSET "XGA-1" Instance 6 IObase 0x2160 COPbase 0xc3f00 MEMbase 0xfd800000 BIOSbase 0xc2000 DACSpeed 45 POSbase 0 EndSection The Clocks line usually has to be set explicitely since clock probing on MCA XGA cards is a little buggy. Same thing with the VideoRam. Once you've finished your XF86Config, test it with /usr/bin/X11/XF86_AGX -probeonly That tests the card out and verifies that some video modes are available. If that works, try xinit to actually start up the server. Problems ======== Aside from the usualy XFree86 problems (i.e. Monitor settings), there's one serious MCA-related problem you'll run into with Linux. If you change your XGA hardware configuration in any way (usually by installing new hardware and running autoconfiguration), the Device section will have to be regenerated. If you have X start up automatically at boot time (via xdm) and your XGA configuration changes, you'll have to boot from a rescue disk in order to recover. Trust me, I've done it a few times. Dave was working on modifying the AGX server to read POS settings from /proc/mca/pos. Here's hoping he gets something working. Building xgapos =============== 1. Grab the source from glycerine. All you need is xgapos.c. 2. Compile with gcc -o xgapos xgapos.c 3. As root, do the following: chmod +s xgapos Corrections, Questions, Comments? ================================= cpbeaure@csclub.uwaterloo.ca chrisb@truespectra.com http://glycerine.itsmm.uni.edu/mca/ Copyright 1997 by Christophe Beauregard #include ================================= $Header: /home/cpb/os/linux/slack96/RCS/XGA,v 1.2 1997/12/18 21:54:10 cpb Exp cpb $