Usenet comp.os.linux.announce (1993-2013)
 help / color / mirror / Atom feed
* Linux Frequently Asked Questions 6/6 [monthly posted]
@ 1993-06-11 10:06 corsini
  0 siblings, 0 replies; 2+ messages in thread
From: corsini @ 1993-06-11 10:06 UTC (permalink / raw)


Archive-name: linux-faq/part6

Last-Modified: 93/06/11
Version: 1.19

*********************************************************
*							*
*   Answers to Frequently asked questions about Linux   *
*							*
*********************************************************

This post contains Part 6 of the Linux FAQ (6 parts).
It must be read *after* the 5 first parts. 

===================================8<====>8============================
CONTENTS (of this part)

	XIV.	EVERYTHING FOR PRINTING		(part5)
	XV.	UUCP/NEWS/MAIL for LINUX	(part6)

===================================8<====>8============================



XIV.  EVERYTHING FOR PRINTING
=============================
**** This is the lpd FAQ version 1.3 (last update 8th june), this
**** section is maintained by Brian McCauley. Please send any
**** suggestion to: B.A.McCauley@bham.ac.uk

 XIV.01)  What _is_ the Linux lpr/lpd package?

ANSWER: To quote the net-FAQ:

Lpr is a utility that is used to print files out to local and remote
printers. As with all networking, there are configuration files which
have to be tailored to your needs. These files are concerned with
access control, accounting and page setup of your printer(s).  Now all
control of the printer is performed by a process called lpd

Lpd is a laser printer daemon (yes I know an epson isn't a laser
printer but thats besides the point). The program lpd is normally
started in /etc/rc.local in either the forground or the background.
What happens is that lpd will sink back as a daemon, only ever being
invoked when a printer request is generated. lpd itself has some
options which are of possible intrest to some people chiefly that of
the '-l' flag which causes lpd to log requests recieved from the
network (useful for debugging). The other option is for what port lpd
should listen for data on and is generally not used.

[ Note: lp really stands for line printer but as technology has
advanced laser printer makes more sense. Note also that lpr can be
used for queuing requests to use any specialised resource on a network
not just hardcopy output devices. ]


 XIV.02)  What is _the_ Linux lpr/lpd package?

ANSWER: Up until 28th May 1993, as far as there is a definitive Linux
version of anything _the_ Linux lpr/lpd is <bir7@leland.stanford.edu>
Ross Biro's port of the BSD sources dated 20th November 1992 (so if
you're used to AT&T's you'll find some differences).  Ross's binaries
and the diffse wer found in:

tsx-11.mit.edu:pub/linux/binaries/usr.bin/lpr.tar.Z
sunsite.unc.edu:pub/Linux/system/Daemons/lpr.tar.Z

The SLS file lpr.tgz on disk b2 contained the same stuff.

In addition to the standard BSD lpr capabilities Ross Biro's port
should have had better support for serial printers (but it didn't work
in the old binaries).

Ross's port was not based on the latest BSD sources (by about 3 years,
'88 vs '91). His new release will also be based on these sources which
can be found are at:

gatekeeper.dec.com and /afs/ir.stanford.edu/src/...

However this changed as of about 28th May 1993 so from now on this
version will be called the "old" binaries. On or about that date two
different new releases of lpd appeared. One of these was a version of
Ross's with bug fixes in:

sunsite.unc.edu:pub/Linux/system/Daemons/lpr.tar.z
tsx-11.mit.edu:pub/linux/binaries/usr.bin/lpr.tar.z

The other is a port of the '91 BSD sources by
<waltje@uWalt.NL.Mugnet.ORG> Fred van Kempen port and is availble as
source:

tsx-11.mit.edu:pub/linux/packages/net/net-2/sources/lpd/ 

or as part of the net-2 binary release in:

tsx-11.mit.edu:pub/linux/packages/net/net-2/binaries/net-std.tar.z 

Original '91 BSD sources are all over the place.

ftp.uu.net:systems/unix/bsd-sources/usr.sbin/lpr/
src.doc.ic.ac.uk:unix/bsd-sources/usr.sbin/lpr/

to name but two. The BSD sources have unGNU things in their Makefiles
so they don't compile ``out of the box''.

Ross agrees that Fred's version should be thought of as _the_ Linux
lpd package. I <B.A.McCauley@bham.ac.uk> have not had a chance to look
at the differences in detail yet, but most of this FAQ refers to the
BSD lpd package or Linux in general so this is probably not too
important.

There are some other versions of lpd stuff about but I have to draw
the line somewhere. If anyone whants to maintain FAQ sections on these
they are welcome to do so. The other versions include plp and the ka9q lp
facility. There are also rumours of SysV spoolers being ported.


 XIV.03)  How do I get lpr to work properly other than for root? Where
do the files go and what should their permissions be?

ANSWER: There is quite a bit of variation between the various releases
but I'll try where possible to offer solutions that are universally
applicable. Put /etc/lpd& in your /etc/rc or /etc/rc.local (usually in
/etc/rc.local after you start syslogd (if you use syslogd)).

Set the group fields of the file permissons/ownership as follows:

-rwxr-s---   1 root     daemon      37892 Nov 19 23:32 /etc/lpd
-rwx--s--x   1 root     daemon      21508 Nov 19 23:32 /usr/bin/lpc
-rws--s--x   1 root     daemon      17412 Nov 19 23:32 /usr/bin/lpq
-rwx--s--x   1 root     daemon      17412 Nov 19 23:32 /usr/bin/lpr
-rwx--s--x   1 root     daemon      17412 Nov 19 23:32 /usr/bin/lprm
-r-xr-xr-x   1 root     daemon       2816 May 10 13:37 /usr/bin/lptest
srwxrwxrwx   1 root     daemon          0 Feb  4 20:54 /dev/printer

...and for each of the spool directories listed in the sd fields of
/etc/printcap... 

/usr/spool/lpd:
total 5
drwxrwxr-x   2 root     daemon       1024 May 18 23:00 .
drwxr-xr-x  11 root     root         1024 Feb 19 20:56 ..
-rw-rw-r--   1 root     daemon          4 May 18 23:00 .seq
-rw-rw-r--   1 root     daemon         18 May 18 23:00 lock
-rw-rw-r--   1 root     daemon         25 May 18 23:00 status

Note these 3 files are created by lpr and lpd so if you've never
run these they could be missing so touch them into being.

In Fred's port the group is ``lp'' not ``daemon''. You don't need the
socket /dev/printer for Fred's port as it keeps it's socket in
/tmp/.printer and creates/deletes it as needed.

Some of these permissions may be overkill so don't be surprised if
your system works with different permissions. The fact that lpq needs
to be suid root is inelegant and may change in the future. People tell
me that lpr must be setuid(root) but I've not seen evidence that this
is really the case as long as the file permissions on the spool queues
are right. Still as far as I know lpr is designed to be secure when
installed setuid(root).

Alternative approach: just make lpc, lpr and lprm setuid(root) then
you can almost forget the file permissions on the spool queues!

You're free to choose different directories for the executables on
your system (notably lpc is usually in /etc even though it has
commands that are useful to non-root).

There location of master lpd lock file is fixed at compile time. It is
either in /usr/spool/lpd.lock or /var/spool/lpd/lpd.lock depending on
which version of lpd you get.

My advise is keep your primary spool queue in /usr/spool/lpd and make
/var a symlink to usr or keep it in /var/spool/lpd and make /usr/spool
a symlink to ../var/spool. This gives the greatest compatibility with
the pathnames that are compiled into the various distributed binaries.

The main configuration file is /etc/printcap although the old binaries
look for it in /usr/etc/.  The old binaries' README says hosts.equiv
and hosts.lpd files are looked for in /etc/inet but again the more
accepted convention is to locate them in /etc.

Since, IMHO, working out in which particular etc directory each file
should reside is tedious, I would advise having only one:

mv -i /usr/etc/inet/* /etc/inet/* /usr/etc/* /etc/
rmdir /usr/etc/inet /etc/inet /usr/etc
ln -s ../etc /usr/etc
ln -s . /etc/inet

[But make sure the files in /usr/etc and /etc/inet are not already
symlinks into /etc or you'll be in deep water.]

This makes your /etc huge but I think it's safe as I'm not aware of
any packages that require different files or the same name in /etc and
/usr/etc. [Health warning: this is IMHO - other people have different
ideas.]


 XIV.04)  What are all these diretrories for? (/etc, /usr/etc, /etc/inet,
/usr/spool, /var/spool)

ANSWER: This is one to which I can't find a staight answer.

For various reasons including the difficulties of fsck'ing / some
people like to put all things that aren't needed during bootstrap in
/usr so that / is as small as possible. They therefore move
unessential big files (usually the binaries) from /etc/ to /usr/etc/.

Unless you know what you are doing I'd advise keeping it all in /etc
with /usr/etc and /etc/inet being symlinks back to /etc. (In fact
these links are probably soon to be redundant as most recent binaires
now look in /etc/.)

The alternative approach is to have a real /usr/etc directory
containing all the non-essential stuff and make symlinks to each file
therein from its namesake in /etc.

Also a few people like all their internet stuff in /etc/inet but as
recent binaries excpect to find this stuff in /etc they must create
links for each file from /etc into /etc/inet.

If you want to spread out your configuration files for the sake of
tidiness then a better solution is to have a directory tree called
/conf and make the files in /etc symlinks into this tree.

To avoid the problem of your /usr filesystem filling up as a result of
stuff in spool queues some poeple perfer to keep their spool queues
and such like in a separate filesystem called /var. If you don't have
a /var file system then you should make /var a symlink to usr. If you
_do_ have a /var filesystem to may want to make /usr/spool a symlink
to ../var/spool so that any programs expecting to find /usr/spool will
not be dissapointed.


 XIV.05)  Why do I get ``jobs queued, but cannot start daemon'' or
``lpc: connect: No such file or directory'' ?

ANSWER: Firstly this "start" in the context of this error really means
"wake". If ``ps ax'' does not reveal a lpd then you daemon has died
(or was never started).

If you so have an lpd then you are having trouble with the socket
connection to lpd.  I don't really understand this but the problem was
common in early days with the old binaries but developments in the
TCP/IP code in the kernel fixed it for most people. Using the new lpd
from the net-2 package without the net-2 kernel stuff sometimes gives
this problem.

When I get it I find that kill and restarting lpd a few times will
eventually get rid of the problem. There has also been a suggestion
that recompiling your kernel without TCP/IP at all can help. If
linux-0.99pl10 with it's all new TCP/IP stuff doesn't fix this then
further reserch is probably called for.


 XIV.06)  Where do I get a printcap for a xxxxx?

ANSWER: This question is essentially meaningless - see next question.


 XIV.07)  What is the content of /etc/printcap?

ANSWER: Given the similarity in appearence and name between
/etc/termcap and /etc/printcap one could be forgiven for assuming that
they contain analogous infomation. This is not the case. Whereas
termcap contains informations about terminal *types* - (mostly escape
seqences) printcap contains information about *specific* printers
(like the directory that holds the spool queue and the device name of
the printer). The information about a printer model's escape sequences
and so on are held in the various filters which are _programs_ called
by lpd to drive the printer. /etc/printcap simply gives the locations
of these filters.  For details RTFM(printcap). [Alternatively the
net-FAQ has a summary of some of the more important fileds.]

One last point you should always specify ``suppress header'' ``:sh:''
unless you have *text* (_not_ postscript) printer and want banners. On
a text printer they are usually a waste of time and paper. On a
postscript printer they usually stop your printer working.  (See the
banners question for further expanation).


 XIV.08)  What is the format of a /etc/printcap?

ANSWER: Ideally RTFM(termcap) (yes, I said *termcap*) but since most
people don't have TFM(termcap) here are the essentials.

Lines starting # are comments (as you might have guessed).

For each printer usable from the lpr command on your system there is
one logical line in the file. For the sake of readability each logical
line may be spread over several physical lines by making the last
character on all but the last physical line a backslash.

Each logical line has the following format:

name1|name2|name3:string_capability=string:\
       :numeric_capability#number:boolean_capability:

The leading spaces and colon on the second line are for readability
only.

A printer can have as many names as you like but conventionally the
final name is used as a longhand description of the printer. (Still
people are free to say `lpr -P "Fred's grotty teletype"' if that's
the description you've given.)

The list of capabilities can be as long as needed and the order is not
significant. Each ``capability'' is denoted by a two character code.
(The name ``capability'' comes form the file format's termcap heritage
- parameter or attribute would be a more sensible terms.) [Note from
Ross Biro: capabilities with 3 character names don't work properly
which is why the serial port stuff in the old binaries failed.]
Capabilities having string value and have a = delimiter between the
capability name and the value while those having a numeric value use a
# (actually they can use either a # or an =). Boolean ``capablilties''
are true if they appear in the list and false if they do not.

Special characters in a string value can be expressed using `\'-escape
sequences as in C; in addition, `\E' stands for ESC.  `^' is also a
kind of escape character; `^' followed by CHAR stands for the
control-equivalent of CHAR.  Thus, `^a' stands for the character
control-a, just like `\001'. `\' and `^' themselves can be represented
as `\\' and `\^' respectively. `\:' for `:' seems to work but the
source code contains a comment to the effect that it is unsafe and
`\072' is a better idea.

Example:

lp|bam|BAM's Epson FX-80:lp=/dev/lp1:sd=/usr/spool/lp1:sh:mx#0:\
	:df=/usr/local/lib/magic-filter/lp.df:\
	:if=/usr/local/lib/magic-filter/lp.if:

Name is lp (this is the printer that lpr uses by default). It's also
known as bam or "BAM's Epson FX-80".

The printer is on /dev/lp1 (aka AT-bus LPT1:). I don't want a burst
page. I don't want a file length limit. Files queued by `lpr -d' are
passed through /usr/local/lib/magic-filter/lp.df and those queued by
`lpr' through /usr/local/lib/magic-filter/lp.lf.

See also the next question.


 XIV.09)  My /etc/printcap looks identical to someone else's but it
doesn't work - why?

ANSWER: See if lpc stat reports a printer called ` :'. The last
character on a continued line must be a \. If there are whitespace
characters after the \ then it doesn't register the next line as a
continuation.
 

 XIV.10)  What's the minimum /etc/printcap?

ANSWER: This is a silly question but it _is_ frequently asked. The
answer is ``lp:sh'' (that's 6 bytes including the required linefeed
character on the end). To use this /etc/printcap you must make /dev/lp
a symlink to your printer and create your spool queue directory as
/usr/spool/lpd.  (You might think that if you wanted banner pages you
could loose the ``:sh'' but the termcap syntax requires at least one
capability per entry).


 XIV.11)  How do I prevent the `staircase effect'?

ANSWER: Unix terminates each line of a file with a linefeed but not a
carriage return so taken literally a Unix text file printed on an
ASCII device will start each line below the end of the previous line.
Some printers can be set to treat "linefeed" as "carriage return,
linefeed", others can't. If yours can then do simply do that. If the
printer cannot be fixed create a shell script filter that reads:

#!/bin/sh
if [ $1 = -c ]; then
  cat
else
  sed -e s/$/^M/
fi
echo -ne \\f

where ^M is a carriage return character not a ^ followed by a M.  To
type ^M in emacs use the sequence C-q C-m and in vi use C-v C-m.
Conventionally this script is called /usr/lib/lpf. The test of $1
allows the isertion of carriage returns to be switched off by the `-l'
switch on lpr.

Alternatively your printer may have an escape sequence that will set
the way it handles linefeed characters. A simple filter that uses an 
`echo -ne' command to send this sequence may be appropriate.

#!/bin/sh
# Filter for HP printers to treat LF as CRLF  
echo -ne \\033\&k2G
cat
echo -ne \\f

[Ross Biro's new release includes a slightly more complex filter
stript called /usr/lib/hpof that does this and a few other things to
make an HP printer behave sensibly even if it was in the wrong
language when you started.]


 XIV.12)  How do I get my printer to go back to the default font after
each printout?

ANSWER: Either make your filters do it or define the `tr'
``capability'' in /etc/printcap to be your printer's font reset
command. For details of the format of this string see the question on
the format of printcap. This may not work if a printout crashes in the
middle of an escape sequence - putting a lot of ^@ on the front may
help but this probably won't be enough it you were printing raster
graphics when the filter died.


 XIV.13)  How do I prevent a formfeed at the end of every printout?

ANSWER: If you don't have an `if' specified in /etc/printcap then lpd
will automatically put a formfeed at the end of each file. If you're
using a filter then it's up to the filter to decide if it wants to put
a formfeed. To disable formfeed completely if you don't have an `if'
put :ff=: in your /etc/printcap.  But please note this suppresses the
formfeed that would usually be printed if a filter dies. If you want
formfeeds after text printouts but not on printouts printed with `lpr
-l' then create the following `if' filter:

#!/bin/sh
cat
if [ "$1" != -c ]; then
  echo -ne \\f
fi

If you want a formfeed after `lpr -l' to be optional you can misuse the
`-i' switch to suppress the formfeed with the following trick (after
all `lpr -i -l' would usually not be implemented).

#!/bin/sh
cat
# use lpr -i -l to print raw without trailing formfeed
if [ "$1" != -c -o "$4" = -i0 ]; then 
  echo -ne \\f
fi 


 XIV.14)  How do I use a printer that's doesn't present a normal
device interface?

ANSWER: [Firstly I'll explain the question.] The most common example
is a printer that is connected via a network in some strange way.  For
example consider a printer conneccted to a host running some esoteric
OS with which you can only communicate via E-mail. To use this printer
without going through lpr you would say something like:

  | uuencode tmp | mail printer-request@eosteric

in place of: 

  > /dev/lp

To use such a printer through lpr the ``lp'' capability of the print
queue can be directed to /dev/null and _each_ filter must must
explicitly uuencode and mail its output. In more complex cases if you
already have an ``if'' or ``of'' filter for a strangely connected
printer then other filters can pass their output to/through this
filter to avoid duplication of effort.  In this case the ``if'' filter
should usually be called with the ``-c'' switch to minimise the
further manipulations if performs.


 XIV.15)  How do I get burst/banner pages?

ANSWER: For a simple text printer (in particular not postscript) and a
simple text banner simply take :sh: out of the printcap record. If you
want to prevent the banner comming out in whatever font was last used
on the printer then define the `tr' ``capability'' to be your
printer's font reset command.

If you want a fancy cusomised banner (or have a postscript printer)
leave :sh: in the printcap and make each of your filters print the
banner. All the information to put on the banner is included in the
filter's positional parameters.  RTFM(printcap) for details. [ If
you're using <B.A.McCauley@bham.ac.uk>'s magic-filter package then
call the code to print the banners from the config script. ]


 XIV.16)  How do I print text on a PS printer?

ANSWER: You need a filter based on a program that converts ascii to
postscript. The most well known of these is ``enscript'' but it's also
the hardest to find. Others include ``a2ps'' and ``mpage'' (for
details of these see the periodic c.o.l.a posting "How to print under
Linux" by <gtaylor@god.hounix.org> Grant Taylor)

The nearest thing to enscript that an archie search revealed was a
package called ``nenscript-1.13++.tar.Z'' deep in the guts of
gatekeeper.dec.com which appears to do the job but it's prone to
trimming off the tops of your pages.  (It didn't compile ``out of the
box'' with the GNU libs but all it needed was one #undef.)

[I've not looked into these in detail as I don't have a PS printer. I
would like someone to send me an exaple of a filter that they use
using one of these.]


 XIV.17)  Why do files with a lot of graphics get truncated?

ANSWER: Usually because you've got a limit set on the maximum size
file that can sit in the spool queue. Put `mx#0' in your printcap.


 XIV.18)  Why doesn't `lpr -i' work?

ANSWER: To get lpr -i to work you need a filter istalled as `if' that
implements it.  The -i switch is simply passed on by lpd to the filter.
There is such a filter usually called /usr/lib/lpf that can be obtained from
bsd source archives in the directory bsd-source/lpr/filters.  It's also part
of Fred's port but he put it in /usr/bin/.  If you whant to use this program
but still want your filter to do some printer specific initialisation then
write script thus:

#!/bin/sh
# My initialisation stuff goes here
exec /usr/lib/lpf $*


 XIV.19)  Why doesn't `lpr -p' work?

ANSWER: Because it's broken. lpd always thinks that the printer is 0
characters wide regardless of what printcap says. This is still broken
in Ross's new release and Fred's port of the '91 sources. Looking at the
sources the fix for Fred's port appears to be:

-------------------------------Cut Here-------------------------------------
*** printjob.c.old	Sat Feb 27 14:07:01 1993
--- printjob.c	Sun Jun  6 11:02:36 1993
***************
*** 265,271 ****
  	 */
  	for (i = 0; i < 4; i++)
  		strcpy(fonts[i], ifonts[i]);
! 	strcpy(width+2, "0");
  	strcpy(indent+2, "0");
  
  	/*
--- 265,271 ----
  	 */
  	for (i = 0; i < 4; i++)
  		strcpy(fonts[i], ifonts[i]);
! 	sprintf(&width[2], "%d", PW);
  	strcpy(indent+2, "0");
  
  	/*
***************
*** 1081,1087 ****
  		FF = DEFFF;
  	if ((PW = pgetnum("pw")) < 0)
  		PW = DEFWIDTH;
- 	sprintf(&width[2], "%d", PW);
  	if ((PL = pgetnum("pl")) < 0)
  		PL = DEFLENGTH;
  	sprintf(&length[2], "%d", PL);
--- 1081,1086 ----
----------------------------------Cut Here------------------------------

This patch is untested as I don't have a complete set of net-2 include
files on my machine yet.

One other thing: lpd calls pr by full pathname so if you keep pr
somewhere different from where lpd looks you will need a symlink.
Where lpd expects to find pr varies from version to version but I
think /usr/bin/pr is the usual place.


 XIV.20)  Why does lprm say `too many users'?

ANSWER: This was a bug in the C library in the scandir() function
which failed when an unsorted directory list was requested. This has
been fixed now so just get a new libc.so. Alternatively there is a
lprm with a workround (by toy@soho.crd.ge.com) in:

sunsite.unc.edu:/pub/Linux/system/Daemons/lprm-fix.tar.z


 XIV.21)  Why does lpc complain that it hasn't stopped a daemon?

ANSWER: There's one lpd process that runs all the time and it spawns
off children to handle each printer as needed. These children leave
lock files lying about so lpc thinks that they are still running and
tries to kill them. Was a bug but it was not serious and is fixed in
the latest releases.


 XIV.22)  Why does 


 XIV.23)  How do I print over a Network?

ANSWER: To print on the printer "foo" connected to the machine
"bar.baz.net" from the machine "mine.baz.net" you put an entry like
this in your /etc/printcap (on mine.baz.net):

foo:lp=:rm=bar.baz.net:rp=foo:sd=/usr/lpd/spool/foo:

and, of course, create the spool directory /usr/lpd/spool/foo.

There's no point specitying filters and the like in
mine.baz.net:/etc/printcap as it's the one in
bar.baz.net:/etc/printcap that will get used.

On the machine bar.baz.foo, you need to put "mine.baz.net" on a line
by itself in either /etc/hosts.equiv or /etc/hosts.lpd; note that
putting it in /etc/hosts.equiv will allow for unauthenticated logins as
well as printing.  /etc/hosts.lpd is printing only.

[ Editors note: I realise there are more questions about net printing
but I don't know them. If you find any let me know (with answers if
possible). See also the net FAQ ]


 XIV.24)  Which /dev/lp* is my printer?

ANSWER: On an XT bus system LPT1: becomes /dev/lp0 (major=6, minor=0),
on an AT LPT1: becomes /dev/lp1 (major=6, minor=1). To be more
precise:

Name Major Minor I/O address
 lp0   6     0       0x3bc
 lp1   6     1       0x378
 lp2   6     2       0x278


 XIV.25)  When the kernel boots it says `using polling driver,' is
there an interrupt driven driver?

ANSWER: Yes the latest kernels support parrallel port IRQs but to
enable them you must ether: edit the IRQ number into lp_table[] in
lp.c in the kernel source, or use `lpcntl'. The interrupt driver uses
less processor time and gives a faster throughput but sometimes one
may choose sacrifice this to free up an IRQ line. If your printer is
/dev/lp1 using IRQ 7 put:

/etc/lpcntl /dev/lp1 7

in your /etc/rc.

If you don't have lpcntl get it from:

tsx-11.mit.edu:/pub/Linux/BETA/lp/lpirq.4.tar.Z


 XIV.26)  What's the difference between the polling driver and an the
interrupt driven one?

ANSWER: A polling sits in a loop repeatedly reading the port hardware
to see if it is ready for another character and then gives it one. An
interrupt driver goes to sleep and is woken by the port hardware
(using a hardware interrupt) when it wants another character. Polling
drivers are easier to write but in multitasking environments they are
a bad thing.) I have seen some OSs for PC/AT machines where the
polling printer drivers are more reliable than the interrupt ones but
I doubt this is the case in Linux :-).
 

 XIV.27)  How do I write filters?

ANSWER: In normal Unix terminology, filters are just programs (so they
must have execute permission) that read a stream from their standard
input and write to their standard output.

lpd filters are filters in the sense that thay read from their STDIN
and write to their STDOUT but are not necessarily true filters in that
they may assume that their standard input is a file and perform
lseek() operations on it. I'm not sure that such filters are strictly
conforming but they seem to work OK.

All lpd filters must conform to a particular command line syntax (or
more often simply ignore command line parameters). For details of the
command line parameters RTFM(printcap).

It's easier to debug filters if you test them in an immediate shell
before you install them. (If your filter make use of its command line
arguments you'll have to specify them too).

my-new-filter <file >/dev/lp1

If you want to write a shell script filter it must have a #!/bin/sh
header.  Here for example is my Epson FX-80 dvi filter:

#!/bin/sh
/usr/TeX/bin/dvips -f | \
/usr/bin/gs -q -sDEVICE=eps9high -r120x216 -dNOPAUSE -sOutputFile=- -

More good specific examples can be found in the peroidic c.o.l.a
posting "How to print under Linux" by <gtaylor@god.hounix.org> Grant
Taylor. The document also explains to print out the types of file you
wouldn't normally have a filter for eg. texinfo. (Not that you can't
have a texinfo filter - I have one but it does leaver the printer
idling for a long time while tex runs.)


 XIV.28)  I've written a filter in shell script which works OK when I
use it from the shell prompt but fails when I tell lpd to use it?

ANSWER: You may need a #!/bin/sh header. You may also need to set PATH
within the script since the daemon's PATH may not have everything you
need.


 XIV.29)  When should I define an `of' filter?

ANSWER: Never. (Well strictly speaking there are circumstances but
you're unlikey to meet them until you're so familar with lpd that you
won't need this FAQ.)


 XIV.30)  Where do I get filters for given printers?

ANSWER: From BSD source archives (I think). [Editors note: I need a
better answer here ].

If you already have a program to print say DVI on your printer by some
mechanism then making it into a filter is usually a matter of writting
trivial shell script - see this FAQ. If the program you are using
insists on reading a names file as input see the next question. Text
mode filters are trivial too (see this FAQ) unless you want lpr to
have a choice of fonts in which case they are slightly harder than
trivial.  You will probably want to insert and `echo -ne' command at
the beginning and end of your filter to set up the font etc to your
liking.


 XIV.31)  How do I get a program that won't read from STDIN to act as
a filter?

ANSWER: For example dvilj2p insists on a named file as its input (and
what's more expects one with a .dvi suffix). To make a dvi filter for
a laserjet you'll have to capture the STDIN into a temporary file.

#!/bin/sh
cat >/tmp/$$.dvi
dvilj2p /tmp/$$
rm /tmp/$$.dvi

The problem with this kludge is that is may have a very high disk
overhead. (In the long term dvilj2p should be fixed).

If you have procfs you can use the following trick:

#!/bin/sh
ln -s /proc/self/fd/0 /tmp/$$.dvi
dvilj2p /tmp/$$
rm /tmp/$$.dvi

Note: If it wasn't for the fact that dvilj2p adds a .dvi suffix you
wouldn't need the temporary symlink and could just specify
/proc/self/fd/0 directly. People who use this trick often usually keep
permanent symlinks to /proc/self/fd/* in /dev.


 XIV.32)  The set of filters supported by lpd seem strange - why
aren't there filters for Postscript, GIF, TIFF and so on?

ANSWER: History. You can, in fact, use any of the filters (with the
possible exception of the default filter) for any reason. If you're
never going to use Benson Varian raster files you could use the -v
switch for GIF files. Remember that if you create a filter for a file
format that takes a long time to process then your printer may sit
idle between print jobs even when there are things in the queue.

If you are on a network remember that the filter setups go on the
print server so you will need to consider other people's needs too.
One way to avoid running out of filter options is to define several
logical printers in /etc/printcap that all point to the same physical
one. One small problem with this is that you have no control over the
order in which files from separate queues are printed. Another way to
avoid running out of possible types is to use magic filters.


 XIV.33)  What are magic filters?

ANSWER: Magic filters deduce their input files' types from `magic
numbers' (distictive byte patterns at particular offsets).  Magic
filters are usually perl scripts, shell scripts or C programs that
simply identify the file type then call the appropriate non-magic
filter. Blatent plug :-) I <B.A.McCauley@bham.ac.uk> have a generic
magic filter bash script that selects the right filter to use based on
the output of the `file' command. With my magic ``dvi'' filter (and
3 associated non-magic filters) I can do things like:

lpr -d file1.dvi file2.div.Z file3.ps file4.texinfo.z

(BTW confguring lpr to handle texinfo files getting a bit silly - see
previous question).

This is now at:

tsx-11.mit.edu:pub/linux/sources/usr.bin/magic-filter-0.3.tar.gz

(Although the release number will doubtless change in future).

Other examples of magic filters (a simpler shell one and one in C)
can be found in the periodic c.o.l.a posting "How to print under
Linux" by <gtaylor@god.hounix.org> Grant Taylor.

Magic filters should never specified as `of' as the output filter only
gets called once if a number of files are printed without a gap.

IMHO magic filters as `if' can also cause problems as they may prevent
you, say, _listing_ a PostScript or nroff file. (Other people disagree
as, if you are making your printer available on a network, it can be a
pain having people accidently listing ps files.)



XV. UUCP/NEWS/MAIL for LINUX
============================
*** This section is an expert of the UUCP-NEWS-MAIL-FAQ, posted twice
*** monthly in c.o.l.a. This section and the complete FAQ about UUCP
*** and others is written by Vince Skahan (vince@victoria.sea.wa.us),
*** mail him for any corrections and information.
***
*** Last update 93/06/11


XV.A. General Information
XV.B. UUCP

XV.C. News
XV.D. Mail


XV.A. General Information
~~~~~~~~~~~~~~~~~~~~~~~~~

  XV.01)  What uucp, news, and mail software works under Linux ?

ANSWER:
Just about everything, most with no (or minimal) patching required...

The following is a quick but not all-inclusive list of software known to work
under Linux:

	UUCP 		- Taylor UUCP 1.04
	News transport	- Cnews 12/22/91 patchdate (no 'optional' speedups)
                          Cnews 'performance release' (needs patching)
                          INN 1.4 (needs patching)
                          dynafeed
                          nntp 1.5.11 'reference' release, slurp 1.05
	News readers	- tin-1.2-p0
                          trn-2.5 (probably also 3.0)
                          nn-6.4.18
                          tass
                          rn4.4
                          waffle 1.65
	Mail transport  - smail2.5
                          smail3.1.28
                          sendmail5.65c+IDA
	Mail program	- elm2.4.21 (probably also 2.4.22)
                          pine
                          procmail
                          deliver

  XV.02)  So where are the sources ?

ANSWER:
At your friendly neighborhood archive site where you find sources normally.
Consult archie for a list.

Config files for the portions of UUCP/News/Mail currently in the SLS
distribution of Linux can be found on sunsite.unc.edu in the file
sunsite.unc.edu:/pub/Linux/system/Mail/newspak-1.4.tar

  XV.03)  Do I really need the sources ?

ANSWER:
Yes, if you want to *really* understand how the pieces are configured and
how they fit together.  If you already know how...probably not unless you
want to change the paths used or do custom patching for some reason.

There is considerable documentation in the sources that doesn't get
"installed" that helps fill in the blanks between what you need to know, and
what you can figure out.

  XV.04)  How do I get my system a news/mail/uucp feed ?

ANSWER:
	Please see the "how to become a USENET site" periodic posting
	in news.answers


XV.B. UUCP
~~~~~~~~~~

  XV.05)  Why do I get 'timeout' on connections when I upgraded to
uucp-1.04 ? 

ANSWER:
	If you use a 'Direct' device in the Devices file, there's now a
	10 second timeout compiled in.  Make the name of the Device anything
	other than 'Direct'.

  XV.06)  Why doesn't anonymous uucp seem to work ?

ANSWER:
	The SLS anonymous uucp only works in Taylor mode because it's
	compiled with HAVE_TAYLOR_CONFIG.  If you want to do anon uucp in HDB
	mode, you'll have to recompile the sources with just HDB defined.

	HDB mode also seems rather particular about things like blank spaces
	and blank lines in your Permissions file.  If you get log file entries
	that indicate 'no permission' for anon uucp, a good place to start is
	to make sure that there are no blank lines (comment 'em out).


XV.C News
~~~~~~~~~

  XV.07)   What newsreader is best ?

ANSWER:
	No way I'll open that can of worms other than to say that you
	definitely want something with "kill files" and probably want
	something with 'threads'.  

	For what little it's worth, I use 'nn'.
	
  XV.08)  with trn - why do I get the message 'dbinit failed' ? 

ANSWER:
	Because you didn't run mthreads from cron to keep the threads database
	up-to-date.

  XV.09)  why is my 'nn' database getting continuously corrupted ?

ANSWER:
	If you built it from sources and you asked for the 'words' method of
	building the database,  it will definitely get corrupted if your
	filesystem doesn't handle long filenames (ie...comp.os.linux.announce
	is more than 14-characters).  Build it with the 'by-number' way of
	creating the database and you'll be fine.

  XV.10)  why can't I post to moderated groups ?

ANSWER:
	Probably because the newsreader is trying to call /bin/mail to send
	the mail and it doesn't like it.  Replace the /bin/mail in SLS with
	the port of mailx-5.3a.tar.z from the pub/Linux/system/Mail dir on
	sunsite.unc.edu and make it mode 2755 and group mail (like 'elm') and
	you'll be all set.

	Another possibility is that you have a moderated newsgroup set up on
	your local system as not-moderated and somebody upstream is quietly
	deleting the article (some system's software, not a person).  Make
	sure you run a 'checkgroups' every now and then when the checkgroups
	article rolls by in news.admin every few weeks.

  XV.11)  Why do I have problems that appear to be permission-related ?

ANSWER:
	All the stuff in /usr/local/lib/news should be news.news except
	/usr/local/lib/news/setnewsids which should be setuid root.

	Past versions of SLS had no 'news' group or user by default, which
	caused lots of problems for people if they installed the news 
	software *before* they added the 'news' group and user.

  XV.12)  Why doesn't SLS have the 'Performance Release' of C-news?
	  INN ? NNTP ? 

ANSWER:
	Because SLS can't have *everything*.  It has the pre-performance C-news
	because it's a very fast and stable implementation for non-nntp sites
	that fits the needs of a normal uucp-only site.  If you're that into
	having the most current of everything, you should probably be building
	it from the sources.

  XV.13)  Why does doexpire say "severe space shortage" when there's
	lots of room ? 

ANSWER:
	Because it can't read /etc/mtab.  Make it mode 644.  This happens
	when you unmount a mounted filesystem by root with a umask that
	doesn't permit world-read of files owned by root.

  XV.14)  How do I set up NNTP?

ANSWER:
	Please see the extended description from Matt Welsh in the
	UUCP-NEWS-MAIL-FAQ that appears routinely in c.o.l.a.


XV.D. Mail
~~~~~~~~~~

  XV.15)  Why is my hostname.domainname not in my headers and
something funky's there ? 

ANSWER:
	Because you didn't edit one or more of the following files like the
	README.linux files in the lib directories told you to:

		/usr/local/lib/smail/paths
		/usr/local/lib/smail/config
		/usr/local/lib/elm/elm.rc 

  XV.16)  Why can't elm write to my mailbox ?

ANSWER:
	You need elm and filter to be mode 2755 and group mail
	and also have /usr/spool/mail mode 775 and group mail.


  XV.17)  is sendmail+IDA available for Linux instead of smail ?

ANSWER:
   Yes !!! I've recently switched from smail to sendmail+IDA from the binary
   distribution on sunsite.unc.edu and it works great...and I'm a uucp-only
   site.  Look in pub/Linux/system/Mail for it...

 

	   ===================8<==========>8================


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#	LaBRI 			 |					    #
#  351 cours de la Liberation    |  e-mail:  corsini@geocub.greco-prog.fr   #
#  33405 Talence Cedex		 |  e-mail:  corsini@labri.u-bordeaux.fr    #
#  				 |					    #
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- 
	 There will be a sig when our local net is reliable.
	       For now, I would rather stay anonymous.


^ permalink raw reply	[flat|nested] 2+ messages in thread
* Linux Frequently Asked Questions 5/6 [monthly posted]
@ 1993-07-21  9:52 corsini
  1993-07-21  9:52 ` Linux Frequently Asked Questions 6/6 " corsini
  0 siblings, 1 reply; 2+ messages in thread
From: corsini @ 1993-07-21  9:52 UTC (permalink / raw)


Archive-name: linux-faq/part5

Last-Modified: 93/07/11
Version: 1.20

*********************************************************
*							*
*   Answers to Frequently asked questions about Linux   *
*							*
*********************************************************

This post contains Part 5 of the Linux FAQ (6 parts).
It must be read *after* the 4 first parts. 

===================================8<====>8============================
CONTENTS (of this part)

	XI. 	EMACS for LINUX			(part5)
	XII.	X11, THE MAXIMUM and MORE	(part5)
	XIII.	NETWORKING and LINUX		(part5)

===================================8<====>8============================


XI. EMACS for LINUX
=====================
*** This section is maintained by Rick Sladkey (jrs@world.std.com)
*** Last Update July 1993.



XI.A. GENERAL INFORMATION 
XI.B. GNU EMACS for LINUX



XI.A. GENERAL INFORMATION
~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is a short list of Frequently Asked Questions about GNU Emacs
under Linux.  It does not address general questions about Emacs which
are not Linux specific.  For general help about Emacs, 1) learn to use
and read the online documentation, 2) read the real Emacs FAQ found in
emacs/etc/FAQ, and 3) read the newsgroup gnu.emacs.help.

                                        Rick Sladkey <jrs@world.std.com>



XI.B. GNU EMACS for LINUX
~~~~~~~~~~~~~~~~~~~~~~~~~~~
  XI.01)  What versions of GNU Emacs are available for Linux?

ANSWER: All of them.  GNU Emacs 18, Epoch, Lucid Emacs, and FSF Emacs 19.
Even MULE and Nemacs are rumored to work.  In addition, there are other
Emacs-like but non-GNU editors such as Micro Emacs, Vile, JOVE, etc.

  XI.02)  Which files do I need?

ANSWER:
GNU Emacs 18.59 -- tsx-11.mit.edu:/pub/linux/packages/emacs-19.59/*
Epoch 4.1 -- sunsite.unc.edu:/pub/Linux/X11/epoch/*
Lucid Emacs 19.4 -- sunsite.unc.edu:/pub/Linux/apps/editors/lemacs/*
GNU Emacs 19.16 -- sunsite.unc.edu:/pub/Linux/apps/editors/emacs-19.16/*

  XI.03)  What if I want to compile Emacs myself?

ANSWER: It is fairly easy (and highly recommended) to compile Emacs
yourself if you have the the disk space.  In this case you only need
the standard Emacs distribution (emacs-18.59.tar.Z from any GNU archive)
and the Linux diffs and support files (emacs-18.59b.tar.Z from a Linux
archive).  The diffs are quite small and mostly amount to a
configuration file.  GNU Emacs 19.17 is even easier: just unpack it,
type `./configure --prefix=/usr' and then `make' and `make install'.

  XI.04)  How do I get Emacs to recognize my cursor keys?

ANSWER: Simple.  Don't use them. :-)   For Emacs 19.59 try putting the
linux.el file (from emacs-18.59b.tar.Z) in ~emacs/lisp/term and the
sample default.el in ~emacs/lisp.  For FSF Emacs 19 you need a decent
/etc/termcap file.  X11-based Emacsen don't need any support files
to get the cursor and function keys right.

  XI.05)  What packages are particularly useful under Linux?

ANSWER: Because info format is the documentation standard of the GNU
project and just about everything except the kernel comes from FSF,
you will find that Dave Gillespie's enhanced info package is very
useful.  It allows multiple info directories, space bar paging, and
supports compressed info files. Please learn to use info.  Imagine
Unix life without man.

Others that I highly recommend are Sebastian Kremer's enhanced
dired directory editor, Dave Gillespie's calc calculator, Masanobu
UMEDA's gnus for usenet news, and Kyle Jone's vm for mail.

All can be found in the OSU Emacs archive, ftp.cis.ohio-state.edu,
/pub/gnu/emacs/elisp-archive.  See the real FAQ for more details.

  XI.06)  Why does Emacs from the SLS dump core?

ANSWER: The version of Emacs included with the SLS requires the X
shared libraries.  Either install X or get the terminal-only version
of Emacs 18.59.



XII. X11 THE MAXIMUM and MORE
=============================
*** This section is maintained by Krishna Balasubramanian
*** <balasub@cis.ohio-state.edu>. Mail him if you have corrections,
*** additions, etc.
*** Last update:  July 1993



XII.A. X386 GENERAL INFORMATION
XII.B. HARDWARE REQUIREMENTS: Supported Video cards, mice.


XII.C. LINUX DISTRIBUTION: Files required, Current version.
XII.D. LEARNING/USING X: Pointers to X documentation.


XII.E. DEBUGGING STARTUP PROBLEMS: Checklist, Screen restoration, Hanging.
XII.F. XCONFIG: Video mode settings and common errors in Xconfig.


XII.G. X-APPLICATIONS: Compiling X programs.
XII.H. ATI: SVGA server for ATI boards.


XII.I. BUGS


The X11 directories on linux systems are:
XLIB = /usr/X386/lib/X11/  	(or /usr/lib/X11/) 
XBIN = /usr/X386/bin/  		(or /usr/bin/X11/)
XDOC = XLIB/etc/

cwxi = the comp.windows.x.i386unix newsgroup
Subscribe to this group if you are an xfree86 user. Post general
questions on xfree86 to cwxi instead of c.o.l. Very few problems
with using xfree86 are Linux specific.




XII.A. X386 GENERAL INFORMATION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 XII.01)  What is the X11 release supported by Linux?

ANSWER: It's the X11R5 (XFree86-1.3). 
There are (currently separate) servers for 8514 and S3 chips.

You should get newer versions of any applications that are older 
than the XFree86-1.2 release.

 XII.02)  What is X386/XFree86?

ANSWER: X386 is the port of the X11 server to System V/386 that was
done by Thomas Roell (roell@informatik.tu-muenchen.de).  It supports a
wide variety of VGA boards.  X386 1.2 is included in MIT's X11R5
distribution.

The Linux X386 port was based on the stock distribution from X11R5,
from MIT and was done by Orest Zborowski (obz@sisd.kodak.com).

It has since moved to becoming part of the standard XFree86 distribution.
See the FAQ on cwxi for more information on XFree86.

 XII.03)  Where can I get X386 1.2 (X11R5)?

ANSWER: The X386 1.2 and xfree86 sources are available at any site that
distributes the X11R5 source (too numerous to list here, but includes
export.lcs.mit.edu)


 XII.04)  Any tips on compiling X11R5?

ANSWER:
-  Dont do it.
-  XFree86 is distributed with a link kit so you can optionally
	include what you like in the server.
-  Join the XFree86 beta team (how to? see cwxi FAQ)
-  Instructions are in the README file in XDOC/ and the cwxi FAQ.




XII.B  HARDWARE REQUIREMENTS:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Approx: at least 4 megs of ram + swap ...slooooww. 10 Meg disk for X.
Another 6-10 meg of disk for GCC if you want to compile X11 programs.

 XII.05)  What VGA boards are supported?

ANSWER: 
	et3000, et4000, gvga, pvga1, wd890c00, trident, cirrus, ncr,
        compaq. X386mono supports generic vga's and hercules. This is
        covered completely in the XFree86 README file. 

	Diamond cards are not supported and will not be supported. If
	you are the unfortunate owner of such a card, you can probably 
	get the server up by booting in specific modes or using dos to 
	set your modes before warm booting into linux or using an external 
	clock setting program. You will have to bear with these irks until 
	you can convince diamond to alter their non-disclosure policy.

	ATI		See the ATI section below.

			Those with 8514 compatible cards may want to get 
			the X8514 server for speed (~2x xstones?).

	MONO    Any vga card should be able to use X386mono server. (At least
		640x480 with 800x600 virtual). Use the vga2 section of Xconfig.
		Support for hercules monochrome card (usable as 2nd display).

The following servers will usually not handle all the options supported by 
XFree86. Read the documentation that comes with them carefully. They
will be merged with the XFree86 distribution in some time.
 

8514	ATI graphics ULTRA, ATI graphics Vantage 
	Should work with any VESA standard 8514/A register compatible
	card? Courtesy Kevin Martin (martin@cs.unc.edu).

	Scott Laird (lair@midway.uchicago.edu) writes: 
	I uploaded a new version of the X8514 X Server to sunsite and 
	tsx-11. It is in /pub/Linux/X11/X-servers/X8514/X8514scale.tar.Z
	on sunsite. It's linked with version 4.2 of the jumptable libraries,
	includes TCP/IP support, support for compressed bitmap fonts, Type 1 
	and Speedo scalable fonts.  There's a README file in the same 
	directory that will answer more questions.

XS3	S3 chipset server (Jon Tombs jon@robots.ox.ac.uk)
	Get the FAQ on ftp.robots.ox.ac.uk (pub/linux/S3 check sunsite).

Xega	Generic 640x480x16 compatible server (originally for laptops).
	This requires a microsoft mouse at /dev/mouse for now
	and it does not use Xconfig so use environment variables
	to define the font path etc. in .xinitrc:
	export FONT_PATH=/usr/lib/X11/fonts/misc:/usr/lib/X11/fonts75dpi
	Works better with courier fonts so add to .Xresources:  
	*Font: -*-courier-medium-r-*--10* ..or whatever..
	A link kit is available at tsx-11 (you need gcc2.2.2).
	in pub/linux/ALPHA/Xega/X386.ega.T.Z
	(Obselete? Unusable? Anyone?)


WARNING: Do not try to bring up an Xserver that does not support your 
hardware. There have been cases where damage has resulted from pushing
the monitor (specially fixed frequency monitors) beyond its specs.


 XII.06)  What Mouses are supported?

ANSWER: Serial : Logitech, Microsoft, MouseSystems .... compatibles ...
	Busmouses : Logitech, microsoft, ATI_XL, PS/2 (aux).



XII.C. LINUX DISTRIBUTION
~~~~~~~~~~~~~~~~~~~~~~~~~

 XII.07)  What is the current version?

ANSWER:	The newest public Linux release is XFree86-1.3. 
It was compiled with gcc-2.4.3 (jump tables 4.4) and is available 
for example at tsx-11 in pub/linux/packages/X11/XFree86-1.3/.

 XII.08)  What Files do I need to download?

ANSWER: For XFree86: There is a README file in the distribution directory.
Bring this down first and read it. Then get xbin, xman and xfonts.
You need xprog and xlibman only if you plan to compile X applications.
You need xkit if you want to relink the server.

**** You need The shared images libc.so.4 (4.4 or later) and libm.so.4  
in /lib/. All the X11 binaries use these. These are available with the GCC
distribution or any new rootdisk. To compile programs you should
get gcc-2.3 or later and the 4.4 libraries.

To get a different server, see the notes in the previous section.

X11 directories in the archive sites are:
tsx-11 : pub/linux/packages/X11, pub/linux/usr.bin.X11
sunsite : pub/Linux/X11/ 


 XII.09)  Where do the X11 files go? What are they?

ANSWER: The linux X binary distribution looks something like:

/usr/X386/
        lib/
	    libX11.a ...     (X libraries needed for compiling stuff).
    	    X11/
     	        config/      (template files for compiling ... xmkmf) 
       	        fonts/
       		    misc/ , 75dpi/ .... 
       	        etc/         (documentation).
        bin/             (XF86_SVGA, XF86_Mono, xterm, X linked to XF86_SVGA).
        include/X11/         (include files needed for compiling).
	           bitmaps/  (icons, bitmaps used by some applications).
        man/
	    man1/, man3/, cat1/, cat3/
/lib
    libX??.so.??         (Shared images needed by all X11 binaries).


Its best you do a tar -tvzf on the distribution you get or find
some means of extracting the distribution file list.
The support files include default/example Xconfig, xinitrc, twmrc
which you could copy to your HOME directory (as Xconfig, .xinitrc
and .twmrc) and edit them to define your hardware and X11 setup.
The directory XLIB/etc/ contains much documentation on how to 
configure video modes.

Read the files XDOC/README and XDOC/README.Linux.





XII.D.  LEARNING/USING X
~~~~~~~~~~~~~~~~~~~~~~~~

 XII.10)  Where can I find the basic help for learning/using X ?

ANSWER: Try man X386; man Xserver; man xterm; man twm; man xinit
on any machine with X11.  The man pages on xterm and twm will reflect
behaviour on Linux systems quite accurately. The others will give you
some bearing though not every option will work.  These man pages are
part of the xfree86 distribution.
	

 XII.11)  What docs are available besides man pages?

ANSWER: The FAQ in comp.windows.x is extensive and has a bibliography. 
There is also the Xt-FAQ. Both are available from export.lcs.mit.edu in
pub/contrib/. There is a collection of (mit) X11 documents on tsx-11
(pub/linux/doc/xdoc.tar.Z ?) or export (pub/R5-Untarred) if you are 
interested in internals.
Also of interest if you use motif, open-look/xview or interviews:
comp.windows.x.motif, comp.windows.open-look, comp.windows.interviews.


 XII.12)  How do I start up X?

ANSWER: Type 'startx' at the shell prompt. Before doing this you should:
0) Untar the xfree86 distribution from / (read XDOC/README, XDOC/README.Linux).
1) copy the file Xconfig.sample from the XLIB/ directory to your 
	HOME directory (/usr/root/Xconfig?) or to XLIB/Xconfig.
2) Edit Xconfig and set the video data for your card and monitor. 
   Use the clocks appropriate for your card and the modes appropriate 
   for your monitor for those clock values. To determine what values are
   appropriate the Xconfig section below and the files in XDOC/. 
3) Set the mouse device in Xconfig correctly....Use the busmouse entry
   for Logitech only. For other busmouses use microsoft (try all :-).
4) Ensure that there is a termcap entry for xterm in /etc/termcap
   (One is available in the subdir /doc/).
5) Ensure that the X11 binaries are in the path example:
   add the line PATH=${PATH}:/usr/X386/bin to ~/.profile.
6) If your system is not configured for networking you must use
   the -pn (partial network) option ... this is probably the 
   default in startx anyway.

 XII.13)  How can I start X directly with xdm after booting ?

ANSWER: (durka@informatik.tu-muenchen.de)

	1. You need a file .xsession identical to .xinitrc
	2. Add the line
		DisplayManager*terminateServer:	true
	   in the file /usr/X386/lib/X11/xdm/xdm-config
	Then X is restarted after logout.
	3. You have to add
	   /usr/X386/bin/xdm
	   at the end of your rc.local file
	4. Now you can reboot

If you prefer to test it first, perform step 1. and 2. only. Then as
root call xdm from the console. 

 XII.14)  How do I configure X .. colors, menu, keyboard?

ANSWER: makes me ... dizzy ...
server : video, keyboard
	Xconfig : man X386, man Xserver, XDOC/VideoModes.doc
	          man X386keybd, man xset, man xmodmap. 

resources: global and application preferences.
	XLIB/xinit/.Xresources or ~/.Xresources : man xrdb?

twm :   menus, title bars, colors .. look and feel.
	~/.twmrc or XLIB/twm/system.twmrc : man twm

xinit : startup. 
        ~/.xinitrc or XLIB/xinit/xinitrc -- man xinit

applications : XLIB/app-defaults/Xxx (also ~/.Xresources)
		man xxx

You can start with files from any X11 setup. Backup the files 
you change. See the FAQ on comp.windows.x.


 XII.15)  [suggested by Thomas Koenig]
	How do I support national keyboards in X11 ?

ANSWER: Put a .Xmodmap file into the user's home directory specifying
which keys to use for what; or else replace the
/usr/lib/X11/xinit/.Xmodmap with the national keyboard keys
customized. Do man xmodmap for more details. 
enclosed an excerpt of mine (french keyboard):
keycode   8 =
keycode   9 = Escape
keycode  10 = ampersand 1
keycode  11 = eacute 2 asciitilde
keycode  12 = quotedbl 3 numbersign
keycode  13 = apostrophe 4 braceleft
keycode  14 = parenleft 5 bracketleft
keycode  15 = minus 6 bar
keycode  16 = egrave 7 grave
keycode  17 = underscore 8 backslash
keycode  18 = ccedilla 9 asciicircum
keycode  19 = agrave 0 at
keycode  20 = parenright degree bracketright
keycode  21 = equal plus braceright
keycode  22 = BackSpace
keycode  23 = Tab
keycode  24 = A
........



XII.E. DEBUGGING STARTUP PROBLEMS:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 XII.16)  What do I use in my Xconfig file to use the bus mouse?
Logitech doesn't work with my Logitech busmouse.

ANSWER: (Nathan I. Laredo)
Here are the mouse lines from my Xconfig:

BusMouse   "/dev/mouse"

You may add a sample rate if you want, but chances are, unless the model
number on your mouse matches mine: PC-93-9MD it probably will cause your
machine to lock up, as I've gotten several reports saying that.
According to the X386 documentation, non-logitech mice do not support
a sample rate.


 XII.17)  My busmouse works fine with windows but ...

ANSWER: (Les Troyer t2078@dcs2.nfuel.com)
If your busmouse is not on the kernel default of IRQ 5 then you need to 
change /usr/include/linux/busmouse.h to reflect what your IRQ is. and 
if you use IRQ2 then put 9 in for the define.


 XII.18)  Does anyone have a working PS/2 mouse? Has anyone gotten the 
"Mini-DIN" mouse on an HP Vectra 486/33T to work? The slight info I've 
been able to find says it's PS/2 compatible. Does anyone have a
working MouseMan on a PS/2 port ?

ANSWER: (heeb@watson.ibm.com)
First you need to create an entry in /dev for it:

mknod /dev/psaux c 10 1

The other steps depend on the version of XFree: for XFree86-1.2
add the following line to your Xconfig (and you are done):

PS/2 "/dev/psaux"

This works even for 3 button mice (e.g. the MouseMan)!
There is no direct PS/2 mouse support in XFree86-1.1, so to use the
mouse with X you'll have either to upgrade or use the mconv mouse
protocol conversion utility, which can be found on nic.funet.fi, in
/pub/OS/Linux/utils/tools/mconv.c. This program converts the packets
sent by the PS/2 mouse into the corresponding ones from a Microsoft
mouse, so you can fool X telling it you have a Microsoft serial
mouse instead. Instructions for use are included in the source file.
(Johan Myreen jem@cs.hut.fi)


 XII.19)  I have trouble with my logitech Pilot mouse and X under
Linux, any clue ? 

ANSWER: (Thomas Roell?) There are TWO lines of Logitech mice out there.
One is the programmable and uses MouseSystems protocol at startup.
X386 reprogramms them to use another protocol. If you specify
'Logitech' in the Xconfig, X386 assumes a mouse like C7 or S9 (notC7-M).
The second line is the MicroSoft compatible. Currently all newer
Logitech mice follows this practice, like the MouseMan. In that case
you have to say 'MicroSoft' or 'MouseMan'. 


 XII.20)  I cannot type in my xterm 

ANSWER: /dev/console must have major=4, minor=0
	rm -f /dev/console; ln /dev/console /dev/tty0


 XII.21)  What are some of the common omissions and errors?

ANSWER: (Peter)
1) Add /usr/X386/bin/ (or /usr/bin/X11) to your path.

2) Add the xterm termcap entry to /etc/termcap.

3) ln -s X386 X in the XBIN directory.
   ln -s X386mono X (if you want to use the mono server).

4) Run X as root first. This avoids some trivial problems.

5) If you change the font path entry .... X386 is finicky about
   the syntax. 

6) Make sure your mouse entry in Xconfig points to a legitimate serial 
   device  (or busmouse)... usually something like:  microsoft "/dev/ttyS1"
   serial devices have major # 4 minor 64,65 ... busmouses are major 10.
   ls -l in /dev will show you the major and minor entries.

7) Need read/write/exec access to /tmp directory 

8) Use startx 2> x.err to log your error messages. If the server sticks 
   and you have to reboot you'll probably loose this stuff... see notes
   on `hanging' below.

9) You must have a free vt (eg. /dev/tty5 with no getty (see /etc/rc)).

10) Delete /tmp/.Xn-lock if recovering from a crash.

11) Note the new probeonly option for the server (man X386):
	startx -- -pn -probeonly 

12) The following message is not the cause of your problems:
    Setting TCP SO_LINGER: Protocol not available
    no SIOCGIFCONF

13) See Xconfig problems and the device list below.



 XII.22)  Why is the server unable to find some of the fonts?

ANSWER: First check that the directories listed in the font path exist
and have font files in them. Some of the servers are not set up to use 
compressed fonts. In such cases you have to uncompress the fonts in the
directory and run `mkfontdir .`. Read the man page on mkfontdir.


 XII.23)  My server "hangs" Why?

ANSWER: (Peter) Quite often it isn't a hang. If the server grabs the
screen(and enters graphics mode) and then dies, it may return you to
bash *without* restoring the screen. In other words, just because you
see no output, don't assume it's running/hanging.  The way to test
this is to see if you can use a bash command to spin your disk. eg.:
sync; ls -l /bin.

Also - I *suspect* that (at least for me), you can kill the
server if you include the servernum option in the Xconfig (Obselete?)

You can kill the server when you want to by typing ctrl-alt-backspace. 
Then a couple of ctrl-C 's in case your stuck in xinit.

The two line message
 		X386 version .....
 		(protocol Version ....
is returned from the X386 programme itself, so if you get
this (or if the screen blanks) X must be starting.


 XII.24)  When I started X11 I got "Cannot connect to
server" or "process does not exist", any clue ?

ANSWER: The cause might be a wrong fontpath variable, mouse device
or video settings in your Xconfig.


 XII.25)  Why cant I run more than 4 xterms?
	  How can I have more than 4 pty's ?

ANSWER: set the number in the header include/linux/tty.h and 
recompile the kernel. Also make nodes :
	mknod /dev/ptypxx 4  minor  (where minor = 128 + xx)
	mknod /dev/ttypxx 4  minor  (minor = 192 + xx)
	This is for before linux-0.97pl6.... for later versions
	you only need to make the nodes.
	


 XII.26)  How does X11 start up?

ANSWER: The startup involves the server (XBIN/X), and some
programs like startx and xinit.

Typing startx runs the script  XBIN/startx. Look through startx. 
For explanation of the server arguments try man Xserver.
startx does little other than gather arguments and then call xinit.

xinit runs the server X (X is linked to X386) and the client programs
specified in ~/.xinitrc. xinit continues to run, and is often the 
source of the error messages you see when you exit. If you get the 
message "giving up", it means X has died (quite probably  it died 
immediately) and xinit has been unable to start clients from the 
xinitrc script. (The scripts must be executable).


 XII.27)  What devices does X depend on:

ANSWER: check your device numbers with ls -l /dev. You should have:

5 0 tty
4 0 tty0
4 0 console
4 1 tty1 (etc)		virtual consoles (vt's) : eg. startx -- vt8
1 1 mem

4 128 ptyp0 		pseudo ttys used by xterm/emacs etc 
4 129 ptyp1 (etc)	to talk to unix programs.
4 192 ttyp0
4 193 ttyp1 (etc)

4 64 ttyS1 		one of these is the mouse 
4 65 ttyS2		or you have a busmouse.
10 x mouse 		busmouse x = 0 => logitech 	1 => ps/2 (aux)
			2 => microsoft		3 => ATI_XL.
/tmp/.X11-unix/Xn       n = display number. Socket used by X11 programs to 
			talk to the server. This is created by X386.
/tmp/.Xn-lock  		n = display number. Lock file.

Note that unix programs dont expect standard names for serial devices 
and mice. So you can give these devices any name as long as you tell 
the server what its called (in Xconfig).




XII.F. Xconfig: Xconfig and Video mode settings.
~~~~~~~~~~~~~~~
 XII.28)  What do the mode names in Xconfig mean?

ANSWER: Mode names like "640x480" are used to match entries in 
the modes line with the modeDB entry which actually defines the mode. 
You can toggle between modes in the modes line  with ctrl-alt-numericplus. 
If you're experimenting with 640x480 you can define 
      modes "640x480a" "641x480b" "642x480c"
with different entries for each under ModeDB so you can toggle between 
these three modes. 

 XII.29)  How do I compute the numbers for the video modes?

ANSWER: See if there is an entry that matches your chip/monitor in
XDOC/modeDB.txt. Use the clock entries for your chip
and the mode entry for that clock appropriate for your monitor.
If you cant find a mode entry for a particular clock 'needed_clock'
but can find a mode entry (for your monitor) for a nearby clock value
'found_clock', scale all numbers in the modeDB entry by 
(needed_clock/found_clock). Read XDOC/VideoModes.doc


 XII.30)  How can I determine the clocks on the video chip?
	Where can I find clock.exe or clock.pas ?

ANSWER: The XFREE Team discourages the use  of clocks.exe and wants it
to be removed from all docs, since the new Server is better at
guessing the clocks than clocks.exe.

You can get X to tell you what it finds by commenting the clocks entry 
in Xconfig. Use 'startx -- -probeonly 2> x.err' to log the output.
If X starts up this file gets the clocks only after you exit.

I strongly advise using the 'modegen' spreadsheets to generate the 
appropriate settings. If I remember correctly you can find them in 
'pub/linux/packages/SLS/x4' called modegen.taz or something equally 
as obvious ... Good luck. (Andy asb@cs.nott.ac.uk)

The clocks entry in Xconfig serves as an index. example: 
clocks 1 2 
ModeDB
1 640x480 .....
2 800x600 .....
means the first clock on the chip will be used for the 640x480 mode
and so on. Usually one uses the MHz value for the clock for convenience
instead of 1 2  you probably have 25 28 ... etc.


 XII.31)  What are the settings used with a trident-8900C?

ANSWER: To get X/SLS/Linux working with a trident-8900C :

1) From Frank Houston fh8n@uvacs.cs.Virginia.EDU 
vga256
  Virtual	1024 768
  ViewPort      0 0
  Modes	        "1024x768" "800x600" "640x480"
Use the VESA monitor timings from the modeDB in the example Xconfig.
You do not need to specify the chipset or clocks.

2) From: Henk Vandecasteele henkv@cs.kuleuven.ac.be 
TRIDENT TVGA 8900C card with BIOS C2.11, A cheap color monitor AOC (CM-335) 
with a maximum horizontal frequence of 39.5
vga256
  Virtual	1024 1024
  ViewPort      0 0
  Modes        "912x684" "800x600" "640x480" 
# This mode drives my monitor to the limit (VESA timings for the rest).
 "912x684"     45      912  944 1104 1136    684  684  690  712 


 XII.32)  Oh what, Oh what, Oh what can I do with a trident 8900b?

ANSWER: (drew@cs.colorado.edu)
1.  While the 8900b works with the Xfree 8900c driver, you must 
    specify a chipset line for the 8900c in your Xconfig.

2.  The tridents are miserably slow in a Color mode.  If you don't 
    mind black and white, you should use X386mono.  Not only is it 
    faster, but it requires less video memory, and you'll be able 
    to run a 1k X 1k virtual desktop. Again, you must specify the 
    Chipset line to use the banked mono server for virtual 
    resolutions > ~800x600.


 XII.33)  What are common problems with Xconfig?

ANSWER: If X isn't firing at all, or even if it clears the screen and
crashes (see below) you almost certainly have a fault in Xconfig.

1. Note that the server X interprets Xconfig. (not xinit)

2. test with only one graphics mode included - one you are most sure of.

3. If you make a mistake in the mouse section, you will (I understand)
get an error message, so if you don't get some mouse error, try
elsewhere first. (eg "No such file or directory" indicates you have a
fault in the "/dev/ttyxx" line, or /dev/ttyxx doesn't exist.

4. *NB* X looks in your home directory first to find an Xconfig. make
certain it's using the one you've been working on!

5. you need double quotes (") around your chipset and modes: eg
	chipset "et4000"
	Modes   "640x480" "640x480a" "800x600"
   and around the /dev/ttyxx eg.:
	microsoft "/dev/ttys1"

6. Check your VGA section and modeDB first.

9. ensure ModeDB clock speeds match the VGA section. Comment out any
unused lines in MODEDB.

eg  clocks  25 36 00 00 00 00 00 00 

then you *must* have (and only have) lines under modeDB corresponding
to speeds 25 and 36. If you have one with (say) 62 uncommented out in
the modeDB section in place of the 36 line, you will cause the server to
die immediately with no error message.

10. videoram must equal the amount of display ram on your chip.

11. The virtual resolution screen must fit in the videoram.
    eg: 512kB => 800x600 (for the 1 byte per pixel color server)


 XII.34)  Where can I get Xconfig-files for various hardware?

ANSWER: If you have access to e-mail, e-mail  bcr@physics.purdue.edu 
a  message with the  subject: help 
If you do create a new Xconfig file or improve on an old one please mail
it to bcr@physics.purdue.edu to save others from having to duplicate
your work.




XII.G X-APPLICATIONS: Compiling X Programs.
~~~~~~~~~~~~~~~~~~~~~

 XII.35)  Does anyone know where I can find the libobz.a library ?

ANSWER: This library contained the socket stuff, when X386 V0.1 was
released. Meanwhile it has found it's way into the kernel, so
remove -lobz from the link step in the Makefile. Any program
asking for libobz needs to be recompiled anyway.


 XII.36)  I get _setjmp undefined when linking xv from .a files.

ANSWER: You are trying to link a program compiled with gcc-2.2.2
and setjmp has changed sice then. Recompile xv from the source
using the latest gcc.


 XII.37)  How do I compile an X application that has an Imakefile?

ANSWER:
	Type xmkmf to generate the Makefile.
	Type make.


 XII.38)  How do I compile a program that has no Imakefile?

ANSWER: Use compiler options generated with programs that do have
	Imakefiles. Look in XLIB/config/ for the linux definitions.
	In particular you need -fwritable-strings.

 XII.39)  gcc complains the X libraries are not found or links static.

ANSWER: Check out the -nojump -static options of GCC ... read the GCC FAQ.
	You can tell gcc what directories to search with -L. 


 XII.40)  When using Makefiles generated by xmkmf why do I get many error 
	messages?

ANSWER: The old xmkmf under Linux doesn't like # comments in Imakefiles. 
Therefore you must change the #'s to XCOMM. But be careful. Don't change
any pre-compiler directives. (mal11@po.CWRU.Edu  Matthew A. Lewis)

 XII.41)  (Ton van Rosmalen wrote):
I recently compiled XFree86 1.2A for Linux and it compiled fine with
gcc-2.3.3 and libc-4.3.3 iff I skipped the make depend.

ANSWER: (Rik Faith)
The source for ed.c is available from (Linux binaries are in utilb13.taz)
ftp.cs.unc.edu:/pub/faith/linux/utils/utilb-1.3.src.tar.Z 
This version of ed.c has a 4096 character line limit and will work
correctly when building XFree86 under Linux.


 XII.42)  What are the  development tools available for X under Linux?

ANSWER: Some of the X development packages available on Linux:
(XS = sunsite.unc.edu pub/Linux/X11)
(Contact the people who distribute them in case of problems.)

Libraries: 
Xpm, tiff .. are in XS/libs/. If you are compiling a package 
that uses these libraries it is best to pick up the standard DLLs.
hooft@chem.ruu.nl, mitchum.dsouza@mrc-apu.cam.ac.uk
(Some older libraries are in XS/libs/oldlibs).

Interviews: SLS package
Shared libraries are not yet available so doc ~1M, idraw ~1.5M, ibuild?

KHOROS:
This is the second release of my patches (~15K XS/xapps) to the Khoros 
system for image processing. If you want to compile it, you 
need Khoros 1.0, patchlevel 5 (source distribution) and up to 100MB 
free disk space (including package 0.).  
Wolfram Gloger wmglo@dent.med.uni-muenchen.de Apr 04 1993.

MOTIF XS/$$$:-)
Metro Link, Inc. is pleased to announce the availability of OSF/Motif 1.2.2 
for Linux at the introductory price of $199 for a complete runtime and 
development system (shared libs, UIL, source for some demos + 1 Orielly book). 
You can order OSF/Motif 1.2.2 for Linux by calling Metro Link,Inc. at 
(305) 970-7353 (voice) or (305) 970-7351 (fax) or by mailing us at 
sales@metrolink.com.

SUIT: XS/devel
Simple User Interface Toolkit. 
Included are shared libs and static libs. Compiled with the SLS kit.
To use these shared libs you need libX11 3.0 and libc 4.3.
Rob Robert-Jan Kooper rob@is.twi.tudelft.nl kooper@dutiws.twi.tudelft.nl

tk+tcl: XS/devel
Here is tk3.0 and tcl6.5 sources and libraries. Compiled this with gcc2.3.3
I have also included the wish (X11) binary.  
Mitch mitchum.dsouza@mrc-apu.cam.ac.uk 	mitch%markab@mrc-apu.cam.ac.uk 

xview: XS/devel
New libxview.a and libolgx.a that correct some problems with the
ones found in SLS (and maybe in the other xview releases, I don't know).
Kenneth Osterberg ??



XII.H ATI: SVGA server for ATI boards.
~~~~~~~~~
Last Revised: Mon May 10 15:17:57 1993 by faith@cs.unc.edu


 XII.43)  What's new?

ANSWER:
For XFree86 version 1.2 (and later versions), there are two changes to the
extregPlusXLAndOrMasks table:

1) ER_B0 was changed from 0x28 to 0x31.  (In the Linux world, this was
distributed as a binary patch long ago.)

2) ER_BE was changed from 0x08, but only for cards EARLIER than the
28800-5.

Both of these changes allow more 28800-4 cards to work, although either one
may be sufficient for any one card.  You can find these changes in the
driver by searching for the Feb 3 timestamps.



 XII.44)  What is the ATI SVGA driver?

ANSWER:
The ATI SVGA driver is a 256 color driver for the XFree86 server.  The
driver was written for the ATI WONDER series of graphics adapters.  In
general, the following modes are supported for cards with 512kb of memory:

640x480x256
600x800x256

The following modes are supported for cards with 1024kb of memory:

1024x768x256


 XII.45)  What is the ATI SVGA driver *NOT*?

ANSWER:
The ATI SVGA driver is *NOT* a black and white (2 bit) driver.  Therefore,
it will *NOT* work with the XFree86 monoserver.

The ATI SVGA driver is *NOT* a 16 color driver.  Even though your manual
says that your graphics adapter has a 1024x768x16 mode, the ATI SVGA driver
will *NOT* use this mode.  If you want to use 1024x768, you *MUST* have 1MB
of memory on your board and use the 1024x768x256 mode.

The ATI SVGA driver will *NOT* support more than 8 bits of pixel depth.
Therefore, even though your manual says that your graphics adapter supports
modes using more than 256 colors, the ATI SVGA driver will *NOT* use these
modes.

The ATI SVGA driver is *NOT* an accelerated driver.  If you have an ATI
GRAPHICS ULTRA series card, the ATI SVGA driver will *NOT* use the
accelerated hardware.  It will only use the SVGA hardware.  This will
probably not be any faster than a VGA WONDER card, unless the card is on a
local bus (and then, it won't be faster than a VGA WONDER card on a local
bus, if a card of this type existed).


 XII.46)  What cards will the driver work with?

ANSWER:
This is a difficult question, because there are many different ATI video
cards, and it is sometimes difficult to tell them apart.  The best way is
to look on the card itself for the ATI chip numbers.  Here is a partial
list of ATI VGA WONDER cards.  The MOST IMPORTANT number is the CHIP
VERSION.

Adapter version     Dot clock       Chip version

VGA WONDER V3                       ATI18800        NOT SUPPORTED
VGA WONDER V4                       ATI18800-1      NOT SUPPORTED
VGA WONDER V5       ATI18810        ATI18800-1      NOT SUPPORTED
VGA WONDER + (V6)   ATI18810        ATI28800-2      ? MAY WORK ?
VGA WONDER (1 MB)   ATI18810        ATI28800-4      SUPPORTED
VGA WONDER (1 MB)   ATI18810        ATI28800-5      SUPPORTED
VGA WONDER XL       ATI18810        ATI28800-5      SUPPORTED

Note that the ATI SVGA driver code has hooks and some support for all of
the cards listed.  However, with the earlier cards, there are serious
differences in the programmer's interface.  The only people who have ever
worked on the code have had 28800-4 and 28800-5 chips, so these chips are
the only ones that are actually known to work.

The ATI GRAPHICS ULTRA chips seem to have SVGA support which is equivalent
to the 28800-4, 28800-5, and 28800-a, although I can find no documentation
on this in the technical manuals provided by ATI.  The ULTRA PLUS and ULTRA
PRO boards have been tested to some extent, and seem to work fine, but the
original ULTRA may have some problems at greater than 640x480 resolution.



 XII.47)  What should I put in my Xconfig file?

ANSWER:
THE MOST IMPORTANT LINE IS THE CLOCKS LINE:

  Clocks        18 22 25 28 36 44 50 56
                30 32 37 39 40 0  75 65

The first row of clocks is usable on all VGA Wonder cards.  The second row
is usable only on V5, PLUS, and XL cards (28800-2, 28800-4, and 28800-5).
However, you should include *BOTH* rows for *ALL* cards.

The specification is different from the specification used with the ET-4000
cards.  Programs with claim to detect the clocks usually work only with
ET-4000 based cards.  No such program exists for the ATI cards, since it
isn't needed.  THE CLOCKS LINE SHOULD NEVER BE CHANGED.  The order of
numbers in the clocks line *is* significant.

The actual frequencies, which can be used to calculate the ModeDB lines,
are as follows:

18 = 18.000
22 = 22.450
25 = 25.175
28 = 28.320
36 = 36.000
44 = 44.900
50 = 50.350
56 = 56.640

30 = 30.240
32 = 32.000
37 = 37.500
39 = 39.000
40 = 40.000
 0 = 56.640
75 = 75.000
65 = 65.000

The Chipset will be automatically detected.  The chipset name for this
driver is "ati".

Here is a sample Xconfig (which I use):

RGBPath		"/usr/lib/X11/rgb"
FontPath	"/usr/lib/X11/fonts/misc/,/usr/lib/X11/fonts/75dpi/"

Keyboard
  AutoRepeat 500 5
  ServerNumLock

#Microsoft	"/dev/mouse"
#MouseSystems	"/dev/mouse"
#MMSeries	"/dev/mouse"
#Logitech	"/dev/mouse"
#MouseMan	"/dev/mouse"
Busmouse	"/dev/mouse"
#  BaudRate	1200
  SampleRate	150
#  Emulate3Buttons


vga256
  ViewPort      0 0
  #Modes	 "1024x768v" "800x600v"
  Modes	        "800x600v"
  Clocks        18 22 25 28 36 44 50 56
                30 32 37 39 40 0  75 65
  Displaysize   260 184

ModeDB

# From NEC MultiSync 3FGx manual (copied by faith@cs.unc.edu)
# active_area front_porch pulse_width back_porch for horiz and vert
# VESA 640x480 at 72Hz (37.860kHz)
# 20.317us 0.762us 1.270us 4.603us; 12.678ms 0.238ms 0.079ms 0.740ms
# (I couldn't find a good clock rate for this one)
# VESA 800x600 at 72Hz (48.077kHz)
# 16.000us 1.120us 2.400us 1.280us; 12.480ms 0.770ms 0.125ms 0.478ms
"800x600v"   50      800  856  976 1040    600  637  643  693
# VESA 1024x768 at 60Hz (48.363kHz)
# 15.754us 0.369us 2.092us 2.462us; 15.880ms 0.062ms 0.124ms 0.600ms
"1024x768v"  65    1024 1048 1184 1344    768  771  777  806



 XII.48)  What is the history of the driver?

ANSWER:
The complete history of the driver is cloudy.  I have tried to reconstruct
the history from several email messages from a few of the people involved.
The history is probably incomplete and inaccurate.

Apparently, Per Lindqvist (pgd@compuram.bbt.se) first got an ATI driver
working with an early ATI card under X386 1.1a.  (This original driver may
have actually been based on an non-functional ATI driver written by Roell.)
Then Doug Evans (dje@cygnus.com) ported the driver to the ATI XL, trying in
the process to make the driver work with all other ATI cards.

I (Rik Faith) obtained the X11R4 driver from Doug Evans in the summer of
1992, and ported the code to the X386 part of X11R5.  This subsequently
became part of XFree86.  Per and Doug did the majority of work, making the
port somewhat trivial.  I am grateful for their contribution.

The port to X11R5 required writing the ATIProbe and ATIEnterLeave routines,
and re-organizing the ATISave and ATIRestore routines.  Someone else added
the operating system specific code, but I don't know who.

The major reference that I used was manual from ATI:

"VGA WONDER Programmer's Reference"
ATI Technologies, 1991.
Release 1.2 -- Reference #PRG28800
(Part No. 10709B0412)

However, Chapter 11 (ATI 18800 ATI VGAWONDER) of George Sutty and Steve
Blair's "Advanced Programmer's Guide to SuperVGAs" (Brady/Simon & Schuster,
1990) was also useful.  Further, someone e-mailed be a random document from
the ATI BBS which was dated 3Jul91 and which may have been named
PROGINFO.DOC.



 XII.49)  What is the future of the driver?

ANSWER:
I no longer use an ATI Wonder card and have no interest in this driver.
Since I have received no bug reports or patches for the driver during the
past 3 months, I think it is about as stable as it is going to get.  (I
suspect that support for the 28800-2, 28800-4, and 28800-5 chips can be
made more robust, but I doubt that the other chips will ever be fully
supported.)

I have absolutely *NO* intention of porting the code to the mono or 16
color servers.  If *you* want ATI support in the mono or 16 color servers,
they *you* should do the port.  (Since I no longer use my ATI Wonder card,
please feel free to take over the current driver as well.)





XII.I BUGS:
~~~~~~~~~~~

Restoration of the text screen fails on some hardware. You can
get the program runx from the vgalib distribution (tsx-11
pub/linux/sources/libs/). Report the problem to the xfree86 team.

Cant compile Xaw programs without -static in versions x11v1.1 or older.

Fix for missing numlock control in xfree86-1.1.
use xmodmap to change the mapping:
  clear mod1
  add mod1 = Alt_L
  keysym Alt_R = Mode_switch
  add mod5 = Mode_switch
David (Dawes)



Sources for X11_FAQ: 
Steve Kotsopoulos, Peter Hawkins, John Morris, MM. Corsini, 
K. Balasubramanian. 
Direct comments, questions, complaints to krishna at:
balasub@cis.ohio-state.edu


XIII.	NETWORKING and LINUX
============================
*** This section is maintained by Matt Welsh (mdw@tc.cornell.edu).


XIII.01)  Where can I find useful information about networking for
Linux ?

ANSWER: As of Linux 0.99.pl10 a new suite of networking and TCP/IP 
software has been added to the Linux kernel, known as ``NET-2'' (no
relationship to the BSD NET-2 software distribution). 

In order to use TCP/IP, SLIP, or other networking with Linux, you should
upgrade to the newest version of the kernel (at least 0.99.pl10). 

All of the information that you need to get started with networking is
in the NET-2-FAQ by Matt Welsh and Terry Dawson. You can find it on
sunsite.unc.edu:/pub/Linux/docs. 

Note that the NET-2-FAQ supercedes the old NET-FAQ, which was for kernels
before 0.99.pl10. If the NET-FAQ you find does not say anything about
``NET-2'', then you have the wrong version.

You can direct questions about networking and TCP/IP either to the NET
channel of the mailing list (see section II of the FAQ on how to join), or 
to mdw@tc.cornell.edu.



	   ===================8<==========>8================


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#	LaBRI 			 |					    #
#  351 cours de la Liberation    |  e-mail:  corsini@geocub.greco-prog.fr   #
#  33405 Talence Cedex		 |  e-mail:  corsini@labri.u-bordeaux.fr    #
#  				 |					    #
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- 
	 There will be a sig when our local net is reliable.
	       For now, I would rather stay anonymous.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1993-07-21  9:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-06-11 10:06 Linux Frequently Asked Questions 6/6 [monthly posted] corsini
  -- strict thread matches above, loose matches on Subject: below --
1993-07-21  9:52 Linux Frequently Asked Questions 5/6 " corsini
1993-07-21  9:52 ` Linux Frequently Asked Questions 6/6 " corsini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox