************* BACK AND FORTH PAGING SUBROUTINE ************

PAGEFLOP

If they want to quit, do so
 If They want to quit subsession, Do SO!
  Decrement LOCAL and GLOBAL Page Counters

FORWARD

  Increment LOCAL and GLOBAL Page Counters
   *************** END PAGEFLOP *********************
  ****** CHAPTER INTERNAL SELECTOR ALGORITHM ******

SELECTOR

   Reset Local Page Counter

SELAGAIN

 CHECK IF ONLY A <CR>

WRONGSEL

YOUR SELECTION IS NOT IN THE 0 - #SELIMIT  RANGE  Please Try Again

MENU

Adding Devices|Topics to Learn|1-0|14,55
    #                   Topic
   ---                 -------
    1    -     Introduction
    2    -     Serial vs. Parallel Devices
    3    -     How to Add a Terminal
    4    -     Connecting the Hardware
    5    -     Modifying Terminal Initialization Files
    6    -     Setting the Terminal Type
    7    -     Activating the Terminal
    8    -     How to Add a Printer
    8    -     How to Add a Serial Printer
    9    -     Managing Printers 
   10    -     Adding Parallel Devices
    0    -     Return to the Main Menu

P22

Adding Devices|How to Add a Serial Printer|1-8.1|12,60
     These are the steps involved in adding a new serial 
printer to your system:

  1.  Connect the printer to a serial port on the back 
      of your computer.
  2.  Edit the /etc/printcap file (a database describing 
      all printers directly and indirectly accessible) to 
      include the printer.
  3.  Create a subdirectory for the printer in the /usr/spool
      directory.
  4.  Kill off the line printer daemon and restart it.
  5.  Check permissions and ownerships of the relevant files.
Adding Devices|How to Add a Printer|1-8.1|6,56
     To add a new serial or parallel printer to your 
system you must use the /usr/lib/lpadmin program to 
change the off-line printer configuration and modify 
the off-line printer interface program.

P23

Adding Devices|How to Add a Printer|1-8.2|14,62
     The utility for changing the off-line printer configuration 
as well as the utility for modifying the off-line printer interface 
program is:
/usr/lib/lpadmin

     lpadmin lets you:  add new printers, both serial 
and parallel, specify the printer filter program, specify 
the associated special device file like /dev/lp2, specify 
the destination printers, etc.

 UNIX users may use the interactive shell
script lpinit for easier printer setup.  lpinit calls 
lpadmin with parameters you specify.
Adding Devices|How to Add a Serial Printer|1-8.2|12,54
     After you have connected your serial printer to a 
serial port on the back of your computer, you have to 
edit the /etc/printcap file.


     This file is a database describing printers.  It 
should contain a descriptive entry for each printer 
directly attached to your system or accessible across 
a network.  Fields in an entry are separated by colons.  
The syntax rules are strict regarding blank spaces and 
line continuations, so see your User's Manual for a 
more elaborate description if you have any problems.

P24

Adding Devices|How to Add a Printer|1-8.3|14,56
     The command to specify that you are adding a 
printer whose name is lp3, that is connected to the 
device /dev/tty11 and whose filter program is hpjet is:

/usr/lib/lpadmin  -plp3  -v/dev/tty11  -ihpjet

NOTE:   hpjet would be located in the 
/usr/spool/lp/interface directory.


     The command to specify that the printer lp1 
is the default printer is:

/usr/lib/lpadmin  -dlp1
Adding Devices|How to Add a Serial Printer|1-8.3|15,75
Let's look at the entry for a PostScript laser printer:

laser1|cti|CTI|LASER1|postscript|PostScript:lp=/dev/laser1:\              
sd=/usr/spool/laser1:br#9600:fs#0000003:fc#0000374:of=/local/lib/ps/psof:\
lf=/usr/adm/lpd-errs:tf=/local/lib/ps/pstf:af=/usr/adm/laser1.acct        

The first field lists all of the possible names for the printer 
separated by a |.  One and only one printer MUST have the name lp 
included.  Subsequent fields are introduced by a two character code 
with the following forms:  

character code#value 
or
character code=string  

We'll look at some of those capabilities.

P25

Adding Devices|How to Add a Serial Printer|1-8.4|12,56
     Next you'll need to create a subdirectory for your 
printer in the /usr/spool directory.  Do this with 
mkdir and make sure that the name of the subdirectory 
is the same as the first name that you listed in the 
/etc/printcap file.  Using our DecWriter example, 
where the printcap entry began with:

lp=/dev/ttya ...
    
The mkdir command would look like:

mkdir  /usr/spool/lp

P26

Adding Devices|How to Add a Serial Printer|1-8.5|4,56
     In addition, you should us ps to check and see if 
there is a line printer daemon (/usr/lib/lpd) running.  
If so, you should kill it with the kill command and 
start it over again.
 for bsd create practice to kill off /usr/lib/lpd and restart it,
 L(UID$="Bsd"):1aa_lpd
 *LPD

P27

Adding Devices|How to Add a Serial Printer|1-8.6|17,66
Finally, you need to use ls -lg to check the permissions 
and ownerships for /usr/lib/lpd and /usr/ucb/lpr as 
well as the files in /usr/spool/lpd.  Then use ls -lgd 
to check /usr/spool/lpd.

The output should match the following:

#ls -lg /usr/lib/lpd /usr/ucb/lpr /usr/spool/lpd
-rws--s--x  1  root   daemon   81920  Apr 14 10:15  /usr/lib/lpd
-rws--s--x  1  root   daemon   30876  Apr 14 10:15  /usr/ucb/lpr
  
/usr/spool/lpd:
-rw-r--r--  1  root   daemon      22  Nov 12 09:00  lock
-rw-r--r--  1  root   daemon      22  Nov 12 08:00  status
  
#ls -lgd /usr/spool/lpd
drwxrwx---  2  daemon daemon     512  Jun 12 6:14   /usr/spool/lpd

P28

Adding Devices|Managing Printers|1-9.1|10,56
     When your system has more than one printer, you 
can move unprinted requests from the originally 
specified printer to another.


     The command for moving printer requests between 
printing destinations is lpmove.  For example, the 
command to move a print request with id result-232 
to a printer named laser is:

/usr/lib/lpmove  result-232  laser
Adding Devices|Managing Printers|1-9.1|10,56
The lpr command will enter a printing job into the 
local queue and notifies lpd (the line printer daemon) 
that there is a new job in the spooling area.  The job 
is either scheduled to be printed locally or is forwarded 
to the appropriate machine.  The job remains in the queue 
until it is printed, even if the printer is down.

The syntax for lpr is:

lpr  -Pprinter  -#number copies  [options]  filename(s)

P29

Adding Devices|Managing Printers|1-9.2|9,56
     When several printers on the system have common 
characteristics, they are referred to as being in the 
same class.


     To have a print request accepted for a class of 
printers named class2, use the command:

/usr/lib/accept  class2
Adding Devices|Managing Printers|1-9.2|11,60
The lpq command displays the printing queue, with a single 
line of output per queued job reporting the user's name, 
current rank in the queue, filenames comprising the job, 
the job identifier number and the size of the job in bytes.  
For example:

  %lpq
  Rank     Owner    Job    Files               Total Size
  active   joe      87     /tmp/man132         3168 bytes
  1st      mary     88     /usr2/mary/report   7257 bytes
  2nd      jane     89     /usr2/jane/letter   450 bytes

P30

Adding Devices|Managing Printers|1-9.3|10,54
     To prevent print requests from being sent to 
the printer print3 because it is being repaired, 
you would use the command:

/usr/lib/reject  -r"print3 on repair"  print3


     The command for determining the acceptance 
status of a printing destination is:

lpstat  -a
Adding Devices|Managing Printers|1-9.3|10,57
The lprm command will delete spooled jobs from the queue.
The syntax for lprm is:

  lprm  [-Pprinter]  [ - ] job id number [login name]

where  -  requests that all jobs belonging to login name
be removed.

NOTE:  Only the owner of a job or a superuser can remove 
a job from the queue.

P31

Adding Devices|Adding Parallel Devices|1-10.1|13,54
     Disk drives, tape drives, and high-resolution 
graphic devices all transfer data at a rate much 
higher than is possible with serial devices.


     These devices require a proper interface program 
or device driver to communicate with the system.


     The device driver must be a part of the UNIX 
kernel; therefore, you must rebuild the kernel 
whenever you add devices which are not configured 
in your current UNIX kernel.

P32

Adding Devices|Adding Parallel Devices|1-10.2|12,58
The process of adding a non-standard parallel device to 
your system involves the following:

    1.  Create the special device file for the new device 
        by using mknod command.
    2.  Install, if necessary, the device driver software.
    3.  Update your system configuration file.
    4.  Recompile and/or relink the kernel with the new 
        driver and a new configuration file.
    5.  Reboot the system. If you made no mistakes in the 
        configuration file, your new system should be 
        functional.
Adding Devices|Adding Parallel Devices|1-10.2|15,54
The process of adding a non-standard parallel device 
to your system is rather involved.  Here is an overview.  
We suggest you study your system administrators manual 
before attempting this.

    1.  Create the special device file for the new device 
        by using MAKEDEV command in the /dev directory.
    2.  Install, if necessary, the device driver software.
    3.  Modify the kernel by making a copy of the existing 
        kernel, then edit the copy to add the new entry. 
    4.  Run /etc/config on the new kernel. 
    5.  Build and install the new kernel and test it.
    6.  Save the old kernel and install the new one.
    7.  Reboot the system. If you made no mistakes in the 
        configuration file, your new system should be 
        functional.
we don't want them to practice mknod for Bsd--have to rebuild kernel