May 11, 2001, 2:57 PM — I have admitted several times in this column that I can be absentminded and careless. At least I meant to. Regardless, this tendency got me into an annoying situation recently. I made several changes to my system at once. I swapped my network card, rebuilt the kernel to try out different USB drivers, and made a few other changes. But I forgot to make changes to the file /etc/modules, which would tell the system to load the appropriate modules for my USB driver, keyboard, mouse, and new network card.
When I rebooted the system, I couldn't operate the machine. Linux ignored my USB keyboard and mouse and I couldn't contact the computer over the network using ssh (secure shell) because it didn't load support for the new network card. (See Resources for a link.)
There are several very simple ways of dealing with this situation. For example, I could hunt down a keyboard with a PS/2 connector and plug it in, or I could reboot the system with a previous kernel version. Being lazy by nature, I didn't want to look for a keyboard. Being impatient by nature, I didn't want to wait for the system to reboot. I especially dislike reboots. My system seems to take forever to initialize the IDE drives and controllers, the Intel Ethernet Express Pro management BIOS, and the Adaptec SCSI BIOS at boot time.
Fortunately, I anticipated such an event and left myself one more option. I set up Linux so that I could access it using my Palm Pilot as a VT100 terminal connected to the serial port. I logged in via the Palm Pilot, loaded the USB driver and modules for my keyboard, and was back in business in a wink.
There are other ways a Palm Pilot terminal can help you work or get you out of a jam. I imagine it could really come in handy as a debugging tool, especially if you're building a full-screen graphical application. You can redirect various types of error or debugging messages to your Palm terminal while you develop your application. Your Palm instantly takes on the role of a second monitor.
Here's how to set up your Linux system to work that way: First, make sure your Linux kernel supports the serial ports on your machine, and also supports the console on the serial port. Your kernel may already support these options, but if not, you can build a new kernel yourself. If you use make menuconfig as your kernel configuration tool, select the Character Devices section and mark these two options in the screen that comes up:
<*> Standard/generic (8250/16550 and compatible UARTs) serial support [*] Support for console on serial port
You also need the program getty or one like it installed on your system (alternatives include agetty). Next, edit your /etc/inittab file to include a line like the following:
T0:23:respawn:/sbin/getty -h -L ttyS0 9600 vt100
In the above example, getty is looking for the Palm Pilot on the first serial port, which PC users tend to think of as COM1. In Linux that's currently called ttyS0. If you want to use COM2, change that to ttyS1. This line also assumes that you'll be talking to the Palm at 9600 bps. The defaults for the connection are 8 bits, 1 stop bit, and no parity, which is something you need to remember when setting up your Palm Pilot terminal program.
Once you have decided how to configure this line in /etc/inittab, run the following command to tell your system to reread the /etc/inittab file. (Remember, this isn't Windows -- you don't need to reboot to make your system recognize changes to just about anything except the kernel itself, and there are even exceptions to that rule.)













