Subject: Re: RFC: switching to the console on panic
To: None <tech-kern@netbsd.org>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-kern
Date: 02/11/2006 18:12:00
--X1bOJ3K7DJ5YkBrT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Feb 11, 2006 at 05:11:23PM +0100, Reinoud Zandijk wrote:
> Dear folks,
>=20
> a small patch proposal to have ddb() switch to the console when invoked. =
So=20
> when working on say ttyE5 and a panic occures, it'll switch to the consol=
e=20
> where it prints the ddb prompt and backtrack if any.
>=20
> Avoids confusion mainly and prevents ppl. from typing in stuff and not=20
> understanding why the program is not responding.

I don't think this is very useful - you can still type Ctrl-Alt-1
to switch to the console.

Jaromir
=20
> regards,
> Reinoud
>=20

> Index: ddb/db_trap.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /cvsroot/src/sys/ddb/db_trap.c,v
> retrieving revision 1.23
> diff -u -p -r1.23 db_trap.c
> --- ddb/db_trap.c	11 Dec 2005 12:20:53 -0000	1.23
> +++ ddb/db_trap.c	11 Feb 2006 15:59:51 -0000
> @@ -48,6 +48,9 @@ __KERNEL_RCSID(0, "$NetBSD: db_trap.c,v=20
>  #include <ddb/db_sym.h>
>  #include <ddb/db_extern.h>
> =20
> +#include <dev/wscons/wsdisplayvar.h>
> +#include "wsdisplay.h"
> +
>  /*
>   * db_trap_callback can be hooked by MD port code to handle special
>   * cases such as disabling hardware watchdogs while in DDB.
> @@ -70,6 +73,9 @@ db_trap(int type, int code)
>  	if (db_trap_callback) db_trap_callback(1);
> =20
>  	if (db_stop_at_pc(DDB_REGS, &bkpt)) {
> +#if NWSDISPLAY > 0
> +		wsdisplay_switchtoconsole();
> +#endif
>  		if (db_inst_count) {
>  			db_printf("After %d instructions "
>  			    "(%d loads, %d stores),\n",
> Index: dev/wscons/wsdisplay.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /cvsroot/src/sys/dev/wscons/wsdisplay.c,v
> retrieving revision 1.88
> diff -u -p -r1.88 wsdisplay.c
> --- dev/wscons/wsdisplay.c	7 Feb 2006 09:13:02 -0000	1.88
> +++ dev/wscons/wsdisplay.c	11 Feb 2006 15:59:52 -0000
> @@ -2026,9 +2026,7 @@ wsdisplay_switchtoconsole(void)
>  		sc =3D wsdisplay_console_device;
>  		if ((scr =3D sc->sc_scr[0]) =3D=3D NULL)
>  			return;
> -		(*sc->sc_accessops->show_screen)(sc->sc_accesscookie,
> -						 scr->scr_dconf->emulcookie,
> -						 0, NULL, NULL);
> +		wsdisplay_switch((struct device *) sc, 0, 1);
>  	}
>  }
> =20




--=20
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=3D- We can walk our road together if our goals are all the same;     -=3D-
-=3D- We can run alone and free if we pursue a different aim.          -=3D-

--X1bOJ3K7DJ5YkBrT
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: 8KBGOFh1M3ApGj1nO8ESCbsyOiL6m1Mk

iQCVAwUBQ+4a4LZjOQfIPRaZAQGFUgP/T0sFwYJbXrxXTNtvL6oKEO00a48fPXAw
iUChflCNigKpcE1dsY/yzdx2+G0JscYn4bftwy+p1ireqRqqTPVfB7ItGeG6hC5n
e3Hm35dsgxoANYixE3oCWPZRr8nTxjoBtxS8KyfhiX3JSLVX0PP4gxfJicVGfwgE
bTU2reiEBjc=
=+e1G
-----END PGP SIGNATURE-----

--X1bOJ3K7DJ5YkBrT--