<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Setting Up The Build Information </TITLE>
</HEAD>
<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">

<A HREF="VGADriver.html"><EM> How to add an (S)VGA driver to XFree86</EM></A>
 <b>:</b> <EM>Setting Up The Build Information </EM><BR>
<b>Previous:</b> <A HREF="VGADriver3.html"><EM>Directory Tree Structure </EM></A><BR>
<b>Next:</b> <A HREF="VGADriver5.html"><EM>The Bank-Switching Functions </EM></A>


<HR NOSHADE>
  <H2><A NAME="4"></A>4. Setting Up The Build Information </H2>
<p>This section describes the peripheral configuration and build steps that
must be performed to set up for your new driver.  The steps are the same
whether you are building from the source tree of from the Link Kit; only
the locations of the files is different.  Here are the configuration steps
that must be followed:</p>
<p>
<ol>
<li>	 Choose the name for your driver subdirectory and data structures.
Since the current driver scheme allows (in fact, encourages)
putting drivers for multiple related chipsets in a single driver,
it is usually best to use the vendor name, rather than a chipset
version.  The fact that older XFree86 drivers do not follow this
convention should not deter you from using it now - most of that
code was developed before the driver interface had been made
flexible and extensible.

For this documentation, we'll use chips from the SuperDuper Chips
vendor.  Hence, we'll use `sdc' for the name of the driver.
</li>
<li>	 Decide whether your driver will support the color server, the
monochrome server, or both.  For this documentation, we will
assume that both the color and monochrome servers will be
supported.  If you intend to support only the color server, the
steps for the monochrome server can be ignored.  If you intend
to support only the monochrome server, the steps for the color
server listed should be performed for the monochrome server,
and the monochrome steps ignored.  Most of the existing drivers
support only the color or both servers; the ``generic'' driver is
the only driver (currently) that supports just the monochrome
server.
</li>
<li>	 Create your driver directories:

<ul>
<li>If you are working in the source tree, create the
following directories:

<pre>
   xc/programs/Xserver/hw/xfree86/vga256/drivers/sdc
   xc/programs/Xserver/hw/xfree86/vga16/drivers/sdc
   xc/programs/Xserver/hw/xfree86/vga2/drivers/sdc
</pre>

</li>
<li>If you are working in the Link Kit, create the
following directories:
			
<pre>
   /usr/X11R6/lib/Server/drivers/vga256/sdc
   /usr/X11R6/lib/Server/drivers/vga16/sdc
   /usr/X11R6/lib/Server/drivers/vga2/sdc
</pre>
</li>
</ul>

</li>
<li>	 Set up the Imakefile parameters to cause your driver to be
built:

<ul>
<li>If you are working in the source tree:
<ol>
<li>Edit the file xc/config/cf/xfree86.cf,
and add 
`sdc' to the list for the definitions for 
`XF86Vga256Drivers', `XF86Vga16Drivers' and
`XF86Vga2Drivers'.
You should put `sdc' just before `generic' in the
list (i.e. second last), to ensure that none of the
other driver's probe functions incorrectly detect
the `sdc' chipset .</li>
<li>Edit the file xc/config/cf/xf86site.def,
and add
the same entries in this file (this is just a
comment that shows the default values).</li>
<li>Edit the site.def.LK file in
xc/programs/Xserver/hw/xfree86/LinkKit/,
and add the same entries in this file.  This is
the prototype `site.def' file that will be
installed in the Link Kit.</li>
</ol>

		</li>
<li>If you are working in the Link Kit, edit the file
/usr/X11R6/lib/Server/site.def, and add `sdc' to
the `XF86Vga256Drivers', `XF86Vga16Drivers' and
`XF86Vga2Drivers' definitions as described in (a) above.</li>
</ul>
</li>
<li>	 Now copy the prototype files into your new directories:
<ul>
<li>If you are working in the source tree, copy the `stub' 
files as follows (directories are below xc/programs/Xserver):
<dl>
<dt><b>Imakefile.stub =&gt;</b><dd><p>hw/xfree86/vga256/drivers/sdc/Imakefile</p>
<dt><b>stub_driver.c =&gt;</b><dd><p>hw/xfree86/vga256/drivers/sdc/sdc_driver.c</p>
<dt><b>stub_bank.s =&gt;</b><dd><p>hw/xfree86/vga256/drivers/sdc/sdc_bank.s</p>
<dt><b>Imakefile.stub =&gt;</b><dd><p>hw/xfree86/vga16/drivers/sdc/Imakefile
(then edit this Imakefile and make the changes
described in the comments).</p>
<dt><b>Imakefile.stub =&gt;</b><dd><p>hw/xfree86/vga2/drivers/sdc/Imakefile
(then edit this Imakefile and make the changes
described in the comments).</p>
</dl>
</li>
<li>If you are working in the Link Kit, copy the `stub' files
as follows:
<dl>
<dt><b>Imakefile.stub =&gt; </b><dd><p>/usr/X11R6/lib/Server/drivers/vga256/sdc/Imakefile</p>
<dt><b>stub_driver.c =&gt; </b><dd><p>/usr/X11R6/lib/Server/drivers/vga256/sdc/sdc_driver.c</p>
<dt><b>stub_bank.s =&gt; </b><dd><p>/usr/X11R6/lib/Server/drivers/vga256/sdc/sdc_bank.s</p>
<dt><b>Imakefile.stub =&gt; </b><dd><p>/usr/X11R6/lib/Server/drivers/vga16/sdc/Imakefile
(then edit this Imakefile and make the changes
described in the comments).</p>
<dt><b>Imakefile.stub =&gt; </b><dd><p>/usr/X11R6/lib/Server/drivers/vga2/sdc/Imakefile
(then edit this Imakefile and make the changes
described in the comments).</p>
</dl>
</li>
</ul>
</li>
<li>	 Edit each of the files you've just copied, and replace `stub'
with `sdc' and `STUB' with `SDC' wherever they appear.</li>
</ol>

That's all the prep work needed.  Now it's time to work on the actual driver.</p>

 <HR NOSHADE>
<A HREF="VGADriver.html"><EM> How to add an (S)VGA driver to XFree86</EM></A>
 <b>:</b> <EM>Setting Up The Build Information </EM><BR>
<b>Previous:</b> <A HREF="VGADriver3.html"><EM>Directory Tree Structure </EM></A><BR>
<b>Next:</b> <A HREF="VGADriver5.html"><EM>The Bank-Switching Functions </EM></A>



</BODY>
</HTML>
