Commit Graph

373 Commits

Author SHA1 Message Date
Poul-Henning Kamp
d6a0e38a1b Remove five now unused fields from struct cdevsw. They should never
have been there in the first place.  A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags
1999-09-25 18:24:47 +00:00
Poul-Henning Kamp
ae8e1d08d7 This patch clears the way for removing a number of tty related
fields in struct cdevsw:

        d_stop          moved to struct tty.
        d_reset         already unused.
        d_devtotty      linkage now provided by dev_t->si_tty.

These fields will be removed from struct cdevsw together with
d_params and d_maxio Real Soon Now.

The changes in this patch consist of:

        initialize dev->si_tty in *_open()
        initialize tty->t_stop
        remove devtotty functions
        rename ttpoll to ttypoll
        a few adjustments to these changes in the generic code
        a bump of __FreeBSD_version
        add a couple of FreeBSD tags
1999-09-25 16:21:39 +00:00
Kazutaka YOKOTA
8c12242c81 - Hang the scr_stat struct from dev_t.
- Remove sc_get_scr_stat().  It's not necessary anymore.
- Call ttymalloc() to allocate the struct tty for each vty, rather than
  statically declaring an array of struct tty.  We still need a statically
  allocated struct tty for the first vty which is used for the kernel
  console I/O, though.
- Likewise, call ttymalloc() for /dev/sysmouse and /dev/consolectl.
- Delete unnecessary test on the pointer struct tty *tp in some functions.
- Delete unused code in scmouse.c.

WARNING: this change requires you to recompile screen savers!
1999-09-19 08:58:53 +00:00
Kazutaka YOKOTA
d94eccc2ad - Preserve the content of the back scroll buffer when changing the
video mode.

Requested by: a lot of people.
PR: kern/13764
1999-09-19 08:07:46 +00:00
Kazutaka YOKOTA
b86daab4e5 Enable ioctls to manipulate color palette. They have been implemented,
but disabled until now...
1999-09-02 08:09:13 +00:00
Poul-Henning Kamp
c5b72c3d85 s/si_tty_tty/si_tty/g 1999-08-30 10:35:37 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Kazutaka YOKOTA
21f652c5b1 - Retain the previous vty and history buffers when setting up
the graphics mode.  This was the behavior prior to syscons.c
  rev 1.278, but broken in scvidctl.c rev 1.1.
1999-08-27 09:20:41 +00:00
Poul-Henning Kamp
9dcbe2404a Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().
1999-08-23 20:59:21 +00:00
Mike Smith
fcb893a801 Implement a new generic mechanism for attaching handler functions to
events, in order to pave the way for removing a number of the ad-hoc
implementations currently in use.

Retire the at_shutdown family of functions and replace them with
new event handler lists.

Rework kern_shutdown.c to take greater advantage of the use of event
handlers.

Reviewed by:	green
1999-08-21 06:24:40 +00:00
Julian Elischer
1744fcd082 First small steps at merging DEVFS and PHK's Dev_t stuff. 1999-08-20 20:25:00 +00:00
Bill Fumerola
aa498bf3d4 Wrap two declarations that are only used in an #ifdef in their own #ifdef.
Reviewed by:	bde
1999-08-17 22:06:17 +00:00
Dmitrij Tejblum
e9e879c34d Fix a warning on the alpha. 1999-08-13 16:17:54 +00:00
Poul-Henning Kamp
ce9edcf5b5 Merge the cons.c and cons.h to the best of my ability. alpha may or
may not compile, I can't test it.
1999-08-09 10:35:05 +00:00
Poul-Henning Kamp
57ad459b75 register tty devices so they will look right in pstat. 1999-08-08 21:35:17 +00:00
Kazutaka YOKOTA
f1235db8bd - Clear relevant variables when the keyboard is not available.
- Do not touch the `tty' struct when it's not yet available.
- Initialize correct bits in `fonts_loaded'.
1999-07-18 06:16:53 +00:00
Kazutaka YOKOTA
c4c9400b69 - Fixed memory leak in sc_alloc_history_buffer().
- Correctly observe the variable `extra_history_size' when changing
  the size of history (scroll back) buffer.
- Added sc_free_history_buffer().

Pointed out by: des
1999-07-07 13:48:50 +00:00
Peter Wemm
4180e07c29 Tidy up a few warnings when used without splash. (things defined but not
used)
1999-07-01 20:43:03 +00:00
Peter Wemm
ea24629773 Fix warnings on the Alpha. 1999-07-01 20:29:25 +00:00
Kazutaka YOKOTA
8c76a16644 Fill in tp->t_windowsize AFTER the call to (*linesw[tp->t_line].l_open)(),
rather than BEFORE the call.  Otherwise the structure will be `zero'ed out
by l_open, which actually is ttyopen(), if !TS_OPEN.

PR: kern/12420
1999-06-29 17:30:33 +00:00
Peter Wemm
81b1c87805 Fix a dev_t/udev_t issue 1999-06-26 11:00:17 +00:00
Kazutaka YOKOTA
7107ea4aa1 Fix ESC[P (delete N chars) and ESC[@ (insert N chars). These deletion
and insertion should affect the line the cursor is on only.

This change should have been committed together with syscons.c rev 1.308.
(I forgot to do so, when I committed syscons.c :-(

Pointed out by: sos
1999-06-24 13:04:33 +00:00
Kazutaka YOKOTA
d1bb8e0e13 Fix ESC[P (delete N chars) and ESC[@ (insert N chars). These deletion
and insertion should affect the line the cursor is on only.
1999-06-24 09:21:27 +00:00
Kazutaka YOKOTA
6e8394b8ba The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
  some of complicated functions.

- Many static variables are moved to the softc structure.

- Added a new key function, PREV.  When this key is pressed, the vty
  immediately before the current vty will become foreground.  Analogue
  to PREV, which is usually assigned to the PrntScrn key.
  PR: kern/10113
  Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>

- Modified the kernel console input function sccngetc() so that it
  handles function keys properly.

- Reorganized the screen update routine.

- VT switching code is reorganized.  It now should be slightly more
  robust than before.

- Added the DEVICE_RESUME function so that syscons no longer hooks the
  APM resume event directly.

- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
  SC_NO_HISTORY and SC_NO_SYSMOUSE.
  Various parts of syscons can be omitted so that the kernel size is
  reduced.

  SC_PIXEL_MODE
  Made the VESA 800x600 mode an option, rather than a standard part of
  syscons.

  SC_DISABLE_DDBKEY
  Disables the `debug' key combination.

  SC_ALT_MOUSE_IMAGE
  Inverse the character cell at the mouse cursor position in the text
  console, rather than drawing an arrow on the screen.
  Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)

  SC_DFLT_FONT
  makeoptions "SC_DFLT_FONT=_font_name_"
  Include the named font as the default font of syscons.  16-line,
  14-line and 8-line font data will be compiled in.  This option replaces
  the existing STD8X16FONT option, which loads 16-line font data only.

- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.

- The video driver provides a set of ioctl commands to manipulate the
  frame buffer.

- New kernel configuration option: VGA_WIDTH90
  Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60.  These
  modes are mot always supported by the video card.
  PR: i386/7510
  Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.

- The header file machine/console.h is reorganized; its contents is now
  split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
  (another new file).  machine/console.h is still maintained for
  compatibility reasons.

- Kernel console selection/installation routines are fixed and
  slightly rebumped so that it should now be possible to switch between
  the interanl kernel console (sc or vt) and a remote kernel console
  (sio) again, as it was in 2.x, 3.0 and 3.1.

- Screen savers and splash screen decoders
  Because of the header file reorganization described above, screen
  savers and splash screen decoders are slightly modified.  After this
  update, /sys/modules/syscons/saver.h is no longer necessary and is
  removed.
1999-06-22 14:14:06 +00:00
Jonathan Lemon
2171c52a81 Unifdef VM86
Reviewed by:	silence on on -current
1999-06-01 18:17:50 +00:00
Poul-Henning Kamp
2447bec829 Simplify cdevsw registration.
The cdevsw_add() function now finds the major number(s) in the
struct cdevsw passed to it.  cdevsw_add_generic() is no longer
needed, cdevsw_add() does the same thing.

cdevsw_add() will print an message if the d_maj field looks bogus.

Remove nblkdev and nchrdev variables.  Most places they were used
bogusly.  Instead check a dev_t for validity by seeing if devsw()
or bdevsw() returns NULL.

Move bdevsw() and devsw() functions to kern/kern_conf.c

Bump __FreeBSD_version to 400006

This commit removes:
        72 bogus makedev() calls
        26 bogus SYSINIT functions

if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.

I4b and vinum not changed.  Patches emailed to authors.  LINT
probably broken until they catch up.
1999-05-31 11:29:30 +00:00
Poul-Henning Kamp
4e2f199e0c This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw".

        Initialize the d_maj and d_bmaj fields.

        The d_reset field was not removed, although it is never used.

I used a program to do most of this, so all the files now use the
same consistent format.  Please keep it that way.

Vinum and i4b not modified, patches emailed to respective authors.
1999-05-30 16:53:49 +00:00
Bruce Evans
4a79c0bea3 Removed global variable `Crtat'. This was once (bogusly) shared with
pcvt, but it had rotted into unuse here, and of course its type had
become inconsisent with its type in pcvt.

Fixed some minor style bugs.
1999-05-12 04:45:56 +00:00
Dag-Erling Smørgrav
4a5222d798 MFS: indent-assisted style cleanup. 1999-05-10 15:25:50 +00:00
Doug Rabson
1d3710bdf3 Adjust console stuff now that makedev is no longer a macro. 1999-05-10 14:01:35 +00:00
Dag-Erling Smørgrav
7782bb379d A little closer to style(9). 1999-05-08 11:51:51 +00:00
Jordan K. Hubbard
d4fb5cb1e8 Add missing copyright. 1999-05-04 12:58:56 +00:00
Jordan K. Hubbard
cc611a43c2 Add "fire" screen saver.
Submitted by:	Brad Forschinger <retch@flag.blackened.net>
1999-05-04 12:23:32 +00:00
Poul-Henning Kamp
f711d546d2 Suser() simplification:
1:
  s/suser/suser_xxx/

2:
  Add new function: suser(struct proc *), prototyped in <sys/proc.h>.

3:
  s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/

The remaining suser_xxx() calls will be scrutinized and dealt with
later.

There may be some unneeded #include <sys/cred.h>, but they are left
as an exercise for Bruce.

More changes to the suser() API will come along with the "jail" code.
1999-04-27 11:18:52 +00:00
Peter Wemm
6182fdbda8 Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition.  eisa, isapnp and pccard* are
not yet using the new resource manager.  Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
 ATA driver to the Alpha.  Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by:	core
1999-04-16 21:22:55 +00:00
Dag-Erling Smørgrav
601752d5a7 Centralize and reorganize a few macros. 1999-04-12 13:34:58 +00:00
Kazutaka YOKOTA
e9deda23ae Keyboard driver update in preparation for the USB keyboard driver.
- Refined internal interface in keyboard drivers so that:
  1. the side effect of device probe is kept minimal,
  2. polling mode function is added,
  3. and new ioctl and configuration options are added (see below).

- Added new ioctl: KDSETREPEAT
  Set keyboard typematic rate.  There has existed an ioctl command,
  KDSETRAD, for the same purpose.  However, KDSETRAD is dependent on
  the AT keyboard.  KDSETREPEAT provides more generic interface.
  KDSETRAD will still be supported in the atkbd driver.

- Added new configuration options:
  ATKBD_DFLT_KEYMAP
  Specify a keymap to be used as the default, built-in keymap.
  (There has been undocumented options, DKKEYMAP, UKKEYMAP, GRKEYMAP,
  SWKEYMAP, RUKEYMAP, ESKEYMAP, and ISKEYMAP to set the default keymap.
  These options are now gone for good.  The new option is more general.)

  KBD_DISABLE_KEYMAP_LOADING
  Don't allow the user to change the keymap.
1999-03-10 10:36:53 +00:00
Dag-Erling Smørgrav
2da199da53 Followup to yokota's last commit:
- va_mode_flags -> va_info.vi_flags
 - scanline width may be different from screen width
1999-02-05 12:40:16 +00:00
Kazutaka YOKOTA
1c27745f73 - Don't assume the line length in the video memory is always the same as
the screen width.
- Store the current video mode information in the `video_adapter' struct.
- The size of the `v_offscreensize' field in the VESA mode information
  block is u_int16, not u_int8.
1999-02-05 11:52:13 +00:00
Poul-Henning Kamp
4e2d2aa1cd Use suser() to check for super user rather than examining cr_uid directly.
Use TTYDEF_SPEED rather than 9600 a couple of places.

Reviewed by:	bde, with a few grumbles.
1999-01-30 12:17:38 +00:00
Matthew Dillon
697457a133 Fix warnings related to -Wall -Wcast-qual 1999-01-28 17:32:05 +00:00
Matthew Dillon
0a5e03dda5 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
1999-01-28 01:59:53 +00:00
Kazutaka YOKOTA
44ad10ea41 Pull down the splash screen when someone is about to read from the
keyboard.  Do this in scread(), rather than in scopen().
1999-01-26 09:58:37 +00:00
Kazutaka YOKOTA
f359876ff1 syscons
- Bring down the splash screen when a vty is opened for the first
  time.
- Make sure the splash screen/screen saver is stopped before
  switching vtys.
- Read and save initial values in the BIOS data area early.
  VESA BIOS may change BIOS data values when switching modes.
- Fix missing '&' operator.
- Move ISA specific part of driver initialization to syscons_isa.c.

atkbd
- kbdtables.h is now in /sys/dev/kbd.

all
- Adjust for forthcoming alpha port.  Submitted by: dfr
1999-01-19 11:31:22 +00:00
Kazutaka YOKOTA
f9e730bbb3 Retrun EAGAIN if the current video mode is a graphics mode. 1999-01-17 14:25:19 +00:00
Kazutaka YOKOTA
6d479db3c3 - Examine the error code from the screen saver and act accordingly.
0	success
	EAGAIN	try again later
	other	don't call this screen saver again
- Test flags consistently to examine the status of the screen saver.
	scrn_blanked: the screen saver is running
	scp->status & SAVER_RUNNING: the saver is running in this vty
- Correctlyu preserve status flag bits in set/restore_scrn_saver_mdoe().
1999-01-17 14:23:15 +00:00
Dag-Erling Smørgrav
9402dfb01a Move the definition of set_origin from logo_saver.c to saver.h. 1999-01-16 10:20:16 +00:00
Kazutaka YOKOTA
aae6a996c3 Get conditional compilation right so that unnecessary reference
to splash-relatec call won't be made if there is no splash pseudo
device.
1999-01-13 01:14:26 +00:00
Kazutaka YOKOTA
2ad872c579 The first stage of console driver reorganization: activate new
keyboard and video card drivers.

Because of the changes, you are required to update your kernel
configuration file now!

The files in sys/dev/syscons are still i386-specific (but less so than
before), and won't compile for alpha and PC98 yet.

syscons still directly accesses the video card registers here and
there; this will be rectified in the later stages.
1999-01-11 03:18:56 +00:00
Kazutaka YOKOTA
fc847f6651 Remove a hard-coded table of kernel console I/O functions exported
from sc, vt and sio drivers.  Use instead a linker_set to collect them.

Staticize ??cngetc(), ??cnputc(), etc functions in sc and vt drivers.
We must still have siocngetc() and siocnputc() as globals because they
are directly referred to by i386-gdbstub.c :-(

Oked by: bde
1999-01-07 14:14:24 +00:00