summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_cons.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Added hooks for an easy drop-in of the pcvt concole driver.joerg1994-10-311-2/+3
| | | | | Don't panic:-), this is simple stuff just doing exactly the same as for syscons. (files.i386 did already contain the necessary stuff.)
* Peter Dufaults comconsole changes.phk1994-10-201-5/+13
| | | | Submitted by: Peter Dufault
* Conditionalized support for syscons as the console so that it can bedg1994-08-311-1/+6
| | | | | | made optional in the kernel config file. Submitted by: John Hay
* Cleaned up after Bruce: there were still some things that includeddg1994-08-301-9/+1
| | | | | | com.h/lpa.h. Removed all vestiges of com/lpa out of conf.c and also fixed up the end of cdevsw/bdevsw to have "no" routines instead of a NULL pointer (suggested by someone a few weeks back).
* Change all #includes to follow the current Berkeley style. Some of thesewollman1994-08-131-13/+13
| | | | | | | | | | | | | | | | | | | | | ``changes'' are actually not changes at all, but CVS sometimes has trouble telling the difference. This also includes support for second-directory compiles. This is not quite complete yet, as `config' doesn't yet do the right thing. You can still make it work trivially, however, by doing the following: rm /sys/compile mkdir /usr/obj/sys/compile ln -s M-. /sys/compile cd /sys/i386/conf config MYKERNEL cd ../../compile/MYKERNEL ln -s /sys @ rm machine ln -s @/i386/include machine make depend make
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.rgrimes1994-05-251-3/+3
| | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
* Remove confusing and incorrect comment inherited from patchkit days.dg1994-01-261-2/+2
|
* Much better fix for the hanging console problem. This one actuallydg1994-01-231-1/+14
| | | | works.
* Backed out previous commit as it requires additional kludges to workdg1994-01-231-4/+1
| | | | | completely, and it looks like syscons might solve the problem a different way (although what about serial consoles??).
* Brute-force fix for the "hanging console" problem. Simply _don't_ calldg1994-01-221-1/+4
| | | | | | | | the device close routine. This works because the device close calls the line discipline close (which only flushes the output buffers) and the ttyclose() routine, which does little of nothing except screw with the session and process group fields (which is what was causing all the problems).
* 1) Added proc file system from Paul Kranenburg with changes fromdg1993-12-121-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | John Dyson to make it reliably work under FreeBSD. 2) Added and enabled PROCFS in the GENERICxx and LINT kernels. 3) New execve() from me. Still work to be done here, but this version works well and is needed before other changes can be made. For a description of the design behind this, see freebsd-arch or ask me. 4) Rewrote stack fault code; made user stack VM grow as needed rather than all up front; improves performance a little and reduces process memory requirements. 5) Incorporated fix from Gene Stark to fault/wire a user page table page to fix a problem in copyout. This is a temporary fix and is not appropriate for pageable page tables. For a description of the problem, see Gene's post to the freebsd-hackers mailing list. 6) Tighten up vm_page struct to reduce memory requirements for it. ifdef pager page lock code as it's not being used currently. 7) Introduced new element to vmspace struct - vm_minsaddr; initial (minimum) stack address. Compliment to vm_maxsaddr. 8) Added a panic if the allocation for process u-pages fails. 9) Improve performance and accuracy of kernel profiling by putting in a little inline assembly instead of spl(). 10) Made serial console with sio driver work. Still has problems with serial input, but is almost useable. 11) Added -Bstatic to SYSTEM_LD in Makefile.i386 so that kernels will build properly with the new ld.
* Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, andwollman1993-11-251-1/+14
| | | | add same (sans -Werror) to Makefile for future compilations.
* Made all header files idempotent and moved incorrect common data fromwollman1993-11-071-6/+9
| | | | | headers into a related source file. (This is the only change to locore.s). Also fixed pg() to be properly declared and use stdargs.
* Yank out Christoph Robitschko's hack for the hanging console problem asdg1993-10-181-25/+2
| | | | | it didn't actually fix it, and because starting the getty on /dev/console instead of /dev/vga is a good work-around.
* Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, somergrimes1993-10-161-9/+2
| | | | minor cleanup. Added $Id$ to files that did not have any version info, etc
* patch 1of2 to prevent kill -1 syslogd from hanging the consolealm1993-08-201-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blindly applied patch provided by Christoph Robitschko: *** cons.c.orig Sat Jun 12 07:57:53 1993 --- cons.c Thu Aug 19 22:34:53 1993 *************** *** 56,61 **** --- 56,62 ---- #include "sys/tty.h" #include "sys/file.h" #include "sys/conf.h" + #include "sys/vnode.h" #include "cons.h" *************** *** 105,118 **** --- 106,130 ---- (*cp->cn_init)(cp); } + static struct vnode *cnopenvp = NULLVP; + + cnopen(dev, flag, mode, p) dev_t dev; int flag, mode; struct proc *p; { + int error; + + if (cn_tab == NULL) return (0); dev = cn_tab->cn_dev; + if (cnopenvp == NULLVP) + if ((error = getdevvp(dev, &cnopenvp, VCHR))) { + printf("cnopen: getdevvp returned %d !\n", error); + return(error); + } return ((*cdevsw[major(dev)].d_open)(dev, flag, mode, p)); } *************** *** 121,130 **** int flag, mode; struct proc *p; { if (cn_tab == NULL) return (0); dev = cn_tab->cn_dev; ! return ((*cdevsw[major(dev)].d_close)(dev, flag, mode, p)); } cnread(dev, uio, flag) --- 133,153 ---- int flag, mode; struct proc *p; { + int error; + + if (cn_tab == NULL) return (0); dev = cn_tab->cn_dev; ! if (vcount(cnopenvp) <= 1) ! error = (*cdevsw[major(dev)].d_close)(dev, flag, mode, p); ! else ! error = 0; ! if (error == 0) { ! vrele(cnopenvp); ! cnopenvp = NULLVP; ! return(error); ! } } cnread(dev, uio, flag)
* Initial import, 0.1 + pk 0.2.4-B1rgrimes1993-06-121-0/+213
OpenPOWER on IntegriCloud