aboutsummaryrefslogtreecommitdiff
path: root/sys/isa/syscons.c
Commit message (Collapse)AuthorAgeFilesLines
* Update the alpha port to use the new syscons.Doug Rabson1999-01-231-4671/+0
| | | | | | | Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> (partly) Notes: svn path=/head/; revision=43105
* * Add hooks to allow the X server to access I/O ports and memory.Doug Rabson1998-11-151-8/+9
| | | | | | | | | | | | * Update drivers to the latest version of the bus interface. The ISA drivers' use of the new resource api is minimal. Garrett has some much cleaner drivers which should be more easily shared between i386 and alpha. This has only been tested on cia based machines. It should work on lca and apecs but I might have broken something. Notes: svn path=/head/; revision=41181
* * 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
* * Fix vga_probe() so that it doesn't report a non-vga display adapter asDoug Rabson1998-10-311-3/+3
| | | | | | | | | | | | a vga. * Fix broken logic in syscons for a failed probe. * Fix AlphaStation 500/600 so that non-serial consoles are supported. Submitted by: Thomas Valentino Crimi <tcrimi+@andrew.cmu.edu> (vga bits), Andrew Gallatin <gallatin@cs.duke.edu> (AS500/AS600) Notes: svn path=/head/; revision=40778
* Merge with the latest i386 syscons.Doug Rabson1998-09-171-1334/+507
| | | | Notes: svn path=/head/; revision=39414
* Port syscons to the alpha. The driver itself has moved to sys/isa as it willDoug Rabson1998-08-061-108/+209
| | | | | | | | | | | | hopefully become a portable driver usable by all architectures. The api support files have had to be copied to sys/alpha/include since userland programs expect to find them in <machine/*.h>. All the revision history of the i386 syscons has been retained by a repository copy. Notes: svn path=/head/; revision=38138
* 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
* - Add binary compatibility support for obsolete console/mouse ioctlsKazutaka YOKOTA1998-01-201-1/+51
| | | | | | | | | | 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. Notes: svn path=/head/; revision=32633
* add devfs entries for a few more syscons devices (e.g. sysmouse)Julian Elischer1998-01-121-3/+9
| | | | Notes: svn path=/head/; revision=32457
* - Produce the accent letter if the user hits the accent key twice.Kazutaka YOKOTA1998-01-091-4/+28
| | | | | | | | | | | (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. Notes: svn path=/head/; revision=32364
* Added accent (dead) key support to syscons and kbdcontrol.Kazutaka YOKOTA1998-01-071-4/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=32315
* - Add support for the following mice to psm/moused/sysmouse:Kazutaka YOKOTA1997-12-071-49/+435
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=31603
* Use ENOIOCTL instead of -1 (= ERESTART) for tty ioctls that areBruce Evans1997-12-061-3/+3
| | | | | | | | not handled at a particular level. This fixes mainly restarting of interrupted TIOCDRAINs and TIOCSETA{W,F}s. Notes: svn path=/head/; revision=31577
* Move the hardware currsor off screen when getting back from anSøren Schmidt1997-11-251-2/+9
| | | | | | | | unknown mode. Fix warning on uninitialized var. Notes: svn path=/head/; revision=31412
* Make comp_vgaregs() less strict about VGA register values whenKazutaka YOKOTA1997-11-211-144/+230
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=31334
* Rename some local variables to avoid shadowing other local variables.Poul-Henning Kamp1997-11-071-4/+4
| | | | | | | Found by: -Wshadow Notes: svn path=/head/; revision=31017
* Remove a bunch of variables which were unused both in GENERIC and LINT.Poul-Henning Kamp1997-11-071-3/+1
| | | | | | | Found by: -Wunused Notes: svn path=/head/; revision=31016
* - Slightly change the way the border color register is updated so thatKazutaka YOKOTA1997-10-261-4/+3
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=30726
* Reject unreasonable values passed to CONS_HISTORY ioctl. It did notKazutaka YOKOTA1997-10-231-21/+83
| | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=30662
* Add a new keyboard mode K_CODE. Returns a single byte for each keySøren Schmidt1997-10-011-4/+15
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=30043
* tiny update of ESC sequence parser.Jun-ichiro itojun Hagino1997-09-261-5/+23
| | | | | | | | | | - 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) Notes: svn path=/head/; revision=29875
* Update select -> poll in drivers.Peter Wemm1997-09-141-2/+2
| | | | Notes: svn path=/head/; revision=29368
* Add a new compile option SC_HISTORY_SIZE to specify the history bufferKazutaka YOKOTA1997-09-041-12/+14
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=29121
* Fix the checks for screenborder for the mousepointer.Søren Schmidt1997-08-091-14/+12
| | | | Notes: svn path=/head/; revision=28022
* Yeah I'm back hacking syscons !!Søren Schmidt1997-08-081-6/+56
| | | | | | | | | | 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. Notes: svn path=/head/; revision=27990