Subject: Re: Is this a panic or a break to ddb?
To: Mark Cullen <mark.r.cullen@gmail.com>
From: Greg A. Woods <woods@weird.com>
List: netbsd-users
Date: 08/05/2006 13:43:21
--pgp-sign-Multipart_Sat_Aug__5_13:38:27_2006-1
Content-Type: multipart/mixed;
 boundary="Multipart_Sat_Aug__5_13:38:27_2006-1"

--Multipart_Sat_Aug__5_13:38:27_2006-1
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

At Sat, 05 Aug 2006 13:31:56 +0100,
Mark Cullen wrote:
>=20
> What does the 0x104 actually mean?

You have to work backwards from the values in /usr/include/sys/reboot.h

This is one of those things I always hate having to chase down too!

Your question finally made me make some local manual page changes
(albiet to an older rev of the page) to remedy this problem for myself.
At least then I've only got one place to look and in some cases it's
easier to find and read too (especially since it can be printed in a
book this way).

Strictly speaking I guess the "reboot" command in DDB should parse the
names.  Most of the logic is already there, but there are no identifiers
in the symbol table for constants such as these.  A really horrible hack
would be to just add global integer variables to the kernel with the
same RB_* names but lowercased, and containing their defined constant
values.  Then one might be able to type "reboot (rb_dump + rb_nosync)".
Adding support for a logical-OR operator to the expression parser would
be nice too.

--=20
						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>       Secrets of the Weird <woods@weird.com>


--Multipart_Sat_Aug__5_13:38:27_2006-1
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: attachment; filename="reboot.2-diffs"
Content-Transfer-Encoding: quoted-printable

Index: lib/libc/sys/reboot.2
=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: /cvs/master/m-NetBSD/main/src/lib/libc/sys/reboot.2,v
retrieving revision 1.13
diff -u -r1.13 reboot.2
--- lib/libc/sys/reboot.2	8 Feb 2002 01:28:21 -0000	1.13
+++ lib/libc/sys/reboot.2	5 Aug 2006 17:03:12 -0000
@@ -33,7 +33,7 @@
 .\"
 .\"     @(#)reboot.2	8.1 (Berkeley) 6/4/93
 .\"
-.Dd June 4, 1993
+.Dd August 5, 2006
 .Dt REBOOT 2
 .Os
 .Sh NAME
@@ -59,10 +59,11 @@
 .Aq Pa sys/reboot.h ,
 to be passed
 to the new kernel or the new bootstrap and init programs.
-.Bl -tag -width RB_INITNAMEA
-.It Dv RB_AUTOBOOT
+.Bl -column RB_INITNAMEA 0x0000
+.It Dv RB_AUTOBOOT Ta Li 0x0000 Ta
 The default, causing the system to reboot in its usual fashion.
-.It Dv RB_ASKNAME
+.Pp
+.It Dv RB_ASKNAME Ta Li 0x0001 Ta
 Interpreted by the bootstrap program itself, causing it to
 prompt on the console as to what file should be booted.
 Normally, the system is booted from the file
@@ -71,28 +72,25 @@
 .Em xx
 is the default disk name,
 without prompting for the file name.
-.It Dv RB_DFLTROOT
-Use the compiled in root device.
-Normally, the system uses the device from which it was booted
-as the root device if possible.
-(The default behavior is dependent on the ability of the bootstrap program
-to determine the drive from which it was loaded, which is not possible
-on all systems.)
-.It Dv RB_DUMP
+.Pp
+.It Dv RB_DUMP Ta Li 0x0100 Ta
 Dump kernel memory before rebooting; see
 .Xr savecore 8
 for more information.
-.It Dv RB_HALT
+.Pp
+.It Dv RB_HALT Ta Li 0x0008 Ta
 the processor is simply halted; no reboot takes place.
 This option should be used with caution.
-.It Dv RB_INITNAME
+.Pp
+.It Dv RB_INITNAME Ta Li 0x0010 Ta
 An option allowing the specification of an init program (see
 .Xr init 8 )
 other than
 .Pa /sbin/init
 to be run when the system reboots.
 This switch is not currently available.
-.It Dv RB_KDB
+.Pp
+.It Dv RB_KDB Ta Li 0x0040 Ta
 Load the symbol table and enable a built-in debugger in the system.
 This option will have no useful function if the kernel is not configured
 for debugging.
@@ -104,16 +102,24 @@
 See
 .Xr ddb 4
 for more information.
-.It Dv RB_NOSYNC
+.Pp
+.It Dv RB_NOSYNC Ta Li 0x0004 Ta
 Normally, the disks are sync'd (see
 .Xr sync 8 )
 before the processor is halted or rebooted.
 This option may be useful if file system changes have been made manually
 or if the processor is on fire.
-.It Dv RB_RDONLY
+.Pp
+.It Dv RB_POWERDOWN Ta Li 0x0900 Ta
+The power is turned off, if possible, else the action is the same as
+that of
+.Dv RB_HALT .
+.Pp
+.It Dv RB_RDONLY Ta Li 0x0080 Ta
 Initially mount the root file system read-only.
 This is currently the default, and this option has been deprecated.
-.It Dv RB_SINGLE
+.Pp
+.It Dv RB_SINGLE Ta Li 0x0002 Ta
 Normally, the reboot procedure involves an automatic disk consistency
 check and then multi-user operations.
 .Dv RB_SINGLE
@@ -132,14 +138,21 @@
 An automatic consistency check of the disks is normally performed
 (see
 .Xr fsck 8 ) .
-.It Dv RB_STRING
+.Pp
+.It Dv RB_STRING Ta Li 0x0400 Ta
 .Fa bootstr
 is a string passed to the firmware on the machine, if possible, if this
 option is set.  Currently this only implemented on the sparc and the sun3.
+.Pp
+.It Dv RB_USERCONF Ta Li 0x1000 Ta
+Initially invoke the
+.Xr userconf 4
+facility when the system starts up again, if it has been compiled into
+the kernel that is loaded.
 .El
 .Sh RETURN VALUES
 If successful, this call never returns.
-Otherwise, a -1 is returned and an error is returned in the global
+Otherwise, a \-1 is returned and an error is returned in the global
 variable
 .Va errno .
 .Sh ERRORS
@@ -159,3 +172,8 @@
 .Fn reboot
 function call appeared in
 .Bx 4.0 .
+.Pp
+The
+.Dv RB_DFLTROOT
+option is now
+.Em obsolete .

--Multipart_Sat_Aug__5_13:38:27_2006-1--

--pgp-sign-Multipart_Sat_Aug__5_13:38:27_2006-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: BrEtE2Gu53/q2IqN+qOdIC++/sNKRa4H

iQA/AwUBRNTXlWJ7XxTCWceFEQLUgQCg7E5njTeYMSGlae47CKVeTT9M5IgAoP6a
XBUVRV3/+kwgeH5QIag+1Mtc
=euXe
-----END PGP SIGNATURE-----

--pgp-sign-Multipart_Sat_Aug__5_13:38:27_2006-1--