summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/sio/sio.c6
-rw-r--r--sys/dev/syscons/syscons.c27
-rw-r--r--sys/i386/isa/sio.c6
-rw-r--r--sys/i386/isa/syscons.c27
-rw-r--r--sys/isa/sio.c6
-rw-r--r--sys/isa/syscons.c27
6 files changed, 66 insertions, 33 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index a51e58c..0dbb439 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -41,7 +41,7 @@
* into the patch kit. Added in sioselect
* from com.c. Added port 4 support.
*/
-static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/isa/sio.c,v 1.7 1993/09/08 17:38:05 rgrimes Exp $";
+static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/isa/sio.c,v 1.8 1993/09/10 16:59:16 rgrimes Exp $";
#include "sio.h"
#if NSIO > 0
@@ -467,8 +467,12 @@ sioattach(isdp)
scr2 = inb(iobase + com_scr);
outb(iobase + com_scr, scr);
printf("sio%d: type", unit);
+#ifdef COM_MULTIPORT
+ if (0);
+#else
if (scr1 != 0xa5 || scr2 != 0x5a)
printf(" <8250>");
+#endif
else {
outb(iobase + com_fifo, FIFO_ENABLE | FIFO_TRIGGER_14);
DELAY(100);
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index c98f012..acf3d56 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -35,11 +35,11 @@
*
*/
/*
- * Heavily modified by Søren Schmidt (sos@kmd-ac.dk) to provide:
+ * Heavily modified by Søren Schmidt (sos@login.dkuug.dk) to provide:
*
* virtual consoles, SYSV ioctl's, ANSI emulation
*
- * @(#)syscons.c 0.2d 930908
+ * @(#)syscons.c 0.2e 930924
* Derived from:
* @(#)pccons.c 5.11 (Berkeley) 5/21/91
*/
@@ -297,14 +297,14 @@ int pcattach(struct isa_device *dev)
if (crtc_vga)
if (crtc_addr == MONO_BASE)
- printf(" VGA mono");
+ printf("VGA mono");
else
- printf(" VGA color");
+ printf("VGA color");
else
if (crtc_addr == MONO_BASE)
- printf(" MDA/hercules");
+ printf("MDA/hercules");
else
- printf(" CGA/EGA");
+ printf("CGA/EGA");
if (NCONS > 1)
printf(" <%d virtual consoles>\n", NCONS);
@@ -463,6 +463,8 @@ scintr(dev_t dev, int irq, int cpl)
c = sgetc(1);
if (c & 0x100)
return;
+ if ((cur_pccons->t_state & TS_ISOPEN) == 0)
+ return;
if (pcconsoftc.cs_flags & CSF_POLLING)
return;
if (c < 0x100)
@@ -492,7 +494,7 @@ pcparam(struct tty *tp, struct termios *t)
pcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
{
- int error;
+ int i, error;
struct tty *tp;
struct syscframe *fp;
scr_stat *scp;
@@ -608,9 +610,14 @@ pcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
}
/* NOT REACHED */
- case VT_OPENQRY: /* return free virtual cons, allways current */
- *data = get_scr_num(scp);
- return 0;
+ case VT_OPENQRY: /* return free virtual console */
+ for (i = 0; i < NCONS; i++)
+ if (!(pccons[i].t_state & TS_ISOPEN)) {
+ *data = i + 1;
+ return 0;
+ }
+ return EINVAL;
+ /* NOT REACHED */
case VT_ACTIVATE: /* switch to screen *data */
return switch_scr((*data) - 1);
diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c
index a51e58c..0dbb439 100644
--- a/sys/i386/isa/sio.c
+++ b/sys/i386/isa/sio.c
@@ -41,7 +41,7 @@
* into the patch kit. Added in sioselect
* from com.c. Added port 4 support.
*/
-static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/isa/sio.c,v 1.7 1993/09/08 17:38:05 rgrimes Exp $";
+static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/isa/sio.c,v 1.8 1993/09/10 16:59:16 rgrimes Exp $";
#include "sio.h"
#if NSIO > 0
@@ -467,8 +467,12 @@ sioattach(isdp)
scr2 = inb(iobase + com_scr);
outb(iobase + com_scr, scr);
printf("sio%d: type", unit);
+#ifdef COM_MULTIPORT
+ if (0);
+#else
if (scr1 != 0xa5 || scr2 != 0x5a)
printf(" <8250>");
+#endif
else {
outb(iobase + com_fifo, FIFO_ENABLE | FIFO_TRIGGER_14);
DELAY(100);
diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c
index c98f012..acf3d56 100644
--- a/sys/i386/isa/syscons.c
+++ b/sys/i386/isa/syscons.c
@@ -35,11 +35,11 @@
*
*/
/*
- * Heavily modified by Søren Schmidt (sos@kmd-ac.dk) to provide:
+ * Heavily modified by Søren Schmidt (sos@login.dkuug.dk) to provide:
*
* virtual consoles, SYSV ioctl's, ANSI emulation
*
- * @(#)syscons.c 0.2d 930908
+ * @(#)syscons.c 0.2e 930924
* Derived from:
* @(#)pccons.c 5.11 (Berkeley) 5/21/91
*/
@@ -297,14 +297,14 @@ int pcattach(struct isa_device *dev)
if (crtc_vga)
if (crtc_addr == MONO_BASE)
- printf(" VGA mono");
+ printf("VGA mono");
else
- printf(" VGA color");
+ printf("VGA color");
else
if (crtc_addr == MONO_BASE)
- printf(" MDA/hercules");
+ printf("MDA/hercules");
else
- printf(" CGA/EGA");
+ printf("CGA/EGA");
if (NCONS > 1)
printf(" <%d virtual consoles>\n", NCONS);
@@ -463,6 +463,8 @@ scintr(dev_t dev, int irq, int cpl)
c = sgetc(1);
if (c & 0x100)
return;
+ if ((cur_pccons->t_state & TS_ISOPEN) == 0)
+ return;
if (pcconsoftc.cs_flags & CSF_POLLING)
return;
if (c < 0x100)
@@ -492,7 +494,7 @@ pcparam(struct tty *tp, struct termios *t)
pcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
{
- int error;
+ int i, error;
struct tty *tp;
struct syscframe *fp;
scr_stat *scp;
@@ -608,9 +610,14 @@ pcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
}
/* NOT REACHED */
- case VT_OPENQRY: /* return free virtual cons, allways current */
- *data = get_scr_num(scp);
- return 0;
+ case VT_OPENQRY: /* return free virtual console */
+ for (i = 0; i < NCONS; i++)
+ if (!(pccons[i].t_state & TS_ISOPEN)) {
+ *data = i + 1;
+ return 0;
+ }
+ return EINVAL;
+ /* NOT REACHED */
case VT_ACTIVATE: /* switch to screen *data */
return switch_scr((*data) - 1);
diff --git a/sys/isa/sio.c b/sys/isa/sio.c
index a51e58c..0dbb439 100644
--- a/sys/isa/sio.c
+++ b/sys/isa/sio.c
@@ -41,7 +41,7 @@
* into the patch kit. Added in sioselect
* from com.c. Added port 4 support.
*/
-static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/isa/sio.c,v 1.7 1993/09/08 17:38:05 rgrimes Exp $";
+static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/isa/sio.c,v 1.8 1993/09/10 16:59:16 rgrimes Exp $";
#include "sio.h"
#if NSIO > 0
@@ -467,8 +467,12 @@ sioattach(isdp)
scr2 = inb(iobase + com_scr);
outb(iobase + com_scr, scr);
printf("sio%d: type", unit);
+#ifdef COM_MULTIPORT
+ if (0);
+#else
if (scr1 != 0xa5 || scr2 != 0x5a)
printf(" <8250>");
+#endif
else {
outb(iobase + com_fifo, FIFO_ENABLE | FIFO_TRIGGER_14);
DELAY(100);
diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c
index c98f012..acf3d56 100644
--- a/sys/isa/syscons.c
+++ b/sys/isa/syscons.c
@@ -35,11 +35,11 @@
*
*/
/*
- * Heavily modified by Søren Schmidt (sos@kmd-ac.dk) to provide:
+ * Heavily modified by Søren Schmidt (sos@login.dkuug.dk) to provide:
*
* virtual consoles, SYSV ioctl's, ANSI emulation
*
- * @(#)syscons.c 0.2d 930908
+ * @(#)syscons.c 0.2e 930924
* Derived from:
* @(#)pccons.c 5.11 (Berkeley) 5/21/91
*/
@@ -297,14 +297,14 @@ int pcattach(struct isa_device *dev)
if (crtc_vga)
if (crtc_addr == MONO_BASE)
- printf(" VGA mono");
+ printf("VGA mono");
else
- printf(" VGA color");
+ printf("VGA color");
else
if (crtc_addr == MONO_BASE)
- printf(" MDA/hercules");
+ printf("MDA/hercules");
else
- printf(" CGA/EGA");
+ printf("CGA/EGA");
if (NCONS > 1)
printf(" <%d virtual consoles>\n", NCONS);
@@ -463,6 +463,8 @@ scintr(dev_t dev, int irq, int cpl)
c = sgetc(1);
if (c & 0x100)
return;
+ if ((cur_pccons->t_state & TS_ISOPEN) == 0)
+ return;
if (pcconsoftc.cs_flags & CSF_POLLING)
return;
if (c < 0x100)
@@ -492,7 +494,7 @@ pcparam(struct tty *tp, struct termios *t)
pcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
{
- int error;
+ int i, error;
struct tty *tp;
struct syscframe *fp;
scr_stat *scp;
@@ -608,9 +610,14 @@ pcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
}
/* NOT REACHED */
- case VT_OPENQRY: /* return free virtual cons, allways current */
- *data = get_scr_num(scp);
- return 0;
+ case VT_OPENQRY: /* return free virtual console */
+ for (i = 0; i < NCONS; i++)
+ if (!(pccons[i].t_state & TS_ISOPEN)) {
+ *data = i + 1;
+ return 0;
+ }
+ return EINVAL;
+ /* NOT REACHED */
case VT_ACTIVATE: /* switch to screen *data */
return switch_scr((*data) - 1);
OpenPOWER on IntegriCloud