summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_cons.c
Commit message (Collapse)AuthorAgeFilesLines
* Simplify cdevsw registration.phk1999-05-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* This commit should be a extensive NO-OP:phk1999-05-301-7/+21
| | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-081-7/+7
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* s/static foo_devsw_installed = 0;/static int foo_devsw_installed;/.dt1999-04-281-2/+2
| | | | (Edited automatically)
* Change suser_xxx() to suser() where it applies.phk1999-04-271-2/+2
|
* Suser() simplification:phk1999-04-271-2/+2
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Remove a hard-coded table of kernel console I/O functions exportedyokota1999-01-071-18/+7
| | | | | | | | | | from sc, vt and sio drivers. Use instead a linker_set to collect them. Staticize ??cngetc(), ??cnputc(), etc functions in sc and vt drivers. We must still have siocngetc() and siocnputc() as globals because they are directly referred to by i386-gdbstub.c :-( Oked by: bde
* Get rid of CTLTYPE_OPAQUE in a SYSCTL_OPAQUE - it is added my theeivind1998-12-091-2/+2
| | | | SYSCTL_OPAQUE macro.
* Added D_TTY to the cdevswitch flags for all tty drivers. This is requiredbde1998-08-231-6/+9
| | | | | | | | | for the Lite2 fix for always returning EIO in dead_read(). Cleaned up the cdevswitch initializers for all tty drivers. Removed explicit calls to ttsetwater() from all (tty) drivers. ttsetwater() is now called centrally for opens, not just for parameter changes.
* This commit fixes various 64bit portability problems required fordfr1998-06-071-2/+2
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Moved some #includes from <sys/param.h> nearer to where they are actuallybde1998-03-281-1/+2
| | | | used.
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.eivind1998-01-241-1/+3
| | | | | | | | This introduce an xxxFS_BOOT for each of the rootable filesystems. (Presently not required, but encouraged to allow a smooth move of option *FS to opt_dontuse.h later.) LFS is temporarily disabled, and will be re-enabled tomorrow.
* Update select -> poll in drivers.peter1997-09-141-6/+6
|
* Make a function static to quieten gccjulian1997-08-081-3/+3
|
* Clean up the console muting functionality.julian1997-08-081-15/+107
| | | | this has been in production now for a long time with no known effects.
* Removed extra definition of constty. It is defined in subr_prf.c.bde1997-07-011-3/+1
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | 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.
* if there is no console, cngetc should act like getc and return -1julian1996-10-301-3/+3
| | | | make callers aware of this in those cases where it can occur.
* Add support for embedded operation withou consolejulian1996-10-161-8/+23
| | | | | The boot.c patch is applied only to teh JULIAN_HACK branch the muted console is controlable by a sysctl variable kern.consmute
* Changed cncheckc() interface so that it is 8-bit clean - return -1bde1996-09-141-2/+2
| | | | instead of 0 if there is no input.
* Removed unused #include.bde1996-05-011-2/+1
|
* Undid the last 2 commits. Rev.1.43 reversed the changes in rev.1.42 andbde1996-03-281-4/+4
| | | | rev.1.44 was a subset of them.
* Switched from using devfs_add_sw() to using devfs_add_swf()scrappy1996-03-281-10/+4
| | | | Reviewed by: julian@freebsd.org
* Fixed permissions of /devfs/*random.bde1996-03-271-4/+10
| | | | Fixed group and permissions of /devfs/perfmon.
* Fixed mode of /devfs/console.bde1996-03-271-10/+4
|
* Remove crufty "pg" function.phk1995-12-221-9/+1
|
* devsw tables are now arrays of POINTERS to struct [cb]devswjulian1995-12-131-6/+6
| | | | | | | | | seems to work hre just fine though I can't check every file that changed due to limmited h/w, however I've checked enught to be petty happy withe hte code.. WARNING... struct lkm[mumble] has changed so it might be an idea to recompile any lkm related programs
* Move sysctl machdep.consdev to cons.cphk1995-12-091-10/+9
|
* Julian forgot to make the *devsw structures static.phk1995-12-081-2/+2
|
* Pass 3 of the great devsw changesjulian1995-12-081-27/+38
| | | | | | | | | | | | | | | | | | | | | | | most devsw referenced functions are now static, as they are in the same file as their devsw structure. I've also added DEVFS support for nearly every device in the system, however many of the devices have 'incorrect' names under DEVFS because I couldn't quickly work out the correct naming conventions. (but devfs won't be coming on line for a month or so anyhow so that doesn't matter) If you "OWN" a device which would normally have an entry in /dev then search for the devfs_add_devsw() entries and munge to make them right.. check out similar devices to see what I might have done in them in you can't see what's going on.. for a laugh compare conf.c conf.h defore and after... :) I have not doen DEVFS entries for any DISKSLICE devices yet as that will be a much more complicated job.. (pass 5 :) pass 4 will be to make the devsw tables of type (cdevsw * ) rather than (cdevsw) seems to work here.. complaints to the usual places.. :)
* If you're going to mechanically replicate something in 50 filesjulian1995-11-291-2/+3
| | | | it's best to not have a (compiles cleanly) typo in it! (sigh)
* OK, that's it..julian1995-11-291-18/+36
| | | | | | | | | | | | | | | | | | | | | | | | That's EVERY SINGLE driver that has an entry in conf.c.. my next trick will be to define cdevsw[] and bdevsw[] as empty arrays and remove all those DAMNED defines as well.. Each of these drivers has a SYSINIT linker set entry that comes in very early.. and asks teh driver to add it's own entry to the two devsw[] tables. some slight reworking of the commits from yesterday (added the SYSINIT stuff and some usually wrong but token DEVFS entries to all these devices. BTW does anyone know where the 'ata' entries in conf.c actually reside? seems we don't actually have a 'ataopen() etc... If you want to add a new device in conf.c please make sure I know so I can keep it up to date too.. as before, this is all dependent on #if defined(JREMOD) (and #ifdef DEVFS in parts)
* Make pcvt and syscons live in the same kernel. If both are enabled, thenbde1995-09-101-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the first one in the config has priority. They can be switched using userconfig(). i386/i386/conf.c: Initialize the shared syscons/pcvt cdevsw entry to `nx'. Add cdevsw registration functions. Use devsw functions of the correct type if they exist. i386/i386/cons.c: Add renamed syscons entry points to constab. i386/i386/cons.h: Declare the renamed syscons entry points. i386/i386/machdep.c: Repeat console initialization after userconfig() in case the current console has become wrong. This depends on cn functions not wiring down anything important. sys/conf.h: Declare new functions. i386/isa/isa.[ch]: Add a function to decide which display driver has priority. Should be done better. i386/isa/syscons.c: Rename pccn* -> sccn*. Initialize CRTC start address in case the previous driver has moved it. i386/isa/syscons.c, i386/isa/pcvt/* Initialize the bogusly shared variable Crtat dynamically in case the stored value was changed by the previous driver. Initialize cdevsw table from a template. Don't grab the console if another display driver has priority. i386/isa/syscons.h, i386/isa/pcvt/pcvt_hdr.h: Don't externally declare now-static cdevsw functions. i386/isa/pcvt/pcvt_hdr.h: Set the sensitive hardware flag so that pcvt doesn't always have lower priority than syscons. This also fixes the "stupid" detection of the display after filling the display with text. i386/isa/pcvt/pcvt_out.c: Don't be confused the off-screen cursor offset 0xffff set by syscons. kern/subr_xxx.c: Add enough nxio/nodev/null devsw functions of the correct type for syscons and pcvt.
* cons.c:bde1995-09-101-19/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split off cdevsw initialization in cninit() into a new function cninit_finish() that isn't called until all hardware device drivers have been attached. The bdevsw entry of the driver for the physical console needs to be hooked after the physical driver has been attached in case the attachment modified the entry. Rearrange cninit() to avoid changing cn_tab until the driver for the physical console has been initialized, so that the previous driver (if any) can be used for debugging. Start removing half-baked lint support. bdevsw functions usually have unused args but /*ARGSUSED*/ was used for only about 5% of them. cons.h: Declare cn_init_finish(). autoconf.c: Call cn_init_finish(). Start adding prototypes. Functions with bogus linkage (extern where static is probably should be static) are explicitly declared as extern so that the can be found easily (extern in a non-header is usually wrong). All: Continue cleaning up init stuff: init functions shall be static; INITs should be at the start of files...
* Fixed init functions argument type - caddr_t -> void *. Fixed a couple ofdg1995-09-091-2/+2
| | | | compiler warnings.
* devfs changes..julian1995-09-031-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | changes to allow devices that don't probe (e.g. /dev/mem) to create devfs entries this required giving 'configure' its own SYSINIT entry so we could duck in just before it with a DEVFS init and some device inits.. my devfs now looks like: ./misc ./misc/speaker ./misc/mem ./misc/kmem ./misc/null ./misc/zero ./misc/io ./misc/console ./misc/pcaudio ./misc/pcaudioctl ./disks ./disks/rfloppy ./disks/rfloppy/fd0.1440 ./disks/rfloppy/fd1.1200 ./disks/floppy ./disks/floppy/fd0.1440 ./disks/floppy/fd1.1200 also some sligt cleanups.. DEVFS needs a lot of work but I'm getting back to it..
* Partially fix `sysctl machdep.console_device'. The fix will be completebde1995-06-261-2/+9
| | | | | | | | | | | | | when syscons stops mapping the console to minor MAXCONS. There is usually no corresponding device in /dev, and the correct device has minor 0. cons.c: Initialize cn_tty properly, so that CPU_CONSDEV can work. Comment about too many variants of the console tty pointer. machdep.c: Return device NODEV and not error EFAULT when there is no console device.
* Output \n as \r\n, not as \n\r.bde1995-06-141-2/+2
|
* Remove trailing whitespace.rgrimes1995-05-301-5/+5
|
* Undo the move of `#include "sc.h"' etc. to cons.h. It broke anythingbde1995-04-241-1/+4
| | | | that includes <machine/cons.h>.
* Declare the console switch functions completely.bde1995-04-231-14/+2
| | | | | Move declarations of console functions to cons.h (they should be config(8)ed).
* Implement a simple hook (or hack?) to allow graphics device consolejoerg1995-04-081-1/+5
| | | | | | | | | | | | | drivers to protect DDB from being invoked while the console is in process-controlled (i.e., graphics) mode. Implement the logic to use this hook from within pcvt. (I'm sure Søren will do the syscons part RSN). I've still got one occasion where the system stalled, but my attempts to trigger the situation artificially resulted int the expected behaviour. It's hard to track bugs without the console and DDB available. :-/
* Attempt to fix the `you can log into console only once' problem (PRjoerg1995-04-021-2/+13
| | | | | | | | #179). The fix implements a ttyhalfclose() (sort of), resetting the session and pgrp pointers when the physical device is about to be closed. Suggested by: bde
* Eliminate my private type `bool_t'.bde1995-02-261-6/+3
|
* (a) remove the pointer to each driver's tty structure array from cdevswpst1995-02-251-2/+5
| | | | | | | | | (b) add a function callback vector to tty drivers that will return a pointer to a valid tty structure based upon a dev_t (c) make syscons structures the same size whether or not APM is enabled so utilities don't crash if NAPM changes (and make the damn kernel compile!) (d) rewrite /dev/snp ioctl interface so that it is device driver and i386 independant
* Kill redundant declarations of d_open_t and d_close_t.dg1995-01-231-3/+1
|
* Keep track of open devices better to avoid closing the console device whenbde1995-01-211-26/+50
| | | | | | | the physical device is closed. Previously only the reverse case was handled. Abuse the cdevsw interface instead of the vfs interface to do this. Remove unnecessary #includes.
* Ooops, i forgot one NVT > 0 in a previous commit. Now pcvt will alsojoerg1994-12-181-2/+2
| | | | work as the system's console.
* Move the code providing the equivalent of ICRNL for console input fromjoerg1994-12-181-2/+5
| | | | the device driver(s) to cons.c.
OpenPOWER on IntegriCloud