2004-07-30 18:00:18 +04:00
|
|
|
.\" $NetBSD: wsdisplay.4,v 1.25 2004/07/30 14:00:18 jmmv Exp $
|
2003-02-17 23:07:06 +03:00
|
|
|
.\"
|
2003-02-19 03:36:24 +03:00
|
|
|
.\" Copyright (c) 1999 Matthias Drochner.
|
|
|
|
.\" Copyright (c) 2002 Ben Harris.
|
2004-07-30 18:00:18 +04:00
|
|
|
.\" Copyright (c) 2004 Julio M. Merino Vidal.
|
2003-02-19 03:36:24 +03:00
|
|
|
.\" All rights reserved.
|
2003-02-17 23:07:06 +03:00
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
2004-07-30 18:00:18 +04:00
|
|
|
.Dd July 30, 2004
|
1999-03-22 22:15:01 +03:00
|
|
|
.Os
|
|
|
|
.Dt WSDISPLAY 4
|
|
|
|
.Sh NAME
|
|
|
|
.Nm wsdisplay
|
|
|
|
.Nd generic display device support in wscons
|
|
|
|
.Sh SYNOPSIS
|
2003-06-27 22:54:09 +04:00
|
|
|
.Cd "wsdisplay* at ega? console ?"
|
2000-06-12 15:04:15 +04:00
|
|
|
(EGA display on ISA)
|
2003-06-27 22:54:09 +04:00
|
|
|
.Cd "wsdisplay* at vga? console ?"
|
1999-03-22 22:15:01 +03:00
|
|
|
(VGA display on ISA or PCI)
|
2003-06-27 22:54:09 +04:00
|
|
|
.Cd "wsdisplay* at pcdisplay? console ?"
|
1999-03-22 22:15:01 +03:00
|
|
|
(generic PC (ISA) display)
|
2003-06-27 22:54:09 +04:00
|
|
|
.Cd "wsdisplay* at tga? console ?"
|
1999-03-22 22:15:01 +03:00
|
|
|
(DEC TGA display, alpha only)
|
2003-06-27 22:54:09 +04:00
|
|
|
.Cd "wsdisplay* at pfb? console ?"
|
1999-03-22 22:15:01 +03:00
|
|
|
(PCI framebuffer, bebox only)
|
2003-06-27 22:54:09 +04:00
|
|
|
.Cd "wsdisplay0 at ofb? console ?"
|
1999-03-22 22:15:01 +03:00
|
|
|
(Open Firmware framebuffer, macppc only)
|
2003-06-27 22:54:09 +04:00
|
|
|
.Cd "wsdisplay* at nextdisplay? console ?"
|
1999-03-22 22:15:01 +03:00
|
|
|
(NeXT display)
|
2003-06-27 22:54:09 +04:00
|
|
|
.Cd "wsdisplay0 at smg0"
|
1999-03-22 22:15:01 +03:00
|
|
|
(VAXstation small monochrome display)
|
2003-06-27 22:54:09 +04:00
|
|
|
.Cd "wsdisplay* at ... kbdmux N"
|
2004-07-30 18:00:18 +04:00
|
|
|
.Cd options WSDISPLAY_BORDER_COLOR=WSCOL_XXX
|
2002-08-20 20:56:05 +04:00
|
|
|
.Cd options WSDISPLAY_CHARFUNCS
|
2004-07-30 18:00:18 +04:00
|
|
|
.Cd options WSDISPLAY_CUSTOM_BORDER
|
|
|
|
.Cd options WSDISPLAY_CUSTOM_OUTPUT
|
|
|
|
.Cd options WSDISPLAY_DEFAULTSCREENS=N
|
1999-03-22 22:15:01 +03:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver is an abstraction layer for display devices within the
|
|
|
|
.Xr wscons 4
|
2004-01-20 21:31:18 +03:00
|
|
|
framework.
|
|
|
|
It attaches to the hardware specific display device driver and makes it
|
|
|
|
available as a text terminal or graphics interface.
|
1999-03-22 22:15:01 +03:00
|
|
|
.Pp
|
|
|
|
A display device can have the ability to display characters on it
|
2004-01-20 21:31:18 +03:00
|
|
|
(without the help of an X server), either directly by hardware or through
|
1999-03-22 22:15:01 +03:00
|
|
|
software putting pixel data into the display memory.
|
|
|
|
Such displays are called
|
|
|
|
.Dq emulating ,
|
|
|
|
the
|
|
|
|
.Nm
|
2004-01-20 21:31:18 +03:00
|
|
|
driver will connect a terminal emulation module and provide a tty-like
|
|
|
|
software interface.
|
|
|
|
In contrary, non-emulating displays can only be used by special programs
|
|
|
|
like X servers.
|
1999-03-22 22:15:01 +03:00
|
|
|
.Pp
|
1999-04-08 20:29:56 +04:00
|
|
|
The
|
|
|
|
.Em console
|
2004-01-20 21:31:18 +03:00
|
|
|
locator in the configuration line refers to the device's use as the output
|
|
|
|
part of the operating system console.
|
|
|
|
A device specification containing a positive value here will only match if
|
|
|
|
the device is in use as the system console.
|
|
|
|
(The console device selection in early system startup is not influenced.)
|
|
|
|
This way, the console device can be connected to a known wsdisplay device
|
|
|
|
instance.
|
|
|
|
(Naturally, only
|
1999-04-08 20:29:56 +04:00
|
|
|
.Dq emulating
|
|
|
|
display devices are usable as console.)
|
|
|
|
.Pp
|
2001-10-13 21:15:33 +04:00
|
|
|
The
|
|
|
|
.Em kbdmux
|
|
|
|
locator in the configuration line refers to the
|
|
|
|
.Xr wsmux 4
|
2004-01-20 21:31:18 +03:00
|
|
|
that will be used to get keyboard events.
|
|
|
|
If this locator is -1 no mux will be used.
|
2001-10-13 21:15:33 +04:00
|
|
|
.Pp
|
2000-03-20 14:51:59 +03:00
|
|
|
The logical unit of an independent contents displayed on a display
|
1999-03-22 22:15:01 +03:00
|
|
|
(sometimes referred to as
|
|
|
|
.Dq virtual terminal
|
|
|
|
) is called a
|
|
|
|
.Dq screen
|
|
|
|
here. If the underlying device driver supports it, multiple screens can
|
2004-01-20 21:31:18 +03:00
|
|
|
be used on one display.
|
|
|
|
(As of this writing, only the
|
1999-03-22 22:15:01 +03:00
|
|
|
.Xr vga 4
|
|
|
|
and the
|
|
|
|
.Tn VAX
|
|
|
|
.Dq smg
|
|
|
|
display drivers provide this ability.)
|
|
|
|
Screens have different minor device numbers and separate tty instances.
|
2001-06-10 19:43:56 +04:00
|
|
|
One screen possesses the
|
1999-03-22 22:15:01 +03:00
|
|
|
.Dq focus ,
|
2001-11-30 02:19:52 +03:00
|
|
|
this means it is visible and its tty device will get
|
|
|
|
the keyboard input. (In some cases \- if no screen is set up or if a screen
|
|
|
|
was just deleted \- it is possible that no focus is present at all.)
|
1999-03-22 22:15:01 +03:00
|
|
|
The focus can be switched by either special keyboard input (typically
|
2001-11-30 02:19:52 +03:00
|
|
|
.Tn CTRL-ALT-F Ns Ar n )
|
|
|
|
or an ioctl command issued by a user program.
|
|
|
|
Screens are created and deleted through the
|
1999-03-22 22:15:01 +03:00
|
|
|
.Pa /dev/ttyEcfg
|
2001-06-10 19:43:56 +04:00
|
|
|
control device (preferably using the
|
1999-03-22 22:15:01 +03:00
|
|
|
.Xr wsconscfg 8
|
|
|
|
utility). Alternatively, the compile-time option
|
2001-11-30 02:19:52 +03:00
|
|
|
.Dv WSDISPLAY_DEFAULTSCREENS Ns = Ns Ar n
|
|
|
|
will also create (at autoconfiguration time)
|
|
|
|
.Ar n
|
|
|
|
initial screens of the display driver's default type with
|
|
|
|
the system's default terminal emulator.
|
2004-07-30 18:00:18 +04:00
|
|
|
.Ss Kernel options
|
|
|
|
The following kernel options are available to configure the behavior of the
|
|
|
|
.Nm
|
|
|
|
driver:
|
|
|
|
.Bl -tag -width xxxxxxxx
|
|
|
|
.It Cd options WSDISPLAY_BORDER_COLOR=WSCOL_XXX
|
|
|
|
Sets the border color at boot time.
|
|
|
|
Possible values are defined in
|
|
|
|
.Pa src/sys/dev/wscons/wsdisplayvar.h .
|
|
|
|
Defaults to
|
|
|
|
.Sq WSCOL_BLACK .
|
|
|
|
.It Cd options WSDISPLAY_CHARFUNCS
|
|
|
|
Enables the
|
|
|
|
.Dv WSDISPLAYIO_GETWSCHAR
|
|
|
|
and
|
|
|
|
.Dv WSDISPLAYIO_PUTWSCHAR
|
|
|
|
ioctls.
|
|
|
|
These are mainly used by the
|
|
|
|
.Sq selection
|
|
|
|
mode of
|
|
|
|
.Xr wsmoused 8 .
|
|
|
|
.It Cd options WSDISPLAY_CUSTOM_BORDER
|
|
|
|
Enables the
|
|
|
|
.Dv WSDISPLAYIO_GBORDER
|
|
|
|
and
|
|
|
|
.Dv WSDISPLAYIO_SBORDER
|
|
|
|
ioctls, which allow the customization of the border color from userland
|
|
|
|
(after boot).
|
|
|
|
See
|
|
|
|
.Xr wsconsctl 8 .
|
|
|
|
.It Cd options WSDISPLAY_CUSTOM_OUTPUT
|
|
|
|
Enables the
|
|
|
|
.Dv WSDISPLAYIO_GMSGATTRS
|
|
|
|
and
|
|
|
|
.Dv WSDISPLAYIO_SMSGATTRS
|
|
|
|
ioctls, which allow the customization of the console output and kernel
|
|
|
|
messages from userland (after boot).
|
|
|
|
See
|
|
|
|
.Xr wsconsctl 8 .
|
|
|
|
.It Cd options WSDISPLAY_DEFAULTSCREENS=N
|
|
|
|
Sets the number of virtual screens to allocate at boot time.
|
|
|
|
Useful for small root filesystems where the
|
|
|
|
.Xr wsconscfg 8
|
|
|
|
utility is not wanted.
|
|
|
|
.El
|
|
|
|
.Ss Ioctls
|
2002-06-22 23:08:32 +04:00
|
|
|
The following
|
|
|
|
.Xr ioctl 2
|
|
|
|
calls are provided by the
|
|
|
|
.Nm
|
2004-01-20 21:31:18 +03:00
|
|
|
driver or by devices which use it.
|
|
|
|
Their definitions are found in
|
2002-06-22 23:08:32 +04:00
|
|
|
.Aq Pa dev/wscons/wsconsio.h .
|
|
|
|
.Bl -tag -width Dv
|
|
|
|
.It Dv WSDISPLAYIO_GTYPE Pq Li int
|
2004-01-20 21:31:18 +03:00
|
|
|
Retrieve the type of the display.
|
|
|
|
The list of types is in
|
2002-06-22 23:08:32 +04:00
|
|
|
.Aq Pa dev/wscons/wsconsio.h .
|
|
|
|
.It Dv WSDISPLAYIO_GINFO Pq Li "struct wsdisplay_fbinfo"
|
|
|
|
Retrieve basic information about a framebuffer display.
|
|
|
|
The returned structure is as follows:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
struct wsdisplay_fbinfo {
|
|
|
|
u_int height;
|
|
|
|
u_int width;
|
|
|
|
u_int depth;
|
|
|
|
u_int cmsize;
|
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Va height
|
|
|
|
and
|
|
|
|
.Va width
|
2004-01-20 21:31:18 +03:00
|
|
|
members are counted in pixels.
|
|
|
|
The
|
2002-06-22 23:08:32 +04:00
|
|
|
.Va depth
|
|
|
|
member indicates the number of bits per pixel, and
|
|
|
|
.Va cmsize
|
|
|
|
indicates the number of color map entries accessible through
|
|
|
|
.Dv WSDISPLAYIO_GETCMAP
|
|
|
|
and
|
|
|
|
.Dv WSDISPLAYIO_PUTCMAP .
|
|
|
|
This call is likely to be unavailable on text-only displays.
|
|
|
|
.It Dv WSDISPLAYIO_GETCMAP Pq Li "struct wsdisplay_cmap"
|
2004-01-20 21:31:18 +03:00
|
|
|
Retrieve the current color map from the display.
|
|
|
|
This call needs the
|
2002-06-22 23:08:32 +04:00
|
|
|
following structure set up beforehand:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
struct wsdisplay_cmap {
|
|
|
|
u_int index;
|
|
|
|
u_int count;
|
|
|
|
u_char *red;
|
|
|
|
u_char *green;
|
|
|
|
u_char *blue;
|
2002-06-23 00:16:31 +04:00
|
|
|
};
|
2002-06-22 23:08:32 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Va index
|
|
|
|
and
|
|
|
|
.Va count
|
2004-01-20 21:31:18 +03:00
|
|
|
members specify the range of color map entries to retrieve.
|
|
|
|
The
|
2002-06-23 00:16:31 +04:00
|
|
|
.Va red ,
|
|
|
|
.Va green ,
|
2002-06-22 23:08:32 +04:00
|
|
|
and
|
|
|
|
.Va blue
|
|
|
|
members should each point to an array of
|
|
|
|
.Va count
|
|
|
|
.Li u_char Ns s .
|
|
|
|
On return, these will be filled in with the appropriate entries from the
|
2004-01-20 21:31:18 +03:00
|
|
|
color map.
|
|
|
|
On all displays that support this call, values range from 0 for minimum
|
|
|
|
intensity to 255 for maximum intensity, even if the display does not use
|
|
|
|
eight bits internally to represent intensity.
|
2002-06-22 23:08:32 +04:00
|
|
|
.It Dv WSDISPLAYIO_PUTCMAP Pq Li "struct wsdisplay_cmap"
|
2004-01-20 21:31:18 +03:00
|
|
|
Change the display's color map.
|
|
|
|
The argument structure is the same as for
|
2002-06-22 23:08:32 +04:00
|
|
|
.Dv WSDISPLAYIO_GETCMAP ,
|
|
|
|
but
|
2002-06-23 00:16:31 +04:00
|
|
|
.Va red ,
|
|
|
|
.Va green ,
|
2002-06-22 23:08:32 +04:00
|
|
|
and
|
|
|
|
.Va blue
|
|
|
|
are taken as pointers to the values to use to set the color map.
|
|
|
|
This call is not available on displays with fixed color maps.
|
|
|
|
.It Dv WSDISPLAYIO_GVIDEO Pq Li int
|
2004-01-20 21:31:18 +03:00
|
|
|
Get the current state of the display's video output.
|
|
|
|
Possible values are:
|
2002-06-22 23:08:32 +04:00
|
|
|
.Bl -tag -width Dv
|
|
|
|
.It Dv WSDISPLAYIO_VIDEO_OFF
|
|
|
|
The display is blanked.
|
|
|
|
.It Dv WSDISPLAYIO_VIDEO_ON
|
|
|
|
The display is enabled.
|
|
|
|
.El
|
|
|
|
.It Dv WSDISPLAYIO_SVIDEO Pq Li int
|
2004-01-20 21:31:18 +03:00
|
|
|
Set the state of the display's video output.
|
|
|
|
See
|
2002-06-22 23:08:32 +04:00
|
|
|
.Dv WSDISPLAYIO_GVIDEO
|
|
|
|
above for possible values.
|
|
|
|
.It Dv WSDISPLAYIO_GCURPOS Pq Li "struct wsdisplay_curpos"
|
2004-01-20 21:31:18 +03:00
|
|
|
Retrieve the current position of the hardware cursor.
|
|
|
|
The returned structure
|
2002-06-22 23:08:32 +04:00
|
|
|
is as follows:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
struct wsdisplay_curpos {
|
|
|
|
u_int x, y;
|
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Va x
|
|
|
|
and
|
|
|
|
.Va y
|
|
|
|
members count the number of pixels right and down, respectively, from
|
|
|
|
the top-left corner of the display to the hot spot of the cursor.
|
|
|
|
This call is not available on displays without a hardware cursor.
|
|
|
|
.It Dv WSDISPLAYOP_SCURPOS Pq Li "struct wsdisplay_curpos"
|
|
|
|
Set the current cursor position. The argument structure, and its semantics,
|
|
|
|
are the same as for
|
|
|
|
.Dv WSDISPLAYIO_GCURPOS .
|
2004-01-20 21:31:18 +03:00
|
|
|
This call is not available on displays without a hardware cursor.
|
2002-06-22 23:08:32 +04:00
|
|
|
.It Dv WSDISPLAYIO_GCURMAX Pq Li "struct wsdisplay_curpos"
|
2004-01-20 21:31:18 +03:00
|
|
|
Retrieve the maximum size of cursor supported by the display.
|
|
|
|
The
|
2002-06-22 23:08:32 +04:00
|
|
|
.Va x
|
|
|
|
and
|
|
|
|
.Va y
|
|
|
|
members of the returned structure indicate the maximum number of pixel rows
|
|
|
|
and columns, respectively, in a hardware cursor on this display.
|
|
|
|
This call is not available on displays without a hardware cursor.
|
|
|
|
.It Dv WSDISPLAYIO_GCURSOR Pq Li "struct wsdisplay_cursor"
|
2004-01-20 21:31:18 +03:00
|
|
|
Retrieve some or all of the hardware cursor's attributes.
|
|
|
|
The argument structure is as follows:
|
2002-06-22 23:08:32 +04:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
struct wsdisplay_cursor {
|
|
|
|
u_int which;
|
|
|
|
u_int enable;
|
|
|
|
struct wsdisplay_curpos pos;
|
|
|
|
struct wsdisplay_curpos hot;
|
|
|
|
struct wsdisplay_cmap cmap;
|
|
|
|
struct wsdisplay_curpos size;
|
|
|
|
u_char *image;
|
|
|
|
u_char *mask;
|
|
|
|
};
|
|
|
|
.Pp
|
|
|
|
.Ed
|
|
|
|
The
|
|
|
|
.Va which
|
|
|
|
member indicates which of the values the application requires to be returned.
|
|
|
|
It should contain the logical OR of the following flags:
|
|
|
|
.Bl -tag -width Dv
|
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOCUR
|
|
|
|
Get
|
|
|
|
.Va enable ,
|
|
|
|
which indicates whether the cursor is currently displayed (non-zero) or
|
|
|
|
not (zero).
|
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOPOS
|
|
|
|
Get
|
|
|
|
.Va pos ,
|
|
|
|
which indicates the current position of the cursor on the display, as
|
|
|
|
would be returned by
|
|
|
|
.Dv WSDISPLAYIO_GCURPOS .
|
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOHOT
|
|
|
|
Get
|
|
|
|
.Va hot ,
|
|
|
|
which indicates the location of the
|
|
|
|
.Dq hot spot
|
2004-01-20 21:31:18 +03:00
|
|
|
within the cursor.
|
|
|
|
This is the point on the cursor whose position on the display is treated
|
|
|
|
as being the position of the cursor by other calls.
|
2002-06-22 23:08:32 +04:00
|
|
|
Its location is counted in pixels from the top-right corner of the cursor.
|
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOCMAP
|
|
|
|
Get
|
|
|
|
.Va cmap ,
|
|
|
|
which indicates the current cursor color map.
|
|
|
|
Unlike in a call to
|
|
|
|
.Dv WSDISPLAYIO_GETCMAP ,
|
|
|
|
.Va cmap
|
|
|
|
here need not have its
|
|
|
|
.Va index
|
|
|
|
and
|
|
|
|
.Va count
|
2004-01-20 21:31:18 +03:00
|
|
|
members initialized.
|
|
|
|
They will be set to 0 and 2 respectively by the call.
|
2002-06-22 23:08:32 +04:00
|
|
|
This means that
|
|
|
|
.Va cmap . Ns Va red ,
|
|
|
|
.Va cmap . Ns Va green ,
|
|
|
|
and
|
|
|
|
.Va cmap . Ns Va blue
|
|
|
|
must each point to at least enough space to hold two
|
2002-06-23 00:16:31 +04:00
|
|
|
.Li u_char Ns s .
|
2002-06-22 23:08:32 +04:00
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOSHAPE
|
|
|
|
Get
|
|
|
|
.Va size , image ,
|
|
|
|
and
|
|
|
|
.Va mask .
|
|
|
|
These are, respectively, the dimensions of the cursor in pixels, the
|
|
|
|
bitmap of set pixels in the cursor and the bitmap of opaque pixels in
|
2004-01-20 21:31:18 +03:00
|
|
|
the cursor.
|
|
|
|
The format in which these bitmaps are returned, and hence the amount of
|
|
|
|
space that must be provided by the application, are device-dependent.
|
2002-06-22 23:08:32 +04:00
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOALL
|
|
|
|
Get all of the above.
|
|
|
|
.El
|
|
|
|
.Pp
|
2002-06-23 00:16:31 +04:00
|
|
|
The device may elect to return information that was not requested by the user,
|
2002-06-22 23:08:32 +04:00
|
|
|
so those elements of
|
|
|
|
.Li "struct wsdisplay_cursor"
|
2002-09-04 04:47:12 +04:00
|
|
|
which are pointers should be initialized to
|
2002-06-22 23:08:32 +04:00
|
|
|
.Dv NULL
|
|
|
|
if not otherwise used.
|
|
|
|
This call is not available on displays without a hardware cursor.
|
|
|
|
.It Dv WSDISPLAYIO_SCURSOR Pq Li "struct wsdisplay_cursor"
|
2004-01-20 21:31:18 +03:00
|
|
|
Set some or all of the hardware cursor's attributes.
|
|
|
|
The argument structure is the same as for
|
2002-06-22 23:08:32 +04:00
|
|
|
.Dv WSDISPLAYIO_GCURSOR .
|
|
|
|
The
|
|
|
|
.Va which
|
|
|
|
member specifies which attributes of the cursor are to be changed.
|
|
|
|
It should contain the logical OR of the following flags:
|
|
|
|
.Bl -tag -width Dv
|
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOCUR
|
|
|
|
If
|
|
|
|
.Va enable
|
2004-01-20 21:31:18 +03:00
|
|
|
is zero, hide the cursor.
|
|
|
|
Otherwise, display it.
|
2002-06-22 23:08:32 +04:00
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOPOS
|
|
|
|
Set the cursor's position on the display to
|
|
|
|
.Va pos ,
|
|
|
|
the same as
|
|
|
|
.Dv WSDISPLAYIO_SCURPOS .
|
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOHOT
|
|
|
|
Set the
|
|
|
|
.Dq hot spot
|
|
|
|
of the cursor, as defined above, to
|
|
|
|
.Va hot .
|
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOCMAP
|
|
|
|
Set some or all of the cursor color map based on
|
|
|
|
.Va cmap .
|
|
|
|
The
|
|
|
|
.Va index
|
|
|
|
and
|
|
|
|
.Va count
|
|
|
|
elements of
|
|
|
|
.Va cmap
|
|
|
|
indicate which color map entries to set, and the entries themselves come from
|
|
|
|
.Va cmap . Ns Va red ,
|
|
|
|
.Va cmap . Ns Va green ,
|
|
|
|
and
|
|
|
|
.Va cmap . Ns Va blue .
|
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOSHAPE
|
|
|
|
Set the cursor shape from
|
|
|
|
.Va size , image ,
|
|
|
|
and
|
|
|
|
.Va mask .
|
|
|
|
See above for their meanings.
|
|
|
|
.It Dv WSDISPLAYIO_CURSOR_DOALL
|
|
|
|
Do all of the above.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
This call is not available on displays without a hardware cursor.
|
|
|
|
.It Dv WSDISPLAYIO_GMODE Pq Li u_int
|
2004-01-20 21:31:18 +03:00
|
|
|
Get the current mode of the display.
|
|
|
|
Possible results include:
|
2002-06-22 23:08:32 +04:00
|
|
|
.Bl -tag -width Dv
|
|
|
|
.It Dv WSDISPLAYIO_MODE_EMUL
|
|
|
|
The display is in emulating (text) mode.
|
|
|
|
.It Dv WSDISPLAYIO_MODE_MAPPED
|
|
|
|
The display is in mapped (graphics) mode.
|
2004-07-21 00:28:20 +04:00
|
|
|
.It Dv WSDISPLAYIO_MODE_DUMBFB
|
|
|
|
The display is in mapped (frame buffer) mode.
|
2002-06-22 23:08:32 +04:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
.It Dv WSDISPLAYIO_SMODE Pq Li u_int
|
2004-01-20 21:31:18 +03:00
|
|
|
Set the current mode of the display.
|
|
|
|
For possible arguments, see
|
2002-06-22 23:08:32 +04:00
|
|
|
.Dv WSDISPLAYIO_GMODE .
|
2004-07-21 00:28:20 +04:00
|
|
|
.Pp
|
|
|
|
.It Dv WSDISPLAYIO_LINEBYTES Pq Li u_int
|
2004-07-21 04:14:28 +04:00
|
|
|
Get the number of bytes per row, which may be the same as the number of pixels.
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
.It Dv WSDISPLAYIO_GMSGATTRS Pq Li struct wsdisplay_msgattrs
|
|
|
|
Get the attributes (colors and flags) used to print console messages, including
|
|
|
|
separate fields for default output and kernel output.
|
|
|
|
The returned structure is as follows:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
struct wsdisplay_msgattrs {
|
|
|
|
int default_attrs, default_bg, default_fg;
|
|
|
|
int kernel_attrs, kernel_bg, kernel_fg;
|
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Va default_attrs
|
|
|
|
and
|
|
|
|
.Va kernel_attrs
|
|
|
|
variables are a combination of
|
|
|
|
.Va WSATTR_*
|
|
|
|
bits, and specify the attribues used to draw messages.
|
|
|
|
The
|
|
|
|
.Va default_bg ,
|
|
|
|
.Va default_fg ,
|
|
|
|
.Va kernel_bg
|
|
|
|
and
|
|
|
|
.Va kernel_fg
|
|
|
|
variables specify the colors used to print messages, being
|
|
|
|
.Sq _bg
|
|
|
|
for the background and
|
|
|
|
.Sq _fg
|
|
|
|
for the foreground; their values are one of all the
|
|
|
|
.Va WSCOL_*
|
|
|
|
macros available.
|
|
|
|
.It Dv WSDISPLAYIO_SMSGATTRS Pq Li struct wsdisplay_msgattrs
|
|
|
|
Set the attributes (colors and flags) used to print console messages, including
|
|
|
|
separate fields for default output and kernel output.
|
|
|
|
The argument structure is the same as for
|
|
|
|
.Dv WSDISPLAYIO_GMSGATTRS .
|
Implement border color customization in wscons(4), only available for vga(4)
at the moment.
This includes the addition of two new wsdisplay ioctls, WSDISPLAY_{G,S}BORDER,
one to get the actual color and one to set it, respectively. Possible colors
match those defined by ANSI (and listed in wsdisplayvar.h).
It also adds two accessops to the underlying graphics device, getborder and
setborder, which mach their ioctl counterparts.
Two kernel options are added: WSDISPLAY_CUSTOM_BORDER, which enables the
ioctls described above (to customize the border color from userland after
boot), and WSDISPLAY_BORDER_COLOR, which sets the color at boot time.
The former is enabled by default on the GENERIC kernel, but not on INSTALL
(among others). The later is always commented out, leaving the usual black
border as a default.
wsconsctl is modified to allow accessing this value easily. For example,
'wsconsctl -d -w border=blue'.
2004-07-30 02:29:35 +04:00
|
|
|
.It Dv WSDISPLAYIO_GBORDER Pq Li u_int
|
|
|
|
Retrieve the color of the screen border.
|
|
|
|
This number corresponds to an ANSI standard color.
|
|
|
|
.It Dv WSDISPLAYIO_SBORDER Pq Li u_int
|
|
|
|
Set the color of the screen border, if applicable.
|
|
|
|
This number corresponds to an ANSI standard color.
|
|
|
|
Not all drivers support this feature.
|
2004-07-30 18:00:18 +04:00
|
|
|
.It Dv WSDISPLAYIO_GETWSCHAR Pq Li struct wsdisplay_char
|
|
|
|
Gets a single character from the screen, specified by its position.
|
|
|
|
The structure used is as follows:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
struct wsdisplay_char {
|
|
|
|
int row, col;
|
|
|
|
uint16_t letter;
|
|
|
|
uint8_t background, foreground;
|
|
|
|
char flags;
|
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Va row
|
|
|
|
and
|
|
|
|
.Va col
|
|
|
|
parameters are used as input; the rest of the structure is filled by the
|
|
|
|
ioctl and is returned to you.
|
|
|
|
.Va letter
|
|
|
|
is the ASCII code of the letter found at the specified position,
|
|
|
|
.Va background
|
|
|
|
and
|
|
|
|
.Va foreground
|
|
|
|
are its colors and
|
|
|
|
.Va flags
|
|
|
|
is a combination of
|
|
|
|
.Sq WSDISPLAY_CHAR_BRIGHT
|
|
|
|
and/or
|
|
|
|
.Sq WSDISPLAY_CHAR_BLINK .
|
|
|
|
.It Dv WSDISPLAYIO_PUTWSCHAR Pq Li struct wsdisplay_char
|
|
|
|
Puts a character on the screen.
|
|
|
|
The structure has the same meaning as described in
|
|
|
|
.Dv WSDISPLAY_GETWSCHAR ,
|
|
|
|
although all of its fields are treated as input.
|
2002-06-22 23:08:32 +04:00
|
|
|
.El
|
1999-03-22 22:15:01 +03:00
|
|
|
.Sh FILES
|
|
|
|
.Bl -item
|
|
|
|
.It
|
|
|
|
.Pa /dev/ttyE*
|
|
|
|
Terminal devices (per screen).
|
|
|
|
.It
|
|
|
|
.Pa /dev/ttyEcfg
|
|
|
|
Control device.
|
|
|
|
.It
|
2002-08-20 20:56:05 +04:00
|
|
|
.Pa /dev/ttyEstat
|
|
|
|
Status device.
|
|
|
|
.It
|
1999-03-22 22:15:01 +03:00
|
|
|
.Pa /usr/include/dev/wscons/wsconsio.h
|
|
|
|
.El
|
2001-09-12 03:18:55 +04:00
|
|
|
.Sh SEE ALSO
|
2002-06-22 23:08:32 +04:00
|
|
|
.Xr ioctl 2 ,
|
2001-09-12 03:18:55 +04:00
|
|
|
.Xr ega 4 ,
|
|
|
|
.Xr pcdisplay 4 ,
|
|
|
|
.Xr tty 4 ,
|
|
|
|
.Xr vga 4 ,
|
|
|
|
.Xr wscons 4 ,
|
|
|
|
.Xr wsconscfg 8 ,
|
|
|
|
.Xr wsconsctl 8 ,
|
2002-09-18 15:56:28 +04:00
|
|
|
.Xr wsfontload 8 ,
|
|
|
|
.Xr wsdisplay 9
|
1999-03-22 22:15:01 +03:00
|
|
|
.Sh BUGS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
code currently limits the number of screens on one display to 8.
|
|
|
|
.Pp
|
|
|
|
The terms
|
|
|
|
.Dq wscons
|
|
|
|
and
|
|
|
|
.Dq wsdisplay
|
|
|
|
are not cleanly distinguished in the code and in manual pages.
|
|
|
|
.Pp
|
|
|
|
.Dq non-emulating
|
|
|
|
display devices are not tested.
|