Commit Graph

128 Commits

Author SHA1 Message Date
Mark Murray
96441a8c38 Remove the #ifdev DEVRANDOM's, as promised.
/dev/random is now a part of the kernel! you will need to make
the device in /dev: sh MAKEDEV random
and take a look at some test code in src/tools/test/random.
1995-11-04 16:00:56 +00:00
Mark Murray
1bb2d3142b Theodore Ts'po's random number gernerator for Linux, ported by me.
This code will only be included in your kernel if you have
'options DEVRANDOM', but that will fall away in a couple of days.
Obtained from: Theodore Ts'o, Linux
1995-10-28 16:58:05 +00:00
Bruce Evans
21e00296ec Don't allow i/o operations for non-root users.
Add prototypes.
1995-10-14 07:08:09 +00:00
Bruce Evans
e7451974bb Make pcvt and syscons live in the same kernel. If both are enabled, then
the first one in the config has priority.  They can be switched using
userconfig().

i386/i386/conf.c:
Initialize the shared syscons/pcvt cdevsw entry to `nx'.

Add cdevsw registration functions.

Use devsw functions of the correct type if they exist.

i386/i386/cons.c:
Add renamed syscons entry points to constab.

i386/i386/cons.h:
Declare the renamed syscons entry points.

i386/i386/machdep.c:
Repeat console initialization after userconfig() in case the current
console has become wrong.  This depends on cn functions not wiring down
anything important.

sys/conf.h:
Declare new functions.

i386/isa/isa.[ch]:
Add a function to decide which display driver has priority.  Should be
done better.

i386/isa/syscons.c:
Rename pccn* -> sccn*.

Initialize CRTC start address in case the previous driver has moved it.

i386/isa/syscons.c, i386/isa/pcvt/*
Initialize the bogusly shared variable Crtat dynamically in case the
stored value was changed by the previous driver.

Initialize cdevsw table from a template.

Don't grab the console if another display driver has priority.

i386/isa/syscons.h, i386/isa/pcvt/pcvt_hdr.h:
Don't externally declare now-static cdevsw functions.

i386/isa/pcvt/pcvt_hdr.h:
Set the sensitive hardware flag so that pcvt doesn't always have lower
priority than syscons.  This also fixes the "stupid" detection of the
display after filling the display with text.

i386/isa/pcvt/pcvt_out.c:
Don't be confused the off-screen cursor offset 0xffff set by syscons.

kern/subr_xxx.c:
Add enough nxio/nodev/null devsw functions of the correct type for syscons
and pcvt.
1995-09-10 21:36:12 +00:00
Nate Williams
a42b8f1321 Added missing semi-colon in the XT_KEYBOARD code. W/out it the code
would not compile.
1995-08-16 22:36:43 +00:00
John Dyson
302cf5869a Fixed a problem that malloc(..,..,M_NOWAIT) was being called without checking
for return values.  It just so happens that in the cases where it is likely
to fail, it is okay to change the M_NOWAIT to M_WAITOK -- and all will
be well.  This problem was manfest as a panic very regularly on a 4MB
system right after bootup.
1995-08-08 05:14:40 +00:00
Bruce Evans
9fa18570a2 Obtained from: partly from ancient patches of mine via 1.1.5
Introduce TS_CONNECTED and TS_ZOMBIE states.  TS_CONNECTED is set
while a connection is established.  It is set while (TS_CARR_ON or
CLOCAL is set) and TS_ZOMBIE is clear.  TS_ZOMBIE is set for on to
off transitions of TS_CARR_ON that occur when CLOCAL is clear and
is cleared for off to on transitions of CLOCAL.  I/o can only occur
while TS_CONNECTED is set.  TS_ZOMBIE prevents further i/o.

Split the input-event sleep address TSA_CARR_ON(tp) into TSA_CARR_ON(tp)
and TSA_HUP_OR_INPUT(tp).  The former address is now used only for
off to on carrier transitions and equivalent CLOCAL transitions.
The latter is used for all input events, all carrier transitions
and certain CLOCAL transitions.  There are some harmless extra
wakeups for rare connection- related events.  Previously there were
too many extra wakeups for non-rare input events.

Drivers now call l_modem() instead of setting TS_CARR_ON directly
to handle even the initial off to on transition of carrier.  They
should always have done this.  l_modem() now handles TS_CONNECTED
and TS_ZOMBIE as well as TS_CARR_ON.

gnu/isdn/iitty.c:
Set TS_CONNECTED for first open ourself to go with bogusly setting
CLOCAL.

i386/isa/syscons.c, i386/isa/pcvt/pcvt_drv.c:
We fake carrier, so don't also fake CLOCAL.

kern/tty.c:
Testing TS_CONNECTED instead of TS_CARR_ON fixes TIOCCONS forgetting to
test CLOCAL.  TS_ISOPEN was tested instead, but that broke when we disabled
the clearing of TS_ISOPEN for certain transitions of CLOCAL.

Testing TS_CONNECTED fixes ttyselect() returning false success for output
to devices in state !TS_CARR_ON && !CLOCAL.

Optimize the other selwakeup() call (this is not related to the other
changes).

kern/tty_pty.c:
ptcopen() can be declared in traditional C now that dev_t isn't short.
1995-07-31 21:02:00 +00:00
Bruce Evans
a16721a13a Move the inline code for waking up writers to a new function
ttwwakeup().  The conditions for doing the wakeup will soon become
more complicated and I don't want them duplicated in all drivers.

It's probably not worth making ttwwakeup() a macro or an inline
function.  The cost of the function call is relatively small when
there is a process to wake up.  There is usually a process to wake
up for large writes and the system call overhead dwarfs the function
call overhead for small writes.
1995-07-22 01:30:45 +00:00
Bruce Evans
d800e06858 Fix races in scstart(). q_to_b() wasn't called at spltty(), so there
were two races:
- q_to_b() might unexpectedly return 0 (e.g, after a keyboard signal
  flushes the output queue and isn't echoed).  ansi_put() interprets
  0 bytes as 4GB...
- more output (e.g. for echoes) might arrive afer q_to_b() returns 0.
  Then scstart() returns presumably and the new output might not be
  handled for a long time.

Remove unused function scxint().

Fix prototypes (foo() isn't a prototype).
1995-07-11 18:34:30 +00:00
Bruce Evans
f2fb20ef41 Speed up the inner loop of ansi_put() by a few percent.
syscons' output is now only about 4-5 times slower than I want.
It loses a factor of 2 for scrolling output by unnecessarily copying
the screen buffer, a factor of 4/3 for dumb OPOST processing, and
a factor of 3/2 for clist processing.
1995-07-11 17:59:22 +00:00
Bruce Evans
5dce8a63fc Don't convert \n to \r\n in pccnputc(). This is the responsibility of
cnputc().
1995-06-14 05:16:12 +00:00
Rodney W. Grimes
9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
Søren Schmidt
ad828abe4b Fixed problem with "char" cursor..
Submitted by:	ache
1995-05-21 18:30:05 +00:00
Søren Schmidt
e5c5c58924 Added nsccons variable for use by pstat
Submitted by:	 ache
1995-04-28 09:10:56 +00:00
Søren Schmidt
5130ec746f Added mark_all() call so that screen is proberly updated
when scroll-lock history is disengaged.
1995-04-25 10:22:28 +00:00
Bruce Evans
38994061cf Correct the type of the `c' arg to pccnputc().
Move declarations of console functions to cons.h so that they can't be
defined inconsistently in several places.  They should be config(8)ed.
1995-04-23 10:15:42 +00:00
Garrett Wollman
6c0081e92b Add a class field to devconf and mst drivers.
For those where it was easy, drivers were also fixed to call
dev_attach() during probe rather than attach (in keeping with the
new design articulated in a mail message five months ago).  For
a few that were really easy, correct state tracking was added as well.
The `fd' driver was fixed to correctly fill in the description.
The CPU identify code was fixed to attach a `cpu' device.  The code
was also massively reordered to fill in cpu_model with somethingremotely
resembling what identifycpu() prints out.  A few bytes saved by using
%b to format the features list rather than lots of ifs.
1995-04-12 20:48:13 +00:00
Søren Schmidt
8c4344bebd Fixes to the hardware cursor emulation.
Submitted by:	ache
1995-04-04 20:06:26 +00:00
Bruce Evans
65202423ff Fix count in mark_for_update() for insert-char(s) and delete-char(s).
Everything from the cursor to the end of the line must be updated.

Fix comment about erase-char(s).
1995-04-01 19:57:36 +00:00
Søren Schmidt
085db34497 Emulate hw cursor closely, and get start&end scanlines from BIOS. 1995-03-30 14:32:31 +00:00
Søren Schmidt
736277a951 Optimized the way physical screen updates are done. Now only
update what has actually been touched. This should speed up
screen access on slow hardware.
Introduced setting of "destructive" cursor size, much like
the old hardware cursor.
1995-03-29 20:55:03 +00:00
Søren Schmidt
dc463a367e Minor update to syscons.
Let "grey delete" be a function key (default is 0x7f)
Fix the xor cursor again..
Made the backspace key generate del as default
Made CTRL-space generate nul as default.
1995-03-03 08:37:52 +00:00
Paul Traina
8c5c37cd75 Incorporate bde's code-review comments.
(a) bring back ttselect, now that we have xxxdevtotty() it isn't dangerous.
(b) remove all of the wrappers that have been replaced by ttselect
(c) fix formatting in syscons.c and definition in syscons.h
(d) add cxdevtotty

NOT DONE:
(e) make pcvt work... it was already broken...when someone fixes pcvt to
	link properly, just rename get_pccons to xxxdevtotty and we're done
1995-02-28 00:21:11 +00:00
Paul Traina
77f77631e7 (a) remove the pointer to each driver's tty structure array from cdevsw
(b) add a function callback vector to tty drivers that will return a pointer
    to a valid tty structure based upon a dev_t
(c) make syscons structures the same size whether or not APM is enabled so
    utilities don't crash if NAPM changes (and make the damn kernel compile!)
(d) rewrite /dev/snp ioctl interface so that it is device driver and i386
    independant
1995-02-25 20:09:44 +00:00
Søren Schmidt
17ee9d00bc Next syscons update (given up on numbering :)
Removed screensavers from syscons, they are now LKM's. This makes it
possible to do some really "interesting" screensavers...
Fixed bug that sometimes caused garbage to appear when leaving
"scroll-lock" history.
Reformattet indentation, it got too deep for a normal 80 pos screen.
Split up in syscons.c & syscons.h for use with the saver-lkm's.
Temporarily removed -s option from vidcontrol, savers should now
be loaded with modload.
1995-02-22 13:48:07 +00:00
Poul-Henning Kamp
648c711bb4 This is the latest version of the APM stuff from HOSOKAWA, I have looked
briefly over it, and see some serious architectural issues in this stuff.

On the other hand, I doubt that we will have any solution to these issues
before 2.1, so we might as well leave this in.

Most of the stuff is bracketed by #ifdef's so it shouldn't matter too much
in the normal case.

Reviewed by:	phk
Submitted by:	HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp>
1995-02-17 02:22:57 +00:00
Søren Schmidt
314908fae3 Fixed cursor xor problem... 1995-02-14 14:37:53 +00:00
Søren Schmidt
719d3245ae Fixed the bug that caused the cursor to disappear under
boot with -c option
1995-02-07 11:53:27 +00:00
Søren Schmidt
768483b761 Fixed the annoing bug that caused writes to /dev/console to go to
the active virtual terminal (Boy, do I have little hair left).
Misc other fixes, try to enable cursor earlier in the game.
1995-02-05 23:44:25 +00:00
Søren Schmidt
130c74bbe7 Allow all characters except "real" control chars.
Fix NULL reference when serial console (thanks bruce).
1995-02-03 21:09:44 +00:00
Søren Schmidt
786f122175 Syscons bug fix: tab now right (thanks bruce!)
Mouse arrow support almost finished.
1995-02-01 21:56:32 +00:00
Søren Schmidt
6de1193d13 Reviewed by:
Submitted by:
Obtained from:
1995-01-30 21:36:32 +00:00
Søren Schmidt
a926a37b0a Third round in syscons update.
Display update method changed, now allways write in memory buffer,
  then periodically update physical display.
Speed improvements (now > 5 times faster than the old syscons).
History now circular buffer, with changeable size.
History scroll by up/down line, up/down page, home and end.
Backtab proberly implemented.
Now space for 96 function keys, 63 allocated standard, default now
  SCO/SYSV compat again as in the old days.
New keyboard definition files ~share/syscons/keymaps/*
Misc fixes for old "hacks" that broke SCO/SYSV compat.
More that I forgot before writing this...
1995-01-28 22:18:05 +00:00
Andrey A. Chernov
b99c427733 Get rid of overloaded Back tab, now F(64) 1995-01-26 10:02:21 +00:00
Andrey A. Chernov
5ddda58b2e o Restore removed hardware cursor support and make it _default_
case, software cursor now optional case. Driver must provide
  raw things (what hardware do for us, exactly) as default case,
  all driver features must be _optional_. Modern VGAs have internal
  configuration utilities to set cursor shape/blinking which stored
  into cards ROM, and syscons nuke out such features completely
  by forcing software cursor. Moreover, software cursor is hard
  to distinguish on standouted (or near standouted) fields and
  tends to disappearse from the screen.
  Set "flags 0x4" to enable software cursor now.

o Cleanup screen savers.

o Don't draw cursor if saver or blinker is active.

o Duplicated code moved to functons.

o Add more checks for blinker in progress, character lost otherwise
  when blinker restore old contents.

o Reduce blinking counter to 3, too slow in old variant.

o Fix timeout code in scrn_timer(), old variant can reenter iself,
  if action takes too long time.

o Disable visual bell for scroll lock mode, saved screen
  becomes overwritted otherwise.
1995-01-26 04:56:25 +00:00
Søren Schmidt
02fb646de1 Second round in syscons update:
Support for pseudo graphic mouse cursor (not complete yet)
Some cheap speed fixes.
More cleanups.
Call ourselves scxxxx finally.
1995-01-20 08:35:32 +00:00
Søren Schmidt
2a13b58b61 Oops, forgot one change when DDB is defined. 1995-01-13 17:13:13 +00:00
Andrey A. Chernov
b9937fcc84 Use (n - 1) in ESC [ xxx d and ESC [ xxx ` 1995-01-13 03:19:22 +00:00
Andrey A. Chernov
9db2473d62 Back out cursor wrap (restore original thing)
Submitted by: Bill Paul
1995-01-12 20:14:28 +00:00
Søren Schmidt
6378775666 First round in syscons update. Several new features has been added:
No kernel config options anymore besides keyboard language layout.
Virtual consoles are now dynamically allocated, no NCONS anymore.
Software cursor blinking/nonblinking.
Visual bell for laptops (don't beep at meetings :-).
Cursor/bell default type setable via config "flags" instead of as defines.
Cursor/bell type setable via ioctl's.
New video modes 80x30 80x60 for some laptops, and those with multisync monitors.
Scroll-lock history (length currently fixed at 100 lines).
Lots of cleanups, some only commented out for now (will goaway soon).
Support for new features in vidcontrol/kbdcontrol.
Updated manpages.
1995-01-12 11:47:05 +00:00
Bruce Evans
f73f117cf0 Don't allow negative console numbers for the VT_WAITACTIVE ioctl. Use the
correct console number for the VT_WAITACTIVE ioctl.  Invalid console numbers
caused waiting on an invalid pointer.

Use bcopyw() instead of move_up() and move_down().  bcopyw() handles
overlapped copies and should be faster.  Actually use bcopy().  bcopy()
is slightly faster if video memory is 16-bit and about twice as fast if
it is 32-bit.  bcopy() is said to fail on someGA's, but syscons already
depends on it working for other accesses to video memory.
1995-01-03 16:56:05 +00:00
Andreas Schulz
d3287e7c11 Change the errors in the XT_KEYBOARD patch. red in the face. Thanks Bruce. 1994-12-31 20:34:19 +00:00
Jordan K. Hubbard
63c5d14d1b Miscellaneous changes from Bill Paul:
- /sys/i386/isa/if_ed.c doesn't quite know how to deal with SMC EtherEZ
  ethernet cards. The EtherEZ looks just like the Elite Ultra, except it
  has only 8K of shared memory. The only way to have it properly detected
  is to zero and test a few bytes of memory just about the first 8K region.
  If it clears properly, it's an Elite Ultra, otherwise it's an EtherEZ.

  I've also got an EtherEZ patch for netboot (Makefile, ether.c and ether.h).

- /sys/i386/isa/syscons.c wraps at the next to the last column rather than
  the last column, like it should. You don't really notice this unless you
  use certain programs that write all the way out to, say, the 80th column,
  like VMSmail. Along with a one-line fix for this are some changes to
  implement a non-blinking cursor. Put 'options "NOBLINK_CURSOR"' in your
  config file and give it a try. :)

Submitted by:	wpaul
1994-12-31 17:09:58 +00:00
David Greenman
2048dd682c Fixed two security holes in the pcmmap() function.
Submitted by:	Bruce Evans
1994-12-27 08:43:06 +00:00
Andreas Schulz
3c8f8257cd Add a patch that someone on the net has used to run on his IBM Thinkpad.
Sorry, lost the name and mail of the original author. The whole patch
is ifdefed, so it should not disturb someone else in the moment.
1994-12-26 17:50:18 +00:00
Joerg Wunsch
0246a9d813 Initialize syscons also in cases where it ain't the system's console
(i.e., there's a comconsole).
1994-12-18 19:45:53 +00:00
Joerg Wunsch
00e82d39d7 Move the code providing the equivalent of ICRNL for console input from
the device driver(s) to cons.c.
1994-12-18 19:35:59 +00:00
Søren Schmidt
05d7c5e73e Changed the behavior of KDMKTONE to comply with svr4, default to
old behavior if no argument present.
1994-12-06 19:32:00 +00:00
Andrey A. Chernov
326d35c650 Fix wrong size check for scroll forward/backward ('S'/'T') 1994-11-21 17:59:29 +00:00
Andrey A. Chernov
22651317ac Attempt to fix scroll forward/ scroll backward bug bringed by vi,
'S' and 'T' use count 1 in fillw() instead of count == n.
1994-11-21 14:36:02 +00:00