Commit Graph

239 Commits

Author SHA1 Message Date
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
f4863d1a23 Take the OS release string from the kernel variable `osrelease'
rather than hard-code it in the message text. Optinally include
the host name in the message if SHOW_HOSTNAME is defined.

The origianl idea and sample code submitted by Angelo Turetta
<ATuretta@stylo.it>.
1997-06-24 12:43:18 +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
8800a82c29 Corrected accidental breakage in the last commit.
Pointed out by: Steve Passe, smp@csn.net
1997-05-26 01:02:41 +00:00
David E. O'Brien
6b35fac151 Fixed up ssigala@globalnet.it's "Jumping Daemon" screen saver for < v3.0. 1997-05-25 16:06:29 +00:00
Kazutaka YOKOTA
068eabc6c4 Flip the daemon at the edge of the screen.
Submitted by:	Sandro Sigala, Chris Shenton
1997-05-24 01:44:39 +00:00
Kazutaka YOKOTA
e8adebf242 Introducing "Jumping Daemon" screen saver. This is really cute and
eye-catching :-)

Submitted by:	ssigala@globalnet.it
1997-05-21 14:18:27 +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
Peter Dufault
0ddf9be1f0 Make MOD_* macros almost consistent:
Use the name argument almost the same in all LKM types.  Maintain
the current behavior for the external (e.g., modstat) name for DEV,
EXEC, and MISC types being #name ## "_mod" and SYCALL and VFS only
#name.  This is a candidate for change and I vote just the name without
the "_mod".

Change the DISPATCH macro to MOD_DISPATCH for consistency with the
other macros.

Add an LKM_ANON #define to eliminate the magic -1 and associated
signed/unsigned warnings.

Add MOD_PRIVATE to support wcd.c's poking around in the lkm structure.

Change source in tree to use the new interface.

Reviewed by:	Bruce Evans
1997-04-06 11:14:13 +00:00
Peter Dufault
952d112864 Make MOD_* macros almost consistent:
Use the name argument almost the same in all LKM types.  Maintain
the current behavior for the external (e.g., modstat) name for DEV,
EXEC, and MISC types being #name ## "_mod" and SYCALL and VFS only
#name.  This is a candidate for change and I vote just the name without
the "_mod".

Change the DISPATCH macro to MOD_DISPATCH for consistency with the
other macros.

Add an LKM_ANON #define to eliminate the magic -1 and associated
signed/unsigned warnings.

Add MOD_PRIVATE to support wcd.c's poking around in the lkm structure.

Change source in tree to use the new interface.

Reviewed by:	Bruce Evans
1997-04-06 10:49:22 +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
4a0f765fbf Revert $FreeBSD$ back to $Id$ 1997-02-22 12:49:29 +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
Jordan K. Hubbard
2b2fe33c89 Make snake 3.0-CURRENT here.
There's gotta be a better way of syncronizing our release numbers. :-)
1996-11-11 14:18:40 +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