README for XFree86 2.1.1 on NetBSD-current ------------------------------------------ Contents -------- 1) What and Where is XFree86? 2) Bug Reports for This Document 3) Installing The Binaries 4) Installing Xdm, the display manager 5) Configuring X for Your Hardware 6) Running X 7) Kernel Support for X 8) Rebuilding the XFree86 Distribution 9) Building New X Clients 1 - What and Where is XFree86? ------------------------------ XFree86 is a port of X11R5 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 MIT X11R5 code, as well as binary distributions for many architectures. The sources for XFree86 are available by anonymous ftp from: ftp.x.org:/contrib/XFree86 ftp.physics.su.oz.au:/XFree86. Binaries for NetBSD-Current will be available from: ftp.laas.fr:/pub/NetBSD sun-lamp.cs.berkeley.edu:/pub/NetBSD/ports If you're running NetBSD 0.9, you'll have to build it from the source. If you've done it and want to share your binaries, please let us know. 2 - Bug Reports for This Document --------------------------------- Send email to matthieu@laas.fr (Matthieu Herrb) or XFree86@XFree86.org if you have comments or suggestions about this file and we'll revise it. 3 - Installing the Binaries --------------------------- The binary distribution is composed of a number of split tar archives which are the executables, servers, fonts, libraries, include files, man pages, config files, and the server link kit. The full distribution takes over 40MB of disk space. The large archives are split into smaller chunks. The contents of the archives are: bin - all of the executable X client applications (except xdm) include - the include/X11 header files fonts - the misc, 75dpi, 100dpi, and scaled fonts doc - READMEs, install scripts, and XFree86 specific man pages. lib - X11 libraries, and data files needed at runtime config - customizable xinit, xdm, and fs runtime configuration files. Choose at least one of the following to match your hardware: 8514 - the X server for IBM 8514/A and compatible boards Mach8 - the X server for ATI Mach8 graphics accelerator boards Mach32 - the X server for ATI Mach32 graphics accelerator boards S3 - the X server for S3 based boards SVGA - the 8-bit pseudo-color X server for Super VGA cards VGA16 - the 4-bit pseudo-color X server for VGA & SVGA cards. Mono - the Monochrome X Server OPTIONAL: man - man pages except XFree86 specific ones in the etc archive xdm - xdm executable (dynamically linked against -lcrypt) linkkit - optional X server reconfiguration kit pex - pex clients, libraries, header files and data If this is your first time, then you should be able to safely install all of the packages. If you're going to be installing the source as well, then you might not want to bother with the linkkit and pex archives. As a minimal install, you'll need bin, include, fonts doc, lib, config, and one X server. To unpack and install the archives: 1. create some destination directory in which you'd like the X distribution to live. /usr/X386 is recommended, but if that partition is full (as it is on my machine), then just create an alternate directory, and sym-link /usr/X386 to this place. ie, on my machine, I do the following: % cd /usr/local % mkdir X11 % ln -s /usr/local/X11 /usr/X386 2. Assuming that the destination directory for XFree86 2.1.1 is /usr/X386, run the following from wherever all the archive files are (replace /usr/X386 with wherever you wish them to go if that isn't the place): % cat XFree86-2.1.1-bin.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-include.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-fonts.tar.gz.* | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-doc.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-lib.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-config.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-man.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-xdm.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-linkkit.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-pex.tar.gz | gunzip | (cd /usr/X386; tar xf -) # Choose one ore more servers to install % cat XFree86-2.1.1-8514.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-Mach8.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-Mach32.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-S3.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-SVGA.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-VGA16.tar.gz | gunzip | (cd /usr/X386; tar xf -) % cat XFree86-2.1.1-Mono.tar.gz | gunzip | (cd /usr/X386; tar xf -) 3. Set the XWINHOME environment variable to the path where you installed XFree86. Under csh type: setenv XWINHOME /usr/X386 under sh type XWINHOME=/usr/X386 export XWINHOME (Replace /usr/X386 by the appropriate dir if necessary). Also, don't forget to include these lines in your .login or .profile for permanent use. 4. You should now run the script x386install from lib/X11/etc. It is invoked as follows (assuming we are in the top level dir of where we installed X to): % lib/X11/etc/x386install This script verifies that ${XWINHOME} points to the correct place, checks the /dev/ and /etc/ttys entries, and adds ${XWINHOME}/bin to the default path in /etc/csh.login. You should also add ${XWINHOME}/bin to your own shell's path variable. 5. If needed, reboot your machine to take all previous modifications into account. If X was already installed on your machine and you have customized your xinit or xdm runtime configuration scripts, omit the config archive or unpack it elsewhere and extract only that which you need. If you're upgrading from XFree86 2.0 or 2.1, you can also omit the fonts archive. NOTE: Do not uncompress the font files in lib/X11/fonts without subsequently running 'mkfontdir' in the corresponding font directory; otherwise, your server will abort with the message "could not open default font 'fixed'". Using shared libraries with NetBSD-current: The binary distribution for NetBSD-current uses shared libraries. In order to get it running you need to make sure that either: o XWINHOME is set to /usr/X386. In this case ld.so will find your libraries automagically o you added ${XWINHOME}/lib to the arguments of the ``ldconfig'' command in /etc/rc. (See ldconfig(8) in the manual for details) o you have a LD_LIBRARY_PATH environment variable that includes the path to your XFree86 libraries. (In this latter case setuid executables won't run). If XWINHOME is not /usr/X386 and you have an older version with shared libraries in /usr/X386, be warned that the libraries in /usr/X386/lib will probably take precedence over the one in XWINHOME because ld has a hard-coded path to /usr/X386/lib. Also, the distribution only works with post 940403 -current kernels and system libraries (after the off_t change). To reflect this incompatiblity, all shared lib version number are now 3.0. 4 - Installing Xdm, the display manager --------------------------------------- Since xdm is dynamically linked against -lcrypt, there's no issue on export restriction outside US for this binary distribution of xdm: it does not contain the DES encryption code. To install xdm type % cat XFree86-2.1.1-xdm.tar.gz | gunzip | (cd /usr/X386; tar xf -) To start the display manager, log in as root on the console and type `xdm -nodaemon'. You can start xdm automatically on bootup by disabling the console getty adding the following code to /etc/rc.local: if [ -x /usr/X386/bin/xdm ]; then echo -n ' xdm'; /usr/X386/bin/xdm fi To disable the console getty, change 'on' to 'off' in the console entry in /etc/ttys: console "/usr/libexec/getty Pc" cons25 off secure 5 - Configuring X for Your Hardware ----------------------------------- You *must* create /usr/X386/lib/X11/Xconfig to suit your hardware. See README.Config for step-by-step instructions for setting it up. The Xconfig file tells the X server what kind of monitor, adapter and mouse you have. In addition to README.Config, the server manual pages (XF86_Accel, XF86_Mono, XF86_SVGA, and XF86_VGA16) describe the options specific to each type of board. 6 - Running X ------------- 8mb of memory is a recommended minimum for running X. The server, window manager and an xterm take about 2.5 Mb of memory themselves. On a 4Mb system that would leave very little left over for other applications like gcc that expect a few meg free. X will 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 'startx >& startx.log'. Error messages are lost unless you redirect them because the server takes over the screen. To get out of X windows, type 'exit' in the console xterm. You can customize your X by creating .xinitrc, .xserverrc, and .twmrc files in your home directory as described in the xinit and startx man pages. 7 - Kernel Support for X ------------------------ The server supports several console drivers: pccons, syscons, codrv and pcvt. They are detected at runtime and no configuration of the server itself is required. The pccons driver is the most widely tested and is the console driver contained in the GENERICAHA kernels in NetBSD 0.9 and NetBSD-current The pcvt console driver is bundled with NetBSD-current. The pcvt X mode is compatible with the pccons driver X mode. VT-switching in X does not work in pcvt as far as I can tell. Syscons and codrv are not bundled with NetBSD-current. In order to use one of these drivers, you must reconfigure, compile and install a new kernel from the NetBSD sources. To make sure X support is enabled under NetBSD, the following line must be in your config file in /sys/arch/i386/conf: options XSERVER, UCONSOLE If using pcons you get the mesage: > XFree86 Version 2.1.1 / X Window System > (protocol Version 11, revision 0, vendor release 5000) > Operating System: NetBSD > Configured drivers: > Mach8: accelerated server for ATI Mach-8 graphics adaptors > (Patchlevel 0) > > Fatal server error: > xf86OpenConsole: CONSOLE_X_MODE_OFF failed (Inappropriate ioctl for device) > Was expecting pccons driver with X support > Check your kernel's console driver configuration and /dev entries > then delete /dev/ttyv0. I don't know why 'MAKEDEV' move /dev/ttyqf to /dev/ttyv0. (from Hung-Chi Chu ) The syscons console driver is not bundled with FreeBSD or NetBSD. Current version is 1.2 and supports XFree86-2.1.1. The codrv console driver is not bundled with FreeBSD, nor with NetBSD. It is available from ftp.uni-duisburg.de in /pub/unix/386bsd-0.1/unofficial/codrv and from bsd386.first.gmd.de in ~veit/codrv (no ANON FTP, login with 'guest'/'guest', cd to ~veit/codrv). It is not clear that anybody has attempted to get this working with NetBSD 0.9 MIT-SHM =-----= NetBSD-current supports System V shared memory. If XFree86 2.1.1 detects this support in your kernel, it will support the MIT-SHM extension. Under NetBSD-current, use the following to add shared memory support to your kernel: To add support for system V shared memory to your kernel add the lines: # System V-like IPC options SYSVMSG options SYSVSEM options SYSVSHM to your kernel config file. Then from /sys/arch/i386/config, type # rm -f ../compile//* # config # cd ../compile/ # make depend # make Then install your new kernel and re-boot: # cp /netbsd /onetbsd # cp netbsd / # reboot 8 - Rebuilding the XFree86 Distribution --------------------------------------- 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 './mkmf' and 'make' to link the server. See /usr/X386/lib/Server/README for more info. See /usr/X386/lib/X11/etc/INSTALL for instructions on unbundling and building the source distribution. If you don't already have the header files 'console.h' and 'pccons.h' installed in /usr/include/machine (or /usr/include/sys for 386BSD), then install the copies that are supplied in mit/server/ddx/x386/etc/. You should configure the distribution by editing mit/site.def before compiling. To compile the sources, invoke make World in the mit directory. Support for shared libs under NetBSD-current =------------------------------------------= If you're running NetBSD-current, you can enable the build of shared libraries by uncommenting the appropriate line in 'config/site.def'. 9 - Building New X Clients -------------------------- The easiest way to build a new client (X application) is to use xmkmf if an Imakefile is included in the sources. Type 'xmkmf -a' to create the Makefiles, check the configuration if necessary and type 'make'. Whenever you install additional man pages you should update whatis.db by running 'makewhatis /usr/X386/man'. To avoid the `Virtual memory exhausted' message from cc while compiling, increase the data and stack size limits (in csh type `limit datasize 32M' and `limit stacksize 16M'). Note: Starting with XFree86 2.1 and NetBSD-current, the symbol "__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 "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: #if (BSD >= 199103) To ensure that this symbol is correctly defined, include either (best) or in the source that requires it. For code that really is specific to a particular i386 BSD port, use __FreeBSD__ for FreeBSD, __NetBSD__ for NetBSD, __386BSD__ for 386BSD, and __bsdi__ for BSD/386. Another note: If you get the message: ld.so: undefined symbol _XtCvtStringToFont at run-time, you've stumbled on a semantic weakness of NetBSD-current dynamic linker. Applications that use libXmu also need libXt. If the client uses a standard Imakefile, this dependancy will probably by included in the Makefile automagically -- you'll not see the problem. Otherwise, just add '-lXt' to your library list in the Imakefile or Makefile and relink. Many thanks to - Pace Willison for providing the initial port to 386BSD. - Amancio Hasty for fixing cursor restoration, mouse bugs and many others. - Christoph Robitschko for fixing com.c and thus select(). - Nate Williams for the patchkit support for X. - Rod Grimes and Jack Velte of Walnut Creek Cdrom for use of their machines in preparing the FreeBSD binary release. Rich Murphey David Dawes Marc Wandschneider Matthieu Herrb $XFree86: mit/server/ddx/x386/README.NetBSD,v 2.11 1994/05/03 08:09:17 dawes Exp $