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.
mode switch in ioctl.
Possibly related to PR: kern/4271
- A kludge: initialize scp->xpixel and ypixel even in the text mode.
If the console enters the `unknown' graphics mode via the ioctl KDSETMODE
(KD_GRAPHICS), these fields are not set (because syscons cannot know
the correct values), but set_mouse_pos() need to refer to these field
to adjust the mouse position.
- Turn off MOUSE_VISIBLE when switching video mode by ioctl.
- another new option: SC_MOUSE_CHAR
Define the first character code of four consecutive codes to be used for
the mouse cursor. Default codes are 0xd0 through 0xd3. Beware that
if you decide to use any codes outside the range of 0xc0-0xdf,
the mouse cursor may not look good, because of the way VGA displays
characters in 9-dot-wide character cells.
Requested by several people.
(This patch was tested by a person who recently reported, in the -current
ML, a page fault problem in the kernel (draw_mouse_iamge()) after
X server shutdown. The patch cured his problem.)
Don't touch/update the screen while manipulating font data.
Possibly related to PR: kern/4271
- Set up VGA in alphanumeric mode rather than graphics mode when
loading font into video memory. This will drastically reduce flicker.
PR: bin/2977
- Set up scp->font_size properly during video mode switch caused by
ioctl.
separate routine: scupdate() called from scrn_timer().
- Make sure that the screen is updated for the low-level console
routines sccngetc() and sccncheckc(). A new routine, sccnupdate(),
is introduced and will call scupdate() above.
Requested by: bde and msmith
OKed by: sos
from the low-level console routines sccngetc() and sccncheckc().
Submitted by: bde (a long time ago)
- Don't try to ring bell and immediately return from do_bell() while
device probe is in progress at boot time; the timeout queue is not
functional yet.
PR: kern/2424
- Stop running the screen saver after panic() is called: check
if `panicstr' is non-NULL during scrn_timer().
PR: kern/5314
- A new option: SC_DISABLE_REBOOT
The reboot key (usually Ctl-Alt-Del) will be ignored if this option
is defined. You may still have the reboot key defined in the keymap and
it won't cause error when the keymap is loaded, but it will be quietly
treated as nop.
OKed by: sos
This introduce an xxxFS_BOOT for each of the rootable filesystems.
(Presently not required, but encouraged to allow a smooth move of option *FS
to opt_dontuse.h later.)
LFS is temporarily disabled, and will be re-enabled tomorrow.
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.
not quite correct, because the Makefiles in lkm/syscons don't set up the
`machine' symlink, but other, more volatile headers in <machine> are
already used.
(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.
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).
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.
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
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
screen size was changed while the screen saver was inactive. Adjust
the positions of the daemon and the text and clip them accordingly
each time.
- Don't call set_border() too often. Some video chip may produce
flicker.
Pointed out by tony@dell.com
- Don't fill the entire screen with blank char every time the saver is
called. Blank only the part of the screen where the daemon and the
text was previously printed.
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
savers are also modified so that they behave in the same way as the
blank saver on MDA and CGA, although it's not the way these screen
savers are supposed to work, but fading monitor and tickling green
monitor cannot be done on MDA and CGA, AFAIK. So, this is the second
best solution.
As of this change, the current state of support of screen savers is
summarized in the following table.
MDA CGA EGA VGA
blank OK OK NA OK
daemon OK OK OK OK
fade * * NA OK
green * * NA OK
snake OK OK OK OK
star OK OK OK OK
OK: works
NA: doesn't work, the module cannot be loaded for this adapter.
*: behave the same way as the blank saver.
As you can see, EGA is left out for now. But, we can do no better, as
EGA registers cannot be read...
Reviewed by: sos
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.
- 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)
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
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.
facilitate the new saver loading/unloading notification interface
in syscons.
daemon_saver:
- M_NOWAIT was wrong, since NULL returns are not handled. Just use
M_WAITOK.
- use `ostype' instead of hard-coded "FreeBSD". Now there is no more
hard-coded string! (But, who will run this screen saver on other
OS?!)
- put macros and data declarations in a consistent order.
- -DDEAMON_ONLY and -DSHOW_HOSTNAME options added in the previous commit
are removed. Options of this kind can go stale and no one notices
because no one uses them. DEAMON_ONLY is just removed. SHOW_HOSTNAME
is made default.
snake_saver:
- use `ostype' and `osrelease' as in the daemon saver. The string changes
slightly - there was a hyphen after "FreeBSD"; now there is a space.
(It is consistent with uname -a, like the daemon server already is.)
all screen savers:
- Use the new add_scrn_saver()/remove_scrn_saver() in syscons.c
to declare loading/unloading of a screen saver. Removed reference
to `current_saver' and the variable `old_saver' as they are not
necessary anymore.
- The blank, fade and green screen savers manipulate VGA registers.
Module loading should fail for non-VGA cards.
- `scrn_blanked' is consistently treated as a number/counter rather
than boolean.
- Some savers touch `scp->start' and `scp->end' to force entire screen
update when stopping themselves. This is unnecessary now because
syscons.c takes care of that.
- cleared up many unused or unnecessary #include statements.
- Removed -DLKM from Makefiles.
YOU NEED TO RECOMPILE BOTH SCREEN SAVERS AND KERNEL AS OF THIS CHANGE.
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
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
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.
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...)
rather than hard-code it in the message text. Optinally include
the host name in the message if SHOW_HOSTNAME is defined.
The origianl idea and sample code submitted by Angelo Turetta
<ATuretta@stylo.it>.
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.