summaryrefslogtreecommitdiff
path: root/sys/dev/syscons
Commit message (Collapse)AuthorAgeFilesLines
* Copy releng/8.2 to release/8.2.0 for 8.2-RELEASE.release/8.2.0_cvsKen Smith2011-02-1636-36/+36
| | | | | | Approved by: re (implicit) This commit was manufactured to restore the state of the 8.2-RELEASE image.
* MFC r215034:Rebecca Cran2010-11-201-3/+3
| | | | | | | | | | Fix typos. PR: bin/148894 Submitted by: olgeni Notes: svn path=/stable/8/; revision=215588
* MFC: r212806Jung-uk Kim2010-09-221-7/+4
| | | | | | | | | | | Rework r210248. Although it fixed most of problems, it did not fix one particular edge case where X-axis resolution is not multiple of font width. Now we just advance enough scan lines, then deduct a partial scan line. It is more intuitive than the previous code. Apply the same wisdom to EGA and VGA planar renderers for consistency. Notes: svn path=/stable/8/; revision=213040
* MFC: r210248Jung-uk Kim2010-07-221-2/+3
| | | | | | | | | Fix two long-standing line wrapping bugs in VGA renderer for pixel mode. Font size may be smaller than 16 and logical scan line may be larger than the displayed scan line. Notes: svn path=/stable/8/; revision=210378
* MFC: r208411, r208412, r208413, r208564, r208567, r210149Jung-uk Kim2010-07-202-2/+3
| | | | | | | | | | | - Suspend screen updates when the video controller is powered down. - Let the first device suspend and the last device resume syscons(4). - Do not attempt to switch to the same VTs between suspend and resume. - When we are not switching VTs, just mark all buffer to be updated. - Fix some style(9) nits. Notes: svn path=/stable/8/; revision=210303
* MFC: r205550, r205605, r205865Jung-uk Kim2010-03-313-5/+13
| | | | | | | | | | | Sync. pixel mode support for syscons(4) with HEAD. - Separate 24-bit pixel draw from 32-bit case. Although it is slower, we do not want to write a useless zero to inaccessible memory region. - We only want the dummy palette for direct color mode. Notes: svn path=/stable/8/; revision=205982
* MFC r204248,r204249 - "fancy snake_saver" with color coded load averagesIvan Voras2010-03-261-6/+49
| | | | Notes: svn path=/stable/8/; revision=205691
* MFC x86emu/x86bios emulator and make previously i386 only dpms and vesaXin LI2010-03-025-51/+194
| | | | | | | | | | | | | | | | framebuffer driver, etc. work on FreeBSD/amd64. A significant amount of improvements were done by jkim@ during the recent months to make vesa(4) work better, over the initial code import. This work is based on OpenBSD's x86emu implementation and contributed by paradox <ddkprog yahoo com> and swell.k at gmail com. Hopefully I have stolen all their work to 8-STABLE :) All bugs in this commit are mine, as usual. Notes: svn path=/stable/8/; revision=204546
* MFC r199355:Konstantin Belousov2009-12-191-1/+5
| | | | | | | | | | Add SI_KERNEL. MFC r199418: Fix pgsignal() call after signature change in r199355. Notes: svn path=/stable/8/; revision=200729
* MFC various commits back to stable/8:Ed Schouten2009-11-011-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SVN r197174: Make sure we never place the cursor outside the screen. For some vague reason, it may be possible that scp->cursor_pos exceeds scp->ysize * scp->xsize. This means that teken_set_cursor() may get called with an invalid position. Just ignore the old cursor position in this case. Reported by: Paul B. Mahol <onemda gmail com> SVN r198213: Make lock devices work properly. It turned out I did add the code to use the init state devices to set the termios structure when opening the device, but it seems I totally forgot to add the bits required to force the actual locking of flags through the lock state devices. Reported by: ru SVN r198215, r198217: Fix a typo in the jail(8) manpage. Submitted by: Jille Timmermans <jille quis cx> SVN r198216: Fix qouting in a comment, to make it look more consistent Submitted by: Jille Timmermans <jille quis cx> SVN r198223: Properly set the low watermarks when reducing the baud rate. Now that buffers are deallocated lazily, we should not use tty*q_getsize() to obtain the buffer size to calculate the low watermarks. Doing this may cause the watermark to be placed outside the typical buffer size. This caused some regressions after my previous commit to the TTY code, which allows pseudo-devices to resize the buffers as well. Reported by: yongari, dougb Notes: svn path=/stable/8/; revision=198745
* MFC 197062:John Baldwin2009-09-141-3/+15
| | | | | | | | | | | | Don't malloc a buffer while holding the prison0 mutex. Instead, use a loop where we figure out the hostname length under the lock, malloc the buffer with the lock dropped, then recheck the length under the lock and loop again if the buffer is now too small. Approved by: re (kib) Notes: svn path=/stable/8/; revision=197194
* Small fixes to Unicode handling:Ed Schouten2009-06-162-38/+43
| | | | | | | | - Add more mappings for Greek characters and the Euro sign. - Print UTF-8 characters in the log file as hexadecimal. Notes: svn path=/head/; revision=194293
* Add more entries to the Unicode-to-CP437 table.Ed Schouten2009-06-141-9/+15
| | | | | | | | | | | | Characters between 0x07 and 0x0d are now also mapped, which means we can display almost 256 different characters. Also remap certain types of dashes and quotes, which means we can finally read our manual pages without red question marks in them. Submitted by: Christoph Mallon Notes: svn path=/head/; revision=194184
* Rename the host-related prison fields to be the same as the host.*Jamie Gritton2009-06-131-2/+2
| | | | | | | | | | parameters they represent, and the variables they replaced, instead of abbreviated versions of them. Approved by: bz (mentor) Notes: svn path=/head/; revision=194118
* Make the proof-of-concept UTF-8 support in Syscons less useless.Ed Schouten2009-06-131-18/+121
| | | | | | | | | | | | | Add a small Unicode-to-CP437 remapping table to at least demonstrate that the terminal emulator is perfectly capable of handling UTF-8. This will of course break if the user loads a different font map, but it at least allows people to give it a try. I can now see the box drawing in dialog(1) and the arrows in mutt(1) correctly. Notes: svn path=/head/; revision=194103
* Make the demo/stress tools build again, after my changes to param().Ed Schouten2009-06-102-2/+2
| | | | Notes: svn path=/head/; revision=193940
* Restore support for bell pitch/duration.Ed Schouten2009-05-315-3/+20
| | | | | | | | | | | Because we only support a single argument to tf_param, use 16 bits for the pitch and 16 bits for the duration. While there, make the argument unsigned. There isn't a single param call that needs a signed integer. Submitted by: danfe (modified) Notes: svn path=/head/; revision=193184
* Place hostnames and similar information fully under the prison system.Jamie Gritton2009-05-291-4/+5
| | | | | | | | | | | | | | | | | | | | The system hostname is now stored in prison0, and the global variable "hostname" has been removed, as has the hostname_mtx mutex. Jails may have their own host information, or they may inherit it from the parent/system. The proper way to read the hostname is via getcredhostname(), which will copy either the hostname associated with the passed cred, or the system hostname if you pass NULL. The system hostname can still be accessed directly (and without locking) at prison0.pr_host, but that should be avoided where possible. The "similar information" referred to is domainname, hostid, and hostuuid, which have also become prison parameters and had their associated global variables removed. Approved by: bz (mentor) Notes: svn path=/head/; revision=193066
* Last minute TTY API change: remove mutex argument from tty_alloc().Ed Schouten2009-05-292-2/+2
| | | | | | | | | | | | | I don't want people to override the mutex when allocating a TTY. It has to be there, to keep drivers like syscons happy. So I'm creating a tty_alloc_mutex() which can be used in those cases. tty_alloc_mutex() should eventually be removed. The advantage of this approach, is that we can just remove a function, without breaking the regular API in the future. Notes: svn path=/head/; revision=193018
* Turn consolectl into a simple device node, not a TTY.Ed Schouten2009-05-151-20/+26
| | | | | | | | | | | | | | Apart from the 16 virtual terminals, Syscons allocates two device nodes that should not really be TTYs, even though they are. One of them is consolectl. In RELENG_7 and before, these device nodes are used in single user mode. After I simplified input path, we only use this device node to call ioctl() on (moused, Xorg, vidcontrol). When you call ioctl() on consolectl, it will behave the same as being called on the first window. Notes: svn path=/head/; revision=192143
* Remove obsolete/bogus layering.Maksim Yevmenkin2009-04-091-8/+1
| | | | | | | | Reviewed by: freebsd-current@, freebsd-hackers@ MFC after: 1 week Notes: svn path=/head/; revision=190868
* Small cleanup to previous commit.Ed Schouten2009-03-201-1/+1
| | | | | | | Just use % 8, instead of & 0x7. This makes it easier to understand. Notes: svn path=/head/; revision=190158
* Just use default behaviour on tabstops when using too many columns.Ed Schouten2009-03-202-5/+6
| | | | | | | | | | | | | | | | It seems I didn't fix this issue before committing teken to the tree. My initial idea was to somehow add an error mechanism to instruct the video driver author to increase T_NUMCOL when using very big terminals. It turns out we have platforms where we have gigantic consoles on systems like the Apple PowerMac G5, which means we crash there right now. Just ignore tabstops placed beyond column 160. Just force tabs to be placed on each 8 columns. Reported by: nwhitehorn Notes: svn path=/head/; revision=190157
* Make a 1:1 mapping between syscons stats and terminal emulators.Ed Schouten2009-03-105-36/+30
| | | | | | | | | | | | | | | | | | | | | | | After I imported libteken into the source tree, I noticed syscons didn't store the cursor position inside the terminal emulator, but inside the virtual terminal stat. This is not very useful, because when you implement more complex forms of line wrapping, you need to keep track of more state than just the cursor position. Because the kernel messages didn't share the same terminal emulator as ttyv0, this caused a lot of strange things, like kernel messages being misplaced and a missing notification to resize the terminal emulator for kernel messages never to be resized when using vidcontrol. This patch just removes kernel_console_ts and adds a special parameter to te_puts to determine whether messages should be printed using regular colors or the ones for kernel messages. Reported by: ache Tested by: nyan, garga (older version) Notes: svn path=/head/; revision=189617
* Don't call into the TTY layer when inside kdb.Ed Schouten2009-03-091-1/+1
| | | | | | | | | | We should just leave the underlying TTY objects alone when scrolling around in KDB. It should be handled by Syscons exclusively. Reported by: pluknet gmail com Notes: svn path=/head/; revision=189596
* Remove unneeded variable assignment.Ed Schouten2009-02-261-1/+1
| | | | | | | | | The ts variable is always initialized a few lines below. Found by: LLVM scan-build Notes: svn path=/head/; revision=189064
* Properly implement GIO_ATTR and CONS_GETINFO.Ed Schouten2009-02-093-11/+32
| | | | | | | | It seems I didn't implement these two ioctl()'s properly, which meant vidcontrol couldn't properly obtain certain terminal parameters. Notes: svn path=/head/; revision=188391
* Add Unicode rendering to the teken demo application.Ed Schouten2009-01-212-11/+32
| | | | | | | | | | | | Some time ago I tried adding Unicode rendering to the teken demo application, but I didn't get it working. It seems I forgot to call setlocale(). Polish this code and make sure it doesn't get lost. Also a small fix for my previous commit: all Unicode characters in teken_boxdrawing are below 0x10000, so store them as 16-bit values. Notes: svn path=/head/; revision=187562
* Properly implement the VT100 SCS sequences in xterm-mode.Ed Schouten2009-01-206-31/+201
| | | | | | | | | | | | | | | | | | Even though VT100-like devices can display non-ASCII characters, they do not use an 8-bit character set. Special escape sequences allow the VT100 to switch character maps. The special graphics character set stores the box drawing characters, starting at 0x60, ending at 0x7e. This means we now pass the character map tests in vttest, even the save/restore cursor test, combined with character maps. dialog(1) also works a lot better now. This commit also includes some other minor fixes: - Default to 24 lines in teken_demo when using xterm emulation. - Make white foreground and background work in teken_demo. Notes: svn path=/head/; revision=187469
* Don't forget to mark the color translation array as const.Ed Schouten2009-01-181-2/+2
| | | | | | | Spotted by: Christoph Mallon <christoph mallon gmx de> Notes: svn path=/head/; revision=187382
* Fix for my previous commit: color mapping is not 1:1.Ed Schouten2009-01-171-4/+7
| | | | | | | | | | | | | | | Cons25 doesn't seem to use a straight 1:1 mapping to the ANSI colors, but uses the same color numbers as at least used by syscons on i386. I suspect if you change the definitions on a different architecture, things may break? Not sure. Add a small array to convert syscons-style color codes to ANSI equivalents, which are used by libteken internally. I didn't notice this bug, because I only tested my code with black, white and green, all of them shared the same numbers. Notes: svn path=/head/; revision=187374
* Make vidcontrol's color setting work again.Ed Schouten2009-01-172-0/+25
| | | | | | | | | | | | It turns out I forgot to implement two escape sequences that allows the user to change the default foreground and background colors. I thought they were implemented by syscons itself, but vidcontrol just generates some escape sequences, which get interpreted by the terminal emulator. Reported by: mgp (forums) Notes: svn path=/head/; revision=187373
* Allow experimental libteken features to be tested without changing code.Ed Schouten2009-01-174-57/+55
| | | | | | | | | | | | | | | | The teken library already supports UTF-8 handling and xterm emulation, but we have reasons to disable this right now. Because we should make it easy and interesting for people to experiment with these features, allow them to be set in kernel configuration files. Before this commit we had a flag called `TEKEN_CONS25' to enable cons25-style emulation. I'm calling it the opposite now, `TEKEN_XTERM', because we want to enable it in kernel configuration files explicitly. Requested by: kib Notes: svn path=/head/; revision=187367
* Import yet some more small fixes to libteken sources:Ed Schouten2009-01-053-0/+25
| | | | | | | | | | | | | | - Implement NP (ASCII 12, Form Feed). When used with cons25, it should clear the screen and place the cursor at the top of the screen. When used with xterm, it should just simulate a newline. - When we want to use xterm emulation, make teken_demo set TERM to xterm. Spotted by: Paul B. Mahol <onemda@gmail.com> Notes: svn path=/head/; revision=186798
* Fix rendering glitch in cons25 emulation.Ed Schouten2009-01-041-0/+12
| | | | | | | | | | | | | | Because we now have cons25-style linewrapping, we must also use cons25- style reverse linewrapping. This means that a ^H on column 0 will move the cursor one line up. Also fix a small regression: if the user invokes a RIS (Reset to Initial State), we must show the cursor again. Spotted by: Paul B. Mahol <onemda gmail com> Notes: svn path=/head/; revision=186753
* Print control characters, even though they are normally not visible.Ed Schouten2009-01-042-1/+7
| | | | | | | | | | | With cons25, there are printable characters below 0x1B. This is not the case with ASCII, UTF-8, etc. but in this case we just have to. Also don't set LC_CTYPE to UTF-8 when libteken is compiled without UTF-8 in the demo-application. Notes: svn path=/head/; revision=186731
* Resolve some regressions related to tabs and linewrap handling.Ed Schouten2009-01-034-2/+34
| | | | | | | | | | | | | | | | | | | | | | | It turns out I was looking too much at mimicing xterm, that I didn't take the differences of cons25 into account. There are some differences between xterm and cons25 that are important. Create a new #define called TEKEN_CONS25 that can be toggled to switch between cons25 and xterm mode. - Don't forget to redraw the cursor after processing a forward/backward tabulation. - Implement cons25-style (WYSE?) autowrapping. This form of autowrapping isn't that nice. It wraps the cursor when printing something on column 80. xterm wraps when printing the first character that doesn't fit. - In cons25, a \t shouldn't overwrite previous contents, while xterm does. Reported by: Garrett Cooper <yanefbsd gmail com> Notes: svn path=/head/; revision=186729
* Remove an unneeded assertion in libteken.Ed Schouten2009-01-011-1/+0
| | | | | | | | | The cursor is only inside the scrolling region when we are in origin mode. In that case, it should use originreg instead of scrollreg. It is completely valid to place the cursor outside the scrolling region. Notes: svn path=/head/; revision=186687
* Replace syscons terminal renderer by a new renderer that uses libteken.Ed Schouten2009-01-0117-1410/+3101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=186681
* Undo revision 185013 until better solution is found.Maksim Yevmenkin2008-11-171-4/+0
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=185028
* More locking for syscons(4). This should prevent races with sckbdevent().Maksim Yevmenkin2008-11-161-0/+4
| | | | | | | | PR: kern/127446 Submitted by: Eygene Ryabinkin rea-fbsd at codelabs dot ru Notes: svn path=/head/; revision=185013
* Reduce the default baud rate of PTY's to 9600.Ed Schouten2008-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=184771
* Disable processing of output data after disabling scroll lock by force.Ed Schouten2008-08-311-0/+9
| | | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=182527
* Make syscons(4) use ttyv0 instead of consolectl as its primary window.Ed Schouten2008-08-241-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=182117
* Make sysmouse(4) use its own locks, instead of using Giant.Ed Schouten2008-08-241-14/+10
| | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=182109
* Integrate the new MPSAFE TTY layer to the FreeBSD operating system.Ed Schouten2008-08-208-310/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Commit step 1 of the vimage project, (network stack)Bjoern A. Zeeb2008-08-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=181803
* Lower the priority of the sleep in the syscons for "waitvt" wchan toKonstantin Belousov2008-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 Notes: svn path=/head/; revision=181286
* Introduce a new lock, hostname_mtx, and use it to synchronize accessRobert Watson2008-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 Notes: svn path=/head/; revision=180291
* The "free-lance" timer in the i8254 is only used for the speakerPoul-Henning Kamp2008-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]. Notes: svn path=/head/; revision=177642