225847 |
28-Sep-2011 |
ed |
Get rid of major/minor number distinction.
As of FreeBSD 6, devices can only be opened through devfs. These device nodes don't have major and minor numbers anymore. The st_rdev field in struct stat is simply based a copy of st_ino.
Simply display device numbers as hexadecimal, using "%#jx". This is allowed by POSIX, since it explicitly states things like the following (example taken from ls(1)):
"If the file is a character special or block special file, the size of the file may be replaced with implementation-defined information associated with the device in question."
This makes the output of these commands more compact. For example, ls(1) now uses approximately four columns less. While there, simplify the column length calculation from ls(1) by calling snprintf() with a NULL buffer.
Don't be afraid; if needed one can still obtain individual major/minor numbers using stat(1).
|
188487 |
11-Feb-2009 |
ed |
Serialize write() calls on TTYs.
Just like the old TTY layer, the current MPSAFE TTY layer does not make any attempt to serialize calls of write(). Data is copied into the kernel in 256 (TTY_STACKBUF) byte chunks. If a write() call occurs at the same time, the data may interleave. This is especially likely when the TTY starts blocking, because the output queue reaches the high watermark.
I've implemented this by adding a new flag, TTY_BUSY_OUT, which is used to mark a TTY as having a thread stuck in write(). Because I don't want non-blocking processes to be possibly blocked by a sleeping thread, I'm still allowing it to bypass the protection. According to this message, the Linux kernel returns EAGAIN in such cases, but I think that's a little too restrictive:
http://kerneltrap.org/index.php?q=mailarchive/linux-kernel/2007/5/2/85418/thread
PR: kern/118287
|
188147 |
05-Feb-2009 |
ed |
Don't leave the console TTY constantly open.
When we leave the console TTY constantly open, we never reset the termios attributes. This causes output processing, echoing, etc. not to be reset to the proper values when going into single user mode after the system has booted. It also causes nl-to-crnl-conversion not to take place during shutdown, which causes a `staircase effect'.
This patch adds a new TTY flag, TF_OPENED_CONS, which is set when the TTY is opened through /dev/console. Because the flags are only used by the kernel and the pstat(8) utility, I've decided to renumber the TTY flags. This shouldn't be an issue, because the TTY layer is not yet part of a stable release.
Reported by: Mark Atkinson <atkin901 yahoo com> Tested by: sepotvin
|
184522 |
01-Nov-2008 |
ed |
Clamp the values of t_column to 5 digits in `pstat -t' and `show all ttys'.
We often run into these very high column numbers when we run curses applications, because they don't print any newlines. This messes up the table output of `pstat -t'. If these numbers get really high, they aren't of any use to the reader anyway. Convert them to `99999' when they run out of bounds.
|
183276 |
22-Sep-2008 |
ed |
Introduce a hooks layer for the MPSAFE TTY layer.
One of the features that prevented us from fixing some of the TTY consumers to work once again, was an interface that allowed consumers to do the following:
- `Sniff' incoming data, which is used by the snp(4) driver.
- Take direct control of the input and output paths of a TTY, which is used by ng_tty(4), ppp(4), sl(4), etc.
There's no practical advantage in committing a hooks layer without having any consumers. In P4 there is a preliminary port of snp(4) and thompsa@ is busy porting ng_tty(4) to this interface. I already want to have it in the tree, because this may stimulate others to work on the remaining modules.
Discussed with: thompsa Obtained from: //depot/projects/mpsafetty/...
|
181905 |
20-Aug-2008 |
ed |
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
|
180559 |
16-Jul-2008 |
ed |
Remove OTTYDISC, NETLDISC and NTTYDISC definitions.
When I ported most applications away from <sgtty.h>, I noticed none of them were actually using these definitions. I kept them in place, because I didn't want to touch tools like pstat(8) and stty(1).
In preparation for the MPSAFE TTY layer, remove these definitions. This doesn't have any impact with respect to binary compatibility (see tty_conf.c).
We couldn now add an #error to <sys/ioctl_compat.h> when included outside the kernel. Unfortunately, kdump's mkioctls includes this file unconditionally.
Approved by: philip (mentor)
|
178987 |
14-May-2008 |
remko |
Fix pstat behaviour when using coredumps. The reference to tp was incorrect and should have been poining to &tty, tp is a virtual address from the coredump, while we should obtain the address through the tty struct.
Approved by: imp (mentor, implicit trivial changes) MFC after: 1 week Submitted by: Ed Schouten (ed at 80836 dot nl)
|
143929 |
21-Mar-2005 |
keramida |
- Add a -h flag to pstat to print swap sizes in "human readable" format, with humanize_number(3).
- Move the common parts of the code that prints the sizes for a single swap device and the total to a single function to avoid repeating the humanize_number() stuff all over the place.
- Change the type of CONVERT() from intmax_t to int64_t, since this makes calling humanize_number() easier but cast the values to intmax_t before printing them, to make use of the %jd format that printf() supports.
- Document the new -h flag in the manpage and bump its date.
Approved by: pjd Useful tips: brooks MFC after: 2 weeks
|
126643 |
05-Mar-2004 |
markm |
Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror) that this provokes. "Wherever possible" means "In the kernel OR NOT C++" (implying C).
There are places where (void *) pointers are not valid, such as for function pointers, but in the special case of (void *)0, agreement settles on it being OK.
Most of the fixes were NULL where an integer zero was needed; many of the fixes were NULL where ascii <nul> ('\0') was needed, and a few were just "other".
Tested on: i386 sparc64
|
110148 |
31-Jan-2003 |
robert |
- Modernize the format of the open file showing mode output: . Print the column headers centered (except for the left-aligned TYPE header) using a different header for architectures where sizeof(uintptr_t) is not four. . Consistently do not print a '0x' prefix for hexadecimal values. . Separate columns by a single space character. . Pad the columns presenting an address or offset enough to hold their respective largest value. . Do not restrict the output to unknown file types, inodes and sockets; allow displaying of pipes, fifos, kqueues and crypto file descriptors too. - Shorten an overly long line by removing a cast of printf's return value to void.
PR: alpha/45240 Tested on: i386, sparc64, alpha
|
109123 |
12-Jan-2003 |
dillon |
Change struct file f_data to un_data, a union of the correct struct pointer types, and remove a huge number of casts from code using it.
Change struct xfile xf_data to xun_data (ABI is still compatible).
If we need to add a #define for f_data and xf_data we can, but I don't think it will be necessary. There are no operational changes in this commit.
|
97375 |
28-May-2002 |
des |
Remove the code that was disabled in a recent commit; it is of very limited use and has been broken in -CURRENT for a long time. Clean up unneeded entries in the nlist array. Implement kvm-backed ttymode (which we never had before). Incomplete as we do not (yet?) print the correct device, sid or pgid.
Sponsored by: DARPA, NAI Labs
|
77031 |
23-May-2001 |
ru |
- FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION file systems were repo-copied from sys/miscfs to sys/fs.
- Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs.
- Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS.
- Install header files for the above file systems.
- Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles.
|
71127 |
16-Jan-2001 |
ben |
Ooops, the -M and -N flags were already documented, though not very clearly. Remove the old description in favour of the new description which lists the -M and -N flags along with all the other flags. This is consistent with the manual pages for ps, netstat, iostat, etc.
|
38429 |
19-Aug-1998 |
bde |
Increased column widths for tty input watermark fields so that watermarks for 11520-byte buffers for 115200 bps are displayed properly.
Fixed my recent printf format error fixes. %p is almost unusable in tables, since its width and format are unknown/machine-dependent. Use %8lx and cast pointers to (u_long)(void*). This is still quite broken, e.g., for machines with 64-bit pointers.
|
31132 |
12-Nov-1997 |
julian |
Reviewed by: various.
Ever since I first say the way the mount flags were used I've hated the fact that modes, and events, internal and exported, and short-term and long term flags are all thrown together. Finally it's annoyed me enough.. This patch to the entire FreeBSD tree adds a second mount flag word to the mount struct. it is not exported to userspace. I have moved some of the non exported flags over to this word. this means that we now have 8 free bits in the mount flags. There are another two that might well move over, but which I'm not sure about. The only user visible change would have been in pstat -v, except that davidg has disabled it anyhow. I'd still like to move the state flags and the 'command' flags apart from each other.. e.g. MNT_FORCE really doesn't have the same semantics as MNT_RDONLY, but that's left for another day.
|
21673 |
14-Jan-1997 |
jkh |
Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
|
19055 |
20-Oct-1996 |
joerg |
Make pstat -s (aka. sswapinfo) print ``[NFS]'' as opposed to ``/dev/??'' for NFS swap.
I had a hard time to figure out whether it's possible to print the actual mounted swap file, but i failed to get any information. If anybody knows how to get ``192.168.0.1:/swap.192.168.0.3'' instead, please step forward!
|
15693 |
09-May-1996 |
jkh |
Properly free up resources allocated in swapmode(). This is not quite the patch submitted by Philippe Charnier since he wasn't actually freeing the resources early enough (an earlier return could be invoked, leaving the resources still allocated), but he definitely pointed it out. Merci, Philippe! Suggested-By: Philippe Charnier <charnier@lirmm.fr>
|
9621 |
21-Jul-1995 |
bde |
Document new tty states TS_CONNECTED, TS_SO_OLOWAT, TS_SO_OCOMPLETE, TS_CAR_OFLOW, TS_CTS_OFLOW, TS_DSR_OFLOW and TS_ZOMBIE.
Document old tty states TS_ASLEEP and TS_TTSTOP more completely.
Document old tty states TS_ASYNC and TS_TBLOCK.
Document not so old tty states TS_CAN_BYPASS_L_RINT and TS_SNOOP.
Don't document nonexistent state TS_HUPCL.
Document the current line disciplines instead of prehistoric ones.
|
9620 |
21-Jul-1995 |
bde |
Support cy driver. All tty drivers require namelist stuff here or they won't get reported. The pcvt, cx and iitty drivers aren't supported.
Report new tty states TS_CONNECTED, TS_SO_OLOWAT, TS_SO_OCOMPLETE, TS_CAR_OFLOW, TS_CTS_OFLOW, TS_DSR_OFLOW and TS_ZOMBIE if they are defined.
Report old tty states TS_WOPEN and TS_ASLEEP only if they are defined.
Report not so old tty states TS_CAN_BYPASS_L_RINT and TS_SNOOP only if they are defined (instead of if __FreeBSD__ is defined).
|
9336 |
27-Jun-1995 |
dfr |
Changes to support version 3 of the NFS protocol. The version 2 support has been tested (client+server) against FreeBSD-2.0, IRIX 5.3 and FreeBSD-current (using a loopback mount). The version 2 support is stable AFAIK. The version 3 support has been tested with a loopback mount and minimally against an IRIX 5.3 server. It needs more testing and may have problems. I have patched amd to support the new variable length filehandles although it will still only use version 2 of the protocol.
Before booting a kernel with these changes, nfs clients will need to at least build and install /usr/sbin/mount_nfs. Servers will need to build and install /usr/sbin/mountd.
NFS diskless support is untested.
Obtained from: Rick Macklem <rick@snowhite.cis.uoguelph.ca>
|