summaryrefslogtreecommitdiff
path: root/sys/dev/syscons/syscons.h
Commit message (Collapse)AuthorAgeFilesLines
* Yet another round of fixes for the VESA support code.Kazutaka YOKOTA1998-10-011-2/+1
| | | | | | | | | | | | | | | | | - 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-1/+2
| | | | | | | This is only for standard modes, I don't check vesa modes yet. Notes: svn path=/head/; revision=39742
* - Use `u_long cmd' ioctl arg.Kazutaka YOKOTA1998-09-261-2/+3
| | | | | | | | - 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-2/+2
| | | | | | | | | | | | | | | | | | | - 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-30/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 1. Reorganized screen saver related code so that both the LKM screenKazutaka YOKOTA1998-08-031-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* - Add new bell types: "quiet.normal" and "quiet.visual".Kazutaka YOKOTA1998-08-031-1/+2
| | | | | | | | | | | | | | | 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
* Add support for VESA mode 0x102 (800x600x4) in syscons. You can activatePoul-Henning Kamp1998-02-121-2/+2
| | | | | | | | | | | | | | | 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
* Make comp_vgaregs() less strict about VGA register values whenKazutaka YOKOTA1997-11-211-1/+2
| | | | | | | | | | | | | | | | | | 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
* Reject unreasonable values passed to CONS_HISTORY ioctl. It did notKazutaka YOKOTA1997-10-231-5/+1
| | | | | | | | | | | | | | | | | | | | | | 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-9/+10
| | | | | | | | | | | 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
* Add a new compile option SC_HISTORY_SIZE to specify the history bufferKazutaka YOKOTA1997-09-041-2/+5
| | | | | | | | | | | | | | | 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
* Removed unused misplaced definition of TIMER_FREQ.Bruce Evans1997-08-251-3/+2
| | | | | | | Use less-magic numbers in the definition of HISTORY_SIZE. Notes: svn path=/head/; revision=28759
* Screen saver related fixes.Kazutaka YOKOTA1997-07-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=27426
* A fix/work-around for ThinkPad 535.Kazutaka YOKOTA1997-06-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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...) Notes: svn path=/head/; revision=27063
* 1) font loading (two fixes)Kazutaka YOKOTA1997-05-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an ioctl command SW_XXXX is issued, scioctl() checks if the font appropriate for the specified mode is already loaded. The check was correctly done for 8 line and 16 line fonts, but not for 14 line font. The symbols FONT_8, FONT_14 and FONT_16 were defined as numbers but were sometimes treated as bit flags. They are now defined as bit flags. 2) screen blinking (two fixes) Removed a redundant call to timeout() in do_bell(). Don't let blink_screen() write to the video buffer if the screen is in the graphics (UNKNOWN) mode. 3) screen saver timeout The ioctl command CONS_BLANKTIME sets the screen saver's timeout. The value of zero will disable the screen saver. If the screen saver is currently running it should be stopped. 4) border color and destructive cursor (two fixes) The border color and the cursor type can be changed via escape sequences. But only VGA can change the border color and set the cursor type to destructive (CHAR_CURSOR) in the current syscons. scan_esc() failed to check this. Reviewed by: sos Notes: svn path=/head/; revision=25828
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Add save/restore cursor as pr SCO screen(HW) manpage.Søren Schmidt1997-01-231-0/+2
| | | | | | | | | | | Fix ESC[2J to not move cursor home Clear mouse cutmarking on more cases. Minor changes by me. Submitted by: ache Notes: svn path=/head/; revision=21964
* Upgrade the kbdio rutines to provide queued kbd & mouse events.Søren Schmidt1997-01-151-2/+2
| | | | | | | | | Minor other updates to syscons by me. Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> Notes: svn path=/head/; revision=21731
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Allow us to enable the 'XT_KEYBOARD' code using a configuration flag.Nate Williams1996-11-101-1/+2
| | | | | | | | | | | This allows the user to add modify syscons's configuration flags using UserConfig that will allow older/quirky hardware (most notably older IBM ThinkPad laptops) to work with the standard boot kernel. Inspired by: The Nomads Notes: svn path=/head/; revision=19613
* Remove SC_KBD_PROBE_WORKS option and replace it with a simple run-time flagPaul Traina1996-10-231-1/+2
| | | | | | | | | | | | bit (0x0008) in the sc driver configuration line. This way it's easy to boink a generic kernel. Also, document and place in an opt_ file the #define's for overriding which serial port is the system console. Approved by: sos Notes: svn path=/head/; revision=19123
* Changed mouse functionality a bit, now the pointer disappears ifSøren Schmidt1996-10-181-2/+4
| | | | | | | | | | | | | there is keyboard input. The mousepointer is shown again immediately if moved. Also a function pointer used to install a userwritten extra ioctl handler (sc_user_ioctl). This way its is possible to install user defined videomodes etc etc. No further changes should be in the kernel. Notes: svn path=/head/; revision=19022
* Fix a couble of nasties regarding mouse pointer and differentSøren Schmidt1996-09-301-3/+5
| | | | | | | | | resolutions. Allow middle mouse button to be used for pasting. Also added the beginnings of support for a splash page. Notes: svn path=/head/; revision=18587
* Fixed a couple of bugs in the mousepointer code.Søren Schmidt1996-09-011-5/+7
| | | | | | | | Changed update strategy slightly. Make set_mode & copy_font externally visible. Notes: svn path=/head/; revision=17993
* Fixed bug in pasting 8bit char (ache).Søren Schmidt1996-06-261-5/+6
| | | | | | | | Added linefeeds in cuts that extend beyond one line. Prepared for the mousefunctions to be used in nontext modes. Notes: svn path=/head/; revision=16769
* Change the way moused talk to syscons, now its only delivering mouseeventsSøren Schmidt1996-06-251-3/+7
| | | | | | | | | | | via an ioctl (MOUSE_ACTION). Fixed a couple of bugs (destructive cursor, uncut, jitter). Now applications can use the mouse via the MOUSE_MODE ioctl, its possible to have a signal sent on mouseevents, makeing an event loop in the application take over mouseevents. Notes: svn path=/head/; revision=16693
* Moved declarations of static functions to the correct file. This fixesBruce Evans1996-06-231-36/+3
| | | | | | | hundreds of warnings from -Wunused in lkm/syscons/*. Notes: svn path=/head/; revision=16633
* Some news for syscons (long overdue):Søren Schmidt1996-06-211-4/+7
| | | | | | | | | | | Real support for a Textmode mousecursor, works by reprogramming the charset. Together with this support for cut&paste in text mode. To use it a userland daemon is needed (moused), which provides the interface to the various mice protokols. Bug fixes here and there, all known PR's closed by this update. Notes: svn path=/head/; revision=16564
* Fix a bunch of spelling errors in the comment fields ofMike Pritchard1996-01-301-2/+2
| | | | | | | a bunch of system include files. Notes: svn path=/head/; revision=13765
* Staticize and cleanup.Poul-Henning Kamp1995-12-101-5/+1
| | | | Notes: svn path=/head/; revision=12724
* Separate colors & attributes as Terry pointsAndrey A. Chernov1995-11-281-6/+17
| | | | | | | Reviewed by: soren Notes: svn path=/head/; revision=12494
* Added `#include "ioconf.h"' to <machine/conf.h> and cleaned up theBruce Evans1995-11-041-2/+1
| | | | | | | | | | | | | misplaced extern declarations (mostly prototypes of interrupt handlers) that this exposed. The prototypes should be moved back to the driver sources when the functions are staticalized. Added idempotency guards to <machine/conf.h>. "ioconf.h" can't be included when building LKMs so define a wart in bsd.kmod.mk to help guard against including it. Notes: svn path=/head/; revision=12080
* Make pcvt and syscons live in the same kernel. If both are enabled, thenBruce Evans1995-09-101-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the first one in the config has priority. They can be switched using userconfig(). i386/i386/conf.c: Initialize the shared syscons/pcvt cdevsw entry to `nx'. Add cdevsw registration functions. Use devsw functions of the correct type if they exist. i386/i386/cons.c: Add renamed syscons entry points to constab. i386/i386/cons.h: Declare the renamed syscons entry points. i386/i386/machdep.c: Repeat console initialization after userconfig() in case the current console has become wrong. This depends on cn functions not wiring down anything important. sys/conf.h: Declare new functions. i386/isa/isa.[ch]: Add a function to decide which display driver has priority. Should be done better. i386/isa/syscons.c: Rename pccn* -> sccn*. Initialize CRTC start address in case the previous driver has moved it. i386/isa/syscons.c, i386/isa/pcvt/* Initialize the bogusly shared variable Crtat dynamically in case the stored value was changed by the previous driver. Initialize cdevsw table from a template. Don't grab the console if another display driver has priority. i386/isa/syscons.h, i386/isa/pcvt/pcvt_hdr.h: Don't externally declare now-static cdevsw functions. i386/isa/pcvt/pcvt_hdr.h: Set the sensitive hardware flag so that pcvt doesn't always have lower priority than syscons. This also fixes the "stupid" detection of the display after filling the display with text. i386/isa/pcvt/pcvt_out.c: Don't be confused the off-screen cursor offset 0xffff set by syscons. kern/subr_xxx.c: Add enough nxio/nodev/null devsw functions of the correct type for syscons and pcvt. Notes: svn path=/head/; revision=10666
* Fix races in scstart(). q_to_b() wasn't called at spltty(), so thereBruce Evans1995-07-111-10/+9
| | | | | | | | | | | | | | | | | were two races: - q_to_b() might unexpectedly return 0 (e.g, after a keyboard signal flushes the output queue and isn't echoed). ansi_put() interprets 0 bytes as 4GB... - more output (e.g. for echoes) might arrive afer q_to_b() returns 0. Then scstart() returns presumably and the new output might not be handled for a long time. Remove unused function scxint(). Fix prototypes (foo() isn't a prototype). Notes: svn path=/head/; revision=9484
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-2/+2
| | | | Notes: svn path=/head/; revision=8876
* Correct the type of the `c' arg to pccnputc().Bruce Evans1995-04-231-7/+3
| | | | | | | | Move declarations of console functions to cons.h so that they can't be defined inconsistently in several places. They should be config(8)ed. Notes: svn path=/head/; revision=8017
* Fixes to the hardware cursor emulation.Søren Schmidt1995-04-041-8/+19
| | | | | | | Submitted by: ache Notes: svn path=/head/; revision=7623
* Emulate hw cursor closely, and get start&end scanlines from BIOS.Søren Schmidt1995-03-301-1/+2
| | | | Notes: svn path=/head/; revision=7498
* Optimized the way physical screen updates are done. Now onlySøren Schmidt1995-03-291-2/+4
| | | | | | | | | | update what has actually been touched. This should speed up screen access on slow hardware. Introduced setting of "destructive" cursor size, much like the old hardware cursor. Notes: svn path=/head/; revision=7475
* Minor update to syscons.Søren Schmidt1995-03-031-8/+6
| | | | | | | | | | Let "grey delete" be a function key (default is 0x7f) Fix the xor cursor again.. Made the backspace key generate del as default Made CTRL-space generate nul as default. Notes: svn path=/head/; revision=6851
* Incorporate bde's code-review comments.Paul Traina1995-02-281-2/+2
| | | | | | | | | | | | | | (a) bring back ttselect, now that we have xxxdevtotty() it isn't dangerous. (b) remove all of the wrappers that have been replaced by ttselect (c) fix formatting in syscons.c and definition in syscons.h (d) add cxdevtotty NOT DONE: (e) make pcvt work... it was already broken...when someone fixes pcvt to link properly, just rename get_pccons to xxxdevtotty and we're done Notes: svn path=/head/; revision=6782
* (a) remove the pointer to each driver's tty structure array from cdevswPaul Traina1995-02-251-3/+8
| | | | | | | | | | | | (b) add a function callback vector to tty drivers that will return a pointer to a valid tty structure based upon a dev_t (c) make syscons structures the same size whether or not APM is enabled so utilities don't crash if NAPM changes (and make the damn kernel compile!) (d) rewrite /dev/snp ioctl interface so that it is device driver and i386 independant Notes: svn path=/head/; revision=6712
* Next syscons update (given up on numbering :)Søren Schmidt1995-02-221-0/+203
Removed screensavers from syscons, they are now LKM's. This makes it possible to do some really "interesting" screensavers... Fixed bug that sometimes caused garbage to appear when leaving "scroll-lock" history. Reformattet indentation, it got too deep for a normal 80 pos screen. Split up in syscons.c & syscons.h for use with the saver-lkm's. Temporarily removed -s option from vidcontrol, savers should now be loaded with modload. Notes: svn path=/head/; revision=6628