Next Previous Contents

12. Serial Tips And Miscellany

Here are some serial tips you might find helpful...

12.1 kermit and zmodem

To use zmodem with kermit, add the following to your .kermrc:

define rz !rz < /dev/ttyS3 > /dev/ttyS3
define sz !sz \%0 > /dev/ttyS3 < /dev/ttyS3
Be sure to put in the correct port your modem is on. Then, to use it, just type rz or sz <filename> at the kermit prompt.

12.2 Setting Terminal Types Automagically

To set your terminal type automagically when you log in, add the terminal type to the entry in /etc/inittab. If I have a vt100 terminal on ttyS1, I would add ``vt100'' to the getty command:

S1:456:respawn:/sbin/getty ttyS1 DT9600 vt100

Other gettys have similar options. You can also use tset, which can establish terminal characteristics when you log in, and doesn't depend on any defaults.

12.3 Color ls On Serial Connections

If ls is screwing up your terminal emulation with the color feature, turn it off. ls --color, and ls --colour all use the color feature. Some installations have ls set to use color by default. Check /etc/profile and /etc/csh.cshrc for ls aliases. You can also alias ls to ls --no-color, if you don't want to change the system defaults.

12.4 Printing To A Printer Connected To A Terminal

There is a program called vtprint, available from ftp://ftp.sdsu.edu/pub/vtprint, and from http://www.sdsu.edu/~garrett.

Another program that will do this is called xprt. It can be found at ftp://sunsite.unc.edu/pub/Linux/system/printing.

12.5 Can Linux Configure The Serial Devices Automagically?

Yes. If it's not already set up like this (or close to it) you may set Linux up to detect and set up the serial devices automatically on startup. If needed add the line:

/sbin/setserial /dev/ttyS3 auto_irq skip_test autoconfig
to your /etc/rc.d/rc.local or /etc/rc.d/rc.serial or /etc/rc.boot/0setserial file. Do this for every serial port you want to auto configure. Be sure to give a device name that really does exist on your machine.

Notes For Multiport Boards

For board addresses, and IRQs, look at the rc.serial or /etc/rc.boot/0setserial that comes with the setserial program. It has a lot of detail on multiport boards, including I/O addresses and device names.

12.6 Using A Serial Console

There is an article in issue 36 of the Linux Journal, http://www.ssc.com/lj/issue36/index.html that explains how to use a serial console. See Text-Terminal-HOWTO.

12.7 Higher Serial Throughput

If you are seeing slow throughput and serial port overruns on a system with (E)IDE disk drives, you can get hdparm. This is a utility that can modify (E)IDE parameters, including unmasking other IRQs during a disk IRQ. This will improve responsiveness and will help eliminate overruns. Be sure to read the man page very carefully, since some drive/controller combinations don't like this and may corrupt the filesystem.

Also have a look at a utility called irqtune that will change the IRQ priority of a device, for example the serial port that your modem is on. This may improve the serial throughput on your system. The irqtune FAQ is at http://www.best.com/~cae/irqtune.


Next Previous Contents