Commit Graph

732 Commits

Author SHA1 Message Date
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
Steve Passe
9d37772f68 Added include of intr_machdep.h to eliminate compiler warning for APIC_IO. 1997-08-04 19:12:54 +00:00
Poul-Henning Kamp
9587ee1621 Fix a brino in my last commit.
Noticed by:	smp
1997-07-26 07:58:29 +00:00
Steve Passe
12084b3cf1 clock.c:
- removed TEST_ALTTIMER.
 - removed APIC_PIN0_TIMER.
 - removed TIMER_ALL.

apic_vector.s:
 - new algorithm where a CPU uses try_mplock instead of get_mplock:
	if successful continue as before.
	if fail set ipending bit, mask INT (to avoid recursion), cleanup & iret.

   This allows the CPU to return to successful work, while the ISR will be run
   by the CPU holding the lock as part of the doreti dance.
1997-07-26 01:53:04 +00:00
Poul-Henning Kamp
38d8a113a9 Add option for compiling in a 8x16 font. 1997-07-25 11:53:30 +00:00
Steve Passe
87a6f31089 Last commit didn't take, operator error??? 1997-07-22 20:12:32 +00:00
Steve Passe
35b3c4a0e5 Developed a new strategy for handling the 8254/8259/APIC issue. 1997-07-20 19:41:38 +00:00
Steve Passe
0571e04aee Minor cleanup. 1997-07-20 18:02:59 +00:00
Bruce Evans
f71d35e402 Removed unused #includes. 1997-07-20 14:10:18 +00:00
Steve Passe
797cb61b54 Added #code to support define APIC_PIN0_TIMER.
This code ALWAYS runs the 8254 timer thru the 8259 ICU.
It depricates the usage of "options SMP_TIMER_NC" in the config file.
1997-07-19 03:59:28 +00:00
Steve Passe
bed422e5a3 SMP or APIC_IO:
- Increased NIDT to 256.
 - Moved IPI vectors up above the linux compat vector.
 - Removed runtime setup of RTC vector.
1997-07-19 02:28:30 +00:00
Steve Passe
7bbd2262eb Made the printing of the APIC INTs depend on bootverbose. 1997-07-18 03:59:28 +00:00
John Dyson
955bc15107 Add some support for the 16650 type UARTS. 1997-07-17 06:01:15 +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
Steve Passe
c064ef9175 Cleanup old stop_cpus/restart_cpus() cruft.
new code for handling mixed-mode 8259/APIC programming without 'ExtInt'
new code to control other CPUs: stop_cpus()/restart_cpus()/_Xstopcpu
1997-07-13 01:18:51 +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
Steve Passe
293f18dbbf Modified to use merged/renamed functions:
- get_isa_apic_mask() -> isa_apic_mask()
 - get_isa_apic_irq() && get_eisa_apic_irq() -> isa_apic_pin()
1997-06-25 21:00:00 +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
Paul Traina
5ea6cb03f3 Bring back CONSPEED as a last-ditch default if you can't change the speed
any other way.

Requested by: dfr
1997-06-04 16:25:15 +00:00
Paul Traina
2334749d02 If the boot blocks were using the serial port, read the system console
speed using the boot blocks, instead of a hardcoded value stuck in the
kernel.  This way, you can have systems using the same kernel but different
console speeds.

Add a sysctl entry for changing the system console speed.
Lock the user tty speed to match the system console speed.

Nuke CONSPEED.
Reviewed by:	bde
1997-06-04 04:52:40 +00:00
Doug Rabson
683523378c Move interrupt handling code from isa.c to a new file. This should make
isa.c (slightly) more portable and will make my life developing the really
portable version much easier.

Reviewed by:	peter, fsmp
1997-06-02 08:19:06 +00:00
Poul-Henning Kamp
55d2795997 I've given up on the idea of sizing FIFO's. You can set it with a flag
value now, if you know that you have a fifo deeper than 16.
1997-06-01 20:42:01 +00:00
Peter Wemm
5400ed3b2f Include file updates.. <machine/spl.h> -> <machine/ipl.h>, add
<machine/ipl.h> to those files that were depending on getting SWI_*
implicitly via <machine/cpufunc.h>
1997-05-31 09:27:31 +00:00
Peter Wemm
7a14de6260 No longer need opt_smp.h here 1997-05-29 05:00:35 +00:00
Steve Passe
383243e687 Made the array vec[] a global.
This allows the APIC code to reorder the vectors at runtime.
1997-05-25 16:55:26 +00:00
Poul-Henning Kamp
468d825d86 Whoops, missed a zero there. Flags 0x10000 it is. 1997-05-18 21:22:11 +00:00
Poul-Henning Kamp
e12ca851a6 Flags 0x1000 on sio now disables the dreaded test#3.
PR:		3395
1997-05-18 21:19:04 +00:00
Poul-Henning Kamp
8463cf03a9 Detect various supersets of 16550A based on fifo depth.
PR:		i386/3523
Reviewed by:	phk
Submitted by:	vak@cronyx.ru
1997-05-18 20:53:52 +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
Peter Wemm
f435322e07 correct the order of the variables
use #ifdef where possible instead of #if defined

Submitted by: the KNF police, ie: bde :-)
1997-05-05 09:34:33 +00:00
Peter Wemm
26e5316524 Don't remove i586_ctr_freq from scope, leave it defined as zero. This
simplifies some assumptions and stops some code compile problems.

This should fix the compile hiccup in PR#3491, but smp kernel profiling
isn't likely to be fixed by this.
1997-05-04 14:25:00 +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
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
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
Bruce Evans
750059bbc5 Don't fiddle with RTS if RTS flow control is off. This gives applications
almost complete control over RTS (control of its initial value is still
missing).

This fixes PR 1644 for sio.

The author of PR 1644 wants it in 2.1.6 and 2.2.  This may be safe since
the complications are only in rarely used cases that I hope I've covered.
1996-11-13 18:31:57 +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
Joerg Wunsch
bb6382fae2 Fix the broken EOF handling in the floppy driver. The most obvious
appearance of this bug was the malfunctioning -M option in GNU tar (it
worked only by explicitly specifying -L).

Reviewed by:	bde, and partially corrected accoring to his comments

Candidate for 2.2, IMHO even for 2.1.6.
1996-11-02 23:31:11 +00:00
Paul Traina
39daae723d add in CONSPEED option which controls console serial port speed 1996-11-02 02:26:06 +00:00
Satoshi Asami
e30f001135 More merge and update.
(1) deleted #if 0

    pc98/pc98/mse.c

(2) hold per-unit I/O ports in ed_softc

    pc98/pc98/if_ed.c
    pc98/pc98/if_ed98.h

(3) merge more files by segregating changes into headers.

  new file (moved from pc98/pc98):

    i386/isa/aic_98.h

  deleted:

    well, it's already in the commit message so I won't repeat the
    long list here ;)

Submitted by:	The FreeBSD(98) Development Team
1996-10-30 22:41:46 +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
Bruce Evans
9272350657 Removed initialization of a variable that went away. Oops. 1996-10-26 00:11:57 +00:00
Bruce Evans
2d872b777d Print the clock calibration messages all on one (long) line again so
that they are easy to grep for.

Removed now-unused i586 counter variables.

Fixed some style bugs.
1996-10-25 13:46:21 +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
c20b324bb6 Put I*86_CPU defines in opt_cpu.h. 1996-10-09 19:47:44 +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
92d0aa20dc Work around UMC8669F and Startech UART bugs by not writing to the
divisor latch registers if the registers wouldn't change.

Use the default console cfcr setting while setting the divisor
latch registers for console i/o.  Input may be messed up by
transiently changing the cfcr.

Use a usual cfcr setting while setting the divisor latch registers
in the probe.  This shouldn't matter, but this is not the place to
test the UART's handling of 5 bit words.

Removed a stale devfs comment.
1996-09-30 12:22:27 +00:00
Bruce Evans
831031ce00 Attached simple external ddb commands show rtc', show pgrpdump'
and `show cbstat'.  The pgrpdump code was previously controlled by
`#ifdef DEBUG'.
1996-09-14 10:53:48 +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
Satoshi Asami
0e408c25a1 Another round of merge/update.
(1) Add PC98 support to apm_bios.h and ns16550.h, remove pc98/pc98/ic
(2) Move PC98 specific code out of cpufunc.h (to pc98.h)
(3) Let the boot subtrees look more alike

Submitted by:	The FreeBSD(98) Development Team
		<freebsd98-hackers@jp.freebsd.org>
1996-09-12 11:12:18 +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
Bruce Evans
f313170d3c Updated #includes to 4.4Lite style. 1996-09-10 08:32:01 +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
Bruce Evans
70e53371c4 Eliminated i586_ctr_rate. Use i586_ctr_freq instead. 1996-08-02 21:16:27 +00:00
Bruce Evans
33ded19fc2 Fixed the machdep.i8254_freq and machdep.i586_freq sysctls. Writes were
handled bogusly.

Centralized the setting of all the frequency variables.  Set these
variables atomically.  Some new ones aren't used yet.
1996-07-30 19:26:55 +00:00
Andrey A. Chernov
58db4b5a8f Fix GIO_ATTR ioctl return to match SYSV 1996-07-30 15:20:08 +00:00
Poul-Henning Kamp
cba8a5ddd3 Make a "DWIM" function for adding [bc]devsw entries for bdev drivers.
Saves about 280 butes of source per driver, 56 bytes in object size
and another 56 bytes moves from data to bss.

No functional change intended nor expected.

GENERIC should be about one k smaller now :-)
1996-07-23 21:52:43 +00:00
Joerg Wunsch
3135240845 Post-commit review by Bruce. Mostly stylistic changes.
Submitted by:	bde
1996-07-21 08:20:51 +00:00
Joerg Wunsch
99211adf2c Major cleanup of the timerX_{acquire,release} stuff. In particular,
make it more intelligible, improve the partially bogus locking, and
allow for a ``quick re-acquiration'' from a pending release of timer 0
that happened ``recently'', so it was not processed yet by clkintr().
This latter modification now finally allows to play XBoing over
pcaudio without losing sounds or getting complaints. ;-)  (XBoing
opens/writes/closes the sound device all over the day.)

Correct locking for sysbeep().

Extensively (:-) reviewed by:	bde
1996-07-20 18:47:23 +00:00
Julian Elischer
75d050aeaa some internal modems need LOTS of time to generate an interrupt
on demand.. increase DELAY from 1000 uS to 10000uS
1996-07-17 22:07:23 +00:00
Bruce Evans
65d98215ea Fixed adjustment of `time' when timer0 is released. 27465 was 27645 in
a comment and in code that was only used when pcaudio was closed.  The
maximum error was 66 usec.
1996-07-17 11:26:05 +00:00
Bruce Evans
cba2a7c614 Staticized a few variables.
Fixed warnings about unused variables.
1996-07-12 07:41:34 +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
Bruce Evans
d2700ee639 Use the standard timer (interrupt) frequency while calibrating the clocks.
Testing with the high frequency of 20000 Hz (to find problems) only found
the problem that this frequency is too high for slow i386's.

Disable interrupts while setting the timer frequency.  This was unnecessary
before rev.1.57 and forgotten in rev.1.57.  The critical (i8254) interrupts
are disabled in another way at boot time but not in the sysctl to change
the frequency.
1996-07-01 18:00:47 +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
Bruce Evans
7d64a7fe80 Added support for TIOCDCDTIMESTAMP (enable/get timestamp of last DCD rise).
Original version by John Hay.

Simplified timestamp code by reading the time exactly when necessary.
This may slow down the interrupt handler with extra calls to microtime(),
but only in bad configurations - the input fifo should normally be
disabled if timestamps on input are being used, since otherwise the
timestamp won't be precisely associated with any particular input event.
The interrupt handler remains slowed down by one test and branch for
each input (and now DCD change) event - avoiding this is not practical
yet.

The simplifications also fixed:
- timestamps for input sometimes being clobbered by output and modem
  status interrupts.
- valid timestamps not being available unless the port is configured with
  vector siointrts.  siointrts no longer exists.
- compiler warnings about siointr* in some configurations.

Simplified timestamp and probe code by depending on recent changes in
microtime() and DELAY() to preserve the interrupt enable flag.
1996-06-17 14:23:39 +00:00
Bruce Evans
16263f7a8b In getit(), use read_eflags()/write_eflags() to preserve the interrupt
enable flag instead of enable_intr() to restore it to its usual state.
getit() is only called from DELAY() so there is no point in optimising
its speed (this wasn't so clear when it was extern), and using
enable_intr() made it inconvenient to call DELAY() from probes that need
to run with interrupts disabled.
1996-06-17 12:50:22 +00:00
Paul Traina
8f33d986bc Move warning messages under bootverbose 1996-06-11 16:11:27 +00:00
Paul Traina
6d715e951e Put clock calibration #defines in opt_clock.h to ease reconfiguration 1996-06-11 16:02:55 +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
Poul-Henning Kamp
14212c9d29 Typo. 1996-05-03 20:15:11 +00:00
Poul-Henning Kamp
17542807e5 Move from the old buf.b_actf to the new TAILQ(buf.b_act). 1996-05-03 14:57:27 +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
Poul-Henning Kamp
a8c5fef5e6 KGDB is dead. It may come back one day if somebody does it. 1996-05-02 09:34:51 +00:00
Bruce Evans
2dafbfcbab Added calibration the i8254 and the i586 clocks agains the RTC at boot
time.  The results are currently ignored unless certain temporary options
are used.

Added sysctls to support reading and writing the clock frequency variables
(not the frequencies themselves).  Writing is supposed to atomically
adjust all related variables.

machdep.c:
Fixed spelling of a function name in a comment so that I can log this
message which should have been with the previous commit.

Initialize `cpu_class' earlier so that it can be used in startrtclock()
instead of in calibrate_cyclecounter() (which no longer exists).

Removed range checking of `cpu'.  It is always initialized to CPU_XXX
so it is less likely to be out of bounds than most variables.

clock.h:
Removed I586_CYCLECTR().  Use rdtsc() instead.

clock.c:
TIMER_FREQ is now a variable timer_freq that defaults to the old value of
TIMER_FREQ.  #define'ing TIMER_FREQ should still work and may be the best
way of setting the frequency.

Calibration involves counting cycles while watching the RTC for one second.
This gives values correct to within (a few ppm) + (the innaccuracy of the
RTC) on my systems.
1996-05-01 08:39:02 +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
Nate Williams
e12ac36c96 Format the already applied PCCARD additions to use KNF form. No
functional changes.
1996-04-23 18:36:56 +00:00
Nate Williams
e597b4972e - add apm to the GENERIC kernel (disabled by default), and add some comments
regarding apm to LINT
- Disabled the statistics clock on machines which have an APM BIOS and
  have the options "APM_BROKEN_STATCLOCK" enabled (which is default
  in GENERIC now)
- move around some of the code in clock.c dealing with the rtc to make
  it more obvios the effects of disabling the statistics clock

Reviewed by:	bde
1996-04-22 19:40:28 +00:00
Bruce Evans
aef18d6ed7 Another try: fixed bogus change of the fifo settings for the non-speed of 0.
rev.1.30 incorrectly changed the behaviour from always disabling the fifo
to always enabling it.
1996-04-13 14:55:18 +00:00
Bruce Evans
3745f80a48 Moved AUTO_EOI_[12] and most sio and pcvt options out of the makefile. 1996-04-11 21:18:49 +00:00
Marc G. Fournier
6d4bca5b8a removed RS_IBUFSIZE #ifndef - have been informed it was a bad idea 1996-04-10 18:09:58 +00:00
Marc G. Fournier
f4f119017f Placed an #ifndef around RS_IBUFSIZE so that it can be changed in the
config file ... PR#528 is reportly fixed by adding 'options RS_IBUFSIZE=1024'
to the config file
1996-04-10 04:18:36 +00:00
Sujal Patel
100f78bbe0 Update drivers to use isa_dma_acquire() and isa_dma_release()
Reviewed by:	bde
1996-04-08 19:40:57 +00:00
Bruce Evans
3157adc8af Removed now-unused #includes of <machine/cpu.h>. They were for bootverbose
being declared in the wrong place.
1996-04-07 17:32:42 +00:00
Bruce Evans
2151975455 Fixed devfs device names and numbers.
Fixed handling of unknown CMOS types - don't attach unrecognized devices.
1996-04-07 14:46:42 +00:00
Andrey A. Chernov
2cb9219c5d Fix adjkerntz expression priority 1996-04-05 18:56:10 +00:00
Andrey A. Chernov
fe0d5f43c5 Add wall_cmos_clock sysctl variable, needed to manage adjkerntz even for
UTC cmos clocks (needed for Local Timezone FSes)
1996-04-05 03:36:31 +00:00
Marc G. Fournier
ecd87fe6c3 changed from using dev_link() to devfs_link() 1996-04-02 04:52:03 +00:00
Joerg Wunsch
0e317d05cc Fetch the (dummy) READY CHANGED condition interrupt stati that
happen after an FDC reset.

Submitted by:	bde
1996-03-31 18:04:51 +00:00
Bruce Evans
ef9805a3c8 Moved rtcin() to clock.c.
Always delay using one inb(0x84) after each i/o in rtcin() - don't
do this conditional on the bogus option DUMMY_NOPS not being defined.
If you want an optionally slightly faster rtcin() again, then inline
it and use a better named option or sysctl variable.  It only needs
to be fast in rtcintr().
1996-03-31 04:05:36 +00:00
Bruce Evans
f85120ac5b Fixed group of some more disk devices.
Fixed devfs function names.
1996-03-29 11:45:12 +00:00
Marc G. Fournier
6e18ce4676 Switched from using devfs_add_sw() to using devfs_add_swf()
Reviewed by:	julian@freebsd.org
1996-03-28 14:29:52 +00:00
Bruce Evans
6c4591a089 Fixed ownerships of callout devices. 1996-03-27 20:03:32 +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
Nate Williams
cdf642d171 Whoops, back out the last commit, which was accidentally committed at
the same time as the if_zp cleanup patch.

The commit that occurred was an incomplete patch for APM on my laptop
and needs more work.
1996-03-23 21:36:03 +00:00
Nate Williams
ada00a4447 Now that ac->ac_ipaddr and arpwhohas() no longer exist, remove the
ifdef'd out code that used it.
1996-03-23 21:32:39 +00:00
Jean-Marc Zucconi
80da27b88c Fix the isa_device table (lkm): id_irq and id_maddr must be 0.
Pointed out by: bde
1996-03-16 01:08:04 +00:00
Jean-Marc Zucconi
b1fe5b5c60 Add code to make it a loadable kernel module 1996-03-15 20:35:06 +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
Bruce Evans
3b3bedbc0e Added some delays to the probe. This might fix some incompatible UARTs
(the ones that take more than a few hundred nsec and less than 1 msec to
switch their IRQ output).
1996-02-25 21:10:54 +00:00
Bruce Evans
8335c1b8ae Don't turn off the motor on active drives. The motor timeout may
occur while a command is in progress if the system is overloaded
or was stopped at a debugger breakpoint.
1996-02-25 21:01:31 +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
Mike Pritchard
6c5e9bbdf5 Fix a bunch of spelling errors in the comment fields of
a bunch of system include files.
1996-01-30 23:02:38 +00:00
Garrett Wollman
3addba4f55 No longer use the cyclecounter to attempt to correct for late or missed
clock interrupts.

Keep a 1-in-16 smoothed average of the length of each tick.  If the
CPU speed is correctly diagnosed, this should give experienced users
enough information to figure out a more suitable value for `tick'.
1996-01-30 18:56:47 +00:00
Bruce Evans
c8f2fe8db8 First attempt at creating devfs entries for sliced devices. Doesn't
quite work yet, so the heart of it is disabled.

Added bdev and cdev args to dsopen().

drivers:
Fixed device names, links, minor numbers and modes.

wd.c:
Started actually supporting devfs.

diskslice.h:
Added devfs tokens to structs (currently 576 of them per disk! :-().

subr_diskslice.c:
Create devfs entries in dsopen() and (unsuccessfully) attempt to make
them go away at the right times.  DEVFS is #undefed at the start so
that this shouldn't cause problems.
1996-01-27 04:18:15 +00:00
Bruce Evans
dd87702a51 Allocate DMA bounce buffers only when requested by drivers. Only the
fd and wt drivers need bounce buffers, so this normally saves 32K-1K
of kernel memory.

Keep track of which DMA channels are busy.  isa_dmadone() must now be
called when DMA has finished or been aborted.

Panic for unallocated and too-small (required) bounce buffers.

fd.c:
There will be new warnings about isa_dmadone() not being called after
DMA has been aborted.

sound/dmabuf.c:
isa_dmadone() needs more parameters than are available, so temporarily
use a new interface isa_dmadone_nobounce() to avoid having to worry
about panics for fake parameters.  Untested.
1996-01-27 02:33:48 +00:00
Andrey A. Chernov
887c00b859 Change RUKEYMAP sligtly 1996-01-25 16:37:20 +00:00
Poul-Henning Kamp
e8cbe8fa47 Avoid local sprintfs and other printf'isms. 1996-01-25 07:21:50 +00:00
Andrey A. Chernov
d85314fa5f Since new bcd* macros not argument range overflow resistant,
fix argument overflow for years >= 2000
1996-01-16 06:35:40 +00:00
Poul-Henning Kamp
3eb50b2edd My wife is busy making me a new conical hat, so you don't need to
send any to me this time.  Commited an old copy of this files where
the tables were swapped.  Duh!.
1996-01-15 21:26:43 +00:00