Commit Graph

731 Commits

Author SHA1 Message Date
Ed Schouten
b4b1c5169d Replace syscons terminal renderer by a new renderer that uses libteken.
Some time ago I started working on a library called libteken, which is
terminal emulator. It does not buffer any screen contents, but only
keeps terminal state, such as cursor position, attributes, etc. It
should implement all escape sequences that are implemented by the
cons25 terminal emulator, but also a fair amount of sequences that are
present in VT100 and xterm.

A lot of random notes, which could be of interest to users/developers:

- Even though I'm leaving the terminal type set to `cons25', users can
  do experiments with placing `xterm-color' in /etc/ttys. Because we
  only implement a subset of features of xterm, this may cause
  artifacts. We should consider extending libteken, because in my
  opinion xterm is the way to go. Some missing features:

  - Keypad application mode (DECKPAM)
  - Character sets (SCS)

- libteken is filled with a fair amount of assertions, but unfortunately
  we cannot go into the debugger anymore if we fail them. I've done
  development of this library almost entirely in userspace. In
  sys/dev/syscons/teken there are two applications that can be helpful
  when debugging the code:

  - teken_demo: a terminal emulator that can be started from a regular
    xterm that emulates a terminal using libteken. This application can
    be very useful to debug any rendering issues.

  - teken_stress: a stress testing application that emulates random
    terminal output. libteken has literally survived multiple terabytes
    of random input.

- libteken also includes support for UTF-8, but unfortunately our input
  layer and font renderer don't support this. If users want to
  experiment with UTF-8 support, they can enable `TEKEN_UTF8' in
  teken.h. If you recompile your kernel or the teken_demo application,
  you can hold some nice experiments.

- I've left PC98 the way it is right now. The PC98 platform has a custom
  syscons renderer, which supports some form of localised input. Maybe
  we should port PC98 to libteken by the time syscons supports UTF-8?

- I've removed the `dumb' terminal emulator. It has been broken for
  years. It hasn't survived the `struct proc' -> `struct thread'
  conversion.

- To prevent confusion among people that want to hack on libteken:
  unlike syscons, the state machines that parse the escape sequences are
  machine generated. This means that if you want to add new escape
  sequences, you have to add an entry to the `sequences' file. This will
  cause new entries to be added to `teken_state.h'.

- Any rendering artifacts that didn't occur prior to this commit are by
  accident. They should be reported to me, so I can fix them.

Discussed on:	current@, hackers@
Discussed with:	philip (at 25C3)
2009-01-01 13:26:53 +00:00
Maksim Yevmenkin
8fc061164d Undo revision 185013 until better solution is found.
Pointed out by:	bde
2008-11-17 20:33:13 +00:00
Maksim Yevmenkin
ae670dad61 More locking for syscons(4). This should prevent races with sckbdevent().
PR:		kern/127446
Submitted by:	Eygene Ryabinkin rea-fbsd at codelabs dot ru
2008-11-16 22:39:04 +00:00
Ed Schouten
5bbae50149 Reduce the default baud rate of PTY's to 9600.
On RELENG_6 (and probably RELENG_7) we see our syscons windows and
pseudo-terminals have the following buffer sizes:

| LINE RAW CAN OUT IHIWT ILOWT OHWT LWT     COL STATE  SESS      PGID DISC
| ttyv0  0   0   0  7680  6720 2052 256       7 OCcl       1146  1146 term
| ttyp0  0   0   0  7680  6720 1296 256       0 OCc       82033 82033 term

These buffer sizes make no sense, because we often have much more output
than input, but I guess having higher input buffer sizes improves
guarantees of the system.

On MPSAFE TTY I just sent both the input and output buffer sizes to 7
KB, which is pretty big on a standard FreeBSD install with 8 syscons
windows and some PTY's. Reduce the baud rate to 9600 baud, which means
we now have the following buffer sizes:

|  LINE   INQ  CAN  LIN  LOW  OUTQ  USE  LOW   COL  SESS  PGID STATE
| ttyv0  1920    0    0  192  1984    0  199     7  2401  2401 Oil
| pts/0  1920    0    0  192  1984    0  199  5631  1305  2526 Oi

This is a lot smaller, but for pseudo-devices this should be good
enough. You need to do a lot of punching to fill up a 7.5 KB input
buffer. If it turns out things don't work out this way, we'll just
switch to 19200 baud.
2008-11-08 20:40:39 +00:00
Ed Schouten
0639d527ca Disable processing of output data after disabling scroll lock by force.
The syscons code disabled scroll lock inside sc_cnputs() if it's going
to print a system message. The code currently wants to process any TTY
output data as well, but we cannot do this, because the TTY lock is a
sleep mutex, while cnputs() picks up a spin mutex.

Disable the code for now. It solves a panic when a console message is
printed while scroll lock is enabled. One solution would be to
initialize a task structure here.

Reported by:	Paul B. Mahol <onemda gmail com>
2008-08-31 10:17:40 +00:00
Ed Schouten
537de51435 Make syscons(4) use ttyv0 instead of consolectl as its primary window.
When I was hacking on uart(4) to make it work with the MPSAFE TTY layer,
I noticed there was a difference between the way syscons and uart work
with respect to consoles:

- The uart(4) driver sets cn_name to the corresponding ttyu%r node,
  which means init(8) (which opens /dev/console) will have its output
  redirected to /dev/ttyu%r. After /etc/rc is done, it can spawn a getty
  on that device node as well.

- Syscons used a little different approach. Apart from the /dev/ttyv%r
  nodes, it creates a /dev/consolectl node. This device node is used by
  moused and others to deliver their data, but for some reason it also
  acts as a TTY, which shares its stat structure with ttyv0. This device
  node is used as a console (run conscontrol).

There are a couple advantages of this approach:

- Because we use two different TTY's to represent the 0th syscons
  window, we allocate two sets of TTY buffers. Even if you don't use
  /dev/consolectl after the system has booted (systems that don't run
  moused), it seems the buffers are still allocated.

- We have to apply an evil hack to redirect input to /dev/consolectl.
  Because each window (stat) is associated not associated with one TTY,
  syscons solves this by redirecting all input to closed TTY's to
  consolectl.

  This means that opening /dev/ttyv0 while in single user mode will
  probably cause strange things to happen with respect to keyboard input
  redirection.

The first patch that I discussed with philip@ turned consolectl into a
symlink to ttyv0, but this was not a good idea, because in theory we
would want consolectl to be a simple device node, which contains all the
`privileged' ioctl()'s. Apart from that, it didn't work, because each
time /dev/ttyv0 got revoked, moused also lost its descriptor to deliver
input, which meant you had to plug out/in your mouse to make it work
again. This version just leaves the consolectl device the way it is. It
can still be used to write output to ttyv0, but it can no longer receive
any input.

In my opinion this patch is not a complete solution, but it's already a
step in the good direction. It would allow us to turn consolectl into a
special (non-TTY) device node in the far future. It shaves off 15 KB of
wasted TTY buffer space.

Discussed with:	philip
2008-08-24 19:50:57 +00:00
Ed Schouten
dd63e2a189 Make sysmouse(4) use its own locks, instead of using Giant.
When I changed syscons(4) to work with the MPSAFE TTY code, I just
locked all device nodes down using the compatibility feature that allows
you to override the TTY's lock (Giant in this case). Upon closer
inspection, it seems sysmouse(4) only has two internal variables that
need locking: mouse_level and mouse_status.

I haven't done any performance benchmarks on this, though I think it
won't have any dramatic improvements on the system. It is good to get
rid of Giant here, because the third argument of tty_alloc() has only
been added to ease migration to MPSAFE TTY. It should not be used when
not needed.

While there, remove SC_MOUSE, which is a leftover from the MPSAFE TTY
import.
2008-08-24 15:20:44 +00:00
Ed Schouten
bc093719ca Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
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
2008-08-20 08:31:58 +00:00
Bjoern A. Zeeb
603724d3ab Commit step 1 of the vimage project, (network stack)
virtualization work done by Marko Zec (zec@).

This is the first in a series of commits over the course
of the next few weeks.

Mark all uses of global variables to be virtualized
with a V_ prefix.
Use macros to map them back to their global names for
now, so this is a NOP change only.

We hope to have caught at least 85-90% of what is needed
so we do not invalidate a lot of outstanding patches again.

Obtained from:	//depot/projects/vimage-commit2/...
Reviewed by:	brooks, des, ed, mav, julian,
		jamie, kris, rwatson, zec, ...
		(various people I forgot, different versions)
		md5 (with a bit of help)
Sponsored by:	NLnet Foundation, The FreeBSD Foundation
X-MFC after:	never
V_Commit_Message_Reviewed_By:	more people than the patch
2008-08-17 23:27:27 +00:00
Konstantin Belousov
66548e0a2f Lower the priority of the sleep in the syscons for "waitvt" wchan to
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
2008-08-04 12:22:33 +00:00
Robert Watson
4f7d1876d5 Introduce a new lock, hostname_mtx, and use it to synchronize access
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
2008-07-05 13:10:10 +00:00
Poul-Henning Kamp
e465985885 The "free-lance" timer in the i8254 is only used for the speaker
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].
2008-03-26 20:09:21 +00:00
Alexander Nedotsukov
debf713e45 Improve VT_WAITACTIVE semantics.
- Wait for requested vty activation regardless its open state.
- Remove redundant console cleanup.

Approved by:	kib
MFC after:	1 week
2008-03-20 04:10:52 +00:00
Robert Watson
237fdd787b In keeping with style(9)'s recommendations on macros, use a ';'
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
2008-03-16 10:58:09 +00:00
John Baldwin
1d9c3ad3ef Mark the syscons video spin mutex as recursable since it is currently
recursed in a few places.

MFC after:	1 week
2008-02-13 23:38:08 +00:00
Konstantin Belousov
eee74fe05d Do not dereference NULL scp in the case the screen is not opened.
Instead, return ENXIO to the ioctl caller.

Reported and tested by:	Pawel Worach <pawel.worach gmail com>
Discussed with:	markus
MFC after:	3 days
2008-01-24 15:37:48 +00:00
Wojciech A. Koszek
9336e0699b Replace explicit calls to video methods with their respective variants
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
2007-12-29 23:26:59 +00:00
Wojciech A. Koszek
259699b294 Remove explicit calls to keyboard methods with their respective variants
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
2007-12-29 21:55:25 +00:00
Robert Watson
3de213cc00 Add a new 'why' argument to kdb_enter(), and a set of constants to use
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.
2007-12-25 17:52:02 +00:00
Hidetoshi Shimokawa
a69d19dc33 Serialize output routine of terminal emulator (te_puts()) by a lock.
- 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
2007-09-20 04:05:59 +00:00
Joe Marcus Clarke
e1433e6b8a Fix a bug that will cause a process that calls the VT_WAITACTIVE ioctl
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
2007-09-19 03:59:33 +00:00
Marius Strobl
7ca851e3a5 According to the default font size on sparc64 provide a 12 x 22
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.
2007-06-18 22:15:17 +00:00
Jeff Roberson
1b1618fb12 - Change comments and asserts to reflect the removal of the global
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)
2007-06-04 23:57:32 +00:00
Xin LI
77a20b72ef Make the comparsion more obvious. 2007-05-25 13:13:12 +00:00
Philip Paeps
0754972c5c Optimize set_origin() use in some screensavers to stop them eating
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
2007-02-21 12:27:12 +00:00
Marius Strobl
2e297271ca Correct the VGA_NO_MODE_CHANGE end marker comment. 2007-01-10 19:04:00 +00:00
Ruslan Ermilov
5a66b66324 Replace magic numbers for console bell types with defines. 2006-11-16 12:27:51 +00:00
Ruslan Ermilov
4f32adad48 Sometimes the vty switching has to be delayed; the vty
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
2006-11-06 19:06:07 +00:00
Robert Watson
acd3428b7d Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
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>
2006-11-06 13:42:10 +00:00
Ruslan Ermilov
9fddcc6661 Fix our ioctl(2) implementation when the argument is "int". New
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
2006-09-27 19:57:02 +00:00
Scott Long
988129b824 Introduce a spinlock for synchronizing access to the video output hardware
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.
2006-09-13 15:48:15 +00:00
Poul-Henning Kamp
7672c95932 Convert to new console api 2006-05-26 13:54:27 +00:00
Poul-Henning Kamp
16b1613a31 GC the cn_dbctl_t hook for consoles, it is unused.
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!"
2006-05-26 10:24:00 +00:00
Warner Losh
d708737568 APM was calling the suspend process from a timeout. This meant that
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
2006-05-25 23:06:38 +00:00
Poul-Henning Kamp
f6ce2a64f7 Send the pcvt(4) driver off to retirement. 2006-05-17 09:33:15 +00:00
Giorgos Keramidas
cb9dec9ec1 Check the return code of sc_clean_up() in the only place where it
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
2006-05-12 22:43:07 +00:00
John Baldwin
73dbd3da73 Remove various bits of conditional Alpha code and fixup a few comments. 2006-05-12 05:04:46 +00:00
Maksim Yevmenkin
d168d95487 Integrate kbdmux(4) into syscons(4) and kbd code.
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
2006-02-28 23:46:23 +00:00
Brooks Davis
30e3426947 When SC_DISABLE_KDBKEY or SC_DISABLE_REBOOT are not defined allow the
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
2006-01-14 17:57:17 +00:00
Ruslan Ermilov
f4e9888107 Fix -Wundef. 2005-12-04 02:12:43 +00:00
Marius Strobl
b7c96c0d0b Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_t
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
2005-09-28 14:54:07 +00:00
Craig Rodrigues
3a9c56bec9 In set_mouse_pos(), try to avoid division by zero errors. 2005-09-07 15:19:03 +00:00
Craig Rodrigues
4506b763e0 In sc_set_text_mode(), reset fontwidth if it is <= 0.
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
2005-09-06 20:38:39 +00:00
Craig Rodrigues
86330afe35 Prevent division by zero errors in sc_mouse_move()
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
2005-08-30 18:58:17 +00:00
Maksim Yevmenkin
04551c6ce5 kbdmux(4) keyboard multiplexer integration
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
2005-07-13 23:58:57 +00:00
Peter Wemm
e55b30b469 Fix syscons on amd64. The SC_PIXEL_MODE commit from May 29th added a new
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)
2005-06-14 02:43:45 +00:00
Xin LI
4c3763445d Only set mode when the incoming ioctl is IOC_VOID, until we have better
solution against the ioctl collisions.

Submitted by:	Antoine Brodin <antoine.brodin at laposte net>
PR:		kern/81867
2005-06-10 05:20:33 +00:00
Scott Long
5a8d0950c1 Fix LINT by defining vga_pxlmouse_planar and vga_pxlmouse_direct. 2005-05-30 18:37:25 +00:00
Xin LI
b147cf1db2 Deny to switch into banked video mode when it is not available. Some
users has reported corrupted display with old video cards.

Submitted by:	Michal Mertl <mime traveller cz>
2005-05-30 06:45:40 +00:00
Marius Strobl
80afb03ba1 Add vr_init_t member to sc_rndr_sw_t instances in order to unbreak
compilation after sys/dev/syscons/syscons.h rev. 1.83.
2005-05-29 12:47:39 +00:00
Xin LI
f112120666 Add VESA mode support for syscons, which enables the support of 15, 16,
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]
2005-05-29 08:43:44 +00:00
Marius Strobl
c9367f6c37 - Not every architecture defaults to a black background (e.g. sparc64
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).
2005-05-21 20:32:27 +00:00
Marius Strobl
fc0e49bd50 On sparc64 use 'syscons' rather than 'sc' for SC_DRIVER_NAME so
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).
2005-05-21 20:29:58 +00:00
Marius Strobl
ae240fafb2 Remove superfluous braces and add #ifndef __sparc64__ around the
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
2005-05-21 20:28:15 +00:00
Marius Strobl
912dd06aed For sparc64 conditionalize the compilation of the gfb_cursor() variant
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.
2005-05-21 20:15:14 +00:00
Yoshihiro Takahashi
f4acf7e936 Remove old epson note support. 2005-05-15 09:07:42 +00:00
Yoshihiro Takahashi
6959aa373c - Add color tables for 16 colors mode and 8 colors mode, use a different
table on the pc98 console.
- Remove old epson note support.
2005-05-15 09:07:04 +00:00
Yoshihiro Takahashi
8763b97d37 - Mask an underline attribute on the pc98 console. It enables to use the same
color on the pc98 and the others.
- Remove old epson note support.
2005-05-15 08:59:00 +00:00
Yoshihiro Takahashi
b4d6f74dce Remove the ADJUST_CLOCK ioctl on pc98. It's not used at all. 2005-05-15 07:35:49 +00:00
Yoshihiro Takahashi
d1725ef7ff Change a directory layout for pc98.
- Move MD files into <arch>/<arch>.
  - Move bus dependent files into <arch>/<bus>.
Rename some files to more suitable names.

Repo-copied by:	peter
Discussed with:	imp
2005-05-10 12:02:18 +00:00
Warner Losh
9fc371f86b No need to ifdef this pc98. 2005-04-04 05:28:19 +00:00
Poul-Henning Kamp
7ce296cf04 Remove debug printout of major/minor numbers, print name instead. 2005-02-27 21:16:26 +00:00
Scott Long
05d0bf79ed Remove the last vestiges of the userconfig option. None of this actually
did anything, so this commit should be considered a NO-OP.
2004-12-01 04:59:33 +00:00
Poul-Henning Kamp
95bc568977 Add new function ttyinitmode() which sets our systemwide default
modes on a tty structure.

Both the ".init" and the current settings are initialized allowing
the function to be used both at attach and open time.

The function takes an argument to decide if echoing should be enabled.
Echoing should not be enabled for regular physical serial ports
unless they are consoles, in which case they should be configured
by ttyconsolemode() instead.

Use the new function throughout.
2004-10-18 21:51:27 +00:00
Poul-Henning Kamp
097afe9133 Fix echo in console mode. 2004-10-14 08:58:28 +00:00
Jacques Vidrine
e618ea0cdb Disallow negative coordinates and sizes in the syscons CONS_SCRSHOT
ioctl.

Reported by:	Christer Oberg <christer.oberg@deprotect.com>
2004-09-29 21:36:07 +00:00
Peter Wemm
beafe28690 Implement the KDENABIO etc ioctl's for amd64 as well. 2004-09-24 01:19:11 +00:00
Peter Wemm
d88cc59371 Implement the syscons mouse pointer characters for amd64. It was only
implemented for i386 and alpha.
2004-09-24 01:18:22 +00:00
Dag-Erling Smørgrav
7ba04507e6 Just because we have a serial console attached does not mean we don't
want a splash screen.

There seems to be some confusion in the syscons code as to the meaning of
the SC_KERNEL_CONSOLE flag.  Its absence is sometimes interpreted to mean
"I am not the system console", and sometimes to mean "I am not the only
VGA console" (see the font loading code for an example of the latter).
Someone with better syscons fu than myself should take a closer look.
2004-08-05 23:54:04 +00:00
Scott Long
76c31ef98f Document machdep.enable_panic_key.
Submitted by: Craig Rodrigues
2004-08-02 02:07:56 +00:00
Alexander Kabaev
1f74490224 Avoid casts as lvalues. 2004-07-28 06:30:43 +00:00
Poul-Henning Kamp
672c05d49c Preparation commit for the tty cleanups that will follow in the near
future:

rename ttyopen() -> tty_open() and ttyclose() -> tty_close().

We need the ttyopen() and ttyclose() for the new generic cdevsw
functions for tty devices in order to have consistent naming.
2004-07-15 20:47:41 +00:00
Poul-Henning Kamp
3e019deaed Do a pass over all modules in the kernel and make them return EOPNOTSUPP
for unknown events.

A number of modules return EINVAL in this instance, and I have left
those alone for now and instead taught MOD_QUIESCE to accept this
as "didn't do anything".
2004-07-15 08:26:07 +00:00
Stefan Farfeleder
439dfb0c35 Remove erroneous semicolons. 2004-07-13 16:06:19 +00:00
Marcel Moolenaar
6af8e47df7 Update for the KDB framework. Sanitize the alpha console code now that
it's in the way even more. Basicly: remove all alpha specific console
support from gfb(4), sio(4) and syscons(4). Rewrite the alpha console
initialization to be identical to all other platforms. In a nutshell:
call cninit().
The platform specific code now only sets or clears RB_SERIAL and thus
automaticly causes the right console to be selected.

sio.c:
o  Replace the remote GDB hacks and use the GDB debug port interface
   instead.
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_alt_break() instead of db_alt_break().
o  Call kdb_enter() instead of breakpoint().
o  Remove the ugly compatibility of using the console as the debug
   port.
2004-07-10 22:29:41 +00:00
Poul-Henning Kamp
f3732fd15b Second half of the dev_t cleanup.
The big lines are:
	NODEV -> NULL
	NOUDEV -> NODEV
	udev_t -> dev_t
	udev2dev() -> findcdev()

Various minor adjustments including handling of userland access to kernel
space struct cdev etc.
2004-06-17 17:16:53 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Poul-Henning Kamp
fe3ec6224a Manual edits to change linesw[]-frobbing to ttyld_*() calls. 2004-06-04 20:04:52 +00:00
Poul-Henning Kamp
2140d01b27 Machine generated patch which changes linedisc calls from accessing
linesw[] directly to using the ttyld...() functions

The ttyld...() functions ar inline so there is no performance hit.
2004-06-04 16:02:56 +00:00
Poul-Henning Kamp
4b5f407579 Remove unused variable. 2004-06-01 19:02:51 +00:00
Poul-Henning Kamp
138fbf675a Gainfully employ the new ttyioctl in the trivial cases. 2004-06-01 13:49:28 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Ken Smith
34b678a695 Rearrangements needed for syscons(4) to be used as a console device
on architectures that need to call cninit() before the machine is
ready to support mutexes (required by make_dev()).

	- Remove make_dev() call from scinit() when flags indicate
	  unit is the system console, rely on sc_attach_unit() to
	  handle it.
	- When trying to access current screen's status (scr_stat
	  structure) use the static one provided for the initial
	  system console if no dev_t is available.
	- When calling make_dev() in sc_attach_unit() catch special
	  case of system's initial console and set up dev_t structure
	  to include pointer to console's scr_stat struct.

Reviewed by:	marcel
Tested by:	marcel, grehan (ppc), others on current@
Approved by:	rwatson (mentor)
2004-04-02 15:02:44 +00:00
Ruslan Ermilov
200c238e95 Fixed a nasty old bug where a visual bell in the currently active
VTY prevented waking up processes waiting for the output queue to
get free on other VTYs.

In collaboration with:	Vsevolod Lobko
MFC after:		1 week
2004-03-18 21:07:54 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
8e1f1df080 Device megapatch 3/6:
Add missing D_TTY flags to various drivers.

Complete asserts that dev_t's passed to ttyread(), ttywrite(),
ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty
pointer.

Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default
cdevsw methods for D_TTY drivers and remove the explicit initializations
in various drivers cdevsw structures.
2004-02-21 20:41:11 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
Poul-Henning Kamp
f457ed1403 Try again to get rid of makedev(). 2004-02-14 17:56:59 +00:00
Poul-Henning Kamp
18e47b55a9 Back out my last commit to syscons, things seem to be far more evil
than suspected.

and obviously nobody runs the patches I post to -current :-(

Poul-Henning
2004-02-13 12:04:15 +00:00
Poul-Henning Kamp
f484fc6593 Don't use makedev() to hack up dev_t's early in boot, do it right
with make_dev() (and avoid doing it again later).
2004-02-12 21:32:59 +00:00
Alexander Kabaev
e99c09e2dc Eliminate global cons_unavailable flag and replace it by the status
bit maintained on a per-device basis. Single variable is inadequate
on machines running with multiple consoles enabled.
2004-02-05 01:56:43 +00:00
Peter Grehan
a2dce78a84 __powerpc__ conditional code for the syscons OpenFirmware/PPC framebuffer.
Took the opportunity to reduce

 __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__

 to

 !__alpha__

reviewed by: gallatin
2004-01-21 05:08:51 +00:00
Nate Lawson
e8c321c92f Fix a panic that occurs when resuming. For some reason, sc->cur_scp is
NULL.

Submitted by:	Andrew Thompson <andy@fud.org.nz>
2003-10-29 20:48:13 +00:00
Poul-Henning Kamp
c9f007b685 Convert to cn_name rather than cn_dev. 2003-09-26 18:57:34 +00:00
Jake Burkholder
d893d5f8dc Fix the alpha kernel build.
Pointy hat to:	jake
2003-08-25 21:32:00 +00:00
Yoshihiro Takahashi
ad81a26706 Merge pc98 support from sys/pc98/pc98/syscons.c. 2003-08-25 07:48:42 +00:00
David E. O'Brien
42af95a3c2 Use __FBSDID().
Also some minor style cleanups.
2003-08-24 18:17:24 +00:00
Jake Burkholder
73b0c90728 - Add a font width field to struct scr_stat. Use this instead of '8'.
- Use the values in the video info for the font size and width instead
  of second guessing.
2003-08-24 04:04:44 +00:00
Jake Burkholder
6817cec98e - Remember to flip the foreground and background color attributes in
gfb_draw if 'flip' is specified.  This causes the mouse cut region
  to be displayed in reverse color so it is visbile.
- Use the "other" implementation of gfb_cursor for the creator driver,
  which doesn't assume there is a hardware cursor.  It seems that the
  hardware cursor that creator provides doesn't display the character
  under the cursor in reverse colors, so the driver does this manually
  and uses the hardware cursor for the mouse pointer (which it also works
  much better for).  This is wedged here because it required less hoops
  than accessing the syscons vtb from inside the video driver, which is
  needed to read the character and color attributes under the new cursor
  position.
2003-08-24 02:31:55 +00:00
Jake Burkholder
8b9698b711 Add sparc64 ifdefs. 2003-08-24 00:44:00 +00:00
Jake Burkholder
4ceb2b2039 Fix endian bugs accessing ioctl arguments that are passed by value. 2003-08-24 00:35:10 +00:00
Yoshihiro Takahashi
720cdc05bb Use the clear function provided by the video adapter driver.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2003-07-21 13:04:54 +00:00
Juli Mallett
b0327095f6 Use SC_NO_CUTPASTE to protect cutpaste variables correctly, fixing the
-Werror build with such option, but not other combinations.  LINT
misses this because syscons knobs in LINT turn off a lot of code.

Reviewed by:	marcel (some time ago)
2003-06-01 04:42:14 +00:00
Poul-Henning Kamp
670966596b Remove unused variable(s).
Found by:       FlexeLint
2003-05-31 20:29:34 +00:00
Peter Wemm
7edc7b0d3b Trivial addition of __amd64__ to the ifdefs for platforms that use
i386-style vga console support.

Approved by:  re
2003-05-09 18:24:40 +00:00
Alexander Kabaev
104a9b7e3e Deprecate machine/limits.h in favor of new sys/limits.h.
Change all in-tree consumers to include <sys/limits.h>

Discussed on:	standards@
Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
2003-04-29 13:36:06 +00:00
Matthew N. Dodd
618095ccef Catch up with recent events. 2003-03-27 07:37:02 +00:00
Jake Burkholder
227f9a1c58 - Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
  with PAE.
- Use this to represent physical addresses in the MI vm system and in the
  i386 pmap code.  This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
  detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by:	DARPA, Network Associates Laboratories
Discussed with:	re, phk (cdevsw change)
2003-03-25 00:07:06 +00:00
Matthew N. Dodd
b7b5ae3edb Use repo-copied files in sys/i386/bios. 2003-03-24 19:14:46 +00:00
John Baldwin
c2fae87169 Don't call sysbeep() in sc_bell() if either duration or pitch is zero.
Otherwise sysbeep() makes an annoying clicking sound on some systems.
'kbdcontrol -b off' just sets the duration and pitch to zero, it doesn't
set the QUIET_BELL flag.

Tested by:	SorAlx <soralx@cydem.zp.ua>
PR:		misc/41772
MFC after:	1 week
2003-03-24 15:56:00 +00:00
Poul-Henning Kamp
182a9f7455 Make nokqfilter() return the correct return value.
Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
2003-03-03 16:24:47 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Dag-Erling Smørgrav
521f364b80 More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9). 2003-03-02 16:54:40 +00:00
Maxime Henrion
03ab197379 When DDB is in the kernel, unlock VTY switching so that we
don't end up freezing the box.  This makes VTY locking useless
in the DDB case but a box which is supposed to be physically
secure shouldn't compile DDB anyway.

Reviewed by:	silence on -audit
2003-02-27 18:24:06 +00:00
Maxime Henrion
07159f9c56 Cleanup of the d_mmap_t interface.
- Get rid of the useless atop() / pmap_phys_address() detour.  The
  device mmap handlers must now give back the physical address
  without atop()'ing it.
- Don't borrow the physical address of the mapping in the returned
  int.  Now we properly pass a vm_offset_t * and expect it to be
  filled by the mmap handler when the mapping was successful.  The
  mmap handler must now return 0 when successful, any other value
  is considered as an error.  Previously, returning -1 was the only
  way to fail.  This change thus accidentally fixes some devices
  which were bogusly returning errno constants which would have been
  considered as addresses by the device pager.
- Garbage collect the poorly named pmap_phys_address() now that it's
  no longer used.
- Convert all the d_mmap_t consumers to the new API.

I'm still not sure wheter we need a __FreeBSD_version bump for this,
since and we didn't guarantee API/ABI stability until 5.1-RELEASE.

Discussed with:		alc, phk, jake
Reviewed by:		peter
Compile-tested on:	LINT (i386), GENERIC (alpha and sparc64)
Runtime-tested on:	i386
2003-02-25 03:21:22 +00:00
Poul-Henning Kamp
263444cfbf Change the console interface to pass a "struct consdev *" instead of a
dev_t to the method functions.

The dev_t can still be found at struct consdev *->cn_dev.

Add a void *cn_arg element to struct consdev which the drivers can use
for retrieving their softc.
2003-02-20 20:54:45 +00:00
Olivier Houchard
fe6d8dd8ee Add a "hw.syscons.bell" sysctl, which can disable the bell at syscons level. 2003-02-20 03:27:09 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Ruslan Ermilov
4ce9429c20 Added dependency on the apm(4) module. 2003-02-15 21:22:19 +00:00
Alfred Perlstein
b7f305981e chase more of the MIN/MAX mess. *sigh* 2003-02-02 13:52:25 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Robert Drehmel
47e40520dd Do not try to work around ``poor (un)sign extension code''
creation by GCC-2.6.3.  Casting pointers to unsigned char
to volatile pointers to unsigned char seemed to produce
better results on the ia32 architecture with old versions
of GCC.
The current FreeBSD system compiler GCC-3.2.1 emits
better sign extension code for non-volatile variables:

volatile char c;
int i = c;

is compiled to:
...
movb	-1(%ebp), %al
movbsl	%al, %eax
movl	%eax, -8(%ebp)
...

char c;
int i = c;

is compiled to:
...
movbsl	-1(%ebp), %eax
movl	%eax, -8(%ebp)
...

The same holds for zero-extension of dereferenced pointers
to volatile unsigned char.
When compiled on alpha or sparc64, the code produced for the
two examples above does not differ.
2002-10-20 22:50:13 +00:00
Kelly Yancey
30c0d52181 Make kqueue(2) work for virtual terminals.
PR:		40486
Submitted by:	Jilles Tjoelker <jilles+fbsd-bugs@stack.nl>
2002-10-17 05:48:56 +00:00
Poul-Henning Kamp
37c841831f Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by:    FlexeLint warning #512
2002-09-28 17:15:38 +00:00
Philippe Charnier
93b0017f88 Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:23:09 +00:00
Peter Wemm
b87a69181e Use machine/limits.h rather than userland limits.h (which may come from
the userland source tree, or even worse: /usr/include)
2002-08-22 20:44:17 +00:00
Archie Cobbs
55f7c614fd Don't use "NULL" when "0" is really meant. 2002-08-21 23:39:52 +00:00
Peter Wemm
f457830b8e de-count schistory.c. The handling of NSC was rather bogus here and was
little more than a place holder, because nothing actually counted the
number of 'sc' units to compare it against NSC.  A bit more work here
is needed so that the scaling of SC_MAX_HISTORY_SIZE and extra_history_size
goes up when more sc units are added.  But, it does not appear that we can
have more than one console yet, so it does not seem particularly urgent.
2002-08-19 23:56:01 +00:00
Maxim Sobolev
41a2a5c1c6 1. Allow information about current history size be retrieved using ioctl(2);
2. modify screen dumpung routine, so that in addition to visible area, it
   allows to grab any portion of history buffer as well.
2002-08-19 16:32:09 +00:00
Dima Dorfman
ce907d4246 Add a VT_LOCKSWITCH ioctl that disallows vty switching. Something
like this can be emulated by VT_SETMODEing to VT_PROCESS and never
releasing the vty, but this has a number of problems, most notably
that a process must stay resident for the lock to be in effect.

Reviewed by:	roam, sheldonh
2002-07-10 03:29:38 +00:00
Alfred Perlstein
f5bd5dceda Make sc_saver_keyb_only (sceen saver interrupted by keyboard input only)
the default.
2002-06-06 06:02:17 +00:00
Maxime Henrion
614be65181 When a program launched on the local console exits, the shell will
call read() to get the next command, and scread() disables the
screensaver.  We don't want this behaviour in the sc_saver_keybonly
case.

Submitted by:	Olivier Houchard <doginou@ci0.org>
2002-05-04 15:42:38 +00:00
David E. O'Brien
0301e9c83b Turn on TGA support.
Submitted by:	Andrew M. Miklic <AndrwMklc@cs.com>
2002-04-13 22:34:16 +00:00
Alfred Perlstein
ae4f6a8242 remove blanktime sysctl, this can't be done as easily as it looks.
Requested by: jhb
2002-04-05 18:17:49 +00:00
Alfred Perlstein
de4dc9595e Add some functionality via sysctl to syscons.
hw.syscons.saver.keybonly: used to specify that only input is to
interrupt the screensaver.  This allows one to run a chatty console
app but still have the screen blank out until a key is pressed.
There should probably also be an ioctl for this, we'll do that later.

hw.syscons.saver.blanktime: exports the screensaver timeout via sysctl.

Submitted by: Olivier Houchard <doginou@cognet.ci0.org>
2002-04-05 17:53:25 +00:00
John Baldwin
44731cab3b Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@
2002-04-01 21:31:13 +00:00
Brooks Davis
c86556de7f Remote newly unused variable to unbreak LINT.
Pointy hat to:	amorita
2002-03-25 02:55:34 +00:00
Akio Morita
81b60c7395 Add new graphical screen saver (dragon_saver).
Add support for NEC PC-9821 PEGC screen (fire/logo/rain/warp_saver).
2002-03-23 12:36:19 +00:00
Alfred Perlstein
e57574233a Remove __P. 2002-03-20 06:48:11 +00:00
Maxim Sobolev
95bd81d145 Extend CONS_GETINFO ioctl to provide information about size of the currently
displayed font.

MFC after:	2 weeks
2002-03-16 23:31:15 +00:00
Ruslan Ermilov
97b6284457 Fixed compilation warnings. 2002-03-06 08:55:34 +00:00
John Baldwin
a854ed9893 Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.
2002-02-27 18:32:23 +00:00
Seigo Tanimura
f591779bb5 Lock struct pgrp, session and sigio.
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)
2002-02-23 11:12:57 +00:00
Andrew Gallatin
9ffbfb248b Spell #if 0 correctly 2002-02-14 22:29:03 +00:00
Maxim Sobolev
42b841a9c9 In the word selection mode don't append newline if the word ends at the
screen boundary.
2002-01-05 16:52:44 +00:00
Maxim Sobolev
c1f25b2f6b Fix POLA - when selecting line into syscons' cut'n'paste buffer (double
click) do not include newline into the buffer. This is exacly how
things worked before my recent changes to the cut'n'paste code and
how they work in 4-STABLE.
2001-11-25 22:51:30 +00:00
Dag-Erling Smørgrav
f61769f009 More drive-by stylification, and some clarifications 2001-11-06 03:28:21 +00:00
Dag-Erling Smørgrav
1619a4903d More drive-by stylification 2001-11-06 02:40:09 +00:00
Dag-Erling Smørgrav
ff95e02306 Drive-by stylification + reintroduce set_border(). 2001-11-06 02:38:09 +00:00
Mitsuru IWASAKI
f9390180fe Some fix for the recent apm module changes.
- Now that apm loadable module can inform its existence to other kernel
   components  (e.g. i386/isa/clock.c:startrtclock()'s TCS hack).
 - Exchange priority of SI_SUB_CPU and SI_SUB_KLD for above purpose.
 - Add simple arbitration mechanism for APM vs. ACPI.  This prevents
   the kernel enables both of them.
 - Remove obsolete `#ifdef DEV_APM' related code.
 - Add abstracted interface for Powermanagement operations.  Public apm(4)
   functions, such as apm_suspend(), should be replaced new interfaces.
   Currently only power_pm_suspend (successor of apm_suspend) is implemented.

Reviewed by:	peter, arch@ and audit@
2001-11-01 16:34:07 +00:00