カーネルの状態を表示、変更ができます。
状態の表示
> sysctl -a | grep ddb
ddb.radix = 16
ddb.maxoff = 1048576
ddb.maxwidth = 80
ddb.lines = 24
ddb.tabstops = 8
ddb.onpanic = 0
ddb.fromconsole = 0
ddb.tee_msgbuf = 0
ddb.commandonenter =
> sysctl ddb.onpanic
ddb.onpanic = 0
状態の変更:起動時
/etc/sysctl.confを編集します。システムが起動する際に変更されますが、直ぐに変更したい場合は /etc/rc.d/sysctl start を実行します。
ddb.onpanic=0
ddb.fromconsole=0
>/etc/rc.d/sysctl start
Setting sysctl variables:
ddb.onpanic: 1 -> 0
ddb.fromconsole: 1 -> 0
状態の変更:永久
カーネルにパッチをあてます。時刻のオフセット変更等で使用します。また、カーネルを作成する機会があるならばその時に変更するのがいいです。
> gdb --write /netbsd
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf"...
(gdb) set rtc_offset=-540
(gdb) quit
状態の変更:一時
一時的に変更します。システムを再起動させると元の値にもどります。主にシステムのチューニング中に使用します。
> sysctl kern.maxproc
kern.maxproc = 1044
> sysctl -w kern.maxproc=2088
kern.maxproc: 1044 -> 2088
状態項目の説明表示
> sysctl -d | grep ddb
ddb.radix: Input and output radix
ddb.maxoff: Maximum symbol offset
ddb.maxwidth: Maximum output line width
ddb.lines: Number of display lines
ddb.tabstops: Output tab width
ddb.onpanic: Whether to enter ddb on a kernel panic
ddb.fromconsole: Whether ddb can be entered from the console
ddb.tee_msgbuf: Whether to tee ddb output to the msgbuf
ddb.commandonenter: Command to be executed on each ddb enter