<!doctype linuxdoc system>
 
<article>
 
<title> README for XFree86 3.1.1 on BSD/386 1.1
<author> Hans Nasten
<date> 21 January 1995
<toc>

<sect> What and Where is XFree86? <p>
XFree86 3.1.1 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.

The sources for XFree86 are available by anonymous ftp from:
<p>
<url
    name="ftp.XFree86.org:/pub/XFree86/current"
    url="ftp://ftp.XFree86.org/pub/XFree86/current">
<p>
Binaries for BSD/386 1.1 will be available from:
<p>
<url
    name="ftp.XFree86.org:/pub/XFree86/current/binaries/Bsdi"
    url="ftp://ftp.XFree86.org/pub/XFree86/current/binaries/Bsdi">
<p>
If you're running BSD 1.0, you'll have to build it from source.
Building the distribution on BSD/386 1.0 is untested, but believed to
work correctly. If you run into trouble building on BSD/386 1.0, please
let us know so that we can correct any incompatibilities.
If you've done it and want to share your binaries, please let the Bsdi
mailing list know.
The binaries are compiled using gcc 2.5.8. There may be problems using
XFree86 3.1 on a 386/486 without a math coprocessor. If you experience
these kind of problems, you may have better luck building from the source
using gcc 1.42 instead.

<sect> Bug Reports for This Document <p>
Send email to <it>nasten@Everyware.SE</it> (Hans Nasten)
or <it>XFree86@XFree86.org</it>
if you have comments or suggestions about this file and we'll revise it.

<sect> Installing the Binaries <p>
The binary distribution is composed of a number of tar archives
which contains the executables, servers, fonts, libraries, include files,
man pages, config files, and the server link kit. All tar archives should
be extracted as root with <tt>/</tt> as the default directory. The full
distribution
takes over 40MB of disk space.

Note that many clients were moved from the X11R6 distribution to the
`contrib' area. However, they are still distributed with the
XFree86 binary distribution. 

The contents of the archives are:
<descrip>
<tag>REQUIRED:</tag>
    <descrip>
    <tag/xf86-doc.tar.gz/       READMEs and XFree86 specific man pages.
    <tag/xf86-bin.tar.gz/       all of the executable X client applications.
    <tag/xf86-fonts.tar.gz/     all fonts
    <tag/xf86-lib.tar.gz/       data files needed at runtime
    </descrip>
<tag>Choose at least one of the following to match your hardware:</tag>
    <descrip>
    <tag/XF86_SVGA.gz/    the 8-bit pseudo-color X server for Super VGA cards
    <tag/XF86_VGA16.gz/   the 4-bit pseudo-color X server for VGA &amp;
			  SVGA cards.
    <tag/XF86_Mono.gz/    the Monochrome X Server
    <tag/XF86_8514.gz/    the X server for IBM 8514/A and compatible boards
    <tag/XF86_AGX.gz/     the X server for AGX boards
    <tag/XF86_Mach8.gz/   the X server for ATI Mach8 boards
    <tag/XF86_Mach32.gz/  the X server for ATI Mach32 boards
    <tag/XF86_Mach64.gz/  the X server for ATI Mach64 boards
    <tag/XF86_P9000.gz/   the X server for P9000 based boards
    <tag/XF86_S3.gz/      the X server for S3 based boards
    <tag/XF86_W32.gz/     the X server for ET4000/W32 based boards
    </descrip>
<tag/OPTIONAL:</tag>
    <descrip>
    <tag/xf86-fs.tar.gz/        the font server with man pages.
    <tag/xf86-prog.tar.gz/      the <tt>include/X11</tt> header files and
	static libraries needed only for compiling other X applications
    <tag/xf86-man.tar.gz/       all man pages
    <tag/xf86-linkkit.tar.gz/   the server reconfiguration kit.
    </descrip>
</descrip>
If this is your first time, then you should be able to safely
install all of the packages.  As a minimal install, you'll need doc,
bin, fonts lib and one X server.

To unpack and install the archives:
<enum>
<item> create some destination directory in which you'd like the
       X distribution to live.  <tt>/usr/X11R6</tt> is recommended,
       but if that partition is full (as it is on my machine), then just
       create an alternate directory, and sym-link <tt>/usr/X11R6</tt>
       to this place.

       ie, on my machine, I do the following:

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

<item>  You must be logged in as root to unpack the archives and use a
	`<tt>umask</tt>' value of 022.  Typing `<tt>umask 022</tt>' sets it.
        Caution:
	If you do not extract the files as user `<tt>root</tt>' with the
	correct umask you may not be able to run XFree86 3.1.1. The X
	server needs special permissions that are only granted to the
	root user. You must also cd to <tt>/</tt> before extracting the
        archives.

<item>  Create a symbolic link in <tt>/usr/X11R6/bin</tt> named `X' that
	points to 
	the server that matches your video card: See the XF86_* man pages
	for hardware details. For example, if you have an ET4000 based SVGA 
	card:
<verb>
    cd /usr/X11R6/bin
    rm -f X
    ln -s XF86_SVGA X
</verb>
</enum>
<bf>Note:</bf> you don't need to uncompress the fonts files in
<tt>lib/X11/fonts</tt>. 
If you want to uncompress them anyway, don't forget to run
`<tt>mkfontdir</tt>'  in each directory after that.


<sect> Installing Xdm, the display manager <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.
To start the display manager, log in as root on the console and type
`<tt>xdm -nodaemon</tt>'.

You can start xdm automatically on bootup by disabling the console getty
and adding the following code to <tt>/etc/rc.local</tt>:

<verb>
  if [ -x /usr/X11R6/bin/xdm ]; then
    echo -n ' xdm'; /usr/X11R6/bin/xdm
  fi
</verb>

To disable the console getty, change `<tt>on</tt>' to `<tt>off</tt>'
in the console entry in <tt>/etc/ttys</tt>:
<verb>
console "/usr/libexec/getty std.9600"   ibmpc3  off secure
</verb>

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

XFree86 3.1 and later releases uses a new configuration file format.
Consult the
<tt>XF86Config</tt> man
page and the general <tt>INSTALL</tt> file for instructions.

If you have a <tt>Xconfig</tt> file for XFree86 2.x, use reconfig to
translate part of
it into the new format:
<verb>
   # reconfig <Xconfig >XF86Config
</verb>
and complete the rest according to the <tt>XF86Config</tt> man page and the
<tt>XF86Config.sample</tt> file as a template.

In order to protect your hardware from damage, the server will no longer read
<tt>XF86Config</tt> files from a user's home directory, but requires that it
be in <tt>/etc/XF86Config</tt>, <tt>/usr/X11R6/lib/X11/XF86Config.hostname</tt>
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 /dev 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</tt>' or `<tt>kermit</tt>' 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:
<verb>
  % cat < /dev/tty00
</verb>
If you can't find the right mouse device then use `<tt>dmesg|grep com</tt>'
to get a list of devices that were detected upon booting:
<verb>
  % dmesg|grep com
  com0 at isa0 iobase 0x3f8 irq 4
</verb>
<tt>com0</tt> is the hardware port used for <tt>/dev/tty00</tt> and
<tt>com1</tt> is <tt>/dev/tty01</tt>.
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 and an xterm take about 4 Mb of memory themselves. On
a 4Mb system that would leave nothing left over for the kernel and
other applications like <tt>gcc</tt> that expect a few meg free.

The easiest way for new users to start X windows is to type
`<tt>xinit &gt;&amp; xinit.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</tt>' in the console xterm.  You can
customize your X by creating <tt>.xinitrc</tt>, <tt>.xserverrc</tt>,
and <tt>.twmrc</tt> files in your home directory as described in the xinit and
startx man pages.

<sect> Rebuilding the XFree86 Distribution <p>
The server link kit allow you to rebuild just the X server with a
minimum amount of disk space.  Just unpack it, make the appropriate
changes to the site.def, type `<tt>./mkmf</tt>' and `<tt>make</tt>' to link
the server.
See <tt>/usr/X11R6/lib/Server/README</tt> for more info.

See <tt>/usr/X11R6/lib/X11/etc/INSTALL</tt> for instructions on unbundling and
building the source distribution. You will need about 250Mb free for the
sources, objects and binaries during the build.

You should configure the distribution by editing
<tt>xc/config/cf/xf86site.def</tt>
before compiling.  To compile the sources, invoke
<verb>
  make World
</verb>
in the xc directory.

<sect> Building New X Clients <p>
The easiest way to build a new client (X application) is to use
<tt>xmkmf</tt> if an Imakefile is included in the sources.  
Type `<tt>xmkmf</tt>' to create the Makefiles,
check the configuration if necessary and type
`<tt>make</tt>'.  Whenever you install additional man pages you should update
<tt>whatis.db</tt> by running `<tt>makewhatis /usr/X11R6/man</tt>'.
To avoid the `<tt>Virtual memory exhausted</tt>' message from <tt>cc</tt>
while compiling, increase the data and stack size limits
(in <tt>csh</tt> type `<tt>limit datasize 32M</tt>' and
`<tt>limit stacksize 16M</tt>').

Note: Starting with XFree86 2.1, the symbol ``<tt>__386BSD__</tt>'' no
longer gets defined or via the X config files for *BSD systems.
When porting clients to *BSD systems,
make use of the symbol ``<tt>BSD</tt>'' 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:
<verb>                   
#if (BSD >= 199103)
</verb>
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
<tt>__FreeBSD__</tt> for FreeBSD, <tt>__NetBSD__</tt> for NetBSD,
<tt>__386BSD__</tt> for 386BSD, and <tt>__bsdi__</tt> for BSD/386.


<sect> Linear access to the frame buffer <p>
The stock BSD/386 1.1 kernel has problems when trying to mmap the frame
buffer as a linear ( unbanked ) memory area in high memory. This patch
removes the check in <tt>/sys/i386/isa/vga.c</tt> that disables mmapping the
frame buffer in linear mode. Please consult the BSD/386 1.1 release notes for
instructions on how to build a new kernel.
<itemize>
<item> save the patch below in a separate file.
<item> cd to <tt>/sys/i386/isa</tt>.
<item> apply the patch with
       ``<tt>patch -p &lt;</tt><it>the_separate_patch_file</it>''
<item> rebuild and install the new kernel.
<item> reboot.
</itemize>
<tt>vga.c</tt> patch:
<verb>
*** vga.c.orig	Sun Dec 19 09:35:01 1993
--- vga.c	Mon Oct 24 01:38:44 1994
***************
*** 159,165 ****
  #if 0
  	if (off + NBPG > vgap->vga_mem_size)
  		return (-1);
! #else
  	if (off + NBPG > IOM_END)
  		return (-1);
  #endif
--- 159,165 ----
  #if 0
  	if (off + NBPG > vgap->vga_mem_size)
  		return (-1);
! /*#else*/
  	if (off + NBPG > IOM_END)
  		return (-1);
  #endif
</verb>

<verb>
$XConsortium: Bsdi.sgml,v 1.3 95/01/23 15:34:39 kaleb Exp $
$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Bsdi.sgml,v 3.7 1995/01/22 03:06:27 dawes Exp $
</verb>

</article>
