Commit Graph

86 Commits

Author SHA1 Message Date
John Baldwin
73dbd3da73 Remove various bits of conditional Alpha code and fixup a few comments. 2006-05-12 05:04:46 +00:00
Marius Strobl
b7c96c0d0b Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_t
and do some preparations for handling 12x22 fonts (currently lots of code
implies and/or hardcodes a font width of 8 pixels). This will be required
on sparc64 which uses a default font size of 12x22 in order to add font
loading and saving support as well as to use a syscons(4)-supplied mouse
pointer image.
This API breakage is committed now so it can be MFC'ed in time for 6.0
and later on upcoming framebuffer drivers destined for use on sparc64
and which are expected to rely on using font loading internally and on
a syscons(4)-supplied mouse pointer image can be easily MFC'ed to
RELENG_6 rather than requiring a backport.

Tested on:	i386, sparc64, make universe
MFC after:	1 week
2005-09-28 14:54:07 +00:00
Craig Rodrigues
86330afe35 Prevent division by zero errors in sc_mouse_move()
by explicitly setting sc->font_width, in the same
places where sc->font_size is set, instead of
relying on the default initialized value of 0 for sc->font_width.

PR:		kern/84836
Reported by:	Andrey V. Elsukov <bu7cher at yandex dot ru>
MFC after:	2 days
2005-08-30 18:58:17 +00:00
Xin LI
f112120666 Add VESA mode support for syscons, which enables the support of 15, 16,
24, and 32 bit modes.  To use that, syscons(4) must be built with
the compile time option 'options SC_PIXEL_MODE', and VESA support (a.k.a.
vesa.ko) must be either loaded, or be compiled into the kernel.

Do not return EINVAL when the mouse state is changed to what it already is,
which seems to cause problems when you have two mice attached, and
applications are not likely obtain useful information through the EINVAL
caused by showing the mouse pointer twice.

Teach vidcontrol(8) about mode names like MODE_<NUMBER>, where <NUMBER> is
the video mode number from the vidcontrol -i mode output.  Also, revert the
video mode if something fails.

Obtained from:	DragonFlyBSD
Discussed at:	current@ with patch attached [1]
PR:		kern/71142 [2]
Submitted by:	Xuefeng DENG <dsnofe at msn com> [1],
		Cyrille Lefevre <cyrille dot lefevre at laposte dot net> [2]
2005-05-29 08:43:44 +00:00
Marius Strobl
fc0e49bd50 On sparc64 use 'syscons' rather than 'sc' for SC_DRIVER_NAME so
syscons(4) and its pseudo-devices don't get confused (including by
other device drivers) with the system controller devices which are
also termed 'sc' in the OFW tree (and which we probably want to
interface with hwpmc(4) one day).
2005-05-21 20:29:58 +00:00
Yoshihiro Takahashi
d1725ef7ff Change a directory layout for pc98.
- Move MD files into <arch>/<arch>.
  - Move bus dependent files into <arch>/<bus>.
Rename some files to more suitable names.

Repo-copied by:	peter
Discussed with:	imp
2005-05-10 12:02:18 +00:00
Alexander Kabaev
1f74490224 Avoid casts as lvalues. 2004-07-28 06:30:43 +00:00
Poul-Henning Kamp
3e019deaed Do a pass over all modules in the kernel and make them return EOPNOTSUPP
for unknown events.

A number of modules return EINVAL in this instance, and I have left
those alone for now and instead taught MOD_QUIESCE to accept this
as "didn't do anything".
2004-07-15 08:26:07 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Jake Burkholder
73b0c90728 - Add a font width field to struct scr_stat. Use this instead of '8'.
- Use the values in the video info for the font size and width instead
  of second guessing.
2003-08-24 04:04:44 +00:00
Jake Burkholder
8b9698b711 Add sparc64 ifdefs. 2003-08-24 00:44:00 +00:00
Dima Dorfman
ce907d4246 Add a VT_LOCKSWITCH ioctl that disallows vty switching. Something
like this can be emulated by VT_SETMODEing to VT_PROCESS and never
releasing the vty, but this has a number of problems, most notably
that a process must stay resident for the lock to be in effect.

Reviewed by:	roam, sheldonh
2002-07-10 03:29:38 +00:00
David E. O'Brien
0301e9c83b Turn on TGA support.
Submitted by:	Andrew M. Miklic <AndrwMklc@cs.com>
2002-04-13 22:34:16 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Peter Wemm
22c1cd205e Fix some malformed macro concatenation that gcc-3 has objections about. 2001-09-10 04:20:34 +00:00
Kazutaka YOKOTA
4866e2769a Refine cursor type/shape control escape sequences and
ioctls. We can now add ve, vi and vs capabilities to
cons25 in termcap.

Discussed with and tested by: ache
2001-08-02 08:30:40 +00:00
Kazutaka YOKOTA
44b37d9627 Fix dependencies between kernel options:
- When both SC_PIXEL_MODE and SC_NO_FONT_LOADING are defined,
  quietly drop SC_NO_FONT_LOADING, because the pixel(raster)
  console requires font.
- When SC_NO_FONT_LOADING is defined, force SC_ALT_MOUSE_IMAGE.
  Without font, the arrow-shaped mouse cursor cannot be drawn.
- Fiddle and simplify some internal macros.
MFC after:	2 weeks
2001-07-10 14:13:34 +00:00
Kazutaka YOKOTA
fa783074ac Remove the resume method. It is not necessary any more, because
keyboard drivers have it now...
MFC after:	4 weeks
2001-06-30 10:15:13 +00:00
Kazutaka YOKOTA
2317b70167 Don't free buffers we didn't allocate.
MFC after:	2 weeks
2001-06-29 08:24:56 +00:00
Peter Wemm
f41325db5f With this commit, I hereby pronounce gensetdefs past its use-by date.
Replace the a.out emulation of 'struct linker_set' with something
a little more flexible.  <sys/linker_set.h> now provides macros for
accessing elements and completely hides the implementation.

The linker_set.h macros have been on the back burner in various
forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()),
John Polstra (ELF clue) and myself (cleaned up API and the conversion
of the rest of the kernel to use it).

The macros declare a strongly typed set.  They return elements with the
type that you declare the set with, rather than a generic void *.

For ELF, we use the magic ld symbols (__start_<setname> and
__stop_<setname>).  Thanks to Richard Henderson <rth@redhat.com> for the
trick about how to force ld to provide them for kld's.

For a.out, we use the old linker_set struct.

NOTE: the item lists are no longer null terminated.  This is why
the code impact is high in certain areas.

The runtime linker has a new method to find the linker set
boundaries depending on which backend format is in use.

linker sets are still module/kld unfriendly and should never be used
for anything that may be modular one day.

Reviewed by:	eivind
2001-06-13 10:58:39 +00:00
Poul-Henning Kamp
266aa94283 Make the beep duration independent of HZ.
PR:		25201
Submitted by:	Akio Morita amorita@meadow.scphys.kyoto-u.ac.jp
MFC after:	1 week
2001-05-28 21:11:38 +00:00
Andrey A. Chernov
4629b5e0fb Implement keyboard paste
PR:		25499
Submitted by:	Gaspar Chilingarov <nm@web.am>
2001-03-11 22:51:05 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
Kazutaka YOKOTA
c2c86c2b88 Unbreak LINT. 2000-04-03 09:24:16 +00:00
Kazutaka YOKOTA
091323598f - Fix SC_ALT_MOUSE_IMAGE; don't blink the mouse cursor.
- Fix non-destructive, underline text cursor.
2000-03-31 16:05:46 +00:00
Kazutaka YOKOTA
e17b116645 Unconditionally define sc_paste(). 2000-01-20 13:23:03 +00:00
Kazutaka YOKOTA
acdf858c9b Fix wrong usage of FONT_NONE. It was not meant to be set in
scp->font_size in the first place.  It is redundant now and is
removed.

Found by: bde
2000-01-20 13:21:47 +00:00
Kazutaka YOKOTA
2b944ee2b9 This is the 3rd stage of syscons code reorganization.
- Split terminal emulation code from the main part of the driver so
that we can have alternative terminal emulator modules if we like in
the future.  (We are not quite there yet, though.)

- Put sysmouse related code in a separate file, thus, simplifying the
main part of the driver.

As some files are added to the source tree, you need to run config(8)
before you compile a new kernel next time.

You shouldn't see any functional change by this commit; this is only
internal code reorganization.
2000-01-15 15:25:43 +00:00
Kazutaka YOKOTA
e2f29c6e43 Make the mouse cursor char code configurable via the CONS_MOUSECTL
ioctl.

By popular demand.
2000-01-12 12:30:33 +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
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +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
Julian Elischer
1744fcd082 First small steps at merging DEVFS and PHK's Dev_t stuff. 1999-08-20 20:25:00 +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
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
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
Dag-Erling Smørgrav
601752d5a7 Centralize and reorganize a few macros. 1999-04-12 13:34:58 +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
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
def802441f Yet another round of fixes for the VESA support code.
- Express various sizes in bytes, rather than Kbytes, in the video
  mode and adapter information structures.
- Fill 0 in the linear buffer size field if the linear frame buffer
  is not available.
- Remove SW_VESA_USER ioctl. It is still experimetal and was not meant
  to be released.
- Fix missing cast operator.
- Correctly handle pointers returned by the VESA BIOS. The pointers
  may point to the area either in the BIOS ROM or in the buffer supplied
  by the caller.
- Set the destructive cursor at the right moment.
1998-10-01 11:39:18 +00:00
Andrey A. Chernov
d4b2d02fc1 Fix destructive cursor shape after text mode switch.
This is only for standard modes, I don't check vesa modes yet.
1998-09-29 02:00:57 +00:00
Kazutaka YOKOTA
a8dedb0cfb - Use `u_long cmd' ioctl arg.
- Fix some external function declaration.
Submitted by: bde
1998-09-26 03:34:10 +00:00
Kazutaka YOKOTA
95bafc8f5a Fix and update for VESA BIOS support in syscons.
- Handle pixel (raster text) mode properly.
   - Clear screen and paint border right.
   - Paint text attribute (colors).
   - Fix off-by-one errors.
   - Add some sanity checks.
- Fix some function prototypes.
- Add some comment lines.
- Define generic text mode numbers so that the user can just give
  "80x25", "80x60", "132x25"..., rather than "VGA_xxx", to `vidcontrol'
  to change the current video mode.  `vidoio.c' and `vesa.c' will map
  these numbers to real video mode numbers appropriate and available
  with the given video hardware.  I believe this will be useful to make
  syscons more portable across archtectures.
1998-09-23 09:59:00 +00:00
Søren Schmidt
a8445737e7 Add VESA support to syscons.
Kazu writes:

The VESA support code requires vm86 support. Make sure your kernel
configuration file has the following line.
        options "VM86"
If you want to statically link the VESA support code to the kernel,
add the following option to the kernel configuration file.
        options "VESA"

The vidcontrol command now accepts the following video mode names:
VESA_132x25, VESA_132x43, VESA_132x50, VESA_132x60, VESA_800x600

The VESA_800x600 mode is a raster display mode. The 80x25 text will
be displayed on the 800x600 screen. Useful for some laptop computers.

vidcontrol accepts the new `-i <info>' option, where <info> must be
either `adapter' or `mode'.  When the `-i adapter' option is given,
vidcontrol will print basic information (not much) on the video
adapter. When the `-i mode' option is specified, vidcontrol will
list video modes which are actually supported by the video adapter.

Submitted by:   Kazutaka YOKOTA yokota@FreeBSD.ORG
1998-09-15 18:16:39 +00:00
Kazutaka YOKOTA
88a5f0cca7 1. Reorganized screen saver related code so that both the LKM screen
saver and splash screen can all work properly with syscons.  Note that
the splash screen option (SC_SPLASH_SCREEN) does not work yet, as it
requires additional code from msmith.

- Reorganized the splash screen code to match the latest development
  in this area.
- Delay screen switch in `switch_scr()' until the screen saver is
  stopped, if one is running,
- Start the screen saver immediately, if any, when the `saver' key is
  pressed. (There will be another commit for `kbdcontrol' to support
  this keyword in the keymap file.)
- Do not always stop the screen saver when mouse-related ioctls
  are called.  Stop it only if the mouse is moved or buttons are
  clicked; don't stop it if any other mouse ioctls are called.

2. Added provision to write userland screen savers.  (Contact me if you
are interested in writing one.)

- Added CONS_IDLE, CONS_SAVERMODE, and CONS_SAVERSTART ioctls to
  support userland screen savers.

3. Some code clean-ups.
1998-08-03 11:30:45 +00:00
Kazutaka YOKOTA
30f3a4598b - Add new bell types: "quiet.normal" and "quiet.visual".
When bell is of "quiet" types, the console won't ring (or flush)
  if the ringing process is in a background vty.
  PR: i386/2853

- Modify the escape sequence 'ESC[=%d;%dB' so that bell pitch and
  duration are set in hertz and msecs by kbdcontrol(1).
  There will be a corresponding kbdcontrol patch.
  PR: bin/6037
  Submitted by: Kouichi Hirabayashi (kh@eve.mogami-wire.co.jp)
1998-08-03 09:09:35 +00:00
Poul-Henning Kamp
8a69c85a7e Add support for VESA mode 0x102 (800x600x4) in syscons. You can activate
this using option "-b" to the boot blocks.  It is smartest to compile
a font into your kernel (See LINT), but not mandatory, but apart from
the cursor you will see nothing on the screen until you load a font.

This mode allows XF86_VGA16 to run in 800x600 mode on otherwise unsupported
graphics hardware.

A number of buglets in the cursor handling in syscons may become
visible this way.
1998-02-12 22:05:08 +00:00