Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src In-kernel device configuration manager - allows modification
details: https://anonhg.NetBSD.org/src/rev/d273f8bc8a2b
branches: trunk
changeset: 511966:d273f8bc8a2b
user: gmcgarry <gmcgarry%NetBSD.org@localhost>
date: Sun Jul 01 02:56:20 2001 +0000
description:
In-kernel device configuration manager - allows modification
of device locators at run-time.
Written by Mats O Jansson <moj%stacken.kth.se@localhost>. Reworked by
Jun-ichiro itojun Hagino <itojun%netbsd.org@localhost>.
diffstat:
distrib/sets/lists/man/mi | 4 +-
share/man/man4/Makefile | 6 +-
share/man/man4/userconf.4 | 150 +++++++
sys/conf/files | 6 +-
sys/kern/subr_autoconf.c | 15 +-
sys/kern/subr_userconf.c | 904 ++++++++++++++++++++++++++++++++++++++++++++++
sys/sys/boot_flag.h | 5 +-
sys/sys/device.h | 10 +-
sys/sys/reboot.h | 3 +-
sys/sys/userconf.h | 41 ++
10 files changed, 1131 insertions(+), 13 deletions(-)
diffs (truncated from 1282 to 300 lines):
diff -r cf34be8db683 -r d273f8bc8a2b distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Sun Jul 01 02:46:47 2001 +0000
+++ b/distrib/sets/lists/man/mi Sun Jul 01 02:56:20 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.374 2001/06/27 23:11:31 wiz Exp $
+# $NetBSD: mi,v 1.375 2001/07/01 02:56:21 gmcgarry Exp $
./usr/share/info/am-utils.info man-amd-info
./usr/share/info/as.info man-computil-info
./usr/share/info/awk.info man-util-info
@@ -869,6 +869,7 @@
./usr/share/man/cat4/usb.0 man-sys-catman
./usr/share/man/cat4/uscanner.0 man-sys-catman
./usr/share/man/cat4/usscanner.0 man-sys-catman
+./usr/share/man/cat4/userconf.0 man-sys-catman
./usr/share/man/cat4/uvisor.0 man-sys-catman
./usr/share/man/cat4/uyap.0 man-sys-catman
./usr/share/man/cat4/vax/acc.0 man-sys-catman
@@ -2409,6 +2410,7 @@
./usr/share/man/man4/usb.4 man-sys-man
./usr/share/man/man4/uscanner.4 man-sys-man
./usr/share/man/man4/usscanner.4 man-sys-man
+./usr/share/man/man4/userconf.4 man-sys-man
./usr/share/man/man4/uvisor.4 man-sys-man
./usr/share/man/man4/uyap.4 man-sys-man
./usr/share/man/man4/vax/acc.4 man-sys-man
diff -r cf34be8db683 -r d273f8bc8a2b share/man/man4/Makefile
--- a/share/man/man4/Makefile Sun Jul 01 02:46:47 2001 +0000
+++ b/share/man/man4/Makefile Sun Jul 01 02:56:20 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.207 2001/06/28 21:12:01 fredette Exp $
+# $NetBSD: Makefile,v 1.208 2001/07/01 02:56:21 gmcgarry Exp $
# @(#)Makefile 8.1 (Berkeley) 6/18/93
MAN= adv.4 adw.4 ahb.4 ahc.4 an.4 aria.4 atalk.4 audio.4 auich.4 auvia.4 \
@@ -17,8 +17,8 @@
rtk.4 sbus.4 scsi.4 sd.4 se.4 ses.4 sf.4 siop.4 sip.4 sl.4 sm.4 \
speaker.4 spp.4 sqphy.4 ss.4 st.4 ste.4 sv.4 strip.4 tb.4 tcp.4 \
termios.4 ti.4 tl.4 tlp.4 tlphy.4 tp.4 tr.4 tty.4 tun.4 tqphy.4 twe.4 \
- udp.4 uha.4 uk.4 ukphy.4 unix.4 vga.4 vlan.4 vnd.4 vr.4 wd.4 \
- wdc.4 wi.4 wscons.4 wsdisplay.4 wskbd.4 wsmouse.4 \
+ udp.4 uha.4 uk.4 ukphy.4 unix.4 userconf.4 vga.4 vlan.4 vnd.4 \
+ vr.4 wd.4 wdc.4 wi.4 wscons.4 wsdisplay.4 wskbd.4 wsmouse.4 \
wsmux.4 yds.4 ym.4 zero.4 zstty.4
# USB devices
diff -r cf34be8db683 -r d273f8bc8a2b share/man/man4/userconf.4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/userconf.4 Sun Jul 01 02:56:20 2001 +0000
@@ -0,0 +1,150 @@
+.\" $NetBSD: userconf.4,v 1.1 2001/07/01 02:56:21 gmcgarry Exp $
+.\"
+.\" Copyright (c) 2001 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Gregory McGarry.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the NetBSD
+.\" Foundation, Inc. and its contributors.
+.\" 4. Neither the name of The NetBSD Foundation nor the names of its
+.\" contributors may be used to endorse or promote products derived
+.\" from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd July 1, 2001
+.Dt USERCONF 9
+.Os
+.Sh NAME
+.Nm userconf
+.Nd in-kernel device configuration manager
+.Sh SYNOPSIS
+.Cd options USERCONF
+.Sh DESCRIPTION
+.Nm
+is the in-kernel device configuration manager. It is used to alter
+the kernel autoconfiguration framework at runtime.
+.Nm
+is activated from the boot loader by passing the
+-c
+option to the kernel.
+.Sh COMMAND SYNTAX
+The general command syntax is:
+.Bd -ragged -offset indent
+.Ic command Op Ar option
+.Ed
+.Pp
+.Nm
+has a
+.Xr more 1 -like
+functionality; if a number of lines in a command's output exceeds the
+number defined in the lines variable, then
+.Nm displays
+.Dq "-- more --"
+and waits for a response, which may be one of:
+.Bl -tag -offset indent -width "<return>"
+.It <return>
+one more line.
+.It <space>
+one more page.
+.It Ic q
+abort the current command, and return to the command input mode.
+.El
+.Pp
+.Sh COMMANDS
+.Nm
+supports the following commands:
+.Bl -tag -width 5n
+.It Xo
+.Ic lines
+.Ar count
+.Xc
+Specify the number of lines before more.
+.It Xo
+.Ic base
+.Ar 8 |
+.Ar 10 |
+.Ar 16
+.Xc
+Base for displaying large numbers.
+.It Xo
+.Ic change
+.Ar devno |
+.Ar dev
+.Xc
+Change devices.
+.It Xo
+.Ic disable
+.Ar devno |
+.Ar dev
+.Xc
+Disable devices.
+.It Xo
+.Ic enable
+.Ar devno |
+.Ar dev
+.Xc
+Enable devices.
+.It Xo
+.Ic exit
+.Xc
+A synonym for
+.Ic quit .
+.It Xo
+.Ic find
+.Ar devno |
+.Ar dev
+.Xc
+Find devices.
+.It Xo
+.Ic help
+.Xc
+Display online help.
+.It Xo
+.Ic list
+.Xc
+List current configuration.
+.It Xo
+.Ic quit
+.Xc
+Leave userconf.
+.It Xo
+.Ic ?
+.Xc
+A synomym for
+.Ic help .
+.El
+.Sh AUTHOR
+The
+.Nm
+framework was written by
+.An Mats O Jansson
+.Aq moj%stacken.kth.se@localhost .
+
+.Sh HISTORY
+The
+.Nm
+framework appeared in
+.Nx 1.6 .
diff -r cf34be8db683 -r d273f8bc8a2b sys/conf/files
--- a/sys/conf/files Sun Jul 01 02:46:47 2001 +0000
+++ b/sys/conf/files Sun Jul 01 02:56:20 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.448 2001/06/19 17:58:41 jdolecek Exp $
+# $NetBSD: files,v 1.449 2001/07/01 02:56:20 gmcgarry Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -122,6 +122,9 @@
# buffer cache size options
defopt opt_bufcache.h BUFCACHE BUFPAGES
+# userconf
+defopt opt_userconf.h USERCONF
+
# Not entirely MI, but present on multiple arch's
@@ -862,6 +865,7 @@
file kern/subr_prf.c
file kern/subr_prof.c
file kern/subr_rmap.c
+file kern/subr_userconf.c userconf
file kern/subr_xxx.c
file kern/sys_generic.c
file kern/sys_pipe.c new_pipe
diff -r cf34be8db683 -r d273f8bc8a2b sys/kern/subr_autoconf.c
--- a/sys/kern/subr_autoconf.c Sun Jul 01 02:46:47 2001 +0000
+++ b/sys/kern/subr_autoconf.c Sun Jul 01 02:56:20 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.56 2001/05/28 16:40:31 thorpej Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.57 2001/07/01 02:56:20 gmcgarry Exp $ */
/*
* Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -82,7 +82,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.56 2001/05/28 16:40:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.57 2001/07/01 02:56:20 gmcgarry Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -93,6 +93,12 @@
#include <sys/proc.h>
#include <machine/limits.h>
+#include "opt_userconf.h"
+#ifdef USERCONF
+#include <sys/userconf.h>
+#include <sys/reboot.h>
+#endif
+
/*
* Autoconfiguration subroutines.
*/
@@ -150,6 +156,11 @@
TAILQ_INIT(&interrupt_config_queue);
TAILQ_INIT(&alldevs);
+#ifdef USERCONF
+ if (boothowto & RB_USERCONF)
+ user_config();
+#endif
+
/*
* Do the machine-dependent portion of autoconfiguration. This
* sets the configuration machinery here in motion by "finding"
diff -r cf34be8db683 -r d273f8bc8a2b sys/kern/subr_userconf.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/kern/subr_userconf.c Sun Jul 01 02:56:20 2001 +0000
@@ -0,0 +1,904 @@
+/* $NetBSD: subr_userconf.c,v 1.1 2001/07/01 02:56:20 gmcgarry Exp $ */
+
+/*
+ * Copyright (c) 1996 Mats O Jansson <moj%stacken.kth.se@localhost>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Mats O Jansson.
+ * 4. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Home |
Main Index |
Thread Index |
Old Index