home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / bsd / 5286 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.5 KB

  1. Xref: sparky comp.unix.bsd:5286 comp.windows.x:16318
  2. Path: sparky!uunet!mcsun!uknet!edcastle!aiai!richard
  3. From: richard@aiai.ed.ac.uk (Richard Tobin)
  4. Newsgroups: comp.unix.bsd,comp.windows.x
  5. Subject: X386 patch
  6. Message-ID: <7477@skye.ed.ac.uk>
  7. Date: 8 Sep 92 12:58:47 GMT
  8. Organization: AIAI, University of Edinburgh, Scotland
  9. Lines: 29
  10.  
  11. I had a problem with X under 386BSD (on an Elonex 33MHz 386 with Genoa
  12. SVGA) that the CRTC registers weren't being set, so the display was
  13. completely trashed.  This turns out to be because the bit in CRTC
  14. register 17 that prevents writing to CRTC registers 0-7 was set
  15. (presumably the BIOS sets it when it's booted - I don't know why).
  16. The solution is to clear this bit before setting the other registers.
  17.  
  18. Here's the patch:
  19.  
  20. *** ddx/x386/vga/vgaHW.c.orig    Mon Aug 26 20:43:24 1991
  21. --- ddx/x386/vga/vgaHW.c    Tue Sep  8 12:51:48 1992
  22. ***************
  23. *** 125,130 ****
  24. --- 125,134 ----
  25.     for (i=0; i<16; i++) { outb(0x3C0,i); outb(0x3C0, restore->Attribute[i]); }
  26.     for (i=16; i<21;i++) { outb(0x3C0,i | 0x20);
  27.                outb(0x3C0, restore->Attribute[i]); }
  28. +   /* Ensure CRTC registers 0-7 are writable by clearing bit 7 of register 17 */
  29. +   outw(vgaIOBase + 4, ((restore->CRTC[17] & 0x7f) << 8) | 17);
  30.     for (i=0; i<24; i++) outw(vgaIOBase + 4,(restore->CRTC[i] << 8) | i);
  31.     for (i=0; i<9;  i++) outw(0x3CE, (restore->Graphics[i] << 8) | i);
  32.  
  33. -- Richard
  34. -- 
  35. Richard Tobin,
  36. AI Applications Institute,                                R.Tobin@ed.ac.uk
  37. Edinburgh University.
  38.