Directory Tree Structure

How to add an (S)VGA driver to XFree86 : Directory Tree Structure
Previous: Getting Started
Next: Setting Up The Build Information

## 3. Directory Tree Structure

Here is an outline of the directory tree structure for the source tree. Only directories/files that are relevant to writing a driver are presented. The structure for the Link Kit is presented below.

xc/config/cf/

  site.def

    Local configuration customization

  xf86site.def

    XFree86 local configuration customization

xc/programs/Xserver/hw/xfree86/

  The server source

  common/

    Files common to all of the server (XF86Config parser, I/O device handlers, etc)

    xf86.h

      Contains the `ScrnInfoRec' data structure

    xf86_Option.h

      Contains option flags

    compiler.h

      Contains in-line assembler macros and utility functions

  os-support/

    OS-support layer

    assyntax.h

      Contains macro-ized assembler mnemonics

    xf86_OSlib.h

      OS-support includes, defines, and prototypes

  LinkKit/

    site.def.LK

      Template for Link Kit site.def

  vga256/

    256-color VGA server directories

    vga/

      The generic VGA handling code

      vga.h

        Contains the `vgaVideoChipRec' and `vgaHWRec' data structures

      vgaHW.c

        Contains the generic-VGA-register handling functions vgaHWInit(), vgaHWSave() and vgaHWRestore().

    drivers/

      Contains the SVGA driver subdirectories. Each contains an Imakefile, a .c file for the driver, and a .s file for the bank- switching functions.

  vga2/

    The monochrome vga server directories. Most of the files are linked from vga256, and the differences handled by conditional compilation.

    drivers/

      The SVGA driver subdirectories. The `generic' VGA driver is also located here.

  vga16/

    The 16-color vga server directories. Most of the files are linked from vga256, and the differences handled by conditional compilation.

    drivers/

      The SVGA driver subdirectories.

  VGADriverDoc/

    This documentation and the stub driver.

The Link Kit is usually installed in /usr/X11R6/lib/Server. The Link Kit contains everything that is needed to relink the server. It is possible to write a new driver and build a new server without having even the server source installed.

Server/

  site.def

    Local configuration customization

  include/

    All of the include files listed under the `common' directory above

  drivers/

    All of the SVGA drivers

    vga2/

      The SVGA driver subdirectories.

    vga16/

      The SVGA driver subdirectories.

    vga256/

      The SVGA driver subdirectories.

  VGADriverDoc/

    The directory with this documentation and the stub driver. `vgaHW.c' is also copied here, for reference (it is not built as part of the Link Kit).

How to add an (S)VGA driver to XFree86 : Directory Tree Structure
Previous: Getting Started
Next: Setting Up The Build Information