In the KDE 1.0 on SuSE Linux 5.3 post we told the pain of configuring X in 1998: SaX quitting silently, clocks measured as 28.32 MHz, «No valid modes found» and a frozen machine when testing 1024×768. The root problem belonged to the era: every card needed its own driver, its clocks and the exact monitor frequencies, and a mistake could damage a CRT monitor.
DOS games did not suffer: they used VESA, the standard video cards carry in their BIOS (the VESA BIOS Extensions, VBE). The BIOS lists its modes and sets one with a single call. So we wrote XFree86 3.3.2 a VESA driver: a «non-picky» X with no modelines, no clocks and no frequencies.

Code and downloads: the patch, the sources and the README are on GitHub: madgusmx/xf86vesa. The packages
xf86vesa-1.0-1.i386.rpm(binary for SuSE 5.3) andxf86vesa-1.0-1.src.rpmare in the v1.0 release.
Before


How it works
The video BIOS is 16-bit real-mode code, while Linux runs in protected mode. Linux 2.0 offers the vm86() call, which puts the processor in virtual 8086 mode (the same call DOSEMU used to run MS-DOS). With it we built a small real-mode interface (vbe_rm.c), similar to the LRMI of the time:
- Page 0 (interrupt vectors and BIOS data) is mapped privately from
/dev/mem; low memory (up to 640 KB) is our own memory with a copy of the BIOS extended data area; video memory and the ROMs (0xA0000–0xFFFFF) are mapped shared. - A three-byte stub,
int 10h; hlt, calls the BIOS. The IN/OUT instructions the BIOS runs and the kernel refuses come back asVM86_UNKNOWNand are emulated (including 32-bit ones and REP INS/OUTS). The call ends at thehlt.
With that, the driver (vesa_driver.c, for the XF86_SVGA server) uses the VBE functions:
- 4F00 / 4F01 in the Probe: the BIOS mode list, with resolution, bits per pixel and the linear framebuffer address. Those modes are handed to X as driver built-in modes (
ChipBuiltinModes), so XFree86 asks for no modelines and validates no clocks or frequencies. - 4F02 sets the mode, with a linear framebuffer and without clearing memory; 4F06 sets the line width; 4F03 saves the text mode to return to.
- Going back to the console: the BIOS sets text mode and the driver restores the registers and fonts as they were.
Before touching X we tested it with our own program, vbeinfo, which lists the BIOS modes. On QEMU’s Cirrus GD5446, the BIOS (SeaBIOS) answers VBE 3.0, 4 MB and modes up to 1280×1024, all with a linear framebuffer at 0xFC000000.




The whole XF86Config
This is all the configuration it needs: a monitor with nothing but a name and Chipset "vesa".
Section "Monitor"
Identifier "Cualquiera"
EndSection
Section "Device"
Identifier "VESA"
Chipset "vesa"
EndSection
Section "Screen"
Driver "svga"
Device "VESA"
Monitor "Cualquiera"
DefaultColorDepth 16
SubSection "Display"
Depth 16
EndSubSection
EndSection
Without Modes, the driver uses a single mode: the BIOS’s largest up to 1280×1024, with no virtual screen, like a DOS game. With Modes "1024x768" "800x600" it uses those and Ctrl+Alt+«+» cycles through them. Depths: 8, 15, 16, 24 and 32 bits, depending on what the BIOS offers.
Why a single mode by default? Because we found that the emulated Cirrus BIOS gets function 4F07 wrong (the display start, which X uses to pan the virtual screen): asked for (127,127), it leaves (1150,1355). With several modes the picture came out shifted. The driver detects this and logs a warning.
Tested on two cards




- Cirrus Logic GD5446 (QEMU): KDE at 1280×1024 in 16 bits; switching to the text console and back works.
- Standard VGA (QEMU, Bochs VBE, 16 MB, framebuffer at 0xFD000000): the same binary and the same file, untouched.
A package for YaST
To install it «the 1998 way», we packaged it with SuSE’s RPM 2.4.12: xf86vesa-1.0-1.i386.rpm (1.3 MB) carries the XF86_VESA server, vbeinfo, the sample XF86Config and vesaconfig, which switches X to the VESA driver and keeps the old setup (vesaconfig --deshacer restores it). The source package is xf86vesa-1.0-1.src.rpm.
To install it with YaST we built an «extras CD» with the original SuSE catalogue plus an entry for our package in the xsrv (X servers) series. We tested it backwards: on the standard VGA, without the driver, the usual SVGA server says «A configured device found, but display modes could not be resolved» and «no screens found». Then, YaST:




YaST had its drama: first it could not find the descriptions (the series .ser files were missing) and then it kept saying «Wrong CD» until the CD had its /.S.u.S.E-disk-001 marker. After that: INSTALLATION COMPLETE, the post-install script, vesaconfig and startx: KDE at 1280×1024 where X would not start before.




Workshop notes
- Building needed SuSE’s XFree86 3.3.2 tree (
rpm -bp xf86.specandmake World, a few minutes in the virtual machine). SuSE’sMakefile.Linuxrefused to build because gcc’sspecsincluded/usr/X11R6/lib; we removed it during the build and restored it afterwards. - The driver joins
XF86SvgaDriversright beforegeneric, so it is only picked when no specific driver recognises the card, or when asked for withChipset "vesa". - When changing modes the BIOS must be told not to clear video memory (bit 15 of 4F02): X does not redraw the screen on a resolution change.
- Limits: no 2D acceleration (the processor draws everything) and no DPMS. Requires VBE 2.0 or later with a linear framebuffer.
- All the heavy work was done in the virtual machine. On real hardware (Intel 965/910) only the result will be tried.
- MIT/X11-style licence, like XFree86: the patch (
xf86vesa-3.3.2.diff, 745 lines), the sources and the RPMs are free. Everything is on GitHub and in the v1.0 release.
Did you have this CD or the magazine? Tell us in the Telegram group: Telegram group
This post is also on our social media:
