Terminal paging in the kernel

Steve Zimmerman z at cca.UUCP
Mon Mar 5 11:02:30 AEST 1984


As the author of one of the original versions of terminal paging in the
kernel (known locally as "page mode"), I have been rather surprised by
the strong opposition to it by a number of people in this newsgroup.  To
a large extent, the arguments opposed to page mode remind me lot of a
few years ago when many people were arguing against the use of screen
editors.  In both cases, most people opposed to the new feature had
never used it on a regular basis; the few people who had had used a
particularly brain damaged implementation, and had then begun arguing
against all implementations.

I think the most important people to listen to are the users of a
system, who vote with their keyboards.  When page mode was about to be
brought up here at CCA three years ago, our users were split fairly
evenly between those who were in favor of of it, those who had no
opinion, and those who had their doubts.  Page mode was installed as the
default for all users, with each user having the ability to disable it
by putting an "stty -page" in his or her .login file.  After the first
few days, there were only two users in our user population of several
dozen who decided to disable it; even these two ended up changing their
minds and enabling it over the next several months.  Over the three
years since then, as our user population has multiplied many times, no
one else has ever disabled page mode, and no one has even complained
about it.

This record would seem to say that the objections against page mode can
be met quite successfully.  The version we are now running has evolved
over the years, and contains input from a number of other sites as well.
Here are my answers to the objections I've heard:

	Certain special programs (such as those that send data over a
	terminal line) would get totally messed up by page mode.

This is similar to an argument that screen editors should not be used
because there are still a lot of hardcopy terminals out there.  I would
guess that none of the people who have made this argument have ever used
a page mode, because in every one I've ever seen there is a simple
command (usually an option of stty) to turn it off or on.  In several
implementations such as ours, if you don't want the output of a
particular command to be paged, you can just hit a single control
character (^A in our case) any time after entering the command, and page
mode is then disabled until you start typing again.  Contrast the
ability to turn off page mode temporarily in the middle of a command
with the inability on vanilla Unix systems to start paging output in the
middle of a command.
	
	Lots of programs such as editors will need to be modified so
	that they temporarily turn off page mode.

Page mode is automatically disabled in RAW and CBREAK modes, which is
what these programs typically run in.  On our system, not a single
program had to be modified to be made compatible with page mode.
	
	It's a real annoyance to have to type the space bar every 24
	lines, no matter what is happening.

Some terminals have a hardware scrolling mode, which stops output after
every 24 lines.  I have the same complaint about these terminals, and
never use this feature on them.  However, a reasonable page mode does
not work this way.  Output is only stopped if a screenful has gone by
since the user last typed something.

	It's hard to tell whether output has stopped at the end of a
	page, or whether the program has died, or the system has
	crashed.

This is another complaint from people who have apparently never used a
reasonable page mode.  Some implementations of page mode print
<<STOPPED>> in the lower left hand corner of the screen; ours does a
carriage return but not a linefeed after the last line, so that the
cursor is underlining the character in the lower left hand corner of the
screen.  Both behaviors are quite unique, and I have never hear a user
of either of these systems make the above complaint.

	Page mode does not belong in the kernel.

Or, to quote from a recent article that raised this argument:  "It is
the job of the device driver to SIMPLY and DIRECTLY control the
resource, not to try to "help" me when I may not want or need to be
helped."  By that definition, the erase and kill functions of the
terminal driver should be moved out of the kernel, maybe into "more".
Do people think that that would be a good idea?  Page mode should be in
the terminal driver for exactly the same reasons that erase and kill
processing are there:  it is useful for an overwhelming number of
programs, it is more efficiently implemented in the kernel than anywhere
else, and it is simple to implement in the kernel.  My first
implementation of page mode was a couple of dozen lines of code; the
current version is somewhat larger, but it is still on the order of the
size and complexity of most of the other features in the terminal
driver.  The overall effect of putting page mode into the terminal
driver is to reduce the load on the system; on a heavily loaded system
such as ours with dozens of logged in users, getting rid of all the
"more" processes and the memory and context switching associated with
them makes a noticeable difference in the load.

	Steve Zimmerman



More information about the Comp.unix.wizards mailing list