AIX Printer Support: Colon Files
One of the first questions your manager will ask when
decides to jump on the open system bandwagon is "Can
we use all
of our current terminals and printers on the new platform?"
was asked this question before my company purchased
10 IBM RS/6000's
as badly needed replacements to our aging MAI/Basic
4 systems. MAI
were very helpful in answering the hardware side of
most of the current terminals and printers would work
with some minor
changes and converter boxes, but some of the older equipment
have to be replaced. I soon discovered, however, this
was only a small
part of the solution. Since these were non-supported
functions -- such as form length, cpi, and lpi -- were
So the question became "How do you regain the functionality
non-supported printers?" AIX's answer is called
the colon files.
A colon file is simply a text file that can be used
to control characteristics
of the printer. A stack-based language is used to pass
the colon file is compiled by the chvirprt command.
"digested" file is used by the formatter programs.
is actually a C program that acts as a filter to perform
defined by the colon file. The formatter to be used
is specified on
the mf line of the colon file. The pio commands load
the colon file to find which formatter is to be used
and then load
the appropriate formatter. If you have a lot of time
to waste you
can actually write a formatter, but the ten that IBM
should work for most of your needs. Once you've seen
the reason for the name becomes obvious.
I was first introduced to colon files through two internal
-- "Printing for Fun and Profit Under AIX V3"
Formatters, Colon Files and Virtual Printers."
The internal document
number for the first is GG24-3570. The second document
does not have
an internal document number but the majority of the
contains is in info explorer under "Printer Colon
and "Printer Colon File Escape Sequences."
The printer I needed to configure was an MAI 4201. This
a Printronix P6000 series printer. MAI made some hardware
to allow their system to communicate, but a converter
to negate those changes.
To start working on a non-supported printer, first configure
as another serial printer, that is, a generic RS-232-type
then add a virtual printer of type ASCII. This gives
you a clean colon
file to start.
Most newer printers allow form length to be loaded by
a simple escape
sequence, e.g., ESC C n, where n is the number of lines
per page, but this printer used a method called vertical
(VFU). A short explanation from the hardware reference
VFU as a device that permits executing forms of up to
132 lines in
length and allows slewing within a form. To accomplish
this task with
hex codes requires the following:
1E 10 1D ... (number of
lines - 1) ... 1D 1F.
The 1E tells the printer that you are starting
to load a VFU; the 10 signals the printer that this
top of the form. The 1D values are place holders for
of the lines on the form, and there are number of lines
- 1 of these. The top of form accounts for the need
to use -1.
The 1F tells the printer that you have finished.
To accomplish the same thing with a colon file requires
procedure. The files can be found on AIX 3.1.x in the
Changes will be kept in the directory /usr/lpd/pio/custom.
The file names are <virtual printer>:<physical
colon files are in the directory /usr/lpd/pio/predefs.
headers are in the directory /usr/lpd/pio/burst. After
colon file is compiled by the chvirprt command, the
file is placed in the /usr/lpd/pio/ddi directory. This
file that is actually used by the formatter programs.
If the colon
file is not re-compiled the changes will not take effect.
3.2 these directories were changed to /var/spool/lpd/pio.
A clean colon file would resemble Listing 1. The relevant
are as follows:
_j is a boolean used to decide if form length
needs to be loaded. _l is the number of lines per page.
decides whether or not to load form length by looking
eC loads form length.
The modifications look like this:
The first clause
says, in English,
If the value of _j is equal to 1
then run the eC clause and the al clause
If the value of wp is not equal to 0
then run the c2, eB, eD, and e% clauses.
The last if clause is the standard ASCII printer
clause and can be removed.
The important clause is the eC clause. You should be
that this clause does not even appear in the standard
I found this number by looking at the IBM ProPrinter
colon file and
used it as a rule of thumb.
The second clause
says, in English,
if the value of _l is not equal to 0
then subtract 1 from _l and put it in the
send octal 36 and octal 20
while a does not equal 0
send octal 34 and send octal 37
else use original options from database
push _l on the stack
reset the value before %o was used
then send octal 33 the character C
use original options from database push _l
reset the value before %o was used
pop integer off of stack and use low order byte.
The else phrase is a standard loading of form
length for an IBM ProPrinter. The values are first set
to the originals,
in case you changed something, then reset. The code
looks to see if
a form length is set, then sends octal 33 to the printer
the ASCII value of C. It reloads the original values,
pushes the value
of _l, and resets values, then pops values of _l. Listing
a more technical breakdown of the information. Figure
1 displays the
You can make these changes through smit -- you change
virtual printer, which causes an automatic recompile.
I usually bypass
this and use the vi editor, but I then must manually
using the following command:
-> chvirprt -d<physical
printer> -q<virtual printer>
If doing it yourself seems too complicated, IBM says
they may help (see sidebar).
Don't be nervous about changing the colon files -- the
can always be recovered by deleting the virtual printer
This example is only the beginning of what can be done
colon files. If you want an explanation of the other
values, use smit
to change/show virtual printer. The result will be a
list that consists
of a two-character description, its purpose, and possible
About the Author
Jeff Courington graduated from Virginia Polytechincal
and State University with a BS in Computer Science.
Over the past
eight years, he has worked on various forms of UNIX,
SCO, SVR3 variants from Silicon Valley Software and
He presently runs a network of 10 IBM RS/6000's and
various SCO machines
connected by X.25 over the wide area and Ethernet on
the local area,
also running TCP/IP over X.25.