Commit Graph

381 Commits

Author SHA1 Message Date
Kazutaka YOKOTA
9d6218d088 Add a new compile option SC_HISTORY_SIZE to specify the history buffer
size in terms of lines (instead of bytes).  When changing video mode
in ioctl SW_XXX commands, syscons checks scp->history_size and
allocate a history buffer at least as large as the new screen size.
(This was unnecessary before, because HISTORY_SIZE was as large as 100
lines and this is bigger than the maximum screen size: 60 lines).
Similar adjustment is done in ioctl CONS_HISTORY command too.

PR: kern/4169
Reviewed by: sos
1997-09-04 23:01:06 +00:00
Søren Schmidt
8bce501fd0 Fix the checks for screenborder for the mousepointer. 1997-08-09 19:24:03 +00:00
Søren Schmidt
a1af9248eb Yeah I'm back hacking syscons !!
Add support for MODEX 320x240x256color with "unchained" adressing, giving
access to all 256K on all VGA's, those with that much memory that is :)

Also make sysmouse use the right resolution in graphics modes.
1997-08-08 22:52:30 +00:00
Poul-Henning Kamp
9587ee1621 Fix a brino in my last commit.
Noticed by:	smp
1997-07-26 07:58:29 +00:00
Poul-Henning Kamp
38d8a113a9 Add option for compiling in a 8x16 font. 1997-07-25 11:53:30 +00:00
Bruce Evans
f71d35e402 Removed unused #includes. 1997-07-20 14:10:18 +00:00
Kazutaka YOKOTA
870521063a Screen saver related fixes.
1. Add new interface, add_scrn_saver()/remove_scrn_saver(), to declare
loading/unloading of a screen saver.  The screen saver calls these
functions to notify syscons of loading/unloading events.

It was possible to load multiple savers each of which will try to
remember the previous saver in a local variable (`old_saver'). The
scheme breaks easily if the user load two savers and unload them in a
wrong order; if the first saver is unloaded first, `old_saver' in the
second saver points to nowhere.

Now only one screen saver is allowed in memory at a time.

Soeren will be looking into this issue again later.  syscons is
becoming too heavy.  It's time to cut things down, rather than adding
more...

2. Make scrn_timer() to be the primary caller of the screen saver
(*current_saver)(). scintr(), scioctl() and ansi_put() update
`scrn_time_stamp' to indicate that they want to stop the screen saver.

There are three exceptions, however.

One is remove_scrn_saver() which need to stop the current screen saver
if it is running. To guard against scrn_timer() calling the saver during
this operation, `current_saver' is set to `none_saver' early.

The others are sccngetc() and sccncheckc(); they will unblank the
screen too.  When the kernel enters DDB (via the hot key or a
break point), the screen saver will be stopped by sccngetc().
However, we have a reentrancy problem here. If the system has been in
the middle of the screen saver...

(The screen saver reentrancy problem has always been with sccnputc()
and sccngetc() in the -current source. So, the new code is doing no
worse, I reckon.)

3. Use `mono_time' rather than `time'.

4. Make set_border() work for EGA and CGA in addition to VGA. Do
nothing for MDA.

Changes to the LKM screen saver modules will follow shortly.  YOU NEED
TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THESE CHANGES.

Reviewed by: sos and bde
1997-07-15 14:43:27 +00:00
Kazutaka YOKOTA
99ec86e438 scgetc() referred to `spcl' in different ways when a key is pressed
and released.  It should use `spcl' consistently in both cases,
otherwise shift/control/alt state may not be correctly set/reset.

(Even with this fix, you can still make syscons confused and fail to
change internal state if you really want to, by installing a really
arcane and artificial keymap.)

PR: i386/4030
Reviewed by: sos
1997-07-14 03:36:50 +00:00
Brian Somers
b73937137c Don't allow CONS_HISTORY ioctl to alter history pointers
while in "scroll mode" (return EBUSY).
Suggested by:	Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
1997-07-09 14:10:19 +00:00
Brian Somers
5d20d6843c Remove useless comparison.
Suggested by:	Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
1997-07-08 13:38:58 +00:00
Brian Somers
b43f9ca153 YAMF2.2: Handle indirect results of "kbdcontrol -h X"
where X < 25.
1997-07-07 13:42:42 +00:00
Kazutaka YOKOTA
ac4c944d67 Fixes annoying behavior and a bug regarding the destructive
cursor (CHAR_CURSOR)

1. Reduced the number of calls to set_destructive_cursor().  The
destructive cursor produced noticeable overhead on the system.  It was
caused by draw_cursor_image() calling set_destructive_cursor() every
so often.

set_destructive_cursor() absolutely needs to be called when

a) the character code under the cursor has changed either because
   the cursor moved or because the screen was updated or the mouse
   pointer overlapped the cursor.
b) Or a new font has been loaded,
c) or the video mode has been changed,
d) or the cursor shape has been changed,
e) or the user switched virtual consoles.

2. Turn off the configuration flag CHAR_CURSOR (destructive cursor) in
scattach() if we have a non-VGA card.  The destructive cursor works
only for VGA.

3. Removed redundant calls to set_destructive_cursor() in some places.

4. Fixed the "disappearing mouse pointer" problem. The mouse pointer
looked hidden under the destructive cursor when it overlaped the cursor.

A slightly different version of the patch was reviewd and OKed by
sos and ache.
1997-06-30 13:31:49 +00:00
Andrey A. Chernov
32721aad4f dev->id_flags --> flags
(not compiles otherwise)
1997-06-29 22:23:32 +00:00
Kazutaka YOKOTA
a2fc20d086 A fix/work-around for ThinkPad 535.
Add a new configuration flag, KBD_NORESET (0x20) to tell scprobe() not
to reset the keyboard.

IBM ThinkPad 535 has the `Fn' key with which the user can perform
certain functions in conjunction with other keys. For example, `Fn' +
PageUP/PageDOWN adjust speaker volume, `Fn' + Home/End change
brightness of LCD screen. It can also be used to suspend the system.

It appears that these functions are implemented at the keyboard level
or the keyboard controller level and totally independent from BIOS or
OS.  But, if the keyboard is reset (as is done in scprobe()), they
become unavailable.  (There are other laptops which have similar
functions associated with the `Fn' key. But, they aren't affected by
keyboard reset.)

ThinkPad 535 doesn't have switches or buttons to adjust brightness and
volume, or to put the system into the suspend mode. Therefore, it is
essential to preserve these `Fn' key functions in FreeBSD. The new
flag make scprobe() skip keyboard reset.

If this flag is not set, scprobe() behaves in the same say as before.

(If we only knew a way to detect ThinkPad 535, we could skip keyboard
reset automatically, but...)
1997-06-29 15:11:40 +00:00
Kazutaka YOKOTA
124ff4169d The syscons driver doesn't really check the presence of the display
adapter during the system boot. It always assumes there is at least a
monochrome adapter.

This is rather strange assumption. If there is no dispaly adapter, the
console driver cannot be any good...

In this patch, scinit() is split into two parts; the first part is
now called scvidprobe() which will detect the presence of video card
at the CGA or MONO buffer address and returns TRUE if found. It is
called during sccnprobe() and scprobe(). Both will fail if no video
card is found.

The second part, whose name stays the same as before, scinit(), is
called from sccninit() and scattach() to complete initialization of
the found video card.

The keyboard probe code is moved from scprobe() to sckbdprobe();
scprobe() now calls scvidprobe() and sckbdprobe() to carry out device
probe. (This is rather a cosmetic change, but it sure makes the code
look better organized.)

The problem pointed out by Joerg.
1997-06-22 12:04:36 +00:00
Kazutaka YOKOTA
3ef626ecd5 1) font loading (two fixes)
When an ioctl command SW_XXXX is issued, scioctl() checks if the font
appropriate for the specified mode is already loaded.  The check was
correctly done for 8 line and 16 line fonts, but not for 14 line font.

The symbols FONT_8, FONT_14 and FONT_16 were defined as numbers but
were sometimes treated as bit flags. They are now defined as bit
flags.

2) screen blinking (two fixes)

Removed a redundant call to timeout() in do_bell().

Don't let blink_screen() write to the video buffer if the screen is in
the graphics (UNKNOWN) mode.

3) screen saver timeout

The ioctl command CONS_BLANKTIME sets the screen saver's timeout.  The
value of zero will disable the screen saver. If the screen saver is
currently running it should be stopped.

4) border color and destructive cursor (two fixes)

The border color and the cursor type can be changed via escape
sequences.  But only VGA can change the border color and set the
cursor type to destructive (CHAR_CURSOR) in the current syscons.
scan_esc() failed to check this.

Reviewed by:	sos
1997-05-15 05:43:59 +00:00
Peter Wemm
36428e6100 simplify IOPL gain/remove privs code. It's easier with md_regs
being a trapframe.
1997-05-07 20:02:38 +00:00
Kazutaka YOKOTA
df25dec0e5 Now that we have replaced video-related block copy calls with
sc_bcopy(), which is generic_bcopy() in reality, there is no point in
retaining bcopyw() calls in the source code.
OKed by : sos
1997-05-07 10:42:06 +00:00
Andrey A. Chernov
8a13426b30 Restore CRTC start address check back after looking into more sources 1997-04-30 15:31:22 +00:00
Andrey A. Chernov
bfc43e99c4 In comp_vgaregs skip cursor shape and 4 unused bytes (6 total)
instead of 2 unused.
Previus code broke syscons on Diamond Stealth 3D 3000
(video mode ptr was NULL with no real reason)
1997-04-30 01:19:21 +00:00
Kazutaka YOKOTA
d75a8fdbb1 Addresses the following two problems.
1) i586_bcopy() problem

There have been a number of reports that the syscons doesn't work
properly if i586_bcopy() is enabled.

The problem prevented users from installing 2.2(.1)-RELEASE.  The
symptom is that the system looks frozen during device probe or just
before the main installation menu.  The workaround was to specify the
flag 0x01 to the npx device so that i586_bcopy() is disabled.

The patch forces the syscons to call generic_bcopy() when copying
to/from the video memory, even if CPU is Pentium and i586_bcopy() is
enabled. i586_bcopy() is still called for copy operations between
non-video memory regions.

PR: kern/2277, kern/3066, kern/3107, kern/3134

2) video mode parameter table problem

The syscons reads and uses the video mode parameter table provided by
the VGA BIOS to set VGA registers when changing video mode and
modifying font data. It appears that in some VGA BIOSes the table is
not ordered as the syscons expects, and this leads to screen
corruption.

The problem prevented users from installing 2.2(.1)-RELEASE. The
symptom is the corrupt screen or strange vertical lines soon after the
kernel is loaded into memory (just after the kernel decompression).

The patch performs simplistic test and if it fails, set video_mode_ptr
to NULL so that the video mode switching won't happen.

This is an interim kludge. There should be a better way to deal with
the problem.

PR: kern/2498, conf/2775, conf/3354

Reviewed by: sos
Tested by: PR originators (not all of them, though)
1997-04-27 09:03:10 +00:00
Bruce Evans
5e994ca33f Fixed the type of timeout functions and removed casts that hid the
type mismatches.  Not taking an arg in scrn_timer() broke `cc -mrtd'.
1997-04-20 16:05:33 +00:00
Kazutaka YOKOTA
d0b8731a66 Preserve some bits in the keyboard controller command byte when
resetting the keyboard.

Well, sorry, this bug is totally my fault. I DID intend to preserve
them, but somehow I failed.

The bug puts some old keyboard controllers in a strange state,
resulting in keyboard freeze or random key input.

The fix closes PR kern/3067.
1997-04-10 12:26:50 +00:00
Brian Somers
42e9ba47f8 Make the default VERASE key the <-- key and remove root's
`stty's.  'nuff said.

Inventor:	joerg@FreeBSD.org
Reviewer:	sos@FreeBSD.org
1997-04-03 21:42:42 +00:00
Kazutaka YOKOTA
31774f6d83 Interim patch/kludge for keyboard lock-up when `kbdcontrol' tries to
change typematic rate, or the X server (XFree86 or Accelerated X)
starts up.

So far, there have been two independent reports from Dell Latitude XPi
notebook/laptop owners. The Latitude seems to be the only system which
suffers from this problem.  (I don't know the problem is with the
entire Latitude line or with only some Latitude models) No problem
report has been heard about other systems (I certainly cannot
reproduce the problem in my -current and 2.2 systems).

In 3.0-CURRENT, 2.2-RELEASE and 2.2-GAMMA-970310, when programming the
keyboard LED/repeat-rate, `set_keyboard()' in `syscons' tells the
keyboard controller not to generate keyboard interrupt (IRQ1) and then
enable tty interrupts, expecting the keyboard interrupt doesn't occur.

It appears that somehow Latitude's keyboard controller still generates
the keyboard interrupt thereafter, and `set_keyboard()' doesn't see
the return code from the keyboard because it is consumed by the
keyboard interrupt handler.

The patch entirely disables tty interrupts while setting LED and
typematic rate in `set_keyboard()', making the routine behave more
like the previous versions of `syscons' (versions in 2.1.X and
2.2-ALPHA, -BETA, and some -GAMMAs). The reporter said this patch
eliminated the problem.

(I also found another typo/bug, but the reporter and I found that it
wasn't the cause of the problem...)

This should go into RELENG_2_2.
1997-03-28 10:11:24 +00:00
Bruce Evans
fce002fdef Don't include <sys/ioctl.h> in the kernel. Stage 1: don't include
it when it is not used.  In most cases, the reasons for including it
went away when the special ioctl headers became self-sufficient.
1997-03-24 11:25:10 +00:00
John-Mark Gurney
5ec8909366 make sure that the user supplied signals in struct vt_mode are actually
valid signals, else return EINVAL for ioctl VT_SETMODE.

this fixes a problem that anybody with vty access can panic the system.

2.2-Candidate (and 2.1.0 I believe)

Reviewed-by: sos
1997-03-01 23:53:46 +00:00
Bruce Evans
201d7c413d Fixed spelling error in a variable name. 1997-02-28 14:26:34 +00:00
Kazutaka YOKOTA
a87be5f49e Removed an obsolete test which prevented mouse movement from quiting
screen saver. Added a missing `break' statement  in set_normal_mode().

Reviewed by: sos
1997-02-28 08:42:35 +00:00
Peter Wemm
6875d25465 Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.
1997-02-22 09:48:43 +00:00
Søren Schmidt
cc5625f0ed Oops, cut/paste could be done on tthe WRONG vty :(
pointed out by Kazu.
1997-02-13 11:58:49 +00:00
Søren Schmidt
ac59a2c67c Fixed the "switch to next screen" command (normally bound to the
key "print scrn".
It used to stop at the first non-open vty, now it skips the non-open
ones and thereby enable one to cycle around all open vty by pressing
"print scrn".
1997-01-30 15:12:17 +00:00
Søren Schmidt
0d3f983ad2 Add save/restore cursor as pr SCO screen(HW) manpage.
Fix ESC[2J to not move cursor home
Clear mouse cutmarking on more cases.
Minor changes by me.

Submitted by:	ache
1997-01-23 20:00:45 +00:00
Søren Schmidt
dc31ce3ddb Fix the bug that caused CTRL & ALT keys to be hanging sometimes after
an X seesion. Really stupid error of me, and I've been looking at
this code SO many times. Thanks to Kazutaka YOKOTA for seeing this..

Submitted by:	Kazutaka YOKOTA
1997-01-20 08:05:15 +00:00
Søren Schmidt
cf35b775cb Oops, the position of the savefont code was wrong, cur_console
wasn't set yet.
1997-01-19 17:34:14 +00:00
Søren Schmidt
6b2c8fd9c3 Oops! I commented out the waiting for retrace loops, because the
one in draw_mouse causes spontanious hangs on my p5-100 when I
move the mouse excessively. Forgot that on the last commit, so
using the mouse or destructive cursor would produce large amounts
of flicker..
1997-01-18 15:53:48 +00:00
Søren Schmidt
171b420b11 Bruce pointed out a bogon:
cur_console is NULL when copy_font() is first called from scinit().  This
is apparently harmless when scinit() is called early from sccninit() -
page 0 is apparently mapped r/w then, and 0->status contains suitable
garbage.  However, when there is a serial console, scinit() is first
called from scattach() when the page tables are completely initialized,
so the NULL pointer causes a panic.

Submitted by:	bruce
1997-01-17 15:49:13 +00:00
Søren Schmidt
b6b9dfa17e Upgrade the kbdio rutines to provide queued kbd & mouse events.
Minor other updates to syscons by me.

Submitted by:	Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
1997-01-15 18:16:32 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Alexander Langer
df5080050d Hawaii-Five-Typo 1996-12-19 00:26:22 +00:00
Søren Schmidt
2092b5ac38 Fix the broken support for monochrome VGA's.
It was MY fault after all, damn..
1996-12-07 22:33:05 +00:00
Søren Schmidt
1f9d9075e4 Alot of fixes from kazu:
1. All the suggestions earlier made by Bruce: renaming some symbols,
stricter error checking, removing redundant code, etc.

2. The `psm' driver preserves the default counter resolution and
report rate, whatever they are after reset. (Based on reports and
suggestion from Nate and Rob Bolin).

3. The `psm' driver now does not check the so-called sync. bit in the
first byte of the data packet by default, so that the tapping feature
of ALPUS GlidePoint works (based on reports from Louis Mamakos). I
tested the code with ALPUS Desktop GlidePoint (M/N GP101) and found
no problem; tapping worked. It appears ALPUS produces several models
of GlidePoint. I hope the other models are OK too.

The check code can still be activated by defining the PSM_CHECKSYNC
option in the config file. (The bit checking slightly reduces, if not
completely eliminates, weird mouse behavior cased by unsynchronized
mouse data packets. It also helps us to detect if the mouse interrupt
can ever be lost. But, well, if there are devices which cannot be
supported this way...)

4. The `psm' driver does not include the protocol emulation code by
default. The code can still be compiled in if the PSM_EMULATION option
is specified in the config file. Louis Mamakos suggests the emulation
code is putting too much in the kernel, and `moused' works well.
I will think about this later and decide if the entire emulation
code should be removed.

5. And, of course, the fix in `scprobe()' from Bruce to cure the
UserConfig problem. My code in `kbdio.c' is slightly different from
his patch, but has the same effect. There still is a possibility that
`scprobe()' gets confused, if, for whatever reasons, the user holds
down a key for very long time during the boot process. But we cannot
cope with everything, can we?

Submitted by:	Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
1996-12-01 19:05:50 +00:00
Nate Williams
3d989d58d8 Fix UserConfig w/syscons.
The 'getchar' function in syscons (sccngetc) is used by UserConfig to
get keyboard input from the user.  When it was modified to use the
shared keyboard port routines it used the port passed in during the
probe routine.  Since the probe routine was not yet called, the port was
set to 0, which is obviously not going to work.

Pre-initialize sc_port to IO_KBD which is really a kludge, but it's how
the previous driver did it's job.

Found by:	remote GDB
1996-11-19 17:08:10 +00:00
Søren Schmidt
73e0f79f04 Only poll the keyboard if the data left in the buffer is from the
kbd, not if its from the psm device.
1996-11-15 08:45:24 +00:00
Søren Schmidt
6a90d9750d Finally a start at sharing the kdb controller routines between
syscons and psm, curtesy Kazutaka Yokota with minor changes by
me. This contains an update of the psm driver as well.
This also fixes the breakage that I introduced to the psm driver by
making syscons poll for keyboard events in the atempt to fix the
hanging keyboard problem.

It works perfectly for me, and I'd like to hear from all that
have had keyboard/ps/2 mouse problems if this is the cure...

Submitted by:	 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
1996-11-14 22:19:17 +00:00
Søren Schmidt
65e925d16f 1. Avoid a race in scclose(). tty.c has kludges so that the race is
actually harmless.

2. Fixed code to match comment in scintr().

3. Don't allow even root to take control of the machine when securelevel > 0.
   I've secured the accesses to PSL_IOPL in all drivers and asked pst to
   review it, but he seems to be busy.  Write access to /dev/kmem and
   other critival devices currently leaks across raisings of securelevel
   via open fd's, so there may as well be a similar leak for PSL_IOPL.

4. (Most important.)  Don't corrupt memory beyond the screen buffers if
   the cursor happens to be off the 80x25 screen when syscons starts.

5. Fix console cursor update (not perfect yet).
Submitted by:   bruce
~
1996-11-11 22:21:03 +00:00
Nate Williams
6620cf7868 Removed 'XT_KEYBOARD' option from syscons. Document new-style way of
getting the same behavior using the flags, which can be done inside of
UserConfig.  (Also document other syscons flags which were previously
undocumented).

Requested by:	bde
1996-11-11 22:01:56 +00:00
Nate Williams
a973755bfa Allow us to enable the 'XT_KEYBOARD' code using a configuration flag.
This allows the user to add modify syscons's configuration flags using
UserConfig that will allow older/quirky hardware (most notably older IBM
ThinkPad laptops) to work with the standard boot kernel.

Inspired by:	The Nomads
1996-11-10 16:44:13 +00:00
Søren Schmidt
10661203e7 Fix the hanging keyboard problem under Xaccel. Apprently we are loosing
an interrupt somewhere. The solution here is to check for keyboard
input each time the screen update timer ticks. Not pretty, but works.
1996-11-04 21:01:08 +00:00
Søren Schmidt
66e7fce7ac Use the calibrated/adjustable i8254 frequency `timer_freq' instead of
TIMER_FREQ.

Fixed missing splx() in scrn_timer().  The bug was harmless because of the
undocumented behaviour that the ipl is automatically restored for timeout
functions (see softclock()).  Perhaps we should depend on this behaviour.

Fixed the ddb fix in rev.1.176.  The in_debugger flag was no use because
it only works when the debugger is entered via the keyboard hotkey.  The
debugger may be entered for breakpoints and traps, and the console putc
routine has no way of knowing when it was, so the console putc routine
must (almost?) always remove the cursor image.

Not fixed: console switching in ddb doesn't work (ISTR it working), and
console 0 shouldn't be switched to for the debugger hotkey unless console
0 is /dev/console.

Fixed side effects from calling add_keyboard_randomness() in the console
getc routine by not calling it.  add_keyboard_randomness() currently
always reenables interrupts on 386's and 486's.  This is very bad if the
console getc routine is called from the debugger and the debugger was
entered with interrupts disabled.

Fixed preservation of initial screen and now-bogus comment about it.  It
was broken by setting the initial scr_buf to `buffer' instead of Crtat.
`buffer' was full of nulls and the first scroll cleared everything above
the things written through syscons.

Submitted by:	bruce (bde@freebsd.org)
1996-10-26 20:16:58 +00:00
Paul Traina
dcb21864dc Remove SC_KBD_PROBE_WORKS option and replace it with a simple run-time flag
bit (0x0008) in the sc driver configuration line.  This way it's easy to
boink a generic kernel.

Also, document and place in an opt_ file the #define's for overriding which
serial port is the system console.
Approved by:	sos
1996-10-23 07:29:44 +00:00
Søren Schmidt
c070783c4b Changed mouse functionality a bit, now the pointer disappears if
there is keyboard input.
The mousepointer is shown again immediately if moved.

Also a function pointer used to install a userwritten extra
ioctl handler (sc_user_ioctl). This way its is possible to
install user defined videomodes etc etc. No further changes
should be in the kernel.
1996-10-18 18:51:37 +00:00
Søren Schmidt
b5ca878577 Corrected the setting of winsize on open().
Problem pointed out by David Nugent - davidn@blaze.net.au.
1996-10-15 20:27:07 +00:00
Bruce Evans
14f3567a32 Don't claim the console when the driver is disabled. The getc/putc
part of the console driver usually works when the driver is disabled,
but the normal read/write part doesn't (it caused a panic).
1996-10-09 15:24:21 +00:00
Jordan K. Hubbard
0c8c5f852a scresume erroneously used before declared. Move the function
rather than add another APM ifdef just for the forward decl.
[Boy, sure a lot of warnings in here!]
1996-10-03 00:42:27 +00:00
Søren Schmidt
4a8aeffeb2 Fixed the userconfig problem (and one with ddb as well).
The rudimentary support for a splash page is there, and works, it
just needs a splash page...
1996-10-02 22:00:38 +00:00
Søren Schmidt
d58801b2ee Fixed the "missing updates" reported by ache.
Moved a little closer to having a splash page capability.
1996-10-01 23:24:09 +00:00
Jordan K. Hubbard
10dce6c9f3 #ifdef another instance of toggle_splash_screen() which Soren missed. 1996-10-01 07:38:14 +00:00
Søren Schmidt
ebe3b2aabd Dont make splash screen the default :) 1996-09-30 23:10:35 +00:00
Søren Schmidt
a221620c79 Fix a couble of nasties regarding mouse pointer and different
resolutions.
Allow middle mouse button to be used for pasting.
Also added the beginnings of support for a splash page.
1996-09-30 23:00:58 +00:00
Bruce Evans
daed6ffd24 Changed cncheckc() interface so that it is 8-bit clean - return -1
instead of 0 if there is no input.

syscons.c:
Added missing spl locking in sccncheckc().  Return the same value as
sccngetc() would.  It is wrong for sccngetc() to return non-ASCII, but
stripping the non-ASCII bits doesn't help.
1996-09-14 04:27:46 +00:00
Peter Wemm
9545a0eaa4 Hack workaround XFree86 switching failure when used with /dev/sysmouse
and xdm, possibly in general.

What was happening was that the server was doing a tcsetattr(.. TCSADRAIN)
on the mouse fd after a write.  Since /dev/sysmouse had a null t_oproc,
the drain failed with EIO.  Somehow this spammed XFree86 (!@&^#%*& binary
release!!), and the driver was left in a bogus state (ie: switch_in_progress
permanently TRUE).

The simplest way out was to implement a dummy scmousestart() routine to
accept any characters from the tty system and toss them into the void.

It would probably be more correct to intercept scwrite()'s to the mouse
device, but that's executed for every single write to the screen.
Supplying a start routine to eat the characters is only executed for the
mouse port during startup/shutdown, so it should be faster.
1996-09-10 19:14:49 +00:00
Søren Schmidt
b1538b1658 The poor nsccons variable was gone agian this time hidden by
an ifdef , wonder who broke it this time :)

Submitted by:	 ache
1996-09-09 19:02:26 +00:00
Søren Schmidt
47382cd1e0 Make syscons replicate a mousesystems mouse on minor 128..
This enables other consumers of the mouse, to get it info via
moused/syscons.
In order to use it run moused (from sysconfig), and then tell
your Xserver that it should use /dev/sysmouse (mknod sysmouse c 12 128)
and it a mousesystems mouse. Everybody will be happy then :)
Remember that moused still needs to know what kind of mouse you
have..

Comments welcome, as is test results...
1996-09-08 21:31:56 +00:00
Bruce Evans
a7265255cc Fixed another easy case of const poisoning in the kernel. Cosmetic.
(A pointer to a const was misused to avoid loading loading the same
value twice, but gcc does exactly the same optimization automatically.
It can see that the value hasn't changed.)
1996-09-07 21:47:53 +00:00
Paul Traina
53809eab9c Add option SC_KBD_PROBE_WORKS to syscons driver.
If you define this, it means your keyboard is actually probable using the
brain-dammaged probe routine in syscons, and if the keyboard is NOT found,
then you don't want syscons to activate itself further.

This makes life sane for those of us who use serial consoles most of the
time and want "the right thing" to happen when we plug a keyboard in.
1996-09-06 23:35:54 +00:00
Poul-Henning Kamp
bfbb029d87 Remove devconf, it never grew up to be of any use. 1996-09-06 23:09:20 +00:00
Søren Schmidt
c771590aa7 Fixed a panic when switching to 40x25 mode, and cursor was beyond the
new buffer.
1996-09-04 22:24:19 +00:00
Søren Schmidt
3b1a310b4b Fixed a couple of bugs in the mousepointer code.
Changed update strategy slightly.
Make set_mode & copy_font externally visible.
1996-09-01 18:16:06 +00:00
Bruce Evans
3a4c46bd22 Fixed restoral of nsscons variable. The tty for /dev/console was lost.
A warning was introduced.
1996-08-28 18:20:22 +00:00
Peter Wemm
cb70011ceb restore nsccons variable from rev 1.115 that was deleted in rev 1.136
during phk's staticize/cleanup commits.  pstat needs it, the MAXCONS
option is not visible anywhere else, and pstat uses it to find the bounds
of the sccons[MAXCONS] array, which varies.
1996-08-16 10:16:32 +00:00
Andrey A. Chernov
58db4b5a8f Fix GIO_ATTR ioctl return to match SYSV 1996-07-30 15:20:08 +00:00
Bruce Evans
f6b4ae3c82 Added or restored #include of <machine/md_var.h>. Some declarations
moved from <machine/cpufunc.h> to better places.
1996-07-01 20:29:10 +00:00
Joerg Wunsch
a9e9062ca1 Bump various timeouts in scprobe(). This finally fixes the broken
keyboard reset one of my earlier commits has been causing.
1996-06-27 21:36:11 +00:00
Søren Schmidt
da040b2280 Fixed bug in pasting 8bit char (ache).
Added linefeeds in cuts that extend beyond one line.
Prepared for the mousefunctions to be used in nontext modes.
1996-06-26 13:04:53 +00:00
Bruce Evans
c673fe98d7 Added #include of <machine/md_var.h>. This will be needed when
some declarations are moved from <machine/cpufunc.h> to better
places.
1996-06-25 20:31:01 +00:00
Søren Schmidt
ad0c0c784f Change the way moused talk to syscons, now its only delivering mouseevents
via an ioctl (MOUSE_ACTION).
Fixed a couple of bugs (destructive cursor, uncut, jitter).
Now applications can use the mouse via the MOUSE_MODE ioctl, its
possible to have a signal sent on mouseevents, makeing an event loop
in the application take over mouseevents.
1996-06-25 08:54:57 +00:00
Bruce Evans
ea959743cb Moved declarations of static functions to the correct file. This fixes
hundreds of warnings from -Wunused in lkm/syscons/*.
1996-06-23 17:12:05 +00:00
Søren Schmidt
ab35f219ac Oops, fix a bug that caused updates to the screen to happen, without
anything actually changed, in this case the mousepointer logic.
1996-06-21 11:31:09 +00:00
Søren Schmidt
de4d1b835e Some news for syscons (long overdue):
Real support for a Textmode mousecursor, works by reprogramming the
charset. Together with this support for cut&paste in text mode.
To use it a userland daemon is needed (moused), which provides
the interface to the various mice protokols.
Bug fixes here and there, all known PR's closed by this update.
1996-06-21 07:19:18 +00:00
Bill Paul
afe0e92aa8 Stomp another compiler warning: sc_devfs_token[] should only be declared
if DEVFS is #defined.
1996-06-17 17:21:35 +00:00
Peter Wemm
d2dc185840 Fix the warnings about "cant inline call to xxx" by reordering two
functions.  It seems gcc wants to have seen the definitions of the
function before it will insert it inline in a caller.
1996-05-27 06:02:52 +00:00
Joerg Wunsch
09fdca5394 Fix the "well-known retries bug" (a logic-o). 1996-05-12 12:36:59 +00:00
Joerg Wunsch
a9313682fc Give up waiting for a successful keyboard reset after some
unreasonable time.  I've got a PCI mainboard that simply doesn't grok
it, so continuing with a warning (and a keyboard that's working
nevertheless :) seems to be better than spin-looping forever.
1996-05-11 23:16:23 +00:00
Andrey A. Chernov
f0478277ba Fix ^[[1K (clear from beginning of line to cursor) and
^[[2K (clear whole line), they not work _initially_
1996-05-02 21:47:50 +00:00
Bruce Evans
b1d3d2ffcf Fixed a race that caused panics in kernel printfs when the screen timeout
routine changed the screen pointers while output was in progress.
1996-05-01 03:58:21 +00:00
Søren Schmidt
03475c250b Removed options MAXCONS & HARDFONT, they are no longer in use
(and havn't been for long, sigh)
1996-04-26 06:45:41 +00:00
Bruce Evans
df957ee1b3 Moved the initialization of the devfs devices to after the initialization
of the devswitch so that it actually works.
1996-03-27 19:11:41 +00:00
Peter Wemm
4bd4912865 Add more options into the conf/options and i386/conf/options.i386 files
and the #include hooks so that 'make depend' is more useful.  This
covers most of the options I regularly use (but not all) and some other
easy ones.
1996-03-02 18:24:13 +00:00
Poul-Henning Kamp
01a3e1a590 use devfs_add_devswf and avoid local variable. 1996-02-13 14:15:13 +00:00
Paul Traina
ab58050112 Close kern/627 - panic if syscons not attached 1996-02-08 06:30:31 +00:00
Andrey A. Chernov
f2b4163c2a Deliver all bells to current console, use different pitch
for non-originating bells.
1996-02-05 14:08:39 +00:00
Garrett Wollman
0e41ee3037 Convert DDB to new-style option. 1996-01-04 21:13:23 +00:00
Bruce Evans
d1022821ae Removed my devsw access functions [un]register_cdev() and
getmajorbyname() which were a better (sigh) temporary interface to
the going-away devswitches.

Note that SYSINIT()s to initialize the devswitches would be fatal
in syscons.c and pcvt_drv.c (and are bogus elsewhere) because they
get called independently of whether the device is attached; thus
devices that share a major clobber each other's devswitch entries
until the last one wins.

conf.c:
Removed stale #includes and comments.
1995-12-14 22:03:12 +00:00
Bruce Evans
c73feca0b7 Removed new alias d_size_t for d_psize_t.
Removed old aliases d_rdwr_t and d_ttycv_t for d_read_t/d_write_t and
d_devtotty_t.

Sorted declarations of switch functions into switch order.

Removed duplicated comments and declarations of nonexistent switch
functions.
1995-12-10 15:55:34 +00:00
Poul-Henning Kamp
6f4e0beb7e Staticize and cleanup. 1995-12-10 13:40:44 +00:00
Julian Elischer
87f6c6625d Pass 3 of the great devsw changes
most devsw referenced functions are now static, as they are
in the same file as their devsw structure. I've also added DEVFS
support for nearly every device in the system, however
many of the devices have 'incorrect' names under DEVFS
because I couldn't quickly work out the correct naming conventions.
(but devfs won't be coming on line for a month or so anyhow so that doesn't
matter)

If you "OWN" a device which would normally have an entry in /dev
then search for the devfs_add_devsw() entries and munge to make them right..
check out similar devices to see what I might have done in them in you
can't see what's going on..
for a laugh compare conf.c conf.h defore and after... :)
I have not doen DEVFS entries for any DISKSLICE devices yet as that will be
a much more complicated job.. (pass 5 :)

pass 4 will be to make the devsw tables of type (cdevsw * )
rather than (cdevsw)
seems to work here..
complaints to the usual places.. :)
1995-12-08 11:19:42 +00:00
David Greenman
efeaf95a41 Untangled the vm.h include file spaghetti. 1995-12-07 12:48:31 +00:00
Bruce Evans
0310c19f5d Replaced #includes of <sys/user.h> by less gross headers, usually
<sys/vm.h>.  Many device drivers need only the definition of vtophys()
from vm.

Added nearby #includes of <sys/conf.h> where appropriate.
1995-12-06 23:52:35 +00:00
Andrey A. Chernov
662f3a95dd Fix my color/attr separation patch.
Swap foreground/background logic to allow DIM REVERSE
1995-11-30 03:29:31 +00:00
Andrey A. Chernov
00265e7d4d Separate colors & attributes as Terry points
Reviewed by: soren
1995-11-28 00:17:32 +00:00
Bruce Evans
d818a9cc1f Fixed a comment. 1995-11-24 14:56:00 +00:00
Poul-Henning Kamp
bf6a29da66 Fix compiler warnings. 1995-11-20 12:13:32 +00:00
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
Andrey A. Chernov
1afec25476 More intelligent BackTab fix using BTAB special key (unused before) 1994-11-19 23:17:48 +00:00
Søren Schmidt
5e146a0129 Added support for the MicroSoft Natural keyboard
Add support for ws_xpixel & ws_ypixel in winsize.
Submitted by:	Natural support suggested by Kaleb Keithley (kaleb@x.org)
1994-11-17 22:03:18 +00:00
Bruce Evans
4a7472ce04 The style in my patch011 is inconsistent and out of date. It should
have been changed _before_ committing the patch.
1994-11-06 00:30:16 +00:00
Andrey A. Chernov
5a3391bf7f Fix for 'pstat -t' works on vtys
Submitted by: jhay@mikom.csir.co.za
1994-11-03 11:41:34 +00:00
Poul-Henning Kamp
a95f669560 The other half of patch011, read Numlck state from bios. 1994-10-27 05:47:09 +00:00
Bruce Evans
0d55b76505 Fix initialization of video_mode_ptr. It only worked if the segments
in the far pointers are multiples of 4K (as is normal when the video
BIOS is at seg 0xc000).  Disallow mode switching if the pointer is bad.

Use a new pa_to_va() macro for all BIOS and video addresses in syscons.
1994-10-26 21:51:22 +00:00
Garrett Wollman
8a82d62d7f Fixed cut&paste error.
Submitted by:	davidg
1994-10-24 21:36:38 +00:00
Garrett Wollman
2f86936a07 Finished device configuration database work for all ISA devices (except `ze')
and all SCSI devices (except that it's not done quite the way I want).  New
information added includes:

-	A text description of the device
-	A ``state''---unknown, unconfigured, idle, or busy
-	A generic parent device (with support in the m.i. code)
-	An interrupt mask type field (which will hopefully go away) so that
.	  ``doconfig'' can be written

This requires a new version of the `lsdev' program as well (next commit).
1994-10-23 21:28:03 +00:00
Poul-Henning Kamp
953ca71d9d Peter Dufaults comconsole changes.
Submitted by:	Peter Dufault
1994-10-20 00:08:31 +00:00
Andrey A. Chernov
a5795badfb Remove color_display, GIO_COLOR now exists 1994-10-18 03:34:53 +00:00
Søren Schmidt
be92194467 Added more SCO compat ioctl's. 1994-10-17 22:12:06 +00:00
Poul-Henning Kamp
3595e6807d isa_device.h: Added flag for sensitive HW. ed# seems to break if anything
else has been probed.  This feature could go away again, if we can curb the
problem another way.

if_ed.c, syscons.c:  Set the above flag.  ed# because it needs it, syscons
because it looks stupid to "detect" the display you have already filled up
with text :-)

bt742a.c: Check bt_cmd() return-val during probe, thus failing on adaptec's.
Also silenced various printf's during the probe.

isa.c:  Probe devices with the above flag set before the rest.  Reduce the
number of "conflict" messages per device to one.

***
Please test the GENERIC-kernel now, if nobody can make it fail, GENERICAH
and GENERICBT has a finite and short life-expectancy...
***
1994-10-17 21:16:41 +00:00
Andrey A. Chernov
1d3d5e17f6 Initialize color_display as undefined, cosmetique 1994-10-17 12:44:02 +00:00
Andrey A. Chernov
6d718805b0 Add color_display variable for CPU_COLORDISP sysctl. 1994-10-15 21:33:58 +00:00
Andrey A. Chernov
38ea5c3d90 Fix 'cursor-disappearce-after-switching-screen-from-X' bug 1994-10-03 01:22:46 +00:00
Poul-Henning Kamp
51b713ac2b Ripped out APM-hooks. Not ready for prime time yet. 1994-10-02 17:41:44 +00:00
Andrey A. Chernov
ef0797abc9 Make fat cursor as early as possible, per Bruce suggestion 1994-10-02 14:08:57 +00:00
David Greenman
22414e535a Laptop Advanced Power Management support by HOSOKAWA Tatsumi.
Submitted by:	HOSOKAWA Tatsumi
1994-10-01 02:56:21 +00:00
Andrey A. Chernov
e4b1dc5b1e Fix broken FAT_CURSOR support, don't set cursor shape on VGA 1994-09-29 15:49:09 +00:00
Søren Schmidt
444ada0bd0 Changed header slightly. 1994-09-29 08:29:21 +00:00
Andrey A. Chernov
7b3e881e50 Bug fixed: cursor shaping in mode swithching produce wrong results for
non-fat cursors, cursor_start goes beyond font size.
1994-09-27 11:40:02 +00:00
Andrey A. Chernov
38ddc3a6d6 Refuse text mode switching when proper font not loaded 1994-09-27 01:50:07 +00:00
Andrey A. Chernov
899fe378a6 1)Back out my previous change: only 8x16 font grabbing available,
more work required to grab all fonts
2)Make standard VGA font as default, make HARDFONTS an option
(load iso8859 fonts instead)
3)Check fonts_loaded for all restore (copy_font...palette)
sequences.
1994-09-25 02:06:51 +00:00
Andrey A. Chernov
248a9521f8 SAVE all fonts, if NO_HARDFONTS defined, not only 8x16 1994-09-24 21:29:38 +00:00
Søren Schmidt
4f683116b4 Added support for many more videomodes, including graphic modes up til
320x200 256col VGA. This is nessesary for the iBCS stuff to work right.
(And we get the benefit of more video modes). Uses the videocard BIOS
to optain mode tables.
Added a "green" saver, switches off the syncs for "green" monitors.

Reviewed by:
Submitted by:
Obtained from:
1994-09-15 07:26:40 +00:00
David Greenman
8a129caed5 1) Changed ddb into a option rather than a pseudo-device (use options DDB
in your kernel config now).
2) Added ps ddb function from 1.1.5. Cleaned it up a bit and moved into its
   own file.
3) Added \r handing in db_printf.
4) Added missing memory usage stats to statclock().
5) Added dummy function to pseudo_set so it will be emitted if there
   are no other pseudo declarations.
1994-08-27 16:14:39 +00:00
David Greenman
7b42c960f8 1) cleaned up after Garrett - fixed more redundant declarations, changed
use of timeout_t -> timeout_func_t in aha1542 and aha1742 drivers.
2) fix a bug in the portalfs that was uncovered by better prototyping -
   specifically, the time must be converted from timeval to timespec
   before storing in va_atime.
3) fixed/added some miscellaneous prototypes
1994-08-20 03:49:02 +00:00
Søren Schmidt
49e3cd80ee Oops, changed order of include lines...
Reviewed by:
Submitted by:
1994-08-17 19:32:23 +00:00
Søren Schmidt
529f6e548c Updated to latest 1.1.5.1+ version
Reviewed by:
Submitted by:
1994-08-17 08:51:59 +00:00
Garrett Wollman
0254742789 Add option KBD_RESET_FAIL_OK so that GCC 2.6 doesn't break my
console.
1994-08-15 22:41:33 +00:00
Garrett Wollman
f540b1065a Change all #includes to follow the current Berkeley style. Some of these
``changes'' are actually not changes at all, but CVS sometimes has trouble
telling the difference.

This also includes support for second-directory compiles.  This is not
quite complete yet, as `config' doesn't yet do the right thing.  You can
still make it work trivially, however, by doing the following:

rm /sys/compile
mkdir /usr/obj/sys/compile
ln -s M-. /sys/compile
cd /sys/i386/conf
config MYKERNEL
cd ../../compile/MYKERNEL
ln -s /sys @
rm machine
ln -s @/i386/include machine
make depend
make
1994-08-13 03:50:34 +00:00
David Greenman
a445481c3e Fixed a bug that was introduced in the conversion from 1.1.5 to 2.0. 1994-08-01 10:38:19 +00:00
Rodney W. Grimes
26f9a76710 The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.
Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman
1994-05-25 09:21:21 +00:00
Søren Schmidt
749613741c Fixed missing bounds check in scroll up/down sequence, that could
cause a panic (and did).
1994-04-26 09:09:57 +00:00
Søren Schmidt
872dacbfeb Changed timer usage to new functions in clock.c 1994-04-21 14:22:26 +00:00
Andrey A. Chernov
9642c2b7b8 Patch from S0ren, 80x50 font trashed after switching from X console 1994-04-12 00:05:23 +00:00
Andrey A. Chernov
758ba6e17a Fix arguments of CONS_GETINFO 1994-04-07 23:23:01 +00:00
Andrey A. Chernov
8ceb0f8dea Replace CAPS led with ALTGR led for ALTGR mode (soft) keyboards,
currently affects only russian keyboard.
1994-04-01 18:33:12 +00:00
David Greenman
66ad8173f3 previous optimization from John wasn't quite ready for primetime. 1994-03-21 06:37:04 +00:00
David Greenman
93555dc983 Two fixes from John Dyson to fix hangs and panics when using ctrl-T:
1) tty.c: gather all the info about the processes before calling ttyprintf
	(which may block).
2) syscons.c: handle asynchronous output properly (data structures may
	be corrupted otherwise).
1994-03-20 20:05:55 +00:00
David Greenman
835b7809ab Modified pccnprobe to not set cn_tp = CONSOLE_TTY if __FreeBSD__ is
defined. This code should probably be yanked out.
1994-03-08 15:17:41 +00:00
Guido van Rooij
fe719280d0 Removed a #warning that I left here. 1994-03-06 20:56:26 +00:00
Guido van Rooij
79bdab6c87 Ttys structures are now allocated dynamically via ttymalloc/ttyfree.
This inetrface should be used from now on.
pseudo device pty xx still keeps its meaning: a maximum of
xx ptys is allowed.
A ringbuffer is now 2040 bytes long, per Garrett Wollman's request.
The changes are inspired by the way NetBSD did it (thanks for that!),
though I made it slihghtly different, including the interface so
at least 75% of the allocated space is deallocated when the tty is
closed.
Note further that it is easy to modify the ringbuffer length runtime.
This will have to wait untill some later date...


-Guido
1994-03-02 20:28:38 +00:00
David Greenman
ab377d1e00 From: Chris Wiener <cwiener@CRLABS.COM>
When the keyboard is probed, the LED's blink quickly and
"Keyboard reset failed" is printed on the console.  The
init routine keeps trying endlessly with the same behavior
as above.

I got the latest -current sup sources (06-Feb-94 12:00 GMT) to work using the
old syscons.c.  The following patch makes the new syscons work:
1994-02-07 02:14:27 +00:00
Christoph Robitschko
52fda4247e Make the screen savers runtime switchable. Everybody wants a
different default saver, and the size increase in the kernel is
minimal ( < 2.5K ).
1994-02-04 10:36:15 +00:00
Andrey A. Chernov
cd08e4cab2 Make BLANK_SAVER default to stop best saver war. 1994-02-02 23:10:55 +00:00
Nate Williams
10a0cecedc Moved paren in sgetc to where it belongs. (My fault, I must have wiped it
out when I applied the patch to get the new features by hand)
1994-02-01 19:04:18 +00:00