Parallel Port Zip Drive and Printer

Parallel Port Zip Drive and Printer

Post by pee.. » Wed, 01 Apr 1998 04:00:00



Hi Gang,

Once upon a time I had my HP 855Cxi printer up and running
great on my Linux (RH4.0) -- nenscript, Netscape printing, etc. all
worked
beautifully.

Then I bought a parallel port Zip drive.  I got the Zip drive installed
just fine, but the printer no longer works.  Is there a compatible
parallel
port driver (or some other trick with loading/unloading modules) that
would
allow me to use either the printer or the Zip drive under RH 5.0?

Thanks,
DL

 
 
 

Parallel Port Zip Drive and Printer

Post by Alexey Pushki » Thu, 02 Apr 1998 04:00:00


Quote:> Then I bought a parallel port Zip drive.  I got the Zip drive installed
> just fine, but the printer no longer works.  Is there a compatible
> parallel
> port driver (or some other trick with loading/unloading modules) that
> would
> allow me to use either the printer or the Zip drive under RH 5.0?

To save time instead of explaining I attach
2 shell scripts that handle this.
The 1st (`lpt') handles loading/unloading `ppa.o' & `lp.o'.
the 2nd (`iomega') uses `lpt' to (un)install modules
and then (u)mounts the ZIP drive.

[ lpt 1K ]
#! /bin/sh
#
#  If there are both a printer and an Iomega ZIP drive
#  on the parallel port, this script allows to switch between them.  
#
# Author: Alexey Pushkin
#

mod_desc()
{
   case "$1" in
      lp )      echo "LPT printer" ;;
      ppa )     echo "LPT Iomega ZIP" ;;
      * )       echo "$1" ;;
   esac

Quote:}

### Function prints an empty string if a module is not loaded.
print_if_loaded()
{
   /sbin/lsmod | awk '$1 == "'$1'" {print $1}'

Quote:}

### Function returns 0 if a module is loaded, othervise 1;
check_module()
{
   loaded="`print_if_loaded $1`"
   [ "$loaded" ] && return 0
   return 1

Quote:}

unload_error()
{
   echo "   Probably an `mod_desc $1` is active now."
   echo "   Try again later"
   return 1

Quote:}

load_error()
{
   echo "   Cannot load an `mod_desc $1` driver !"
   return 1

Quote:}

load_module()
{
   if check_module "$1";  then
      return 0
   else
      /sbin/insmod "$1" || load_error "$1"
      return $?
   fi

Quote:}

unload_module()
{
   if check_module "$1"; then
      /sbin/rmmod "$1" || unload_error "$1"
      return $?
   else
      return 0
   fi

Quote:}

case "$1" in
   zip | iomega |ppa )
      unload_module lp && load_module ppa
      ;;

   lp | print*)
      unload_module ppa && load_module lp
      ;;
   *)
      echo "A script to switch between LPT printer & LPT Iomega ZIP drive"
      echo "Usage: lpt  lp | zip "
      exit 2
      ;;
esac

[ iomega < 1K ]
#! /bin/sh

#
# Author: Alexey Pushkin
#

lpt=/usr/local/bin/lpt

case "$1" in
   mount|on )

      $lpt zip && mount /mnt/zip && echo "   Your ZIP drive is mounted on /mnt/zip"

      exit $?

      ;;
   umount|unmount|off)

      umount /mnt/zip

      $lpt lp

      ;;
   *)
      echo "A script to mount and unmount a Parallel Port IOMEGA ZIP drive"
      echo "Usage: $0  on|off "
      exit 1
      ;;
esac

 
 
 

Parallel Port Zip Drive and Printer

Post by Jesse Weiger » Fri, 03 Apr 1998 04:00:00



> Hi Gang,

> Once upon a time I had my HP 855Cxi printer up and running
> great on my Linux (RH4.0) -- nenscript, Netscape printing, etc. all
> worked
> beautifully.

> Then I bought a parallel port Zip drive.  I got the Zip drive installed
> just fine, but the printer no longer works.  Is there a compatible
> parallel
> port driver (or some other trick with loading/unloading modules) that
> would
> allow me to use either the printer or the Zip drive under RH 5.0?

> Thanks,
> DL

 Just get the linux parport driver from http://www.linuxhq.com.  It allows
you to use the printer and the zip drive at the same time.  For some
reason, it only patches against the kernel version 2.0.32 and not 2.0.33.
I just applied the 2.0.33 patch over the whole things and everything
worked great.

--
-Jesse Weigert

 http://mid.home.ml.org
 Any sufficiently advanced bug is indistinguishable from a feature.
                -- Rich Kulawiec