summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons
Commit message (Collapse)AuthorAgeFilesLines
* Lower the priority of the sleep in the syscons for "waitvt" wchan tokib2008-08-041-1/+1
| | | | | | | | | PZERO + 1. The sleeping process at the priority <= PZERO is counted as blocked, or, as comment states, 'disk wait'. PZERO + 1 works as well, and does not cause user confusion. Reported by: sam <samflanker at gmail com> MFC after: 1 week
* Introduce a new lock, hostname_mtx, and use it to synchronize accessrwatson2008-07-051-0/+2
| | | | | | | | | | | | to global hostname and domainname variables. Where necessary, copy to or from a stack-local buffer before performing copyin() or copyout(). A few uses, such as in cd9660 and daemon_saver, remain under-synchronized and will require further updates. Correct a bug in which a failed copyin() of domainname would leave domainname potentially corrupted. MFC after: 3 weeks
* The "free-lance" timer in the i8254 is only used for the speakerphk2008-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | these days, so de-generalize the acquire_timer/release_timer api to just deal with speakers. The new (optional) MD functions are: timer_spkr_acquire() timer_spkr_release() and timer_spkr_setfreq() the last of which configures the timer to generate a tone of a given frequency, in Hz instead of 1/1193182th of seconds. Drop entirely timer2 on pc98, it is not used anywhere at all. Move sysbeep() to kern/tty_cons.c and use the timer_spkr*() if they exist, and do nothing otherwise. Remove prototypes and empty acquire-/release-timer() and sysbeep() functions from the non-beeping archs. This eliminate the need for the speaker driver to know about i8254frequency at all. In theory this makes the speaker driver MI, contingent on the timer_spkr_*() functions existing but the driver does not know this yet and still attaches to the ISA bus. Syscons is more tricky, in one function, sc_tone(), it knows the hz and things are just fine. In the other function, sc_bell() it seems to get the period from the KDMKTONE ioctl in terms if 1/1193182th second, so we hardcode the 1193182 and leave it at that. It's probably not important. Change a few other sysbeep() uses which obviously knew that the argument was in terms of i8254 frequency, and leave alone those that look like people thought sysbeep() took frequency in hertz. This eliminates the knowledge of i8254_freq from all but the actual clock.c code and the prof_machdep.c on amd64 and i386, where I think it would be smart to ask for help from the timecounters anyway [TBD].
* Improve VT_WAITACTIVE semantics.bland2008-03-201-13/+6
| | | | | | | | - Wait for requested vty activation regardless its open state. - Remove redundant console cleanup. Approved by: kib MFC after: 1 week
* In keeping with style(9)'s recommendations on macros, use a ';'rwatson2008-03-161-1/+1
| | | | | | | | | after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr. MFC after: 1 month Discussed with: imp, rink
* Mark the syscons video spin mutex as recursable since it is currentlyjhb2008-02-131-1/+2
| | | | | | recursed in a few places. MFC after: 1 week
* Do not dereference NULL scp in the case the screen is not opened.kib2008-01-241-0/+2
| | | | | | | | Instead, return ENXIO to the ioctl caller. Reported and tested by: Pawel Worach <pawel.worach gmail com> Discussed with: markus MFC after: 3 days
* Replace explicit calls to video methods with their respective variantswkoszek2007-12-2915-127/+108
| | | | | | | | | | | | | | | 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
* Remove explicit calls to keyboard methods with their respective variantswkoszek2007-12-292-48/+28
| | | | | | | | | | | | | | | implemented with macros. This patch improves code readability. Reasoning behind kbdd_* is a "keyboard discipline". List of macros is supposed to be complete--all methods of keyboard_switch should have their respective macros from now on. Functionally, this code should be no-op. My intention is to leave current behaviour of code as is. Glanced at by: rwatson Reviewed by: emax, marcel Approved by: cognet
* Add a new 'why' argument to kdb_enter(), and a set of constants to userwatson2007-12-251-1/+1
| | | | | | | | | for that argument. This will allow DDB to detect the broad category of reason why the debugger has been entered, which it can use for the purposes of deciding which DDB script to run. Assign approximate why values to all current consumers of the kdb_enter() interface.
* Serialize output routine of terminal emulator (te_puts()) by a lock.simokawa2007-09-202-1/+14
| | | | | | | | | | | | | | - The output routine of low level console is not protected by any lock by default. - Increment and decrement of sc->write_in_progress are not atomic and this may cause console hang. - We also have many other states used by emulator that should be protected by the lock. - This change does not fix interspersed messages which PRINTF_BUFR_SIZE kernel option should fix. Approved by: re (bmah) MFC after: 1 week
* Fix a bug that will cause a process that calls the VT_WAITACTIVE ioctlmarcus2007-09-191-2/+1
| | | | | | | | | | | to become unkillable when that process is sent a termination signal. The process will sit in waitvt looping in the kernel, and chewing up all available CPU until the system is rebooted. Submitted by: Jilles Tjoelker <jilles@stack.nl> Reviewed by: bde Approved by: re (kensmith) MFC after: 1 week
* According to the default font size on sparc64 provide a 12 x 22marius2007-06-181-1/+32
| | | | | | | | mouse pointer instead of a 8 x 16 one so device drivers don't need to bring there own one there and in gfb_mouse() (ab)use the pixel_mask argument of putm() to pass along on/off info as erasing the mouse cursor image by redrawing the text underneath doesn't work as we use hardware cursors on sparc64.
* - Change comments and asserts to reflect the removal of the globaljeff2007-06-041-2/+2
| | | | | | | | scheduler lock. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
* Make the comparsion more obvious.delphij2007-05-251-1/+2
|
* Optimize set_origin() use in some screensavers to stop them eatingphilip2007-02-214-12/+40
| | | | | | | | cpu power when the origin hasn't changed. PR: kern/100683 Submitted by: Gareth McCaughan <gareth -dot- mccaughan -at- pobox.com> MFC after: 3 days
* Correct the VGA_NO_MODE_CHANGE end marker comment.marius2007-01-101-1/+1
|
* Replace magic numbers for console bell types with defines.ru2006-11-161-2/+2
|
* Sometimes the vty switching has to be delayed; the vtyru2006-11-061-1/+1
| | | | | | | | | | | | | | | | | | to be switched to is saved in sc->delayed_next_scr and the actual switch is performed later. It was possible to get into the endless loop when attempting to switch to a closed vty (which is not allowed and beep-alerted when attempted) and when the visual beep was in effect. This caused sc->delayed_next_scr to never be reset and endless attempts to switch to a closed vty and endless visual beeping. How to repeat: - boot into single-user - run "kbdcontrol -b visual" - quickly press Alt+F2 two times PR: kern/68016 X-MFC after: 6.2-RELEASE
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-062-3/+6
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Fix our ioctl(2) implementation when the argument is "int". Newru2006-09-272-7/+108
| | | | | | | | | | | | | 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
* Introduce a spinlock for synchronizing access to the video output hardwarescottl2006-09-133-19/+38
| | | | | | | | | in syscons. This replaces a simple access semaphore that was assumed to be protected by Giant but often was not. If two threads that were otherwise SMP-safe called printf at the same time, there was a high likelyhood that the semaphore would get corrupted and result in a permanently frozen video console. This is similar to what is already done in the serial console drivers.
* Convert to new console apiphk2006-05-261-19/+11
|
* GC the cn_dbctl_t hook for consoles, it is unused.phk2006-05-261-33/+1
| | | | | | | This used to make syscons switch to vty0 when we entered DDB but this was lost in the KDB shuffle. We may want to bring it back down the road but it should be done by calling cn_init_t/cn_term_t instead, possibly with a flag argument saying "Debugger!"
* APM was calling the suspend process from a timeout. This meant thatimp2006-05-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | other timeouts could not happen while suspending, including timeouts for things like msleep. This caused the system to hang on suspend when the cbb was enabled, since its suspend path powered down the socket which used a timeout to wait for it to be done. APM now creates a thread when it is enabled, and deletes the thread when it is disabled. This thread takes the place of the timeout by doing its polling every ~.9s. When the thread is disabled, it will wakeup early, otherwise it times out and polls the varius things the old timeout polled (APM events, suspend delays, etc). This makes my Sony VAIO 505TS suspend/resume correctly when APM is enabled (ACPI is black listed on my 505TS). This will likely fix other problems with the suspend path where drivers would sleep with msleep and/or do other timeouts. Maybe there's some special case code that would use DELAY while suspending and msleep otherwise that can be revisited and removed. This was also tested by glebius@, who pointed out that in the patch I sent him, I'd forgotten apm_saver.c MFC After: 3 weeks
* Send the pcvt(4) driver off to retirement.phk2006-05-171-1/+0
|
* Check the return code of sc_clean_up() in the only place where itkeramida2006-05-121-1/+3
| | | | | | | | | was not checked at all. There is only one case when sc_clean_up() can fail, because of wait_scrn_saver_stop(), but it doesn't hurt to check anyway. Reviewed by: rodrigc Found by: Coverity Prevent
* Remove various bits of conditional Alpha code and fixup a few comments.jhb2006-05-123-18/+4
|
* Integrate kbdmux(4) into syscons(4) and kbd code.emax2006-02-281-4/+42
| | | | | | | | | | | | | | | | | | | | By default syscons(4) will look for the kbdmux(4) keyboard first, and then, if not found, look for any keyboard. Current kbd code is modified so if kbdmux(4) is the current keyboard, all new keyboards are automatically added to the kbdmux(4). Switch to kbdmux(4) can be done at boot time, by loading kbdmux module at the loader prompt, or at runtime, by kldload'ing the kbdmux module and releasing current active keyboard. If, for whatever reason, kbdmux(4) is not required/desired then just do not load it and everything should work as before. It is also possible to kldunload kbdmux at runtime and syscons(4) will automatically switch to the first available keyboard. No response from: freebsd-current@ MFC after: 1 day
* When SC_DISABLE_KDBKEY or SC_DISABLE_REBOOT are not defined allow thebrooks2006-01-141-4/+25
| | | | | | | | | | | | same behavior to be controlled by the sysctls, hw.syscons.kbd_kbdkey and hw.syscons.kbd_reboot respectively. Apologies to the submitter for taking so long to commit this simple change. PR: kern/72728 Submitted by: Luca Morettoni <morettoni at libero dot it> MFC After: 3 days
* Fix -Wundef.ru2005-12-045-8/+8
|
* Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_tmarius2005-09-286-26/+31
| | | | | | | | | | | | | | | | 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
* In set_mouse_pos(), try to avoid division by zero errors.rodrigc2005-09-071-1/+2
|
* In sc_set_text_mode(), reset fontwidth if it is <= 0.rodrigc2005-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
* Prevent division by zero errors in sc_mouse_move()rodrigc2005-08-305-14/+17
| | | | | | | | | | 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
* kbdmux(4) keyboard multiplexer integrationemax2005-07-131-0/+7
| | | | | | | | | | | | | | | | | | | o Add two new ioctl's KBADDKBD and KBRELKBD. These are used to add and remove keyboard to (and from) kbdmux(4) keyboard multiplexer; o Introduce new kbd_find_keyboard2() function. It does exactly the same job as kbd_find_keyboard() function except it allows to specify starting index. This function can be used to iterate over keyboards array; o Re-implement kbd_find_keyboard() as call to kbd_find_keyboard2() with starting index of zero; o Make sure syscons(4) passed KBADDKBD and KBRELKBD ioctl's onto currently active keyboard. These changes should not have any visible effect. MFC after: 1 week
* Fix syscons on amd64. The SC_PIXEL_MODE commit from May 29th added a newpeter2005-06-142-4/+4
| | | | | | | | | | | | function pointer to the vga render dispatch table and initialized it with vga_nop. The problem is that vga_nop() is a varargs function, and the table declares a non-varargs function pointer. On amd64 (and I think ppc), mixing varargs and non-varargs function pointers is fatal. Change vga_nop() and gfb_nop() from varargs to non-varargs do-nothing functions. This stops the stack corruption that only happened on amd64. Approved by: re (scottl)
* Only set mode when the incoming ioctl is IOC_VOID, until we have betterdelphij2005-06-101-1/+3
| | | | | | | solution against the ioctl collisions. Submitted by: Antoine Brodin <antoine.brodin at laposte net> PR: kern/81867
* Fix LINT by defining vga_pxlmouse_planar and vga_pxlmouse_direct.scottl2005-05-301-1/+2
|
* Deny to switch into banked video mode when it is not available. Somedelphij2005-05-301-1/+2
| | | | | | users has reported corrupted display with old video cards. Submitted by: Michal Mertl <mime traveller cz>
* Add vr_init_t member to sc_rndr_sw_t instances in order to unbreakmarius2005-05-291-0/+3
| | | | compilation after sys/dev/syscons/syscons.h rev. 1.83.
* Add VESA mode support for syscons, which enables the support of 15, 16,delphij2005-05-296-71/+479
| | | | | | | | | | | | | | | | | | | | | 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]
* - Not every architecture defaults to a black background (e.g. sparc64marius2005-05-211-9/+9
| | | | | | | uses white) so base the color of the border on SC_NORM_ATTR rather than hardcoding BG_BLACK. - Use SC_DRIVER_NAME rather than hardcoding 'sc' in message strings (see also sys/dev/syscons/syscons.h rev. 1.82).
* On sparc64 use 'syscons' rather than 'sc' for SC_DRIVER_NAME somarius2005-05-211-0/+8
| | | | | | | syscons(4) and its pseudo-devices don't get confused (including by other device drivers) with the system controller devices which are also termed 'sc' in the OFW tree (and which we probably want to interface with hwpmc(4) one day).
* Remove superfluous braces and add #ifndef __sparc64__ around themarius2005-05-211-18/+41
| | | | | | | | VTB_FRAMEBUFFER specific code. On sparc64 we don't use a buffer of type VTB_FRAMEBUFFER (see syscons.c) and excluding the respective code here allows to compile syscons(4) without isa(4). Requested by: joerg, marcel, yongari
* For sparc64 conditionalize the compilation of the gfb_cursor() variantmarius2005-05-211-4/+1
| | | | | | | which doesn't assume a hardware cursor on __sparc64__ rather than on DEV_CREATOR. If we want to include more than one framebuffer driver in e.g. the GENERIC kernel all drivers have to work the same way. Now that DEV_CREATOR is no longer used remove it from options.sparc64.
* Remove old epson note support.nyan2005-05-151-21/+2
|
* - Add color tables for 16 colors mode and 8 colors mode, use a differentnyan2005-05-151-27/+16
| | | | | table on the pc98 console. - Remove old epson note support.
* - Mask an underline attribute on the pc98 console. It enables to use the samenyan2005-05-151-49/+28
| | | | | color on the pc98 and the others. - Remove old epson note support.
* Remove the ADJUST_CLOCK ioctl on pc98. It's not used at all.nyan2005-05-151-6/+0
|
OpenPOWER on IntegriCloud