no echo console
Randy Bush
randy at psg.com
Mon Oct 18 11:01:07 PDT 2004
>>> root's shell is /usr/local/bin/bash (no comments, please:-)
>>> i am seeing the problem as root in multiluser. i don't spend
>>> much time in single abuser, so can't say.
>> Ahh, that's different then.
>> I'll hunt this one down tomorrow.
>
> Can you try this patch ?
did, but it did not fix the problem. did a simple portupgrade.
when it finished, i typed "ls," which was not echoed, but i got
the output of the command. issued "reset" command. now it
echos again. sorry.
randy
>
> Index: sys/tty.h
> ===================================================================
> RCS file: /home/ncvs/src/sys/sys/tty.h,v
> retrieving revision 1.96
> diff -u -r1.96 tty.h
> --- sys/tty.h 30 Sep 2004 10:38:47 -0000 1.96
> +++ sys/tty.h 18 Oct 2004 06:43:10 -0000
> @@ -357,6 +357,7 @@
> void ttyfree(struct tty *tp);
> void ttygone(struct tty *tp);
> void ttyinfo(struct tty *tp);
> +void ttyinitmode(struct tty *tp, int echo, int speed);
> int ttyinput(int c, struct tty *tp);
> int ttylclose(struct tty *tp, int flag);
> void ttyldoptim(struct tty *tp);
> Index: kern/tty.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/kern/tty.c,v
> retrieving revision 1.238
> diff -u -r1.238 tty.c
> --- kern/tty.c 15 Oct 2004 09:03:07 -0000 1.238
> +++ kern/tty.c 18 Oct 2004 07:24:42 -0000
> @@ -2845,11 +2845,7 @@
> tp->t_timeout = -1;
> tp->t_dtr_wait = 3 * hz;
>
> - tp->t_init_in.c_iflag = TTYDEF_IFLAG;
> - tp->t_init_in.c_oflag = TTYDEF_OFLAG;
> - tp->t_init_in.c_cflag = TTYDEF_CFLAG;
> - tp->t_init_in.c_lflag = TTYDEF_LFLAG;
> - tp->t_init_in.c_ispeed = tp->t_init_in.c_ospeed = TTYDEF_SPEED;
> + ttyinitmode(tp, 0, 0);
> bcopy(ttydefchars, tp->t_init_in.c_cc, sizeof tp->t_init_in.c_cc);
>
> /* Make callout the same as callin */
> @@ -3365,23 +3361,45 @@
> }
>
> /*
> - * Use more "normal" termios paramters for consoles.
> + * Initialize a tty to sane modes.
> */
> void
> -ttyconsolemode(struct tty *tp, int speed)
> +ttyinitmode(struct tty *tp, int echo, int speed)
> {
>
> + if (speed == 0)
> + speed = TTYDEF_SPEED;
> tp->t_init_in.c_iflag = TTYDEF_IFLAG;
> tp->t_init_in.c_oflag = TTYDEF_OFLAG;
> - tp->t_init_in.c_cflag = TTYDEF_CFLAG | CLOCAL;
> - tp->t_init_in.c_lflag = TTYDEF_LFLAG_ECHO;
> - tp->t_lock_out.c_cflag = tp->t_lock_in.c_cflag = CLOCAL;
> + tp->t_init_in.c_cflag = TTYDEF_CFLAG;
> + if (echo)
> + tp->t_init_in.c_lflag = TTYDEF_LFLAG_ECHO;
> + else
> + tp->t_init_in.c_lflag = TTYDEF_LFLAG;
> +
> + tp->t_init_in.c_ispeed = tp->t_init_in.c_ospeed = speed;
> + tp->t_init_out = tp->t_init_in;
> + termioschars(&tp->t_termios);
> + tp->t_termios = tp->t_init_in;
> +}
> +
> +/*
> + * Use more "normal" termios paramters for consoles.
> + */
> +void
> +ttyconsolemode(struct tty *tp, int speed)
> +{
> +
> if (speed == 0)
> speed = TTYDEF_SPEED;
> + ttyinitmode(tp, 1, speed);
> + tp->t_init_in.c_cflag |= CLOCAL;
> + termioschars(&tp->t_termios);
> + tp->t_lock_out.c_cflag = tp->t_lock_in.c_cflag = CLOCAL;
> tp->t_lock_out.c_ispeed = tp->t_lock_out.c_ospeed =
> - tp->t_lock_in.c_ispeed = tp->t_lock_in.c_ospeed =
> - tp->t_init_in.c_ispeed = tp->t_init_in.c_ospeed = speed;
> + tp->t_lock_in.c_ispeed = tp->t_lock_in.c_ospeed = speed;
> tp->t_init_out = tp->t_init_in;
> + tp->t_termios = tp->t_init_in;
> }
>
> /*
> Index: dev/syscons/syscons.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/syscons/syscons.c,v
> retrieving revision 1.430
> diff -u -r1.430 syscons.c
> --- dev/syscons/syscons.c 14 Oct 2004 08:58:28 -0000 1.430
> +++ dev/syscons/syscons.c 18 Oct 2004 06:52:09 -0000
> @@ -145,6 +145,7 @@
> static int debugger;
>
> /* prototypes */
> +static struct tty *sc_alloc_tty(struct cdev *dev);
> static int scvidprobe(int unit, int flags, int cons);
> static int sckbdprobe(int unit, int flags, int cons);
> static void scmeminit(void *arg);
> @@ -288,10 +289,23 @@
> return names[i].name[(adp->va_flags & V_ADP_COLOR) ? 0 : 1];
> }
>
> +static struct tty *
> +sc_alloc_tty(struct cdev *dev)
> +{
> + struct tty *tp;
> +
> + tp = dev->si_tty = ttyalloc();
> + ttyinitmode(tp, 1, 0);
> + tp->t_oproc = scstart;
> + tp->t_param = scparam;
> + tp->t_stop = nottystop;
> + tp->t_dev = dev;
> + return (tp);
> +}
> +
> int
> sc_attach_unit(int unit, int flags)
> {
> - struct tty *tp;
> sc_softc_t *sc;
> scr_stat *scp;
> #ifdef SC_PIXEL_MODE
> @@ -383,14 +397,9 @@
>
> for (vc = 0; vc < sc->vtys; vc++) {
> if (sc->dev[vc] == NULL) {
> - dev = make_dev(&sc_cdevsw, vc + unit * MAXCONS,
> + sc->dev[vc] = make_dev(&sc_cdevsw, vc + unit * MAXCONS,
> UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc + unit * MAXCONS);
> - sc->dev[vc] = dev;
> - tp = sc->dev[vc]->si_tty = ttyalloc();
> - tp->t_oproc = scstart;
> - tp->t_param = scparam;
> - tp->t_stop = nottystop;
> - tp->t_dev = sc->dev[vc];
> + sc_alloc_tty(sc->dev[vc]);
> if (vc == 0 && sc->dev == main_devs)
> SC_STAT(sc->dev[0]) = &main_console;
> }
> @@ -403,12 +412,8 @@
>
> dev = make_dev(&sc_cdevsw, SC_CONSOLECTL,
> UID_ROOT, GID_WHEEL, 0600, "consolectl");
> - tp = dev->si_tty = sc_console_tty = ttyalloc();
> - ttyconsolemode(tp, 0);
> - tp->t_oproc = scstart;
> - tp->t_param = scparam;
> - tp->t_stop = nottystop;
> - tp->t_dev = dev;
> + sc_console_tty = sc_alloc_tty(dev);
> + ttyconsolemode(sc_console_tty, 0);
> SC_STAT(dev) = sc_console;
>
> return 0;
> @@ -2581,7 +2586,6 @@
> static void
> scinit(int unit, int flags)
> {
> - struct tty *tp;
>
> /*
> * When syscons is being initialized as the kernel console, malloc()
> @@ -2692,11 +2696,7 @@
> sc->dev = malloc(sizeof(struct cdev *)*sc->vtys, M_DEVBUF, M_WAITOK|M_ZERO);
> sc->dev[0] = make_dev(&sc_cdevsw, unit * MAXCONS,
> UID_ROOT, GID_WHEEL, 0600, "ttyv%r", unit * MAXCONS);
> - tp = sc->dev[0]->si_tty = ttyalloc();
> - tp->t_oproc = scstart;
> - tp->t_param = scparam;
> - tp->t_stop = nottystop;
> - tp->t_dev = sc->dev[0];
> + sc_alloc_tty(sc->dev[0]);
> scp = alloc_scp(sc, sc->first_vty);
> SC_STAT(sc->dev[0]) = scp;
> }
> Index: dev/syscons/sysmouse.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/syscons/sysmouse.c,v
> retrieving revision 1.25
> diff -u -r1.25 sysmouse.c
> --- dev/syscons/sysmouse.c 14 Oct 2004 08:58:28 -0000 1.25
> +++ dev/syscons/sysmouse.c 18 Oct 2004 06:58:37 -0000
> @@ -80,12 +80,7 @@
>
> tp = dev->si_tty;
> if (!(tp->t_state & TS_ISOPEN)) {
> - ttychars(tp);
> - tp->t_iflag = TTYDEF_IFLAG;
> - tp->t_oflag = TTYDEF_OFLAG;
> - tp->t_cflag = TTYDEF_CFLAG;
> - tp->t_lflag = TTYDEF_LFLAG;
> - tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
> + ttyinitmode(tp, 0, 0);
> smparam(tp, &tp->t_termios);
> ttyld_modem(tp, 1);
> } else if (tp->t_state & TS_XCLUDE && suser(td)) {
> --
> Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
> phk at FreeBSD.ORG | TCP/IP since RFC 956
> FreeBSD committer | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
More information about the freebsd-current
mailing list