
1) Untar the files into your source root.
2) From your source root, execute:

	patch -p0 < vp.cdif
	
3) compile ps.c, kill.c, and setterm.c.  ie:

	cc -Iinclude -o ps ps.c
	



These patches allow Linux to have Virtual Consoles,
using memory buffers, meaning you may have as many consoles
as you like, by change console.c:MEM_BUFFER_SIZE.
Also provided is a simple ps command and a kill command.

These patches are to be applied against version 0.12.

For those not in the know, VCs allow swapping screen images
with just the touch of a function key, between virtual sessions.

This patch also provides screen blanking for Virtual Consoles with linux.
In effect, we get this for free, since VC already allocates a buffer
per console tty, one of which (the currently actives one) wasn't
being used anyways.  The blanker simply uses this buffer, and
copys blanks to the real screen buffer.

By default, blanking will be disabled at bootup time.  To enable it,
use 

  setterm -blank n

where n is a number between 0 and 60.  Setting it to zero disables
it again.  I usually use the number 10, meaning 10 minutes.
This has already been added to startcons for you. 


A screen dumper is also provided for VC.

  setterm -dump n -file dumpscreenfile

or just 

  setterm -dump

These options to the setterm command cause the screen to be dumped
to a file.  If a console number n is specified, the contents of that
console are dumped, otherwise the current console is dumped.  

If a file is not specified with the -file dumpscreenfile option, 
then the contents of the screen go to the file screen.dump in the 
current directory.  To append the contents to the file, use

  setterm -append n

in place of the -dump option.

 
To clear the screen, or reset the terminal, two short shell scripts
have been provided.  Namely clear and reset.

 
Finally, for you color screen folks, you can set the standout attribute
using 

   setterm -standout n

if you don't like the standout attribute (which is the complemented
foreground attribute).   



Technical notes.

     The ttys are changed: tty0 is always the current window, while
     ttyn is virtual terminal n selected with function key Fn.
     tty64/tty65 are now the serial ports.
     Startcons can be started from /etc/rc, but TERM=dumb.
   
     The VT100 emulation in console is still a hack.  It might
     be better to find a PD vt100 emulation facility that can
     pass VTTEST and adapt it, someday.  Or at least attempt to 
     get this one to pass VTTEST.
  
     To avoid adding another system call, I defined TIOCSNAP in termios.h
     and used ioctl(0,TIOCSNAP,buf) to do the dumping for me, where 
     buf is an array of size SCR_COLS*SCR_ROWS (80*50 or 80*25) and
     the console number is in the first char (ie buf[0] = (char)console).
     Set this to 0 if you just want the current console.  If you have
     need of more than 255 consoles, perhaps you should seek help.
   
     The SCR_COLS and SCR_ROWS should be defined in <linux/config.h>.
     Instead, I currently just check if VIDEO_VGA_50_LINES is defined,
     else use 25 lines.  


Problems/Issues:

     If your console becomes stuck in graphics mode, you can free
     it using "setterm -reset > /dev/ttyN" where N is the number of
     the troubled console.  I think this could happen when catting 
     a binary file to the screen.
     
     Function keys escape sequences were not being caught by console
     (even before my patches), and resulted in characters and beeping.
     Therefore, I have disabled their interpretation in keyboard.S.
     Assembler is not my bag, and I don't know why keystrokes, which
     are infrequent events, need to be handled in assembler.

     Leds and caps/num locks are not saved/restored currently.

     Using your keypad as an application keypad would be nice.
     That and the function keys would allow pretty complete
     VT100 emulation.   It will also become an issue if we ever
     one day, get dos V86 sessions running under Linux.  But this
     will mean using some other key for VC switching.  Perhaps
     left-shift Fn?
     
     Setterm sets the interval by writing out an escape sequence
     to the console.  I do not know what all the valid sequences
     could be, so I selected one linux currently does not use.
     Namely "^[[X;Y;Zl".  That is escape, open square, a number X
     between 0 and 60 and the lowercase letter L.  The numbers Y and
     Z are X+13 and X+17 respectively, and serve as check numbers 
     since if some program were to output the sequence to your screen, 
     the blank time would be changed.  This makes it unlikely to 
     happen unintentionally.

     Blank is called by do_timer.  It is possible, that output could
     be going to the screen just as it is blanked, in which case
     characters could be lost (at least I hope that is the worst that
     could happen).  But since blanking usually only occurs during
     periods of console inactivity, the danger of this is low.
     I have added a check to see if in con_write, but that may
     not work %100.

     The cursor doesn't disappear when blanked.  Maybe it shouldn't.
     
     Select is not really well tested, and ptys even less so.

Acknowledgement:
 
  Gordon Irlam for setterm.c.
  Matthias Lautner for bits an pieces of sel.c and pty design decisions.




********************************************************************

pmacdona@sol.uvic.ca
Peter.MacDonald@bcsystems.gov.bc.ca

