Disgusting Kernel Hack

Guy Harris guy at rlgvax.UUCP
Wed Jan 18 22:46:16 AEST 1984


<has everybody fixed this yet?>

	1) More on our system (2.8BSD 11/44) isn't slow starting up. In
	   fact, I can't tell when readnews needs to fire more up and when
	   it doesn't.  This may be our system though, we have 'more'
	   with the sticky bit on and some other kernel hacks 
	   (not disgusting ones though!) to speed file I/O and execs.

On our 11/780 running 4.1BSD and later 4.1cBSD you could definitely tell
when "more" was getting cranked up.

	3) To make the kernel page nicely, you have to at least make it
	   give you a prompt when it pauses so that the new user won't
	   go home after 30 minutes thinking that the system died when
	   actually it wants him to hit return.  That means that the KERNEL
	   has to send a TEXT message (like '--More--') to a users terminal.
	   The thought of the kernel sending messages to regular ttys (not the
	   console) makes me shudder.  Again, this is a personal bias.

Watch out for 4.xBSD, then, it sends "mag tape not ready" and "out of space"
messages to the user's terminal.

	   I hacked (a pretty hack, tho) a control-T into our kernel 2 years
	   ago and the thought of adding the code to print strings and check
	   for buffer overflows and the like still sends shivers up and
	   down my spine...

Actually, I believe TENEX/TOPS-20 implemented ^T by making it cause a signal
which was ignored by almost everybody but caught by the shell, which did the
moral equivalent of a "ps" or "jobs" command when it got that signal.  A lot
of people who propose or implement it do so by putting the entire facility
into the kernel, when all that's necessary may be hacking the TTY driver a bit
and hacking the shell(s) a bit.

	4) To add onto point #3 above. Once you get to the point where you
	   are saying "Ok, lets make the kernel talk to joe user" you start
	   saying "Wasn't 'more' neet when it would print in reverse video?
	   Let's add an ioctl to pass terminal attributes to the tty driver!"
	   "Yeah! And ioctl's to do cursor addressing!."  That kind of
	   stuff is for giant monitors like TOPS-10.  Not UNIX.  If you don't
	   like 'more' write your own.  At least as a user-level program you
	   can replace it.  If it goes into the kernel, you're out of luck
	   bucko.

Actually, there are two OSs smaller than TOPS-10 that have special functions
to do cursor addressing, although the kernel's repertoire of terminal models
is small; RSX-11M and UNIX System V (it originally came from Columbus UNIX,
I believe).

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.unix.wizards mailing list