Commit Graph

540 Commits

Author SHA1 Message Date
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
Peter Wemm
477a642cee Man the liferafts! Here comes the long awaited SMP -> -current merge!
There are various options documented in i386/conf/LINT, there is more to
come over the next few days.

The kernel should run pretty much "as before" without the options to
activate SMP mode.

There are a handful of known "loose ends" that need to be fixed, but
have been put off since the SMP kernel is in a moderately good condition
at the moment.

This commit is the result of the tinkering and testing over the last 14
months by many people.  A special thanks to Steve Passe for implementing
the APIC code!
1997-04-26 11:46:25 +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
Bruce Evans
63e32a69f2 Don't call timeout() for DTR wakeup or busy check if the relevant timeout
is already active.  This fixes "timeout table full" panics under 100%
interrupt load and other weird conditions.
1997-04-18 18:28:09 +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
Stephen McKay
bc19f8a39e Prevent wedging of the stat clock because of missed interrupts.
This should cure the "alternate system clock has died!" problem.

Discussed with: bde, joerg
1997-04-06 13:25:48 +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
Bruce Evans
24bb2ffb15 Removed defaults for dead options CONADDR and CONUNIT. 1997-04-05 13:15:50 +00:00
Bruce Evans
de09b61a0c Use device flags instead of options for serial console configuration
(see LINT).  There is a new low-level console type that is more suitable
for use with gdb-remote.

Fixed setting of speed at probe time for the serial console (if any).

Reviewed by:	dfr
1997-04-05 13:11:27 +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
Bruce Evans
3ac4d1ef0c Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.
Fixed everything that depended on getting fcntl.h stuff from the wrong
place.  Most things don't depend on file.h stuff at all.
1997-03-23 03:37:54 +00:00
Kazutaka YOKOTA
d36dc5e36b Made set_controller_command_byte() less verbose. It used to print a
debug message whenever one of lock keys were pressed, if the system
was started with the `-v' option.

Removed a couple of lines of dead code too.
1997-03-07 10:22:55 +00:00
Joerg Wunsch
8a973ca81c Move pcvt towards using kbdio (finally!).
Warning: this won't work yet with PCVT_SCANSET=2 along in early
console mode (boot -c, or boot -d).

A big thanks to Kazutaka, and a word of apologies for delaying the
review for that long time...

Submitted by:	yokota@zodiac.mech.utsunomiya-u.ac.jp (Kazutaka YOKOTA)
1997-03-06 22:34:24 +00:00
Bruce Evans
65ff42dd17 Only print clock calibration messages if the system was booted with -v.
Submitted by:	partly by gpalmer
1997-03-05 08:08:48 +00:00
Gary Palmer
0b146b65d2 Back out the patch to break up the clock probe lines. Instead, follow
Bruce's suggestion of deleting "relative to mc146818A clock ",
thus shortening the line ...
1997-03-05 00:54:00 +00:00
Gary Palmer
5c5e8d766c Split the rather long and line-wrapping clock probe messages on boot.
(2.2?)

Submitted by:	Mathew Dood <winter@jurai.net>
1997-03-04 09:24:01 +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
John Dyson
996c772f58 This is the kernel Lite/2 commit. There are some requisite userland
changes, so don't expect to be able to run the kernel as-is (very well)
without the appropriate Lite/2 userland changes.

The system boots and can mount UFS filesystems.

Untested: ext2fs, msdosfs, NFS
Known problems: Incorrect Berkeley ID strings in some files.
		Mount_std mounts will not work until the getfsent
		library routine is changed.

Reviewed by:	various people
Submitted by:	Jeffery Hsu <hsu@freebsd.org>
1997-02-10 02:22:35 +00:00
Kazutaka YOKOTA
445605a6e0 Fix for the Compaq Armada laptop.
The PS/2 mouse device responds to a reset command with a sequence of
ACK(fa), RESULT(aa) and ID(00).  Most PS/2 mice immediately returns
ACK, but spend sometime before sending RESULT. The Armada takes time
before ACK; extra delay is necessary before the call to read ACK.

The problem was reported in comp.unix.bsd.freebsd.misc and the patch
was tested by the reporter. No PR was filed, by the way.
1997-02-07 11:41:45 +00:00
Bruce Evans
d1adf9f099 Fixed the SMC fifo bug fix. sioopen() hung while input was streaming in
with <= 100 usec between each character arrival time.  This didn't happen
until rev.1.75 of clock.c because DELAY(100) used to delay for closer to
80 usec than 100 usec, and the minimum time between character arrivals is
87.8 usec at the maximum supported speed of 115200 bps 8N1.

Clear DCD timestamp flag on close (the input timestamp flag is already
cleared).
1997-02-01 16:04:16 +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
Bruce Evans
49a116737e Estimate an initial overhead of 0 usec instead of 20 usec in DELAY().
I have code to calibrate the overhead fairly accurately, but there
is little point in using it since it is most accurate on machines
where an estimate of 0 works well.  On slow machines, the accuracy
of DELAY() has a large variance since it is limited by the resolution
of getit() even if the initial delay is calibrated perfectly.

Use fixed point and long longs to speed up scaling in DELAY().
The old method slowed down a lot when the frequency became variable.
Assume the default frequency for short delays so that the fixed
point calculation can be exact.

Fast scaling is only important for small delays.  Scaling is done
after looking at the counter and outside the loop, so it doesn't
decrease accuracy or resolution provided it completes before the
delay is up.  The comment in the code is still confused about this.
1997-01-29 22:51:44 +00:00
Bruce Evans
160da193e0 Fixes and workarounds for Hayes ESP:
- don't uselessly initialize the fifo "DMA" bit at attach time.
- initialize the fifo "DMA" bit at open time.  Without this, the device
  interrupts for every character received, reducing input performance
  to that of an 8250.
- don't uselessly initialize the fifo trigger level to 8 (scaled to
  256) at attach time.
- don't scale the fifo trigger level to 512 bytes.  The driver's pseudo-
  dma buffer has size 256, so it can't handle bursts of size 512 or 256.
  It should be able to handle the second lowest ftl (2 scaled to 64).
- don't reset the fifos in siostop().  Reset triggers a hardware bug
  involving wedging of the output interrupt bit  This workaround
  unfortunately requires ESP support to be configured.
1997-01-29 21:50:02 +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
Bruce Evans
6bed7e5140 Guard against the i8254 timer being uninitialzed if DELAY() is
called early for console i/o.  The timer is usually in BIOS mode
if it isn't explicitly initialized.  Then it counts twice as fast
and has a max count of 65535 instead of 11932.  The larger count
tended to cause infinite loops for delays of > 20 us.  Such delays
are rare.  For syscons and kbdio, DELAY() is only called early
enough to matter for ddb input after booting with -d, and the delay
is too small to matter (and too small to be correct) except in the
PC98 case.  For pcvt, DELAY() is not used for small delays (pcvt
uses its own broken routine instead of the standard broken one),
but some versions call DELAY() with a large arg when they unnecessarily
initialize the keyboard for doing console output.  The problem is
more serious for pcvt because there is always some early console
output.

Guard against the i8254 timer being partially or incorrectly
initialized.  This would have prevented the endless loop.

Should be in 2.2.
1997-01-16 18:28:20 +00:00
KATO Takenori
280a2265d9 - Modified for PC-98.
- Included IBM-PC specific code in #ifndef PC98.
1997-01-16 14:56:16 +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
Bruce Evans
b75504fdc2 Use breakpoint() instead of Debugger() in siointr1(). Debugger() doesn't
work in fast interrupt handlers because it calls db_printf() which uses
%es for string stuff and %es isn't initialized.
1996-12-23 19:57:33 +00:00
Alexander Langer
df5080050d Hawaii-Five-Typo 1996-12-19 00:26:22 +00:00
Bruce Evans
d43190805d Disabled half-baked disk statistics support. It didn't actually generate
statistics, so it just wasted scarce disk table slots and screen space.
1996-12-18 17:44:31 +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
Satoshi Asami
f48465862b Synchronize with the RELENG_2_2 branch.
Definite 2.2 candidate.

Submitted by: The FreeBSD(98) Development Team
1996-12-04 04:21:30 +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
Bruce Evans
c252c2507e Fixed input of BREAKs when IGNPAR is set and IGNBRK is not set. BREAKs
are always together with Framing Errors and they were incorrectly
treated as FE's and discarded.

Reorganized the BREAK/FE/PE tests.

Found by:	NIST-PCTS
1996-11-30 15:52:56 +00:00
Bruce Evans
eea9b0845f Reset h/w fifos (if any) in siostop(). Now ttyflush() works fairly well
with sio devices (not perfectly, since there is no way to flush the tx
holding register on 8250-16450's.  I'm not sure if resetting the fifos
flushes the tx shift register).

Reminded by:	NIST-PCTS
1996-11-30 15:29:31 +00:00
Bruce Evans
4670f800ec Fixed sloppy clearing of TS_BUSY. Don't clear it until the transmitter
is completely empty.  There is no interrupt for output completion, so
poll for it every 10 ms after output is nearly complete.  Now ttywait()
works right.

Reminded by:	NIST-PCTS
1996-11-30 15:19:19 +00:00
Bruce Evans
38e81cedcf Throw away input if CREAD is not set. POSIX requires no characters to be
received in this case even if the hardware doesn't have a CREAD bit.

Found by:	NIST-PCTS
1996-11-30 15:03:05 +00:00
Bruce Evans
9924e17950 Cleaned up CONSPEED changes. `comdefaultrate' gives the default
speed for the "com" console, not for general purpose "com" ports,
so there was no need to split it into comdefaultrate and condefaultrate.
1996-11-30 14:51:04 +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