aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/syscons/syscons.c
Commit message (Collapse)AuthorAgeFilesLines
* YAMFC: merge updated keyboard driver code:Kazutaka YOKOTA1999-05-091-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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. - And other minor fixes and updates. merged files and revisions --------------------------------------------------------------------- usr.sbin/kbdcontrol/kbdcontrol.c 1.22, 1.23, 1.24, 1.25 usr.sbin/vidcontrol/vidcontrol.c 1.27 sys/alpha/include/console.h 1.42, 1.43, 1.44 sys/dev/kbd/kbd.c 1.4 sys/dev/kbd/kbdreg.h 1.3 sys/dev/kbd/kbdtables.h 1.45 sys/dev/kbd/atkbd.c 1.5, 1.8 sys/dev/kbd/atkbdreg.h 1.2 sys/dev/syscons/syscons.c 1.295, 1.296, 1.299 sys/dev/usb/ukbd.c 1.9, 1.10, 1.11, 1.12, 1.13 sys/i386/conf/LINT 1.565 sys/i386/conf/options.i386 1.109 sys/i386/conf/files.i386 1.228 sys/i386/include/console.h 1.45 sys/i386/isa/atkbd_isa.c 1.3 sys/i386/isa/pcvt/pcvt_kbd.c 1.28, 1.29 sys/isa/atkbd_isa.c 1.2 Notes: svn path=/stable/3/; revision=46784
* MFC:Kazutaka YOKOTA1999-02-071-2/+2
| | | | | | | | | | | | | - 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. Oked by: jkh Notes: svn path=/stable/3/; revision=43723
* MFC: pull down the splash screen when someone is about to read fromKazutaka YOKOTA1999-01-311-7/+2
| | | | | | | the keyboard (rev 1.294). Notes: svn path=/stable/3/; revision=43469
* sysconsKazutaka YOKOTA1999-01-191-80/+184
| | | | | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=42831
* - Examine the error code from the screen saver and act accordingly.Kazutaka YOKOTA1999-01-171-18/+28
| | | | | | | | | | | | | 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(). Notes: svn path=/head/; revision=42748
* Get conditional compilation right so that unnecessary referenceKazutaka YOKOTA1999-01-131-8/+10
| | | | | | | | to splash-relatec call won't be made if there is no splash pseudo device. Notes: svn path=/head/; revision=42610
* The first stage of console driver reorganization: activate newKazutaka YOKOTA1999-01-111-963/+673
| | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=42504
* Remove a hard-coded table of kernel console I/O functions exportedKazutaka YOKOTA1999-01-071-6/+14
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=42373
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticArchie Cobbs1998-12-071-2/+3
| | | | | | | and local variables, goto labels, and functions declared but not defined. Notes: svn path=/head/; revision=41591
* * Fix a couple of places in the device pager where an address wasDoug Rabson1998-11-081-2/+2
| | | | | | | | | | | | | | truncated to 32 bits. * Change the calling convention of the device mmap entry point to pass a vm_offset_t instead of an int for the offset allowing devices with a larger memory map than (1<<32) to be supported on the alpha (/dev/mem is one such). These changes are required to allow the X server to mmap the various I/O regions used for device port and memory access on the alpha. Notes: svn path=/head/; revision=41004
* Don't update the screen while the cursor shape is being changedKazutaka YOKOTA1998-11-031-1/+5
| | | | | | | | by the user-land program. PR: i386/8344 Notes: svn path=/head/; revision=40836
* Initialize isa_devtab entries for interrupt handlers in individualBruce Evans1998-10-221-2/+4
| | | | | | | | | | device drivers, not in ioconf.c. Use a different hack in isa_device.h so that a new config(8) is not required yet. pc98 parts approved by: kato Notes: svn path=/head/; revision=40565
* Restore static of sc_flags.Andrey A. Chernov1998-10-011-2/+3
| | | | | | | Restore set_destructive_cursor prototype. Notes: svn path=/head/; revision=39874
* Yet another round of fixes for the VESA support code.Kazutaka YOKOTA1998-10-011-3/+4
| | | | | | | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=39858
* Fix destructive cursor shape after text mode switch.Andrey A. Chernov1998-09-291-32/+31
| | | | | | | This is only for standard modes, I don't check vesa modes yet. Notes: svn path=/head/; revision=39742
* Cosmetic changes:Kazutaka YOKOTA1998-09-261-22/+19
| | | | | | | | | | | | | | | | | | - there were too many global variables (there still are :-). - the data section was bloated by explicit initializations of static variables to 0 (only fixed the recently changed ones). - WRAPHIST() had silly parentheses around foo->bar. - the comment about inline functions was stale. - the comment about Userconfig presumes too much about the boot environment. - `i' was reused confusingly in scioctl(). - the declaration of `butmap' used a deprecated K&R misfeature. - the initializeation of `butmap' had an unnecessary line break. - `unsigned char' was not consistently (mis)spelled as u_char. - English was poor in a comment in videoio.c. Submitted by: bde Notes: svn path=/head/; revision=39668
* - Use `u_long cmd' ioctl arg.Kazutaka YOKOTA1998-09-261-4/+2
| | | | | | | | - Fix some external function declaration. Submitted by: bde Notes: svn path=/head/; revision=39667
* Fix and update for VESA BIOS support in syscons.Kazutaka YOKOTA1998-09-231-40/+157
| | | | | | | | | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=39591
* Add VESA support to syscons.Søren Schmidt1998-09-151-1327/+490
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=39287
* Make /dev/vga a softlink to /dev/ttyv0 under DEVFS using /etc/rc.devfsSøren Schmidt1998-09-141-3/+1
| | | | | | | | Remove the hack from syscons that added a /dev/vga node in DEVFS it broke root acces on ttyv0 because dev_mkdb screwed up. Notes: svn path=/head/; revision=39162
* Added D_TTY to the cdevswitch flags for all tty drivers. This is requiredBruce Evans1998-08-231-9/+11
| | | | | | | | | | | | for the Lite2 fix for always returning EIO in dead_read(). Cleaned up the cdevswitch initializers for all tty drivers. Removed explicit calls to ttsetwater() from all (tty) drivers. ttsetwater() is now called centrally for opens, not just for parameter changes. Notes: svn path=/head/; revision=38485
* Fix one forgotten instance of \n to \rSøren Schmidt1998-08-181-2/+2
| | | | Notes: svn path=/head/; revision=38421
* Changed \n to \r in the mouse cutbuffer, this makes pine & EmacsSøren Schmidt1998-08-141-4/+4
| | | | | | | | | behave better when using the cut&paste functionality. Submitted by: Barry Bierbauch <pivrnec@vszbr.cz> Notes: svn path=/head/; revision=38313
* A workaround for screen flicker; eliminate some I/O access to the VGAKazutaka YOKOTA1998-08-101-1/+17
| | | | | | | | | | | | | | | chip. It has been observed that the problem is most apparent: a) in notebook computers, b) and/or in the systems with C&T video chips. Define the new configuration option SC_BAD_FLICKER in the kernel configuration file to remove outb()/outw() calls in question. Notes: svn path=/head/; revision=38216
* 1. Reorganized screen saver related code so that both the LKM screenKazutaka YOKOTA1998-08-031-143/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=38052
* - When the system is shut down, switch to the vty0 if possible.Kazutaka YOKOTA1998-08-031-3/+17
| | | | | | | | | - Don't try to ring bell when system is going down. Beacuse the clock code is about to be stopped, the timeout routine won't be called anymore. Notes: svn path=/head/; revision=38047
* Fix the bug which always reallocated the cut buffer wheneverKazutaka YOKOTA1998-08-031-7/+18
| | | | | | | | | the screen mode is changed even if another vty has larger size. Reallocate the buffer only when the new screen size is larger than the current cut buffer size. Notes: svn path=/head/; revision=38046
* Don't accept the blank time value, if it is too big.Kazutaka YOKOTA1998-08-031-2/+4
| | | | | | | PR: bin/6188 Notes: svn path=/head/; revision=38045
* - Add new bell types: "quiet.normal" and "quiet.visual".Kazutaka YOKOTA1998-08-031-3/+10
| | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=38043
* Changed %n to %r in devfs name format strings. %n has almost gone away.Bruce Evans1998-07-151-2/+2
| | | | Notes: svn path=/head/; revision=37683
* Don't pretend to support ix86's with 16-bit ints by using longsBruce Evans1998-07-141-8/+8
| | | | | | | | just to ensure 32-bit variables. Doing so broke i386's with 64-bit longs. Notes: svn path=/head/; revision=37639
* Add the ability to suspend as well as hibernate to the system. ThisWarner Losh1998-07-061-2/+21
| | | | | | | | | | is the kernel part of my commits, the userlevel stuff will be done in a separate commit. Add the ability to suspend as well as hibernate to syscons. Create a new virtual key like hibernate for suspend. Update apm_bios.h to define more apm bios goodies. Notes: svn path=/head/; revision=37414
* Don't refer to mouse_info.u.datea.[xyz] while processing MOUSE_BUTTON_EVENTKazutaka YOKOTA1998-06-241-5/+2
| | | | | | | | | ioctl. These fields don't have valid values for this ioctl. PR: kern/6928 Submitted by: Bill Fenner <fenner@parc.xerox.com> Notes: svn path=/head/; revision=37136
* Add a symlink from /dev/vga to /dev/ttyv0 when using DEVFSSteve Price1998-06-131-1/+3
| | | | | | | | | | for programs like doscmd. PR: 6920 Submitted by: Luoqi Chen <luoqi@chen.ml.org> Notes: svn path=/head/; revision=36948
* This commit fixes various 64bit portability problems required forDoug Rabson1998-06-071-2/+2
| | | | | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time. Notes: svn path=/head/; revision=36735
* s/nanoruntime/nanouptime/gPoul-Henning Kamp1998-05-171-9/+9
| | | | | | | | | s/microruntime/microuptime/g Reviewed by: bde Notes: svn path=/head/; revision=36119
* Stop the screensaver before switching consoles.Dag-Erling Smørgrav1998-04-171-1/+7
| | | | Notes: svn path=/head/; revision=35248
* Swapped "should we just return" and "should we stop the screensaver"Dag-Erling Smørgrav1998-04-161-8/+11
| | | | | | | in scrn_timer() to avoid deadlock with graphical screensavers. Notes: svn path=/head/; revision=35223
* More fixes to deal with fonts:Kazutaka YOKOTA1998-04-041-23/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Set the correct value scp->font_size in init_scp(). - Set scp->font_size to FONT_NONE for VGA_MODEX. Interim fix for a font problem: - A kludge to display the correct font on some video cards. We should be able to load multiple fonts to the VGA plane #2 and switch between fonts by setting the font select register in the VGA sequencer. It appears that the current code isn't functioning as expected on some VGA cards (I have reports on Millenium and Mach64 cards). This is either a bug in syscons or a hardware compatibility problem ;-< This kludge will always load only one font set at a time and always use the font page #0 on the plane #2. It is an interim kludge until we find the exact cause and solution. Small adjustment for mouse cursor handling: - Turn off the mouse cursor early when changing video modes. Video mode switch fixes: - Stop the screen saver when changing video modes. - Enclose the critical section with a pair of spltty()/splx(). - A kludge to prevent scrn_update() from accessing video memory in less- critical sections in video mode change; artificially turn on the UNKNOWN_MODE flag. PR: bin/5899, bin/5907 Tested by: ache and a couple of users OKed by: sos Notes: svn path=/head/; revision=35030
* Time changes mark 2:Poul-Henning Kamp1998-04-041-10/+12
| | | | | | | | | | | | | | | | | | | | * Figure out UTC relative to boottime. Four new functions provide time relative to boottime. * move "runtime" into struct proc. This helps fix the calcru() problem in SMP. * kill mono_time. * add timespec{add|sub|cmp} macros to time.h. (XXX: These may change!) * nanosleep, select & poll takes long sleeps one day at a time Reviewed by: bde Tested by: ache and others Notes: svn path=/head/; revision=35029
* Fix a couple of lines that dropped out in my merge yesterday.Poul-Henning Kamp1998-02-131-3/+7
| | | | | | | Complained about by: ache Notes: svn path=/head/; revision=33327
* Hmm, it is generally an advantage to commit the most recent version ofPoul-Henning Kamp1998-02-131-15/+14
| | | | | | | | ones changes: A faster character painter procedure and fix on cursor bug. Notes: svn path=/head/; revision=33321
* Add support for VESA mode 0x102 (800x600x4) in syscons. You can activatePoul-Henning Kamp1998-02-121-58/+102
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=33283
* Fix a white-space nit which I happened to notice.Poul-Henning Kamp1998-02-121-3/+2
| | | | Notes: svn path=/head/; revision=33280
* Oops, sorry, a #define line for my debugging session slipped intoKazutaka YOKOTA1998-02-121-3/+1
| | | | | | | the last commit ;-< Notes: svn path=/head/; revision=33272
* - Move the mouse cursor to the center of the screen after videoKazutaka YOKOTA1998-02-111-16/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.) Notes: svn path=/head/; revision=33242
* - A new semaphore: font_loading_in_progress.Kazutaka YOKOTA1998-02-111-9/+27
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=33241
* - Break scrn_timer() into two pieces. Now screen update is done in aKazutaka YOKOTA1998-02-111-85/+97
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=33240
* - Ignore KBD_RAW_MODE and KBD_CODE_MODE in scgetc() when it's calledKazutaka YOKOTA1998-02-111-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=33239
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.Eivind Eklund1998-01-241-1/+2
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=32726