Commit Graph

635 Commits

Author SHA1 Message Date
Kazutaka YOKOTA
6c401d343f - Add binary compatibility support for obsolete console/mouse ioctls
so that existing programs which were compiled before the introduction
  of the new mouse code and use these ioctls will run unmodified.

Suggested by msmith.
1998-01-20 03:37:27 +00:00
Kazutaka YOKOTA
4d76195ef5 Fix illegal numeric expressions: 08 and 09. 1998-01-12 23:54:51 +00:00
Julian Elischer
eae4f847a7 add devfs entries for a few more syscons devices (e.g. sysmouse) 1998-01-12 03:28:36 +00:00
Kazutaka YOKOTA
363f670991 - Produce the accent letter if the user hits the accent key twice.
(accent_key + space does still print the accent letter too, as in
  the previous commit.)
  Requested by a couple of users.
- Clear the accent flag when the next_screen key is pressed.
- Added some comment lines regarding accent key processing.
1998-01-09 09:06:55 +00:00
Atsushi Murai
844451dc95 1. Supporting a bogus 16550A compatible PCMCIA CARD stuffs
- IIR_TXRDY is never off even if reading a IIR register.
    - Know as PIAFS "Palido 321S", "DC-*S" oemed by Sharp corp.

 2. Omiting a restrict probing if it's already probed by pccardd.
    Note: Define a new id_flags as follows

           0x40000 - NO PROBE (Already probed as serial)
           0x80000 - Has a bogus IIR_TXRDY register

	Sato Junichi <junichi@astec.co.jp>
	Nrihiro Kumagai <kuma@slab.tnr.sharp.co.jp>
	Hirao Tetsuya <ai.cs.fujitsu.co.jp>
	Toshiharu Asai <asai@mbc.infoshere.or.jp>
	Shin'ya Kumabuchi <kumabu@t3.rim.or.jp>
        Freebsd-users-jp@jp.freebsd.org
	bsd-nomads@ai.cs.fujitsu.co.jp
1998-01-08 04:53:43 +00:00
Kazutaka YOKOTA
a3bd3dac25 Added accent (dead) key support to syscons and kbdcontrol.
With a keymap with accent key definitions loaded to syscons, you press
an accent key followed by a regular letter key to produce an accented
letter.  Press an accent key followed by the space bar to get the
accent letter itself.

Code is based on the ideas and work by jmrueda@diatel.upm.es and
totii@est.is.

PR: i386/4016

console.h
- Defined structures and constants for accent (dead) keys.

syscons.c, kbdtables.h
- When an accent key is pressed, set the corresponding index to
  `accents'.  If the next key is the space key, produce the accent char
  itself.  Otherwise search the accent key map entry, indexed by
  `accents', for a matching pair of a regular char and an accented char.
- Added ioctl functions to set and get the accent key map (PIO_DEADKEYMAP
  and GIO_DEADKEYMAP).
1998-01-07 08:40:34 +00:00
Poul-Henning Kamp
0f12aa9ffd More cleanup relating to our use of the TSC.
Look in the cpu_feature (CPUID output) to see if we have it.
1997-12-28 17:33:10 +00:00
Poul-Henning Kamp
d46e059f94 wash, sort and put in order various nits from the i586_ctr -> tsc
commit.

Pointed out by: bde
1997-12-28 13:36:09 +00:00
Bruce Evans
88754aaf0e Fixed initialization of the divisor latch. We depended on siocnopen()
initializing it for the (usual) (siocniobase != 0) case, but
siocnopen() doesn't initialize it if the latch registers already
have the correct values.
1997-12-28 06:36:35 +00:00
Bruce Evans
e932603093 Always call ttwwakeup() before returning from comstart(). It isn't
necessary to call it when the tty layer's output state has not been
changed, but siostop() sometimes changes the TS_BUSY state and then
calls comstart() mainly for its side effect of calling ttwwakeup().
1997-12-28 06:20:47 +00:00
Poul-Henning Kamp
71f461f86a Rename "i586_ctr" to "tsc" (both upper and lower case instances).
Fix a couple of printfs too.

Warning: This changes the names of a couple of kernel options!
1997-12-26 20:42:37 +00:00
Eivind Eklund
5591b823d1 Make COMPAT_43 and COMPAT_SUNOS new-style options. 1997-12-16 17:40:42 +00:00
Kazutaka YOKOTA
c6d1bed112 - Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
  Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
  MieMouse, Logitech MouseMan+, FirstMouse+

- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.

- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.

- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.

- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.

/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
  and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
  Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.

/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
  to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON.  Use button bits
  defined in `mouse.h' instead.

/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
  features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones.  Most important
  of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
  While the output level remains zero, the output from the `psm' driver is
  in the standard PS/2 mouse format (three bytes long).  When the level
  is set to one, the `psm' driver will send data in the extended format.
  At the level two the driver uses the format which is native to the
  connected mouse is used. (Meaning that the output from the device is
  passed to the caller as is, unmodified.)  The `psm'  driver will pass
  such extended data format as is to the caller if the output level is
  two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
  (PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
  Acceleration ratio is now specified by the kernel configuration flags
  stated above.  Sync check logic is refined and now standard.
  The sync check can be turned off by the new kernel configuration flags
  PSM_CONFIG_NOCHECKSYNC (0x100).  PSM_EMULATION has been of little use.
- Summer clean up :-)  Removed unused code and obsolete comments.

/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
  Most importantly, the MOUSE_SETLEVEL ioctl will change the
  output format from the 5 byte format to the new, extended format
  so that the caller can take advantage of Z axis movement and additional
  buttons.
- Use constants defined in `mouse.h' rather than magic numbers.

/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
  ioctls defined in `mouse.h'.  Most importantly, the MOUSE_SETLEVEL
  ioctl will change the `sysmouse' output format from the MouseSystems
  5 byte format to the new, extended format so that the caller can
  take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
  single click action of the right button in the virtual console.  The
  left button double click will select a word under the mouse pointer.
  The triple click will select a line and the single click of the right
  button will extend the selected region to the current position of
  the mouse pointer.  This will make the cut/paste support more compatible
  with xterm.

/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
Bruce Evans
239b7b699e Use ENOIOCTL instead of -1 (= ERESTART) for tty ioctls that are
not handled at a particular level.  This fixes mainly restarting
of interrupted TIOCDRAINs and TIOCSETA{W,F}s.
1997-12-06 13:25:01 +00:00
Poul-Henning Kamp
ab3f746966 In all such uses of struct buf: 's/b_un.b_addr/b_data/g' 1997-12-02 21:07:20 +00:00
Søren Schmidt
0690c6fe58 Move the hardware currsor off screen when getting back from an
unknown mode.
Fix warning on uninitialized var.
1997-11-25 12:44:44 +00:00
Kazutaka YOKOTA
10974dbd20 Make comp_vgaregs() less strict about VGA register values when
checking the BIOS video mode paramter table.  Now syscons uses the
parameter table even if some bits in the table are different from the
current VGA register settings.

Even if comp_vgaregs() finds that the BIOS video parameter table looks
totally unfamiliar to it, syscons allows the user to change the
current video mode to some modes which are based on the VGA 80x25
mode. They are VGA 80x30, VGA 80x50, VGA 80x60. In this case the user
will be warned, during boot, that video mode switching is only
paritally supported on his machine.

PR: bin/4477
1997-11-21 11:37:07 +00:00
Nate Williams
133c8c2f49 - Renamed <pccard/card.h> -> <pccard/cardinfo.h>.
Forgotten by:		me
Reminded by:		Bruce
1997-11-20 15:48:41 +00:00
Bruce Evans
41d022ae9c Removed #unused includes.
Added a used #include (don't depend on yet to be fixed namespace pollution).
1997-11-18 11:16:56 +00:00
Poul-Henning Kamp
0abc78a697 Rename some local variables to avoid shadowing other local variables.
Found by: -Wshadow
1997-11-07 09:21:01 +00:00
Poul-Henning Kamp
4a11ca4e29 Remove a bunch of variables which were unused both in GENERIC and LINT.
Found by:	-Wunused
1997-11-07 08:53:44 +00:00
Nate Williams
241fe562b4 - MF22: (I reversed these). Simplify code. 1997-11-02 21:26:14 +00:00
Bruce Evans
7f47cf2f4a Don't include <machine/cputypes.h> or declare cputype/class interfaces
in <machine/cpu.h>.  Moved the declarations to <machine/cputypes.h>.
Fixed style bugs in the moved code.  Fixed everything that depended on
the nested include.  Don't include <machine/cpu.h> (in the changed files)
unless something in it is used directly.
1997-10-28 11:43:57 +00:00
Nate Williams
075a76a29e - Instead of relying on a functional call to register PCARD-capable drivers,
use a Linker Set.  Note, if a driver is loaded as an LKM  if will have
  to use the function call, but since none of the existing drivers
  are loadable, this made things cleaner and boot messages nicer.

Obtained from:	PAO-970616
1997-10-26 21:08:42 +00:00
Kazutaka YOKOTA
4372a2b476 - Slightly change the way the border color register is updated so that
flicker won't occur when set_border() is called.

- Properly restore the border color when switching virtual consoles.

Pointed out by: tony@dell.com
OKed by: sos
1997-10-26 07:36:13 +00:00
Nate Williams
8bb7a8fc95 - Functional changes to PCCARD support.
* Kill individual drivers 'suspend' routines, since there's no simple/safe
   way to suspend/resume a card w/out going through the complete probe
   at initialization time.
 * Default to using the apm_pccard_resume sysctl code, which basically
   pretends the card was removed, and then re-inserted.  Suspend/resume
   is now 'emulated' with a fake insert/removal.  (Hence we no longer
   need the driver-specific suspend routines.)
1997-10-26 04:54:16 +00:00
Nate Williams
e7e437dbfa - Do a bunch of gratuitous changes intended to make the code easier to
follow.
 * Rename/reorder all of the pccard structures, change many of the member
   names to be descriptive, and follow more closely other 'bus' drivers
   naming schemes.
 * Rename a bunch of parameter and local variable names to be more
   consistant in the code.
 * Renamed the PCCARD 'crd' device to be the 'card' device
 * KNF and make the code consistant where it was obvious.
 * ifdef'd out some unused code
1997-10-26 04:36:24 +00:00
Kazutaka YOKOTA
38c6184fd5 Reject unreasonable values passed to CONS_HISTORY ioctl. It did not
check the value and caused kernel panic when a large value was given.

- Move the configuration option SC_HISTORY_SIZE from syscons.h to
syscons.c.
- Define the maximum total number of history lines of all consoles.
It is SC_HISTORY_SIZE*MAXCONS or 1000*MAXCONS; whichever is larger.
CONS_HISTORY will allow the user to set the history size up to
SC_HISTORY_SIZE unconditionally (or the current height of the console
if it is larger than SC_HISTORY_SIZE). If the user requests a larger
buffer, it will be granted only if the total number of all allocated
history lines and the requested number of lines won't exceed the maximum.
- Don't free the previous history buffer and leave the history buffer
pointer holding a invalid pointer. Set the pointer to NULL first, then
free the buffer.

PR: bin/4592
1997-10-23 03:23:50 +00:00
Joerg Wunsch
0722d6aba3 Introduce a device flags value of 0x1 to always pretend a 1.44 MB
floppy drive #0, regardless of what the CMOS says.  This is intended
as a bandaid for those plagued with Compaq's idea to not announce the
floppy drive on their `Aero' notebook.

Using the device flags is not very nice (in particular since they
aren't per-drive but per-controller), but still looks a lot better to
me than the disgusting guesswork hack that was recently posted to
-hackers.

Doc update will follow shortly.
1997-10-19 13:12:02 +00:00
Poul-Henning Kamp
a1c995b626 Last major round (Unless Bruce thinks of somthing :-) of malloc changes.
Distribute all but the most fundamental malloc types.  This time I also
remembered the trick to making things static:  Put "static" in front of
them.

A couple of finer points by:	bde
1997-10-12 20:26:33 +00:00
Jordan K. Hubbard
43990fb0dc Back out my LALT -> META change until we figure out a way to make it
work sympathetically with the function keys.
1997-10-12 19:57:49 +00:00
Jordan K. Hubbard
116851ffa3 Change default keymap (I left all the international ones alone) so
that LALT is META by default.  This will make the emacs users happy.
Approved by: sos
1997-10-10 10:32:53 +00:00
Søren Schmidt
3bd724f2b3 Add a new keyboard mode K_CODE. Returns a single byte for each key
much like the scancode mode.
However the keys that (for no good reason) returns extension codes
etc, are translated into singlebyte codes.
Needed by libvgl.  This makes life ALOT easier, also the XFree86
folks could use this.
1997-10-01 20:46:29 +00:00
Jun-ichiro itojun Hagino
be83a6fab3 tiny update of ESC sequence parser.
- some addition of comments (for readability)
- iso-2022 G0 designation support.  This does almost nothing.  Just for
  avoiding garbled screen when got "ESC ( B".
  (how about G1/2/3 designation? I'm not sure)
1997-09-26 15:27:55 +00:00
Justin T. Gibbs
27651b7faa Fix a call to timeout that wasn't properly saving it's callout handle.
Submitted by:	 durian@plutotech.com
1997-09-23 22:14:43 +00:00
Justin T. Gibbs
02a199102d aha1542.c aic6360.c cy.c fd.c ft.c
if_ie.c if_wl.c if_zp.c isa.c isa_device.h
labpc.c mcd.c ncr5380.c scd.c seagate.c si.c
sio.c tw.c ultra14f.c wcd.c wd.c:

	Update for changes in the callout interface.

apic_vector.s icu_vector.s ipl.s ipl_funcs.c:

	Add CAM software/hardware interrupt support.
1997-09-21 21:41:49 +00:00
John-Mark Gurney
6a796ce0a1 teach sio how to attach to isa PnP cards. This is mainly for use with
internal modems.  Currently detects a USR modem, and a couple Supra
modems...  vendor id's for sio capabile cards welcomed...

document new option EXTRA_SIO that will increase sio's internal data
structures to support X more serial ports...  these are used by the
PnP part of sio for attaching...  If you don't have it specified, it
will default to 2...  This is defaulted to 0 if you don't have PnP
compiled into your kernel...

also document that if you set the PnP flags (pnp x flags y) to 0x1 that
the modem will be refused to be recognized by the sio driver... this
is for people that want the traditional isa driver to probe and attach
the modem... (for keeping legacy sio numbering)
1997-09-19 15:25:49 +00:00
Tor Egge
d66c374f58 Enable the FIFO on enhanced floppy controllers. This reduces the
number of dma overruns/underruns for systems under heavy dma load.
As a side effect, broken enhanced floppy controllers that sometimes
don't detect dma overruns/underruns will give less errors.

Reviewed by:	j@uriah.heep.sax.de (J Wunsch)
1997-09-17 20:16:17 +00:00
Joerg Wunsch
d2fb48929a Make FDC_DEBUG a supported option.
Hide the bogus FDC ``chip type'' display behind a (mostly) undocumented
option, since people started to trust the bogus claim.  Once we're going
to handle 2.88 MB controllers, we have to redo the chip detection, by
now just leave it hidden.
1997-09-16 07:45:45 +00:00
Peter Wemm
35b8b2ddab Update select -> poll in drivers. 1997-09-14 03:19:42 +00:00
Kazutaka YOKOTA
9d6218d088 Add a new compile option SC_HISTORY_SIZE to specify the history buffer
size in terms of lines (instead of bytes).  When changing video mode
in ioctl SW_XXX commands, syscons checks scp->history_size and
allocate a history buffer at least as large as the new screen size.
(This was unnecessary before, because HISTORY_SIZE was as large as 100
lines and this is bigger than the maximum screen size: 60 lines).
Similar adjustment is done in ioctl CONS_HISTORY command too.

PR: kern/4169
Reviewed by: sos
1997-09-04 23:01:06 +00:00
Steve Passe
1de995bb1f General cleanup of the sub-system locking macros.
Eliminated the RECURSIVE_MPINTRLOCK.
clock.c and microtime use clock_lock.
sio.c and cy.c use com_lock.

Suggestions by:	Bruce Evans <bde@zeta.org.au>
1997-09-01 07:45:37 +00:00
Bruce Evans
0ec3217356 Removed unused #includes. 1997-09-01 02:08:42 +00:00
Steve Passe
adc91a77c1 Created a private simple_lock to control accesses to com data structs
and hardware.
There is now another simple_lock around clock data/hardware accesses in
clock.c and microtime.s.  It is my belief that this is the only area
sio/cy might stumble into during an unblocked INTerrupt.  Thus I separated
the sio/cy code from the generic disable_intr()/enable_intr() routines.

Controlled by smptests.h: USE_COMLOCK, ON by default.
1997-08-31 03:17:18 +00:00
Steve Passe
78292efeef Another round of lock pushdown.
Add a simplelock to deal with disable_intr()/enable_intr() as used in UP kernel.
UP kernel expects that this is enough to guarantee exclusive access to
regions of code bracketed by these 2 functions.
Add a simplelock to bracket clock accesses in clock.c: clock_lock.

Help from:	Bruce Evans <bde@zeta.org.au>
1997-08-30 08:08:10 +00:00
Bruce Evans
0cb69e7a49 Removed unused misplaced definition of TIMER_FREQ.
Use less-magic numbers in the definition of HISTORY_SIZE.
1997-08-25 23:21:55 +00:00
Bruce Evans
b1037dcd53 #include <machine/limits.h> explicitly in the few places that it is required. 1997-08-21 20:33:42 +00:00
Steve Passe
f2cf811ca6 Fixed a warning about undefined isa_irq_pending(). (UP kernel only) 1997-08-21 06:16:12 +00:00
Steve Passe
b3e4e390f6 Moved the COM_LOCK and COM_UNLOCK macros to machine/param.h. 1997-08-21 05:47:25 +00:00
Steve Passe
4a73d99f7e Made PEND_INTS default.
Made NEW_STRATEGY default.
Removed misc. old cruft.

Centralized simple locks into mp_machdep.c
Centralized simple lock macros into param.h

More cleanup in the direction of making splxx()/cpl MP-safe.
1997-08-21 05:08:25 +00:00