Obsolyte - Where the antique is elYte!

How To: Serial Console

Obsolyte - Where the antique is elYte!

Summary
Connect, via a null modem, serial port "A" of the Sun to your terminal's serial port. Your terminal settings should be 9600 8N1, which are the default serial settings of the Sun. If possible, emulate a VT-100 terminal (almost every terminal does). DO NOT connect a keyboard to the Sun machine.


The Long Version
First, let's examine the serial port of your box. They generally come in 2 types, with one exception. The first is the standard 25pin serial port. This is generally recognized as a female connector of the back of the machine, with 2 rows of pins in a "D" style connector (see figure 1).

The second type is a "mini-din" style connector. This is a round, inset female connector with 8pins, and a notch to tell you which side is up when plugging it in (see figure 2).

The one notable exception is a 25pin connector which contains both the "A" and the "B" serial ports. If you plan to use both serial ports, you'll need to obtain a special "Y" splitter cable, but if you only want to use serial "A", then you're fine with the standard serial cable. Why Sun did this to us is not known.

Whichever port you have, you need to obtain the right cable for it, and any other adapters you may need to get it to your terminal (for example, you might have a 9pin serial port on your PC, if you're using that as your terminal).

I generally keep all my connections 25pin, right up to the point that I adapt it to 9pin my PC. This allows me the greatest flexibility when searching for null-modem adapters, gender changers, etc, as most decent computer stores, and even most Radio Shacks will carry the appropriate pieces I need when I'm trying to connect two dissimilar pieces of equipment.

If you've got the mini-din serial ports, look for a Macintosh serial cable made to work with external modems - all the currently manufactured ones have the hardware handshaking pin and will work fine with a Sun. Beware very old Mac serial cables though, as they lack the hardware handshaking pin, and will result in more problems for you down the road. Even the newer Mac serial cables are getting harder to find, as Mac's now either have internal modems or are going USB, and as a result, you may have to scrounge around for an appropriate cable. If you can find a Sun serial cable for these machines, all the better!

Okay, so you've got a serial cable connected the the Sun, all you need to do now is place a Null-Modem Adapter (or a null modem cable) between the Sun and your terminal. Do not be fooled into using a "Laplink" cable, this will just cause you problems. You need a true null-modem connection. If you cannot obtain this item, you can always build one if you can get the parts (see below for more information on building an adapter).

Let me mention now that there should NOT be a keyboard connected to the Sun. Sun machines on power-up look at the keyboard port. If something is plugged in, they assume the console is a keyboard and monitor locally connected. If it doesn't see any keyboard, it redirects console input/output to serial port "A". Whether or not you have a "framebuffer" card installed is irrelevant. In fact, some Sun machines have a framebuffer built in, so there's no way to remove it, hence, the sense test is done at the keyboard port.

Now the last stage is the toughest for me to describe because I don't know what you're going to be using as a terminal, but for the purposes of this page, I'm going to use a generic PC as an example. The PC has either a 9pin or a 25pin serial port. Adapt as needed to fit the connector, and that completes the wiring stage. Power up your terminal first.

Now we're ready to configure the terminal. Set your terminal program (if this is a PC) to look at the serial port you're using (most PC's have serials numbered 1-4, with 1 being sometimes reserved for the mouse, so you might be wanting to use serial 2, however, first verify that you're "speaking" to the correct port).

Set that serial port to 9600baud, 8N1. The "8" is the number of data bits, "N" means No parity bits and "1" is the number of stop bits. If you have played with your terminal software for any amount of time, you'll see that there's a variety of these settings (most common are 8N1, 7E1). Most serial consoles I've worked with prefer to "see" your terminal as a VT-100, so try and make sure that's what you're set to. Usually, terminal software allows you to "emulate" a variety of terminal types, and VT-100 is one of the most common. If you're using a hardware terminal, check it's setup. There's usually a "setup screen" built into the firmware and VT-100 emulation is supported.

Now that you've configured your terminal properly, power-on the Sun machine. It should whirr for about 10 to 30 seconds before it displays anything, but the first thing it should tell you is the machine type, how much RAM it has, and what the hardware ethernet address is (and if your hardware ethernet address is ff:ff:ff:ff:ff:ff, you have a whole new problem to deal with, but that's the subject of a different FAQ -- see the NVRAM FAQ). This is known as the machine displaying it's "banner".

Now, depending upon the machine you have, and the revision of your PROM, you'll either be greeted by a ">" prompt or an "ok" prompt. Machines that have everything configured properly and a working OS will of course, begin to boot by themselves rather than displaying a prompt.

If you want to stop the boot from happening so you can wipe out the OS to install something else (or just perform maintenence) or make changes to the NVRAM, then, before the OS starts to load from the HD, (essentially, right after it tells you the hardware ethernet address, but before it says "boot device"), you need to send a "break" signal. On a PC, this is done by holding down the CTRL key and tapping the "Break" key (Pause/Break on most PC keyboards).

Once you've sent a break, as above, you'll either be greeted by a ">" prompt or an "ok" prompt. If you see the ">", type "new" and you'll get the "ok" prompt. Type "help" at the "ok" and you'll get a list of what's in there. In almost all Sun machines, what's in there is a full FORTH monitor and it's pretty extensive. In there, you can change many aspects of how the hardware deals with the outside world. Consider it like a PC's BIOS, but on steroids.

At this point, the exact contents of the PROM and NVRAM will vary greatly from machine to machine, so I'll reserve trying to translate what's in there for a different FAQ. You'll figure out most of it eventually.

UPDATE: Something that I forgot to mention in this FAQ previously, was that if you SHUT OFF YOUR TERMINAL, while it is connected to a running Sun machine, you send a "break" signal down the serial line and the Sun will jump back into the PROM, halting the OS. This can cause first time users considerable confusion who set up their machines, shut off their terminal and then wonder why they can't telnet in.

If you're planning to not have a running terminal connected all the time to serial A, then set up your "headless" machine to autoboot into whatever services you want to have operational. Once you are satisfied that everything is running as it should, normally power down the Sun. After then killing the terminal and disconnecting everything, you may re-power the Sun box, and it will boot without assistance if you've done everything correctly (many OS's will autoboot, but setting things up like an IP number to telnet into you either have to configure or must be set up during the initial install of the OS).

Once the machine is up and running, you'll be able to telnet in normally, assuming you have that service set up.

A Quick Note about Serial "B"
Note that powering the terminal off, if connected to Serial "B" doesn't effect "B" the way it does "A", but the "B" serial port also doesn't show initial console messages, it only allows login after the machine has booted to a multi-user runlevel (and I'm assuming you've set up the machine to allow logins from "B"). Serial "B" cannot be used therefore, as a 'true' console.

However, if your machine is booting up, but you can't telnet in, serial "B" is a handy option for logging on to the machine to look around and diagnose the problem. Depending upon your OS, you will not be able to login as root, but you can login as a user and "su -" to root. You can fix your problems, shut off the terminal while it's still connected, and not halt the OS. I have a VT52 at home which I leave connected to my SS5 on serial "B" all the time. But I only turn the terminal on when I want to use it. It doesn't affect the machine in any way.

I hope this was helpful!



How To: Build a Null-Modem Serial Cable


Connect Pin to Pin on each end.

25-pin           25-pin
 2 --------------- 3
 3 --------------- 2
 4 --------------- 5
 5 --------------- 4
 7 --------------- 7
 6 ---+
      +----------- 20
 8 ---+
	      +--- 6
 20 ----------+
	      +--- 8


This is the traditional "full handshaking" null modem cable. Adapters wired like this are available in most of the computer stores I've been in.

Now, if you want to convert straight to a 9pin connector Greg LeBlanc offers the following insight: "You need to have full duplex, otherwise, you just get output, but no return. (or, if you reverse the cable, you see nothing and can't tell that your keystrokes are going through.) simply checking three pins with a multimeter isn't cutting it. you need the following connections to have a fully compliant cable...


25 pin          9 pin
pin 1 GND  -  pin 1 GND
pin 2 TXD  -  pin 3 RXD
pin 3 RXD  -  pin 3 TXD
pin 4 RTS  -  pin 8 CTS
pin 5 CTS  -  pin 7 RTS
pin 7 gnd  -  pin 5 gnd
pin 6 DSR  -  pin 4 DTR
pin 20 DTR -  pin 6 DSR


Note that GND is frame ground and 'gnd' is Signal ground and the two should not be tied together...

Some Null modem cables tie 6/20 together on the 25 pin side, this doesn't always work with all equipment.

I included the 9-25 pin arrangement because most PeeCees use 9 pin mouseports as the serial port, and mosr Sun's use real 25 pin serial connections (or those double-port serial connections, in which a standard serial cable hits ttya just fine AFAIK...)"


Note: All of the above works fine on SGI systems I have tested. Chances are that Unix workstations from HP, DEC, etc. work the same way as well, but I've never tested that, so your results will vary. The information I've presented is, to the best of my limited knowledge, as accurate as I can get it, but I can't guarantee that it will be as easy for you as it has been for me. When all else fails, do research -- that's what the web is for.

Other Resources

Sun Serial Port & Cable Pinouts

Complete pinouts guide to Parallel, Serial, Network and Monitor Cables for the IBM PC

Ultraspec Workstation Cables