KDrive is an X server written by Keith Packard that was designed for low memory environments. On Linux/x86, a KDrive server with RENDER support but without support for scalable fonts compiles into less than 700 KB of text. KDrive tends to avoid large memory allocations at runtime, and tries to perform operations ``on the fly'' whenever possible (but this is also true of recent versions of the stock XFree86 server).
Unlike the usual XFree86 server, a KDrive server is completely self-contained: it does not require any configuration files, and will even function if no on-disk fonts are available. All configuration is done at compile time and through command-line flags.
At the time of writing, KDrive is for Linux only, although it could probably be ported to other Unix-like systems with little effort.
Disclaimer: This text was written by an incompetent amateur (J.Ch.), and does not carry the imprimatur of Keith Packard or that of the XFree86 Core Team. I am not intimately familiar with all of the KDrive code, and this document is probably wildly inaccurate. I am sole responsible for any errors or omissions in this document.
The information contained herein is offered in good faith, but with no warranty of any kind. No kidding.
The default KDrive server, Xfbdev, is designed for a Linux installation with a working /dev/fb and a PS/2 mouse on either /dev/psaux or /dev/mouse. It includes the following drivers:
Xfbdev includes support for BDF and PCF bitmap fonts only. In addition, it hardwires a number of standard fonts, notably cursor and fixed, which will therefore be available even when there are no on-disk fonts. By default, it does not contain support for local scalable fonts in any format.
Xfbdev also includes support for a number of server extensions, including the ubiquitous SHAPE and the soon-to-be ubiquitous RENDER.
In order to compile Xfbdev, you need a clean XFree86 tree; I recommend version 4.0.2 or later. Put the following lines in your host.def file:
#define BuildServersOnly YES
#define KDriveXServer YES
#define TinyXServer YES
Now make World as usual; if the compilation proceeds without errors, you should have an executable xc/programs/Xserver/Xfbdev.
You may now make install or make install.man.
For information on running the Xfbdev server, please see the Xfbdev(1), Xkdrive(1) and Xserver(1) manual pages.
The Xvesa server is for x86 hardware only, and includes an unaccelerated display driver that will support any card with a VESA, VGA or even EGA BIOS. Except for the display driver, the Xvesa server is identical to Xfbdev.
Unless you're using an original Hercules Graphics chipset or compatible, your hardware is most probably supported. In addition, the video driver in Xvesa will automagically do any initialisation of your chipset that your BIOS knows about but that might be undocumented, and thus not present in the stock XFree86 drivers. Xvesa is therefore an excellent choice for laptops, and in fact I am using Xvesa as the primary X server on mine.
God protect us from copper money and CGA cards.
In order to build the Xvesa server, include the following lines in your host.def file:
#define BuildServersOnly YES
#define KDriveXServer YES
#define TinyXServer YES
#define XfbdevServer NO
#define XvesaServer YES
For information on running the Xvesa server, please see the Xvesa(1), Xkdrive(1) and Xserver(1) manual pages.
The KDrive makefiles include building recipes for a number of other servers, some of which use accelerated display drivers. These servers are not currently documented.
Any volunteers?
Fore more information, please see the Xkdrive(1) manual page and the file xc/config/cf/kdrive.cf.
A KDrive server does not include multiple drivers. In order to run KDrive on your hardware, you need to compile a KDrive server with the proper os, keyboard, mouse and display drivers. In addition, you will need to select the set of font renderers and server extensions that you want to compile.
At the time of writing, the publicly-available KDrive server only supports Linux. As most of KDrive is OS-agnostic, porting to a different Unix-like system should not be difficult.
Some bits of the source hint at support for certain proprietary systems, but it seems incomplete.
If you port KDrive to a different OS, I'd be glad to hear from you (and I am sure so would Keith). BSD should be easy. Minix-VMD might be more challenging, as it lacks a standard socket library; but then, earlier versions of XFree86 used to run on Minix-VMD, and KDrive uses the same XTrans layer. Stock 32-bit Minix doesn't have a poll/select equivalent.
I want to see KDrive on stock Minix. Please.
At the time of writing, the KDrive server only has support for a generic Linux keyboard; the keyboard mapping is copied from the Linux kernel tables at startup. As X11 has richer keyboard information than Linux, and furthermore KDrive's mapping tables are incomplete, the results are not always perfect; I have found it necessary to fix my keyboard using xmodmap.
KDrive currently includes support for PS/2 and bus mice, as well as for some sort of touchscreen (which one?).
I have an almost completely untested MS mouse driver for KDrive. If you test it, please drop me a note with your results.
It is not currently possible to build a server with support for more than one type of mouse. In order to select a mouse driver, search your hardware initialisation file (e.g. fbinit.c or vesainit.c) for the function InitOutput; this function should contain a line that says
KdInitInput (&Ps2MouseFuncs, &LinuxKeyboardFuncs);The first argument is the mouse driver; it should be one of Ps2MouseFuncs or BusMouseFuncs (or MsMouseFuncs).
This is not a satisfactory situation, but it's going to improve soon. Yeah, right.
KDrive includes a fairly large selection of display drivers. Two are fully generic but unaccelerated: fbdev (included in the Xfbdev server) and vesa (included in the Xvesa server). The other drivers are partially accelerated, and support specific video hardware.
The generic drivers are documented in the Xfbdev(1) and Xvesa(1) manual pages. The accelerated drivers are currently undocumented; the only source of information about them is the source. Please see the directories under hw/kdrive/ and enjoy your read.
Somebody make Keith speak.
KDrive should be able to support all the font renderers supported by XFree86. You may add any of the following to your host.def file:
#define BuildSpeedo YES
#define BuildType1 YES
#define BuildCID YES
#define BuildFreeType YES
#define FontServerAccess YES
Some of these renderers are rather large; you may want to think twice before including them in your ``tiny'' server.
As noted above, KDrive includes a number of hardwired, compiled-in fonts. There is no good reason to disable support for these ``built-in'' fonts; however, if you insist, you may use
#define BuildBuiltinFonts NO
KDrive might or might not be able to support any server extension supported by XFree86 that is not directly related to hardware. Use the usual incantations in your host.def file, for example,
#define BuildLBX YES
#define BuildDBE YES
Disabling RENDER support is haram.
Any additional options that you want to pass to the C compiler should be put in KdriveServerExtraDefines:
#define KdriveServerExtraDefines -DPIXPRIV
Juliusz Chroboczek, <jch@xfree86.org>