Parallel port devices on the NetWinder
Updated Oct 25th, 1999 @ 5:27pm

General information:

Kernel modules

The linux operating system is build in a modular fashion, so that the size of the main kernel is kept to a minimum. Additional functionality is obtained by dynamically loading additional modules (device drivers) into the kernel while it is running. In order to use parallel port devices, you must have the appropriate drivers loaded.

I have only tried out some parallel port devices, not all of them. For a more complete list of the various drivers that are available (including what drivers to load for specific devices), you should visit the Parallel Port hompage at http://www.torque.net/parport.

Drivers for most parallel port devices are included on the disk images. However you still have to configure your system to load the drivers. It is also possible that no driver exists for your parallel port device. If you get errors from insmod, check that the module you're trying to load actually exists. For example, if you are running kernel version 2.X.Y then the drivers would be located in /lib/modules/2.X.Y/ and its subdirectories. Sometimes you have to force a driver to load using the -f flag to insmod.

Filesystems

Linux supports many filesystem formats. The most common one is called ext2 (second extended filesystem) and that is what is used on the main hard disk, for example. This one is compiled into the kernel (since you couldn't boot without it) so it is always available. On parallel port devices, there could be other filesystems, such as MSDOS (in various forms), iso9660 (for CD-ROMs), amongst other possibilities. To support these filesystems, you must load appropriate kernel modules. There are sometimes more than a single module needed. You use the insmod command to load a module, the rmmod command to unload a module, and the lsmod command to see what modules are currently loaded.

The following table shows the necesary commands to load support for various filesystems.

Filesystem Commands to load it
iso filesystem insmod nls
insmod isofs
msdos filesystem insmod nls
insmod fat
insmod msdos
ext2 filesystem built-in

Note that for msdos filesystem, instead of fat you might try vfat for Win95/98 filesystems.

Parallel port printers

Low level support for printing is composed of a kernel module called lp.o and a daemon process called lpd. For various reasons these services are not started by default on a NetWinder DM machine. To load the kernel module, simply do

	insmod lp

or you might want to add this line to the /etc/rc.d/rc.modules script that is executed each time your computer boots, so that the module will always be loaded.

Secondly, you want to have the lpd daemon running to handle spooling of print jobs. You can start the service "manually" as shown on the next line, or you can use chkconfig to have it start automatically whenever your machine boots:

	/etc/rc.d/init.d/lpd start	# manual start, or
	chkconfig lpd on		# automatic start upon bootup

Finally, you need to configure one or more printers on your system. This can be done using the RedHat printtool configuration program (run it as root under Xwindows). Alternatively you may use the KDE printer configuration tool (if you have it).

Imation SuperDisk (LS-120)

The LS-120 is a parallel port device that accepts regular 3.5" floppies and also high-capacity floppies that look almost the same, but hold 120 MB of data. To use this device under Linux there are two aspects: loading the appropriate device drivers for the device, and also loading the appropriate device drivers for the filesystem. Please see the section near the top for information on about filesystems, and make sure you load an appropriate one before you try and load the LS-120 device drivers (unless you plan to use ext2 as your filesystem).

For the 2.2.x kernel series: You need to insmod parport and insmod parport_pc before loading the paride and module drivers.

	insmod paride
	insmod epat
	insmod pf

Now the drive can be accessed as /dev/pf0. You could format it with an ext2 filesystem, and then mount it, with the commands

	mke2fs /dev/pf0		# format the drive
	mount /dev/pf0 /mnt	# mount it

Of course you might just want to read somebody else's disk, in which case you would only do the mount command. Bear in mind that if the disk is a filesystem other than ext2 then you must have loaded the support modules for that filesystem, otherwise mount won't recognize the filesystem and will report "you must specify the filesystem type".

Microsolutions Backpack CDROM

For this one you will most likely want iso9660 filesystem support, since that is what most CD-ROM's are written with. Consult the filesystem section at the top and load the appropriate drivers. Then load the drivers for the backpack CDROM:

For the 2.2.x kernel series: You need to insmod parport and insmod parport_pc before loading the paride and module drivers.

	insmod paride
	insmod bpck
	insmod pcd

At this point, the drive is available for mounting as /dev/pcd0. Since the CD-ROM is read-only you can specify this when mounting the drive, that will avoid the warning you'd otherwise get telling you that the media is read only:

	mount -o ro /dev/pcd0 /mnt

Iomega ZIP drive

This one is actually a SCSI drive inside, so things are a bit different. Commonly ZIP drives will use the msdos or hpfs (Macintosh) filesystems, although if you use it only with linux, then ext2 is a better choice. As always you must load the support for the filesystem first, then you can load the ZIP drivers:

For the 2.2.x kernel series: You need to insmod parport and insmod parport_pc before loading the paride and module drivers. Alternatively, you can simply type modprobe ppa and the kernel will automatically load all the required modules.

If you have one of the newer ZIP Plus drives, which can be identified by the words "AutoDetect" written on the cable connector, then you need to use the imm module instead of the ppa module.

	insmod scsi_mod
	insmod sd_mod
	insmod ppa

Normally the ZIP disk is paritioned as if it was a hard disk, and only the fourth parition is used (don't ask me why...) It is normally accessed using /dev/sda. If you had a dos-formatted disk in the drive, you could mount it like so:

	mount -t msdos /dev/sda4 /mnt

Naturally you can use any filesytem you like, and you can use the first parition (or no partition at all). But doing so will mean that your disks will not be readable by Windows or Mac users of ZIP drives.

Avatar Shark

I've tested the Shark with a 250MB cartridge and it worked very well (and it's really small). It takes its power from the keyboard connector so there is really not a lot to carry around. To make it work, you use the epat and pd modules from the paride suite.

For the 2.2.x kernel series: You need to insmod parport and insmod parport_pc before loading the paride and module drivers.

	insmod paride
	insmod epat
	insmod pd

The drive can be partitioned and formatted with whichever filesystem you wish. Normally a single partition exists and is formatted with msdos filesystem. The device is /dev/pda and the first partition would therefore be /dev/pda1 (major 45, minor 1).

	mount -t msdos /dev/pda1 /mnt

The drive can now be accessed under /mnt.


Ralph Siemsen / ralphs@netwinder.org