<!doctype linuxdoc system>

<article>
<title> README for XFree86 3.1.1 on FreeBSD 2.0
<author>Rich Murphey, David Dawes
<date>20 January 1995

<toc>
 
<sect>What and Where is XFree86?

<p>
XFree86 is a port of X11R6 that supports several versions of
Intel-based Unix.  It is derived from X386 1.2, which was the X server
distributed with X11R5.  This release consists of many new features
and performance improvements as well as many bug fixes.  The release
is available as source patches against the X Consortium X11R6 code, as
well as binary distributions for many architectures.

See the <url url="COPYRIGHT.html" name="Copyright Notice">.

The sources for XFree86 are available by anonymous ftp from:

<url name="ftp.XFree86.org:/pub/XFree86/current"
url="ftp://ftp.XFree86.org/pub/XFree86/current">


Binaries for XFree86 on FreeBSD are available from:

<url name="ftp.XFree86.org:/pub/XFree86/current/binaries/FreeBSD-2.0"
url="ftp://ftp.XFree86.org/pub/XFree86/current/binaries/FreeBSD-2.0">
<p>
<url name="XFree86.cdrom.com:/pub/XFree86/current/binaries/FreeBSD-2.0"
url="ftp://XFree86.cdrom.com/pub/XFree86/current/binaries/FreeBSD-2.0">

Send email to <em/Rich-Murphey@Rice.edu/ or <em/XFree86@XFree86.org/
if you have comments or suggestions about this file and we'll revise
it.


<sect>Installing the Binaries
<p>
If you want to save space, first select which archives you want to
unpack.  If you can't decide what to pick and you have 52Mb of disk
space, it's safe to unpack everything.

At a minimum you need to unpack the 'required' <tt/X311*.tgz/
archives plus at least one server that matches your vga card.  You'll
need 9Mb for the minimum required run-time binaries only.

<descrip>
<tag/Required (6.7Mb):/

<descrip>
<tag/X311bin.tgz/
     all the executable X client applications and shared libs

<tag/X311fnts.tgz/
     the misc and 75 dpi fonts

<tag/X311lib.tgz/
     data files needed at runtime
</descrip>

<tag/Required unless you have already customized your configuration files:

<descrip>
<tag/X311xicf.tgz/
     customizable xinit runtime configuration file

<tag/X311xdcf.tgz/
     customizable xdm runtime configuration file
</descrip>

<tag/Choose at least one server (~2.3Mb):/

<descrip>
<tag/X3118514.tgz/
     8-bit color for IBM 8514 and true compatibles.

<tag/X311AGX.tgz/
     8-bit color for AGX boards.

<tag/X311Mch3.tgz/
     8 and 16-bit color for ATI Mach32 boards.

<tag/X311Mch8.tgz/
     8-bit color for ATI Mach8 boards.

<tag/X311Mono.tgz/
     1-bit monochrome for VGA, Super-VGA, Hercules, and others.

<tag/X311P900.tgz/
     8, 16, and 24-bit color for Weitek P9000 boards (Diamond Viper).

<tag/X311S3.tgz/
     8, 16 and 24-bit color for S3 boards (&num;9 GXE, Actix GE32, SPEA Mercury, STB Pegasus)

<tag/X311SVGA.tgz/
     8-bit color for Super-VGA cards.

<tag/X311VG16.tgz/
     4-bit color for VGA and Super-VGA cards

<tag/X311W32.tgz/
     8-bit Color for ET4000/W32, /W32i and /W32p cards.

<tag/X311nest.tgz/
     A nested server running as a client window on another display.
</descrip>

<tag/Optional:/

<descrip>

<tag/X311doc.tgz/
     (.5Mb) READMEs and XFree86 specific man pages

<tag/X311man.tgz/
     (1.7Mb) man pages except XFree86 specific ones in etc archive

<tag/X311f100.tgz/
     (1.8Mb) 100dpi fonts

<tag/X311fscl.tgz/
     (1.6Mb) Speedo and Type1 fonts

<tag/X311fnon.tgz/
     (3.3Mb) Japanese, Chinese and other non-english fonts

<tag/X311fsrv.tgz/
     (.3Mb) the font server and it's man page

<tag/X311prog.tgz/
     (3.9Mb) config, lib*.a and *.h files needed only for compiling

<tag/X311link.tgz/
     (7.8Mb) X server reconfiguration kit

<tag/X311pex.tgz/
     (.5Mb) PEX fonts and shared libs needed by PEX applications.

<tag/X311lbx.tgz/
     (.2Mb) low bandwidth X proxy server and libraries.
</descrip>
</descrip>

Note that there is no longer a separate xdm archive.  FreeBSD 2.0
handles this in shared libraries now, so that the xdm binary does not
itself contain des and there is no more need for us to provide
separate tar balls.


<sect1>Full Install:
<p>
<enum>
<item> You must be logged in as root to unpack the archives because
     several executables are set-user-id.  Otherwise the server may
     abort if you unpack it as an ordinary user.  You must also use a
     ``<tt/umask/'' value of <tt/022/ because the X server requires
     special permissions.
<tscreen><verb>
 % su
 # umask 022
</verb></tscreen>

<item> If you have 52Mb free in the <tt>/usr</tt> partition ``<tt>cd
     /usr</tt>'' and skip to no. 3.
     Otherwise, create a directory on another partition and sym link it into
     <tt>/usr</tt>:

<tscreen><verb>
 # cd /usr/local
 # mkdir X11R6
 # ln -s /usr/local/X11R6 /usr/X11R6
</verb></tscreen>

<item> Unpack everything:

     If you are using sh (as root usually does):

<tscreen><verb>
 # for i in X311*.tgz; do
 #   tar -xzf $i
 # done
</verb></tscreen>

     Else, if you are using csh:
<tscreen><verb>
 % foreach i (X311*.tgz)
 %   tar -xzf $i
 % end
</verb></tscreen>

<item> Create a symbolic link ``<tt/X/'' that points to the server
     that matches your video card.  The <em/XF86_*/ man pages list which
     vga chip sets are supported by each server.  For example, if you
     have an ET4000 based card you will use the XF86_SVGA server:

<tscreen><verb>
 # cd /usr/X11R6/bin; rm X; ln -s XF86_SVGA X
</verb></tscreen>
</enum>

<sect1>Minimal Install:
<p>
First do numbers 1 and 2 above. Then unpack the required archives:

<tscreen><verb>
 # for i in bin fnts lib xicf; do
 #   tar -xzf  X311$i.tgz
 # done
</verb></tscreen>

Then unpack a server archive corresponding to your vga card.  The
server man pages, <tt>X11R6/man/man1/XF86_*</tt>, list the vga chip
sets supported by each server.  For example, if you have an ET4000
based card you will use the XF86_SVGA server:

<tscreen><verb>
 # tar -xzf X311SVGA.tgz
 # cd /usr/X11R6/bin; rm X; ln -s XF86_SVGA X
</verb></tscreen>

<sect1>After either Full or Minimal Install above:
<p>
Add /usr/X11R6/bin to the default path for sh in <tt>/etc/profile</tt>
and for csh in <tt>/etc/csh.login</tt> if they are not already there:

<tscreen><verb>
 # echo 'set path = ($path /usr/X11R6/bin)' >>/etc/csh.login
 # echo 'PATH=$PATH:/usr/X11R6/bin' >>/etc/profile
</verb></tscreen>

Or make sure all who use X put <tt>/usr/X11R6/bin</tt> in their
shell's ``path'' variable.

Next either reboot or invoke <tt/ldconfig/ as root to put the shared
libraries in <tt/ld.so/'s cache:

<tscreen><verb>
 # ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib
</verb></tscreen>

If you had already configured <tt>X11R6/lib/X11/xinit/xinitrc</tt> or
<tt>X11R6/lib/X11/xdm/*</tt> omit the <tt/xinit-config/ or
<tt/xdm-config/ archive or unpack it separately and merge in your
customizations.

The <tt/fscl/ and <tt/f100/ archives are optional and
can be omitted if you are short on space.  The optional <tt/link/
archive allows you to reconfigure and customize a X server binary.
The optional <tt/prog/ archive is needed only for writing or compiling X
applications.  The optional <tt/pex/ archive contains pex clients and
libraries for building 3D graphics applications.

<quote>
<bf/NOTE:/ You don't need to uncompress the font files, but if you
uncompress them anyway you must run <tt/mkfontdir/ in the corresponding
font directory; otherwise your server will abort with the message
``<tt/could not open default font 'fixed'/''.
</quote>

If you are running a stock FreeBSD 1.1.5 system you can ignore the rest of
this section.  If not, make sure you have a spare virtual console which is
running a login process (getty).  First check how many virtual consoles you
have:

<tscreen><verb>
 % dmesg|grep sc
 sc0 at 0x60-0x6f irq 1 on motherboard
 sc0: VGA color <8 virtual consoles>
</verb></tscreen>

Then check <tt>/etc/ttys</tt> to make sure there is at least one
<tt/ttyv?/ devices which doesn't have a getty enabled.  FreeBSD 1.1.5
has the first three ``on'' and the last ``off'' so that getty runs on
only three:

<tscreen><verb>
 % grep ttyv /etc/ttys
 ttyv0	"/usr/libexec/getty Pc"	cons25	on secure
 ttyv1	"/usr/libexec/getty Pc" cons25	on secure
 ttyv2	"/usr/libexec/getty Pc" cons25	on secure
 ttyv3	"/usr/libexec/getty Pc" cons25	off secure
</verb></tscreen>

If your kernel has least 4 VTs and only 3 gettys, this is fine.  If
not, either disable a getty in <tt>/etc/ttys</tt> by changing ``on''
to ``off'' or build another kernel with more VTs as described below.

 
<sect>Installing The Display Manager (xdm)
<p>
The display manager makes your PC look like an X terminal.  That is, it
presents you with a login screen that runs under X.

The easiest way to automatically start the display manager on boot is to
add a line in <tt>/etc/ttys</tt> to start it on one of the unoccupied
virtual terminals:

<tscreen><verb>
 ttyv4	"/usr/X11R6/bin/xdm -nodaemon" xterm	on secure
</verb></tscreen>

You should also make sure that <tt>/usr/X11R6/bin/X</tt> is a symbolic
link to the Xserver that matches your video card or edit the file
Xservers in <tt>/usr/X11R6/lib/X11/xdm</tt> to specify the pathname of
the X server.

The change to <tt>/etc/ttys</tt> won't take effect until you either
reboot or ``<tt/kill -HUP 1/'' to force initd to reread
<tt>/etc/ttys</tt>.  You can also test the display manager manually by
loging in as root on the console and typing ``<tt/xdm -nodaemon/''.

 
<sect>Configuring X for Your Hardware
<p>
The <tt/XF86Config/ file tells the X server what kind of monitor, video card
and mouse you have.  You <em/must/ create it to tell the server what
specific hardware you have.

XFree86 3.1 uses a new configuration file format. Consult the
<em/XF86Config/ man page and the general <url url=INSTALL.html
name=INSTALL> file for instructions.

If you have a <tt/Xconfig/ file for XFree86 2.x, use reconfig to
translate part of it into the new format:

<tscreen><verb>
 # reconfig <Xconfig >XF86Config
</verb></tscreen>

and complete the rest according to the <em/XF86Config/ man page and
the <tt/XF86Config.sample/ file as a template.

In order to protect your hardware from damage, the server no longer
will read <tt/XF86Config/ files from a user's home directory, but
requires that it be in <tt>/etc/XF86Config</tt>,
<tt>/usr/X11R6/lib/X11/XF86Config.</tt><em>hostname</em> or
<tt>/usr/X11R6/lib/X11/XF86Config</tt>.

You'll need info on your hardware:

<itemize>
<item> Your mouse type, baud rate and it's <tt>/dev</tt> entry.
<item> The video card's chipset (e.g. ET4000, S3, etc).
<item> Your monitor's sync frequencies.
</itemize>

The easiest way to find which device your mouse is plugged into is to
use ``<tt/cat/'' or ``<tt/kermit/'' to look at the output of the
mouse.  Connect to it and just make sure that it generates output when
the mouse is moved or clicked:

<tscreen><verb>
 % cat < /dev/tty00
</verb></tscreen>

If you can't find the right mouse device then use ``<tt/dmesg|grep
sio/'' to get a list of devices that were detected upon booting:

<tscreen><verb>
 % dmesg|grep sio
 sio0 at 0x3f8-0x3ff irq 4 on isa
</verb></tscreen>

Then double check the <tt>/dev</tt> entries corresponding to these
devices.  Use the script <tt>/dev/MAKEDEV</tt> to create entries if
they don't already exist:

<tscreen><verb>
 % cd /dev
 % sh MAKEDEV tty00
</verb></tscreen>

If you plan to fine tune the screen size or position on your monitor you'll
need the specs for sync frequencies from your monitor's manual.

 

<sect>Running X
<p>
8mb of memory is a recommended minimum for running X.  The server,
window manager, display manager and an xterm take about 8Mb of virtual
memory themselves.  Even if their resident set size is smaller, on a
8Mb system that leaves very space for other applications such as gcc
that expect a few meg free.  The R6 X servers may work with 4Mb of
memory, but in practice compilation while running X can take 5 or 10
times as long due to constant paging.

The easiest way for new users to start X windows is to type
``<tt>startx >&amp; startx.log</tt>''.  Error messages are lost unless
you redirect them because the server takes over the screen.

To get out of X windows, type: ``<tt/exit/'' in the console xterm.
You can customize your X by creating <tt/.xinitrc/, <tt/.xserverrc/,
and <tt/.twmrc/ files in your home directory as described in the <em/xinit/
and <em/startx/ man pages.

 

<sect>Rebuilding Kernels for X
<p>

The GENERIC FreeBSD 2.0 kernel supports XFree86 without any
modifications required.  You do not need to make any changes to the
GENERIC kernel or any kernel configuration which is a superset.

For a general description of BSD kernel configuration get <url
name="smm.02.config.ps.Z"
url="ftp://gatekeeper.dec.com/pub/BSD/manuals/smm.02.config.ps.Z">.
It is a ready-to-print postscript copy of the kernel configuration
chapter from the system maintainers manual.

If you do decide to reduce your kernel configuration file, do not
remove the two lines below (in <tt>/sys/arch/i386/conf</tt>).  They
are both required for X support:

<tscreen><verb>
 options		XSERVER			#Xserver
 options		UCONSOLE		#X Console support
</verb></tscreen>

The generic FreeBSD 2.0 kernel is configured by default with the
syscons driver.  To configure your kernel similarly it should have a
line like this in <tt>/usr/src/sys/i386/conf/GENERIC</tt>:

<tscreen><verb>
 device		sc0	at isa? port "IO_KBD" tty irq 1 vector scintr
</verb></tscreen>

The number of virtual consoles can be set using the NCONS option:

<tscreen><verb>
 options		"NCONS=4"		#4 virtual consoles
</verb></tscreen>

Otherwise, the default without a line like this is 12.  You must have more
VTs than gettys as described in the end of section 3, and 4 is a reasonable
minimum.

The server supports several console drivers: pccons, syscons and pcvt.
The syscons driver is the default in FreeBSD 1.1.5 and higher.  They are
detected at runtime and no configuration of the server itself is required.

The pcvt console driver is bundled in <tt>/usr/ports/util/pcvt</tt> in
FreeBSD versions 1.0.2 and above.  It can also be ftp-ed from:

<url name="FreeBSD.cdrom.com:/pub/FreeBSD/FreeBSD-1.1/ports/util/pcvt"
url="ftp://FreeBSD.cdrom.com/pub/FreeBSD/FreeBSD-1.1/ports/util/pcvt">

Refer to the <url
url="ftp://FreeBSD.cdrom.com/pub/FreeBSD/FreeBSD-1.1/ports/util/pcvt/README.FreeBSD"
name="README.FreeBSD">
file there for complete installation instructions.

The XFree86 servers include support for the MIT-SHM extension.  The
GENERIC kernel does not support this, so if you want to make use of
this, you will need a kernel configured with SYSV shared memory
support.  To do this, add the following line to your kernel config
file:

<tscreen><verb>
 options		SYSVSHM			# System V shared memory
 options		SYSVSEM			# System V semaphores
 options		SYSVMSG			# System V message queues
</verb></tscreen>

If you are using a SoundBlaster 16 on IRQ 2 (9), then you need a patch for
sb16_dsp.c.  Otherwise a kernel configured with the SoundBlaster driver will
claim interrupt 9 doesn't exist and X server will lock up.

S3 cards and serial port COM 4 cannot be installed together on a
system because the I/O port addresses overlap.


<sect>Rebuilding XFree86
<p>

The server link kit allows you to build an X server using a minimum
amount of disk space.  Just unpack it, make the appropriate changes to
<tt/site.def/, type ``<tt>./mkmf</tt>' and ``<tt/make/'' to link the
server.  See <url name=README.LinkKit url=LinkKit.html> for more info.

The source tree takes about 114Mb before compiling and an additional
100Mb after ``<tt/make World/''.  You should configure the
distribution by editing <tt/xf86site.def/ and <tt/site.def/ in
<tt>xc/config/cf</tt> before compiling.  By default, the config files
are set up to build shared libraries.  If you are running a version of
FreeBSD that doesn't include shared library support, add the following
line to <tt/site.def/:

<tscreen><verb>
 #define BuildBsdSharedLibs		NO
</verb></tscreen>

If your system doesn't have support or SYSV shared memory (for
example, if you don't have the <tt>&lt;sys/shm.h&gt;</tt> header), you
should disable the MIT-SHM extension by adding the following line to
<tt/site.def/:

<tscreen><verb>
 #define HasShm				NO
</verb></tscreen>

To compile the sources on FreeBSD 1.1 and later, type:

<tscreen><verb>
 make World
</verb></tscreen>

If you are running an old version of FreeBSD (before 1.1), then type:

<tscreen><verb>
 make World BOOTSTRAPCFLAGS=-D__FreeBSD__
</verb></tscreen>

 

<sect>Building Other X Clients
<p>

The easiest way to build a new client (X application) is to use
<tt/xmkmf/ if an <tt/Imakefile/ is included with it.  Type ``<tt/xmkmf -a/''
to create the Makefiles, then type ``<tt/make/''.  Whenever you install
additional man pages you should update <tt/whatis.db/ by running
``<tt>makewhatis /usr/X11R6/man</tt>''.

On FreeBSD 1.0 and earlier systems, to avoid the ``Virtual memory
exhausted'' message from cc while compiling, increase the data and
stack size limits (in csh type ``<tt/limit datasize 32M/'' and
``<tt/limit stacksize 16M/'').  This is not needed on FreeBSD 2.0 and
later since the defaults are ample.

<bf/Note:/ Starting with XFree86 2.1 and FreeBSD 1.1, the symbol
<bf/__386BSD__/ no longer gets defined either by the compiler or via the
X config files for FreeBSD systems.  When porting clients to BSD
systems, make use of the symbol <bf/BSD/ for code which is truly
BSD-specific.  The value of the symbol can be used to distinguish
different BSD releases.  For example, code specific to the Net-2 and
later releases can use:

<tscreen>
#if (BSD >= 199103)
</tscreen>

To ensure that this symbol is correctly defined, include
<tt>&lt;sys/param.h&gt;</tt> in the source that requires it.  Note that
the symbol <bf/CSRG_BASED/ is defined for *BSD systems in XFree86 3.1.1
and later.  This should be used to protect the inclusion of
<tt>&lt;sys/param.h&gt;</tt>.

For code that really is specific to a particular i386 BSD port, use
<bf/__FreeBSD__/ for FreeBSD, <bf/__NetBSD__/ for NetBSD,
<bf/__386BSD__/ for 386BSD, and <bf/__bsdi__/ for BSD/386.


<sect> Thanks
<p>
Many thanks to:
  <itemize>
<item> <bf/Pace Willison/  for providing initial *BSD support.
<item> <bf/Amancio Hasty/ for 386BSD kernel and S3 chipset support.
<item> <bf/David Greenman, Nate Williams, Jordan Hubbard/ for FreeBSD
       kernel support.  
<item> <bf/Rod Grimes/, <bf/Jordan Hubbard/ and <bf/Jack Velte/ for 
       the use of Walnut Creek Cdrom's hardware. 
<item> <bf/Orest Zborowski/, <bf/Simon Cooper/ and <bf/Dirk Hohndel/ for ideas from the Linux README.
</itemize>

<verb>
$XConsortium: FreeBSD.sgml,v 1.3 95/01/23 15:34:41 kaleb Exp $
$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/FreeBSD.sgml,v 3.8 1995/01/21 10:44:19 dawes Exp $
</verb>

</article>
