Unix FAQ

Using a serial (RS232) device as a system console
In this FAQ: getty/login, console enabling, PC keyboard, serial stuff,
RS232 Break, Sparcstation connectors DTE/DCE
Related FAQs Solaris devices  


Unix FAQ Menu
Contents
Basic commands
Cron
Creating CDs
Device Files
DHCP server (Solaris)
Filesystem explained
Fsck
grub/lilo vanished!
Linux applications?
Linux databases?
Linux distributions
Serial Console
Solaris devices
Solaris disks - Intro
Solaris disks - Adding
Solaris x86 install
SQL/Shell script
Syslog/Monitoring
Time Synchronisation.
Virtual Memory
Web Multi-Language
Web Server Errors
Humour
Unix a Prank



PC (laptop) RS232 / COM  9-Pin port (left) + VGA connecttor
PC 9-Pin RS232(left)
& VGA connectors


serial (rs232) connector on a Sun Solaris sparcstation
The combined serial ports on a Sun SparcStation


Serial RS-232 Null Modem
A null modem simply
swaps RD/TD


RS232 Female 9-pin
RS232 female 9-pin


RS232 Female 25-pin
RS232 Female 25-pin


RS232 male 25-pin
RS232 male 25-pin

Good This page has received an average rating of 80% from 9 readers

Question;

have a simple question. Well, at least I think that it should be fairly simple. I don't have much experience with Unix (BSD) so I am in a little bind right now with the following. My F5 BIG/ip currently uses only the display and not the terminal port for accessing it. It runs the BSD OS (3.0). I need to be able to disable it from using the display and enable the terminal port so that I can connect a serial cable to the terminal port to manage the machine with my laptop.

To put it simple, I dont want to have to plug a monitor to the display port to manage the machine, I want to use a serial cable and the terminal (COM) port.

Any help would be greatly appreciated. Thank you.

Answer;

Firstly I should say that I'm not familiar with your platform. Thus some of this advice may sound a little general...

There are two distinct aspects to what you are trying to achieve. First is easy, second can be difficult.

1. Login via the COM (serial) port;

This is generally just a case of enabling a program called getty(8) to run on the port on question. The way getty is started & configured varies widely.
BSD variants generally have a /etc/ttys or /etc/ttytab file which configures it. Sys-V derivatives do the same thing in /etc/inittab. You'll need to identify the device file related to the physical serial port you're interested in. Again BSD variants usually have something like /dev/ttya or /dev/ttyb for COM1 and COM2 respectively - these do vary widely.
Boot messages sometimes give a clue.

Once you've got a getty running on the serial port you should be able to attach you laptop and get a login prompt. From this you can manage your machine in most respects. One important thing you can't still do is interact with the boot process - say an 'fsck' needing manual input.

Solaris (sparc) users note that the 'console' device moves from the framebuffer/keyboard to ttya if the keyboard is unplugged before a hard reset. Thus you may not need to do anything more than that. Beyond that, you'll need to look at the 'pmadm (1m)' program. The onboard serial ports are /dev/term/a and /dev/term/b.

Linux is a System-V derivative, enabling getty from /etc/inittab. Usually it's simply a case of changing field 3 for 'getty' from 'off' to 'respawn'. NB exercise extreme caution editing /etc/inittab - it's real easy to completely screw-up your system...

2. Enabling the serial port as system console.

- I'll warn you that on PC's this can be very difficult. So difficult that you might not want to bother.
The methods of doing this are so varied that there are few specifics I can give. However mostly they revolve around configuring the Unix boot(8) program. OnLamp has a good article on the topic which seems to apply to several BSD variants;

On Solaris (sparc) it's simply a case of unplugging the keyboard prior to booting the system. All aspects of console output, from OpenBoot up to the kernel will use the first serial port - usually marked 'ttya'.
More about the Solaris Console in Solaris Devices - The Console

Linux is in essence the same as BSD, there is a good HOWTO on the subject.


Caveats/Gotchas

Most PC's tend to get quite upset when their keyboard is unplugged. Mostly they tend to freeze in their POST test. Sometimes this test can be disabled in the BIOS setup. Otherwise you may have to leave it connected, albeit out-of-the-way.

Serial stuff: To connect a laptop, PDA, or other "DTE" you'll likely need a cable with pins 2/3 (rd/td) swapped at one end - or a null modem on a straight through cable. A three wire cable is sufficient - pins 2,3, & 7 on a DB25 connector. Connecting a modem ( a "DCE" ) requires a straight-through cable with the hardware handshake control lines (RTS/CTS).
Serial port parameters generally default to 9600baud, 8 bits, no parity. Though at least one BSD variant (SunOS4) uses 7bits, even parity. These are set by getty(8).

RS232 BREAK; Be aware that many Unix variants react to an RS232 BREAK signal on their console port by dropping to some sort of boot/diagnostic prompt - suspending the Unix kernel. A BREAK signal is frequently sent when a serial device is powered up - such as when a modem or laptop is switched on. If this occurs on a Sun Solaris box, type 'go' to the OpenBoot 'ok' prompt and your system should continue running, thus;

          ok go
Generally I'd suggest disconnecting the cable before powering up your RS232 device.

Sun Sparcstation connectors.

Sun Sparc station connectors. Left to Right; Keyboard, 
        combined ttya & ttyb ports, console display, and Ethernet 10BaseT. Left to Right; Keyboard, combined ttya & ttyb ports, console display, and Ethernet 10BaseT.
A standard serial cable will connect to ttya. Access to ttyb requires a special forking adapter from Sun. Sun dropped this unpopular RS232 layout on later machines.


Footnote
1. DTE stands for Data Terminal Equipment. Any device that is at the end of a communication link is a DTE. Examples are PCs, Unix boxes, PDAs, dumb terminals. Contrast with -
2. DCE Data Communication Equipment; devices that form part of a communication link. A modem is probably the most common example of a DCE.
The RS232 specification was originally intended as a means of connecting DTEs to DCEs which explains why one needs to swap pins 2 & 3 ( Receive/Transmit ) when connecting two DTEs

Feedback

I hope you found this FAQ to be of some use. It would be most helpful if you could rate it below. All fields are optional...
Please do not use this form to seek free technical assistance - Try AllExperts...

Excellent Your Email:
Good Comments or Suggestions
Useful
Slightly useful
Not useful
        


Home Thai Guide   Great Circle Calculator WorldClock AMS Services Contact us