summaryrefslogtreecommitdiff
path: root/sys/dev/syscons/scvidctl.c
Commit message (Collapse)AuthorAgeFilesLines
* syscons: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365088
* Move most of the contents of opt_compat.h to opt_global.h.Brooks Davis2018-04-061-1/+0
| | | | | | | | | | | | | | | | | | | | | opt_compat.h is mentioned in nearly 180 files. In-progress network driver compabibility improvements may add over 100 more so this is closer to "just about everywhere" than "only some files" per the guidance in sys/conf/options. Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h is created on all architectures. Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the set of compiled files. Reviewed by: kib, cem, jhb, jtl Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14941 Notes: svn path=/head/; revision=332122
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-281-26/+0
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* Add tty_set_winsize().Ed Schouten2012-11-031-33/+12
| | | | | | | | This removes some of the signalling magic from the Syscons driver and puts it in the TTY layer, where it belongs. Notes: svn path=/head/; revision=242529
* Clean up code a bit to make it more readable.Jung-uk Kim2010-11-301-42/+40
| | | | Notes: svn path=/head/; revision=216079
* Refine r204265. We want the standard VGA palette for packed pixel mode.Jung-uk Kim2010-03-291-2/+2
| | | | Notes: svn path=/head/; revision=205865
* Improve VESA mode switching via loader tunable `hint.sc.0.vesa_mode'.Jung-uk Kim2010-02-241-28/+43
| | | | | | | The most notable change is history buffer is fully saved/restored now. Notes: svn path=/head/; revision=204281
* Yet another attempt to make palette loading more safer:Jung-uk Kim2010-02-231-1/+9
| | | | | | | | | | | | - Add a separate palette data for 8-bit DAC mode when SC_PIXEL_MODE is set and fill it up with default gray-scale palette data for text. Now we don't have to set `hint.sc.0.vesa_mode' to get the default palette data. - Add a new adapter flag, V_ADP_DAC8 to track whether the controller is using 8-bit palette format and load correct palette when switching modes. - Set 8-bit DAC mode only for non-VGA compatible graphics mode. Notes: svn path=/head/; revision=204265
* Fix pgsignal() call after signature change in r199355.Konstantin Belousov2009-11-171-1/+5
| | | | | | | | Reported and tested by: bf1783 googlemail com MFC after: 1 month Notes: svn path=/head/; revision=199418
* Fix VESA modes and allow 8bit depth modes.Xin LI2009-08-241-0/+4
| | | | | | | | | PR: i386/124902 Submitted by: paradox <ddkprog yahoo com> MFC after: 2 months Notes: svn path=/head/; revision=196524
* Integrate the new MPSAFE TTY layer to the FreeBSD operating system.Ed Schouten2008-08-201-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following: - Improved driver model: The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers. If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver. - Improved hotplugging: With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc). The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly. - Improved performance: One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters. Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING. Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan Notes: svn path=/head/; revision=181905
* Replace explicit calls to video methods with their respective variantsWojciech A. Koszek2007-12-291-7/+7
| | | | | | | | | | | | | | | | | | implemented with macros. This patch improves code readability. Reasoning behind vidd_* is a sort of "video discipline". List of macros is supposed to be complete--all methods of video_switch ought to have their respective macros from now on. Functionally, this code should be no-op. My intention is to leave current behaviour of touched code as is. No objections: rwatson Silence on: freebsd-current@ Approved by: cognet Notes: svn path=/head/; revision=174985
* Fix our ioctl(2) implementation when the argument is "int". NewRuslan Ermilov2006-09-271-2/+28
| | | | | | | | | | | | | | | | ioctls passing integer arguments should use the _IOWINT() macro. This fixes a lot of ioctl's not working on sparc64, most notable being keyboard/syscons ioctls. Full ABI compatibility is provided, with the bonus of fixing the handling of old ioctls on sparc64. Reviewed by: bde (with contributions) Tested by: emax, marius MFC after: 1 week Notes: svn path=/head/; revision=162711
* Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_tMarius Strobl2005-09-281-3/+3
| | | | | | | | | | | | | | | | | | | and do some preparations for handling 12x22 fonts (currently lots of code implies and/or hardcodes a font width of 8 pixels). This will be required on sparc64 which uses a default font size of 12x22 in order to add font loading and saving support as well as to use a syscons(4)-supplied mouse pointer image. This API breakage is committed now so it can be MFC'ed in time for 6.0 and later on upcoming framebuffer drivers destined for use on sparc64 and which are expected to rely on using font loading internally and on a syscons(4)-supplied mouse pointer image can be easily MFC'ed to RELENG_6 rather than requiring a backport. Tested on: i386, sparc64, make universe MFC after: 1 week Notes: svn path=/head/; revision=150686
* In sc_set_text_mode(), reset fontwidth if it is <= 0.Craig Rodrigues2005-09-061-0/+2
| | | | | | | | | | | Eliminates division by zero errors in syscons driver. Reported by: keramida, Slawa Olhovchenkov <slw at zxy dot spb dot ru>, Kyryll Mirnenko <mirya at matrix dot kiev dot ua> Tested by: keramida, rodrigc Notes: svn path=/head/; revision=149828
* Prevent division by zero errors in sc_mouse_move()Craig Rodrigues2005-08-301-6/+8
| | | | | | | | | | | | | by explicitly setting sc->font_width, in the same places where sc->font_size is set, instead of relying on the default initialized value of 0 for sc->font_width. PR: kern/84836 Reported by: Andrey V. Elsukov <bu7cher at yandex dot ru> MFC after: 2 days Notes: svn path=/head/; revision=149640
* Deny to switch into banked video mode when it is not available. SomeXin LI2005-05-301-1/+2
| | | | | | | | | users has reported corrupted display with old video cards. Submitted by: Michal Mertl <mime traveller cz> Notes: svn path=/head/; revision=146800
* Add VESA mode support for syscons, which enables the support of 15, 16,Xin LI2005-05-291-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | 24, and 32 bit modes. To use that, syscons(4) must be built with the compile time option 'options SC_PIXEL_MODE', and VESA support (a.k.a. vesa.ko) must be either loaded, or be compiled into the kernel. Do not return EINVAL when the mouse state is changed to what it already is, which seems to cause problems when you have two mice attached, and applications are not likely obtain useful information through the EINVAL caused by showing the mouse pointer twice. Teach vidcontrol(8) about mode names like MODE_<NUMBER>, where <NUMBER> is the video mode number from the vidcontrol -i mode output. Also, revert the video mode if something fails. Obtained from: DragonFlyBSD Discussed at: current@ with patch attached [1] PR: kern/71142 [2] Submitted by: Xuefeng DENG <dsnofe at msn com> [1], Cyrille Lefevre <cyrille dot lefevre at laposte dot net> [2] Notes: svn path=/head/; revision=146736
* Remove erroneous semicolons.Stefan Farfeleder2004-07-131-1/+1
| | | | Notes: svn path=/head/; revision=132107
* Use __FBSDID().David E. O'Brien2003-08-241-2/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119420
* Fix endian bugs accessing ioctl arguments that are passed by value.Jake Burkholder2003-08-241-2/+2
| | | | Notes: svn path=/head/; revision=119378
* Replace various spelling with FALLTHROUGH which is lint()ablePhilippe Charnier2002-08-251-2/+2
| | | | Notes: svn path=/head/; revision=102412
* Lock struct pgrp, session and sigio.Seigo Tanimura2002-02-231-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current) Notes: svn path=/head/; revision=91140
* KSE Milestone 2Julian Elischer2001-09-121-1/+1
| | | | | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha Notes: svn path=/head/; revision=83366
* Add FBIO_BLANK ioctl support. Return ENODEV for yet-to-be-Kazutaka YOKOTA2001-08-021-0/+5
| | | | | | | supported ioctls for now. Notes: svn path=/head/; revision=81039
* With this commit, I hereby pronounce gensetdefs past its use-by date.Peter Wemm2001-06-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the a.out emulation of 'struct linker_set' with something a little more flexible. <sys/linker_set.h> now provides macros for accessing elements and completely hides the implementation. The linker_set.h macros have been on the back burner in various forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()), John Polstra (ELF clue) and myself (cleaned up API and the conversion of the rest of the kernel to use it). The macros declare a strongly typed set. They return elements with the type that you declare the set with, rather than a generic void *. For ELF, we use the magic ld symbols (__start_<setname> and __stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the trick about how to force ld to provide them for kld's. For a.out, we use the old linker_set struct. NOTE: the item lists are no longer null terminated. This is why the code impact is high in certain areas. The runtime linker has a new method to find the linker set boundaries depending on which backend format is in use. linker sets are still module/kld unfriendly and should never be used for anything that may be modular one day. Reviewed by: eivind Notes: svn path=/head/; revision=78161
* Initiate deorbit burn sequence for <machine/console.h>.Poul-Henning Kamp2000-10-081-2/+2
| | | | | | | | | | | | Replace all in-tree uses with necessary subset of <sys/{fb,kb,cons}io.h>. This is also the appropriate fix for exo-tree sources. Put warnings in <machine/console.h> to discourage use. November 15th 2000 the warnings will be converted to errors. January 15th 2001 the <machine/console.h> files will be removed. Notes: svn path=/head/; revision=66834
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-1/+1
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-1/+1
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* Supported EGC 640x400, PEGC 640x400 and PEGC 640x480 graphics modes.Yoshihiro Takahashi2000-04-271-0/+5
| | | | | | | | Submitted by: Chiharu Shibata <chi@bd.mbn.or.jp> and Tomokazu HARADA <tkhara@osk4.3web.ne.jp> Notes: svn path=/head/; revision=59689
* - Fix SC_ALT_MOUSE_IMAGE; don't blink the mouse cursor.Kazutaka YOKOTA2000-03-311-9/+9
| | | | | | | - Fix non-destructive, underline text cursor. Notes: svn path=/head/; revision=58872
* Use config's conditional compilation rather than using #ifdefs that makePeter Wemm2000-01-291-5/+0
| | | | | | | | modular compilation harder. I'm doing this because people seem to like cut/pasting examples of bad practices in existing code. Notes: svn path=/head/; revision=56836
* Fix wrong usage of FONT_NONE. It was not meant to be set inKazutaka YOKOTA2000-01-201-2/+2
| | | | | | | | | | scp->font_size in the first place. It is redundant now and is removed. Found by: bde Notes: svn path=/head/; revision=56328
* This is the 3rd stage of syscons code reorganization.Kazutaka YOKOTA2000-01-151-38/+67
| | | | | | | | | | | | | | | | | | - Split terminal emulation code from the main part of the driver so that we can have alternative terminal emulator modules if we like in the future. (We are not quite there yet, though.) - Put sysmouse related code in a separate file, thus, simplifying the main part of the driver. As some files are added to the source tree, you need to run config(8) before you compile a new kernel next time. You shouldn't see any functional change by this commit; this is only internal code reorganization. Notes: svn path=/head/; revision=56043
* - Removed SC_VIDEO_DEBUG. It is broken and useless now.Kazutaka YOKOTA1999-11-081-22/+0
| | | | Notes: svn path=/head/; revision=53008
* - Hang the scr_stat struct from dev_t.Kazutaka YOKOTA1999-09-191-1/+2
| | | | | | | | | | | | | | | | - Remove sc_get_scr_stat(). It's not necessary anymore. - Call ttymalloc() to allocate the struct tty for each vty, rather than statically declaring an array of struct tty. We still need a statically allocated struct tty for the first vty which is used for the kernel console I/O, though. - Likewise, call ttymalloc() for /dev/sysmouse and /dev/consolectl. - Delete unnecessary test on the pointer struct tty *tp in some functions. - Delete unused code in scmouse.c. WARNING: this change requires you to recompile screen savers! Notes: svn path=/head/; revision=51404
* - Preserve the content of the back scroll buffer when changing theKazutaka YOKOTA1999-09-191-0/+8
| | | | | | | | | | video mode. Requested by: a lot of people. PR: kern/13764 Notes: svn path=/head/; revision=51394
* Enable ioctls to manipulate color palette. They have been implemented,Kazutaka YOKOTA1999-09-021-3/+0
| | | | | | | but disabled until now... Notes: svn path=/head/; revision=50793
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* - Retain the previous vty and history buffers when setting upKazutaka YOKOTA1999-08-271-8/+5
| | | | | | | | the graphics mode. This was the behavior prior to syscons.c rev 1.278, but broken in scvidctl.c rev 1.1. Notes: svn path=/head/; revision=50447
* - Fixed memory leak in sc_alloc_history_buffer().Kazutaka YOKOTA1999-07-071-3/+14
| | | | | | | | | | | - Correctly observe the variable `extra_history_size' when changing the size of history (scroll back) buffer. - Added sc_free_history_buffer(). Pointed out by: des Notes: svn path=/head/; revision=48667
* The second phase of syscons reorganization.Kazutaka YOKOTA1999-06-221-130/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Split syscons source code into manageable chunks and reorganize some of complicated functions. - Many static variables are moved to the softc structure. - Added a new key function, PREV. When this key is pressed, the vty immediately before the current vty will become foreground. Analogue to PREV, which is usually assigned to the PrntScrn key. PR: kern/10113 Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de> - Modified the kernel console input function sccngetc() so that it handles function keys properly. - Reorganized the screen update routine. - VT switching code is reorganized. It now should be slightly more robust than before. - Added the DEVICE_RESUME function so that syscons no longer hooks the APM resume event directly. - New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING, SC_NO_HISTORY and SC_NO_SYSMOUSE. Various parts of syscons can be omitted so that the kernel size is reduced. SC_PIXEL_MODE Made the VESA 800x600 mode an option, rather than a standard part of syscons. SC_DISABLE_DDBKEY Disables the `debug' key combination. SC_ALT_MOUSE_IMAGE Inverse the character cell at the mouse cursor position in the text console, rather than drawing an arrow on the screen. Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG) SC_DFLT_FONT makeoptions "SC_DFLT_FONT=_font_name_" Include the named font as the default font of syscons. 16-line, 14-line and 8-line font data will be compiled in. This option replaces the existing STD8X16FONT option, which loads 16-line font data only. - The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c. - The video driver provides a set of ioctl commands to manipulate the frame buffer. - New kernel configuration option: VGA_WIDTH90 Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These modes are mot always supported by the video card. PR: i386/7510 Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx. - The header file machine/console.h is reorganized; its contents is now split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h (another new file). machine/console.h is still maintained for compatibility reasons. - Kernel console selection/installation routines are fixed and slightly rebumped so that it should now be possible to switch between the interanl kernel console (sc or vt) and a remote kernel console (sio) again, as it was in 2.x, 3.0 and 3.1. - Screen savers and splash screen decoders Because of the header file reorganization described above, screen savers and splash screen decoders are slightly modified. After this update, /sys/modules/syscons/saver.h is no longer necessary and is removed. Notes: svn path=/head/; revision=48104
* - Don't assume the line length in the video memory is always the same asKazutaka YOKOTA1999-02-051-2/+2
| | | | | | | | | | 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. Notes: svn path=/head/; revision=43664
* sysconsKazutaka YOKOTA1999-01-191-1/+3
| | | | | | | | | | | | | | | | | | | | - 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
* The first stage of console driver reorganization: activate newKazutaka YOKOTA1999-01-111-38/+123
| | | | | | | | | | | | | | | | 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
* Yet another round of fixes for the VESA support code.Kazutaka YOKOTA1998-10-011-6/+3
| | | | | | | | | | | | | | | | | - 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/+4
| | | | | | | This is only for standard modes, I don't check vesa modes yet. Notes: svn path=/head/; revision=39742
* Cosmetic change: adjust copyright notice.Kazutaka YOKOTA1998-09-251-17/+14
| | | | Notes: svn path=/head/; revision=39643
* Fix and update for VESA BIOS support in syscons.Kazutaka YOKOTA1998-09-231-14/+27
| | | | | | | | | | | | | | | | | | | - 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