diff --git a/sbin/dumpon/dumpon.8 b/sbin/dumpon/dumpon.8 index de9bd648e68b..473f0658158a 100644 --- a/sbin/dumpon/dumpon.8 +++ b/sbin/dumpon/dumpon.8 @@ -1,454 +1,454 @@ .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. .\" .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" .Dd April 23, 2020 .Dt DUMPON 8 .Os .Sh NAME .Nm dumpon .Nd "specify a device for crash dumps" .Sh SYNOPSIS .Nm .Op Fl i Ar index .Op Fl r .Op Fl v .Op Fl C Ar cipher .Op Fl k Ar pubkey .Op Fl Z .Op Fl z .Ar device .Nm .Op Fl i Ar index .Op Fl r .Op Fl v .Op Fl C Ar cipher .Op Fl k Ar pubkey .Op Fl Z .Op Fl z .Op Fl g Ar gateway .Fl s Ar server .Fl c Ar client .Ar iface .Nm .Op Fl v .Cm off .Nm .Op Fl v .Fl l .Sh DESCRIPTION The .Nm utility is used to configure where the kernel can save a crash dump in the case of a panic. .Pp System administrators should typically configure .Nm in a persistent fashion using the .Xr rc.conf 5 variables .Va dumpdev and .Va dumpon_flags . For more information on this usage, see .Xr rc.conf 5 . .Pp Starting in .Fx 13.0 , .Nm can configure a series of fallback dump devices. For example, an administrator may prefer .Xr netdump 4 by default, but if the .Xr netdump 4 service cannot be reached or some other failure occurs, they might choose a local disk dump as a second choice option. .Ss General options .Bl -tag -width _k_pubkey .It Fl i Ar index Insert the specified dump configuration into the prioritized fallback dump device list at the specified index, starting at zero. .Pp If .Fl i is not specified, the configured dump device is appended to the prioritized list. .It Fl r Remove the specified dump device configuration or configurations from the fallback dump device list rather than inserting or appending it. In contrast, .Do .Nm off .Dc removes all configured devices. Conflicts with .Fl i . .It Fl k Ar pubkey Configure encrypted kernel dumps. .Pp A random, one-time symmetric key is automatically generated for bulk kernel dump encryption every time .Nm is used. The provided .Ar pubkey is used to encrypt a copy of the symmetric key. The encrypted dump contents consist of a standard dump header, the pubkey-encrypted symmetric key contents, and the symmetric key encrypted core dump contents. .Pp As a result, only someone with the corresponding private key can decrypt the symmetric key. The symmetric key is necessary to decrypt the kernel core. The goal of the mechanism is to provide confidentiality. .Pp The .Va pubkey file should be a PEM-formatted RSA key of at least 2048 bits. .It Fl C Ar cipher Select the symmetric algorithm used for encrypted kernel crash dump. The default is .Dq chacha20 but .Dq aes256-cbc is also available. (AES256-CBC mode does not work in conjunction with compression.) .It Fl l List the currently configured dump device(s), or /dev/null if no devices are configured. .It Fl v Enable verbose mode. .It Fl Z Enable compression (Zstandard). .It Fl z Enable compression (gzip). Only one compression method may be enabled at a time, so .Fl z is incompatible with .Fl Z . .Pp Zstandard provides superior compression ratio and performance. .El .Ss Netdump .Nm may also configure the kernel to dump to a remote .Xr netdumpd 8 server. (The .Xr netdumpd 8 server is available in ports.) .Xr netdump 4 eliminates the need to reserve space for crash dumps. It is especially useful in diskless environments. When .Nm is used to configure netdump, the .Ar device (or .Ar iface ) parameter should specify a network interface (e.g., .Va igb1 ) . The specified NIC must be up (online) to configure netdump. .Pp .Xr netdump 4 specific options include: .Bl -tag -width _g_gateway .It Fl c Ar client The local IP address of the .Xr netdump 4 client. .It Fl g Ar gateway The first-hop router between .Ar client and .Ar server . If the .Fl g option is not specified and the system has a default route, the default router is used as the .Xr netdump 4 gateway. If the .Fl g option is not specified and the system does not have a default route, .Ar server is assumed to be on the same link as .Ar client . .It Fl s Ar server The IP address of the .Xr netdumpd 8 server. .El .Pp All of these options can be specified in the .Xr rc.conf 5 variable .Va dumpon_flags . .Ss Minidumps The default type of kernel crash dump is the mini crash dump. Mini crash dumps hold only memory pages in use by the kernel. Alternatively, full memory dumps can be enabled by setting the .Va debug.minidump .Xr sysctl 8 variable to 0. .Ss Full dumps For systems using full memory dumps, the size of the specified dump device must be at least the size of physical memory. Even though an additional 64 kB header is added to the dump, the BIOS for a platform typically holds back some memory, so it is not usually necessary to size the dump device larger than the actual amount of RAM available in the machine. Also, when using full memory dumps, the .Nm utility will refuse to enable a dump device which is smaller than the total amount of physical memory as reported by the .Va hw.physmem .Xr sysctl 8 variable. .Sh IMPLEMENTATION NOTES Because the file system layer is already dead by the time a crash dump is taken, it is not possible to send crash dumps directly to a file. .Pp The .Xr loader 8 variable .Va dumpdev may be used to enable early kernel core dumps for system panics which occur before userspace starts. .Sh EXAMPLES In order to generate an RSA private key, a user can use the .Xr genrsa 1 tool: .Pp .Dl # openssl genrsa -out private.pem 4096 .Pp A public key can be extracted from the private key using the .Xr rsa 1 tool: .Pp .Dl # openssl rsa -in private.pem -out public.pem -pubout .Pp Once the RSA keys are created in a safe place, the public key may be moved to the untrusted netdump client machine. Now .Pa public.pem can be used by .Nm to configure encrypted kernel crash dumps: .Pp .Dl # dumpon -k public.pem /dev/ada0s1b .Pp It is recommended to test if the kernel saves encrypted crash dumps using the current configuration. The easiest way to do that is to cause a kernel panic using the .Xr ddb 4 debugger: .Pp .Dl # sysctl debug.kdb.panic=1 .Pp In the debugger the following commands should be typed to write a core dump and reboot: .Pp .Dl db> dump .Dl db> reset .Pp After reboot .Xr savecore 8 should be able to save the core dump in the .Va Dq dumpdir directory, which is .Pa /var/crash by default: .Pp .Dl # savecore /dev/ada0s1b .Pp Three files should be created in the core directory: .Pa info.# , .Pa key.# and .Pa vmcore_encrypted.# (where .Dq # is the number of the last core dump saved by .Xr savecore 8 ) . The .Pa vmcore_encrypted.# can be decrypted using the .Xr decryptcore 8 utility: .Pp .Dl # decryptcore -p private.pem -k key.# -e vmcore_encrypted.# -c vmcore.# .Pp or shorter: .Pp .Dl # decryptcore -p private.pem -n # .Pp The .Pa vmcore.# can be now examined using -.Xr kgdb 1 : +.Xr kgdb 1 Pq Pa ports/devel/gdb : .Pp .Dl # kgdb /boot/kernel/kernel vmcore.# .Pp or shorter: .Pp .Dl # kgdb -n # .Pp The core was decrypted properly if -.Xr kgdb 1 +.Xr kgdb 1 Pq Pa ports/devel/gdb does not print any errors. Note that the live kernel might be at a different path which can be examined by looking at the .Va kern.bootfile .Xr sysctl 8 . .Pp The .Nm .Xr rc 8 script runs early during boot, typically before networking is configured. This makes it unsuitable for configuring .Xr netdump 4 when the client address is dynamic. To configure .Xr netdump 4 when .Xr dhclient 8 binds to a server, .Xr dhclient-script 8 can be used to run .Xr dumpon 8 . For example, to automatically configure .Xr netdump 4 on the vtnet0 interface, add the following to .Pa /etc/dhclient-exit-hooks . .Bd -literal case $reason in BOUND|REBIND|REBOOT|RENEW) if [ "$interface" != vtnet0 ] || [ -n "$old_ip_address" -a \\ "$old_ip_address" = "$new_ip_address" ]; then break fi if [ -n "$new_routers" ]; then # Take the first router in the list. gateway_flag="-g ${new_routers%% *}" fi # Configure as the highest-priority dump device. dumpon -i 0 -c $new_ip_address -s $server $gateway_flag vtnet0 ;; esac .Ed .Pp Be sure to fill in the server IP address and change the interface name if needed. .Sh SEE ALSO .Xr gzip 1 , -.Xr kgdb 1 , +.Xr kgdb 1 Pq Pa ports/devel/gdb , .Xr zstd 1 , .Xr ddb 4 , .Xr netdump 4 , .Xr fstab 5 , .Xr rc.conf 5 , .Xr config 8 , .Xr decryptcore 8 , .Xr init 8 , .Xr loader 8 , .Xr rc 8 , .Xr savecore 8 , .Xr swapon 8 , .Xr panic 9 .Sh HISTORY The .Nm utility appeared in .Fx 2.0.5 . .Pp Support for encrypted kernel core dumps and netdump was added in .Fx 12.0 . .Sh AUTHORS The .Nm manual page was written by .An Mark Johnston Aq Mt markj@FreeBSD.org , .An Conrad Meyer Aq Mt cem@FreeBSD.org , .An Konrad Witaszczyk Aq Mt def@FreeBSD.org , and countless others. .Sh CAVEATS To configure encrypted kernel core dumps, the running kernel must have been compiled with the .Dv EKCD option. .Pp Netdump does not automatically update the configured .Ar gateway if routing topology changes. .Pp The size of a compressed dump or a minidump is not a fixed function of RAM size. Therefore, when at least one of these options is enabled, the .Nm utility cannot verify that the .Ar device has sufficient space for a dump. .Nm is also unable to verify that a configured .Xr netdumpd 8 server has sufficient space for a dump. .Pp .Fl Z requires a kernel compiled with the .Dv ZSTDIO kernel option. Similarly, .Fl z requires the .Dv GZIO option. .Sh BUGS Netdump only supports IPv4 at this time. .Sh SECURITY CONSIDERATIONS The current encrypted kernel core dump scheme does not provide integrity nor authentication. That is, the recipient of an encrypted kernel core dump cannot know if they received an intact core dump, nor can they verify the provenance of the dump. .Pp RSA keys smaller than 1024 bits are practical to factor and therefore weak. Even 1024 bit keys may not be large enough to ensure privacy for many years, so NIST recommends a minimum of 2048 bit RSA keys. As a seatbelt, .Nm prevents users from configuring encrypted kernel dumps with extremely weak RSA keys. If you do not care for cryptographic privacy guarantees, just use .Nm without specifying a .Fl k Ar pubkey option. .Pp This process is sandboxed using .Xr capsicum 4 . diff --git a/share/man/man4/dcons.4 b/share/man/man4/dcons.4 index d228ad5c16b9..2b8292695649 100644 --- a/share/man/man4/dcons.4 +++ b/share/man/man4/dcons.4 @@ -1,125 +1,125 @@ .\" Copyright (c) 2003 Hidetoshi Shimokawa .\" 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. .\" .\" 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 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. .\" .\" $FreeBSD$ .\" .Dd January 26, 2008 .Dt DCONS 4 .Os .Sh NAME .Nm dcons .Nd dumb console device driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "options GDB" .Cd "device firewire" .Cd "device dcons" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "options GDB" .Ed .Pp and in .Xr loader.conf 5 : .Bd -ragged -offset indent dcons_load="YES" .Ed .Sh DESCRIPTION The .Nm device is a simple console device which just reads from and writes to an allocated buffer for input and output respectively. It is of no use by itself and it is supposed that the buffer is accessed via a bus like .Xr firewire 4 or .Xr kvm 3 for interaction. .Pp The buffer consists of 4 channels. There are 2 ports, one for the console TTY and another is GDB port, then each port has an input channel and an output channel. .Sh FILES .Bl -tag -width indent -compact .It Pa /dev/dcons .It Pa /etc/ttys .El .Sh EXAMPLES If you want to run .Xr getty 8 on .Nm , insert the following line into .Xr ttys 5 and send a .Dv HUP signal to .Xr init 8 using .Xr kill 1 . .Bd -literal -offset indent dcons "/usr/libexec/getty std.9600" vt100 on secure .Ed .Pp Once the .Xr fwohci 4 device is initialized to allow physical access, the buffer can be accessed from another host via a .Xr firewire 4 bus using the .Xr dconschat 8 application. See .Xr dconschat 8 for more details. .Pp If you want to use .Nm as a -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb port, add the following line into .Xr loader.conf 5 : .Bd -literal -offset indent dcons_gdb="1" .Ed .Sh SEE ALSO .Xr dcons_crom 4 , .Xr ddb 4 , .Xr firewire 4 , .Xr fwohci 4 , .Xr gdb 4 , .Xr ttys 5 , .Xr conscontrol 8 , .Xr dconschat 8 , .Xr fwcontrol 8 .Sh AUTHORS .An Hidetoshi Shimokawa Aq Mt simokawa@FreeBSD.org .Sh BUGS This driver is .Ud diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index d7b51b270877..f8bf45c62c73 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -1,1629 +1,1629 @@ .\" .\" Mach Operating System .\" Copyright (c) 1991,1990 Carnegie Mellon University .\" Copyright (c) 2007 Robert N. M. Watson .\" All Rights Reserved. .\" .\" Permission to use, copy, modify and distribute this software and its .\" documentation is hereby granted, provided that both the copyright .\" notice and this permission notice appear in all copies of the .\" software, derivative works or modified versions, and any portions .\" thereof, and that both notices appear in supporting documentation. .\" .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR .\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. .\" .\" Carnegie Mellon requests users of this software to return to .\" .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU .\" School of Computer Science .\" Carnegie Mellon University .\" Pittsburgh PA 15213-3890 .\" .\" any improvements or extensions that they make and grant Carnegie Mellon .\" the rights to redistribute these changes. .\" .\" $FreeBSD$ .\" .Dd March 14, 2021 .Dt DDB 4 .Os .Sh NAME .Nm ddb .Nd interactive kernel debugger .Sh SYNOPSIS In order to enable kernel debugging facilities include: .Bd -ragged -offset indent .Cd options KDB .Cd options DDB .Ed .Pp To prevent activation of the debugger on kernel .Xr panic 9 : .Bd -ragged -offset indent .Cd options KDB_UNATTENDED .Ed .Pp In order to print a stack trace of the current thread on the console for a panic: .Bd -ragged -offset indent .Cd options KDB_TRACE .Ed .Pp To print the numerical value of symbols in addition to the symbolic representation, define: .Bd -ragged -offset indent .Cd options DDB_NUMSYM .Ed .Pp To enable the -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb backend, so that remote debugging with .Xr kgdb 1 Pq Pa ports/devel/gdb is possible, include: .Bd -ragged -offset indent .Cd options GDB .Ed .Sh DESCRIPTION The .Nm kernel debugger is an interactive debugger with a syntax inspired by -.Xr gdb 1 . +.Xr gdb 1 Pq Pa ports/devel/gdb . If linked into the running kernel, it can be invoked locally with the .Ql debug .Xr keymap 5 action, usually mapped to Ctrl+Alt+Esc, or by setting the .Va debug.kdb.enter sysctl to 1. The debugger is also invoked on kernel .Xr panic 9 if the .Va debug.debugger_on_panic .Xr sysctl 8 MIB variable is set non-zero, which is the default unless the .Dv KDB_UNATTENDED option is specified. Similarly, if the .Va debug.debugger_on_recursive_panic variable is set to .Dv 1 , then the debugger will be invoked on a recursive kernel panic. This variable has a default value of .Dv 0 , and has no effect if .Va debug.debugger_on_panic is already set non-zero. .Pp The current location is called .Va dot . The .Va dot is displayed with a hexadecimal format at a prompt. The commands .Ic examine and .Ic write update .Va dot to the address of the last line examined or the last location modified, and set .Va next to the address of the next location to be examined or changed. Other commands do not change .Va dot , and set .Va next to be the same as .Va dot . .Pp The general command syntax is: .Ar command Ns Op Li / Ns Ar modifier .Oo Ar addr Oc Ns Op , Ns Ar count .Pp A blank line repeats the previous command from the address .Va next with count 1 and no modifiers. Specifying .Ar addr sets .Va dot to the address. Omitting .Ar addr uses .Va dot . A missing .Ar count is taken to be 1 for printing commands or infinity for stack traces. A .Ar count of -1 is equivalent to a missing .Ar count . Options that are supplied but not supported by the given .Ar command are usually ignored. .Pp The .Nm debugger has a pager feature (like the .Xr more 1 command) for the output. If an output line exceeds the number set in the .Va lines variable, it displays .Dq Li --More-- and waits for a response. The valid responses for it are: .Pp .Bl -tag -compact -width ".Li SPC" .It Li SPC one more page .It Li RET one more line .It Li q abort the current command, and return to the command input mode .El .Pp Finally, .Nm provides a small (currently 10 items) command history, and offers simple .Nm emacs Ns -style command line editing capabilities. In addition to the .Nm emacs control keys, the usual .Tn ANSI arrow keys may be used to browse through the history buffer, and move the cursor within the current line. .Sh COMMANDS .Ss COMMON DEBUGGER COMMANDS .Bl -tag -width indent -compact .It Ic help Print a short summary of the available commands and command abbreviations. .Pp .It Xo .Ic examine Ns Op Li / Ns Cm AISabcdghilmorsuxz ... .Oo Ar addr Oc Ns Op , Ns Ar count .Xc .It Xo .Ic x Ns Op Li / Ns Cm AISabcdghilmorsuxz ... .Oo Ar addr Oc Ns Op , Ns Ar count .Xc Display the addressed locations according to the formats in the modifier. Multiple modifier formats display multiple locations. If no format is specified, the last format specified for this command is used. .Pp The format characters are: .Bl -tag -compact -width indent .It Cm b look at by bytes (8 bits) .It Cm h look at by half words (16 bits) .It Cm l look at by long words (32 bits) .It Cm g look at by quad words (64 bits) .It Cm a print the location being displayed .It Cm A print the location with a line number if possible .It Cm x display in unsigned hex .It Cm z display in signed hex .It Cm o display in unsigned octal .It Cm d display in signed decimal .It Cm u display in unsigned decimal .It Cm r display in current radix, signed .It Cm c display low 8 bits as a character. Non-printing characters are displayed as an octal escape code (e.g., .Ql \e000 ) . .It Cm s display the null-terminated string at the location. Non-printing characters are displayed as octal escapes. .It Cm m display in unsigned hex with character dump at the end of each line. The location is also displayed in hex at the beginning of each line. .It Cm i display as a disassembled instruction .It Cm I display as an disassembled instruction with possible alternate formats depending on the machine. On i386, this selects the alternate format for the instruction decoding (16 bits in a 32-bit code segment and vice versa). .It Cm S display a symbol name for the pointer stored at the address .El .Pp .It Ic xf Examine forward: execute an .Ic examine command with the last specified parameters to it except that the next address displayed by it is used as the start address. .Pp .It Ic xb Examine backward: execute an .Ic examine command with the last specified parameters to it except that the last start address subtracted by the size displayed by it is used as the start address. .Pp .It Ic print Ns Op Li / Ns Cm acdoruxz .It Ic p Ns Op Li / Ns Cm acdoruxz Print .Ar addr Ns s according to the modifier character (as described above for .Cm examine ) . Valid formats are: .Cm a , x , z , o , d , u , r , and .Cm c . If no modifier is specified, the last one specified to it is used. The argument .Ar addr can be a string, in which case it is printed as it is. For example: .Bd -literal -offset indent print/x "eax = " $eax "\enecx = " $ecx "\en" .Ed .Pp will print like: .Bd -literal -offset indent eax = xxxxxx ecx = yyyyyy .Ed .Pp .It Xo .Ic write Ns Op Li / Ns Cm bhl .Ar addr expr1 Op Ar expr2 ... .Xc .It Xo .Ic w Ns Op Li / Ns Cm bhl .Ar addr expr1 Op Ar expr2 ... .Xc Write the expressions specified after .Ar addr on the command line at succeeding locations starting with .Ar addr . The write unit size can be specified in the modifier with a letter .Cm b (byte), .Cm h (half word) or .Cm l (long word) respectively. If omitted, long word is assumed. .Pp .Sy Warning : since there is no delimiter between expressions, strange things may happen. It is best to enclose each expression in parentheses. .Pp .It Ic set Li $ Ns Ar variable Oo Li = Oc Ar expr Set the named variable or register with the value of .Ar expr . Valid variable names are described below. .Pp .It Ic break Ns Oo Li / Ns Cm u Oc Oo Ar addr Oc Ns Op , Ns Ar count .It Ic b Ns Oo Li / Ns Cm u Oc Oo Ar addr Oc Ns Op , Ns Ar count Set a break point at .Ar addr . If .Ar count is supplied, the .Ic continue command will not stop at this break point on the first .Ar count \- 1 times that it is hit. If the break point is set, a break point number is printed with .Ql # . This number can be used in deleting the break point or adding conditions to it. .Pp If the .Cm u modifier is specified, this command sets a break point in user address space. Without the .Cm u option, the address is considered to be in the kernel space, and a wrong space address is rejected with an error message. This modifier can be used only if it is supported by machine dependent routines. .Pp .Sy Warning : If a user text is shadowed by a normal user space debugger, user space break points may not work correctly. Setting a break point at the low-level code paths may also cause strange behavior. .Pp .It Ic delete Op Ar addr .It Ic d Op Ar addr .It Ic delete Li # Ns Ar number .It Ic d Li # Ns Ar number Delete the specified break point. The break point can be specified by a break point number with .Ql # , or by using the same .Ar addr specified in the original .Ic break command, or by omitting .Ar addr to get the default address of .Va dot . .Pp .It Ic halt Halt the system. .Pp .It Ic watch Oo Ar addr Oc Ns Op , Ns Ar size Set a watchpoint for a region. Execution stops when an attempt to modify the region occurs. The .Ar size argument defaults to 4. If you specify a wrong space address, the request is rejected with an error message. .Pp .Sy Warning : Attempts to watch wired kernel memory may cause unrecoverable error in some systems such as i386. Watchpoints on user addresses work best. .Pp .It Ic hwatch Oo Ar addr Oc Ns Op , Ns Ar size Set a hardware watchpoint for a region if supported by the architecture. Execution stops when an attempt to modify the region occurs. The .Ar size argument defaults to 4. .Pp .Sy Warning : The hardware debug facilities do not have a concept of separate address spaces like the watch command does. Use .Ic hwatch for setting watchpoints on kernel address locations only, and avoid its use on user mode address spaces. .Pp .It Ic dhwatch Oo Ar addr Oc Ns Op , Ns Ar size Delete specified hardware watchpoint. .Pp .It Ic kill Ar sig pid Send signal .Ar sig to process .Ar pid . The signal is acted on upon returning from the debugger. This command can be used to kill a process causing resource contention in the case of a hung system. See .Xr signal 3 for a list of signals. Note that the arguments are reversed relative to .Xr kill 2 . .Pp .It Ic step Ns Oo Li / Ns Cm p Oc Ns Op , Ns Ar count .It Ic s Ns Oo Li / Ns Cm p Oc Ns Op , Ns Ar count Single step .Ar count times. If the .Cm p modifier is specified, print each instruction at each step. Otherwise, only print the last instruction. .Pp .Sy Warning : depending on machine type, it may not be possible to single-step through some low-level code paths or user space code. On machines with software-emulated single-stepping (e.g., pmax), stepping through code executed by interrupt handlers will probably do the wrong thing. .Pp .It Ic continue Ns Op Li / Ns Cm c .It Ic c Ns Op Li / Ns Cm c Continue execution until a breakpoint or watchpoint. If the .Cm c modifier is specified, count instructions while executing. Some machines (e.g., pmax) also count loads and stores. .Pp .Sy Warning : when counting, the debugger is really silently single-stepping. This means that single-stepping on low-level code may cause strange behavior. .Pp .It Ic until Ns Op Li / Ns Cm p Stop at the next call or return instruction. If the .Cm p modifier is specified, print the call nesting depth and the cumulative instruction count at each call or return. Otherwise, only print when the matching return is hit. .Pp .It Ic next Ns Op Li / Ns Cm p .It Ic match Ns Op Li / Ns Cm p Stop at the matching return instruction. If the .Cm p modifier is specified, print the call nesting depth and the cumulative instruction count at each call or return. Otherwise, only print when the matching return is hit. .Pp .It Xo .Ic trace Ns Op Li / Ns Cm u .Op Ar pid | tid Ns .Op , Ns Ar count .Xc .It Xo .Ic t Ns Op Li / Ns Cm u .Op Ar pid | tid Ns .Op , Ns Ar count .Xc .It Xo .Ic where Ns Op Li / Ns Cm u .Op Ar pid | tid Ns .Op , Ns Ar count .Xc .It Xo .Ic bt Ns Op Li / Ns Cm u .Op Ar pid | tid Ns .Op , Ns Ar count .Xc Stack trace. The .Cm u option traces user space; if omitted, .Ic trace only traces kernel space. The optional argument .Ar count is the number of frames to be traced. If .Ar count is omitted, all frames are printed. .Pp .Sy Warning : User space stack trace is valid only if the machine dependent code supports it. .Pp .It Xo .Ic search Ns Op Li / Ns Cm bhl .Ar addr .Ar value .Op Ar mask Ns .Op , Ns Ar count .Xc Search memory for .Ar value . The optional .Ar count argument limits the search. .\" .Pp .It Ic reboot Op Ar seconds .It Ic reset Op Ar seconds Hard reset the system. If the optional argument .Ar seconds is given, the debugger will wait for this long, at most a week, before rebooting. .Pp .It Ic thread Ar addr | tid Switch the debugger to the thread with ID .Ar tid , if the argument is a decimal number, or address .Ar addr , otherwise. .El .Ss SPECIALIZED HELPER COMMANDS .Bl -tag -width indent -compact .It Xo .Ic findstack .Ar addr .Xc Prints the thread address for a thread kernel-mode stack of which contains the specified address. If the thread is not found, search the thread stack cache and prints the cached stack address. Otherwise, prints nothing. .Pp .It Ic show Cm all procs Ns Op Li / Ns Cm a .It Ic ps Ns Op Li / Ns Cm a Display all process information. The process information may not be shown if it is not supported in the machine, or the bottom of the stack of the target process is not in the main memory at that time. The .Cm a modifier will print command line arguments for each process. .\" .Pp .It Ic show Cm all trace .It Ic alltrace Show a stack trace for every thread in the system. .Pp .It Ic show Cm all ttys Show all TTY's within the system. Output is similar to .Xr pstat 8 , but also includes the address of the TTY structure. .\" .Pp .It Ic show Cm all vnets Show the same output as "show vnet" does, but lists all virtualized network stacks within the system. .\" .Pp .It Ic show Cm allchains Show the same information like "show lockchain" does, but for every thread in the system. .\" .Pp .It Ic show Cm alllocks Show all locks that are currently held. This command is only available if .Xr witness 4 is included in the kernel. .\" .Pp .It Ic show Cm allpcpu The same as "show pcpu", but for every CPU present in the system. .\" .Pp .It Ic show Cm allrman Show information related with resource management, including interrupt request lines, DMA request lines, I/O ports, I/O memory addresses, and Resource IDs. .\" .Pp .It Ic show Cm apic Dump data about APIC IDT vector mappings. .\" .Pp .It Ic show Cm breaks Show breakpoints set with the "break" command. .\" .Pp .It Ic show Cm bio Ar addr Show information about the bio structure .Vt struct bio present at .Ar addr . See the .Pa sys/bio.h header file and .Xr g_bio 9 for more details on the exact meaning of the structure fields. .\" .Pp .It Ic show Cm buffer Ar addr Show information about the buf structure .Vt struct buf present at .Ar addr . See the .Pa sys/buf.h header file for more details on the exact meaning of the structure fields. .\" .Pp .It Ic show Cm callout Ar addr Show information about the callout structure .Vt struct callout present at .Ar addr . .\" .Pp .It Ic show Cm cbstat Show brief information about the TTY subsystem. .\" .Pp .It Ic show Cm cdev Without argument, show the list of all created cdev's, consisting of devfs node name and struct cdev address. When address of cdev is supplied, show some internal devfs state of the cdev. .\" .Pp .It Ic show Cm conifhk Lists hooks currently waiting for completion in run_interrupt_driven_config_hooks(). .\" .Pp .It Ic show Cm cpusets Print numbered root and assigned CPU affinity sets. See .Xr cpuset 2 for more details. .\" .Pp .It Ic show Cm cyrixreg Show registers specific to the Cyrix processor. .\" .Pp .It Ic show Cm devmap Prints the contents of the static device mapping table. Currently only available on the ARM architecture. .\" .Pp .It Ic show Cm domain Ar addr Print protocol domain structure .Vt struct domain at address .Ar addr . See the .Pa sys/domain.h header file for more details on the exact meaning of the structure fields. .\" .Pp .It Ic show Cm ffs Op Ar addr Show brief information about ffs mount at the address .Ar addr , if argument is given. Otherwise, provides the summary about each ffs mount. .\" .Pp .It Ic show Cm file Ar addr Show information about the file structure .Vt struct file present at address .Ar addr . .\" .Pp .It Ic show Cm files Show information about every file structure in the system. .\" .Pp .It Ic show Cm freepages Show the number of physical pages in each of the free lists. .\" .Pp .It Ic show Cm geom Op Ar addr If the .Ar addr argument is not given, displays the entire GEOM topology. If .Ar addr is given, displays details about the given GEOM object (class, geom, provider or consumer). .\" .Pp .It Ic show Cm idt Show IDT layout. The first column specifies the IDT vector. The second one is the name of the interrupt/trap handler. Those functions are machine dependent. .\" .Pp .It Ic show Cm igi_list Ar addr Show information about the IGMP structure .Vt struct igmp_ifsoftc present at .Ar addr . .\" .Pp .It Ic show Cm inodedeps Op Ar addr Show brief information about each inodedep structure. If .Ar addr is given, only inodedeps belonging to the fs located at the supplied address are shown. .\" .Pp .It Ic show Cm inpcb Ar addr Show information on IP Control Block .Vt struct in_pcb present at .Ar addr . .\" .Pp .It Ic show Cm intr Dump information about interrupt handlers. .\" .Pp .It Ic show Cm intrcnt Dump the interrupt statistics. .\" .Pp .It Ic show Cm irqs Show interrupt lines and their respective kernel threads. .\" .Pp .It Ic show Cm jails Show the list of .Xr jail 8 instances. In addition to what .Xr jls 8 shows, also list kernel internal details. .\" .Pp .It Ic show Cm lapic Show information from the local APIC registers for this CPU. .\" .Pp .It Ic show Cm lock Ar addr Show lock structure. The output format is as follows: .Bl -tag -width "flags" .It Ic class: Class of the lock. Possible types include .Xr mutex 9 , .Xr rmlock 9 , .Xr rwlock 9 , .Xr sx 9 . .It Ic name: Name of the lock. .It Ic flags: Flags passed to the lock initialization function. .Em flags values are lock class specific. .It Ic state: Current state of a lock. .Em state values are lock class specific. .It Ic owner: Lock owner. .El .\" .Pp .It Ic show Cm lockchain Ar addr Show all threads a particular thread at address .Ar addr is waiting on based on non-spin locks. .\" .Pp .It Ic show Cm lockedbufs Show the same information as "show buf", but for every locked .Vt struct buf object. .\" .Pp .It Ic show Cm lockedvnods List all locked vnodes in the system. .\" .Pp .It Ic show Cm locks Prints all locks that are currently acquired. This command is only available if .Xr witness 4 is included in the kernel. .\" .Pp .It Ic show Cm locktree .\" .Pp .It Ic show Cm malloc Ns Op Li / Ns Cm i Prints .Xr malloc 9 memory allocator statistics. If the .Cm i modifier is specified, format output as machine-parseable comma-separated values ("CSV"). The output columns are as follows: .Pp .Bl -tag -compact -offset indent -width "Requests" .It Ic Type Specifies a type of memory. It is the same as a description string used while defining the given memory type with .Xr MALLOC_DECLARE 9 . .It Ic InUse Number of memory allocations of the given type, for which .Xr free 9 has not been called yet. .It Ic MemUse Total memory consumed by the given allocation type. .It Ic Requests Number of memory allocation requests for the given memory type. .El .Pp The same information can be gathered in userspace with .Dq Nm vmstat Fl m . .\" .Pp .It Ic show Cm map Ns Oo Li / Ns Cm f Oc Ar addr Prints the VM map at .Ar addr . If the .Cm f modifier is specified the complete map is printed. .\" .Pp .It Ic show Cm msgbuf Print the system's message buffer. It is the same output as in the .Dq Nm dmesg case. It is useful if you got a kernel panic, attached a serial cable to the machine and want to get the boot messages from before the system hang. .\" .It Ic show Cm mount Displays short info about all currently mounted file systems. .Pp .It Ic show Cm mount Ar addr Displays details about the given mount point. .\" .Pp .It Ic show Cm object Ns Oo Li / Ns Cm f Oc Ar addr Prints the VM object at .Ar addr . If the .Cm f option is specified the complete object is printed. .\" .Pp .It Ic show Cm panic Print the panic message if set. .\" .Pp .It Ic show Cm page Show statistics on VM pages. .\" .Pp .It Ic show Cm pageq Show statistics on VM page queues. .\" .Pp .It Ic show Cm pciregs Print PCI bus registers. The same information can be gathered in userspace by running .Dq Nm pciconf Fl lv . .\" .Pp .It Ic show Cm pcpu Print current processor state. The output format is as follows: .Pp .Bl -tag -compact -offset indent -width "spin locks held:" .It Ic cpuid Processor identifier. .It Ic curthread Thread pointer, process identifier and the name of the process. .It Ic curpcb Control block pointer. .It Ic fpcurthread FPU thread pointer. .It Ic idlethread Idle thread pointer. .It Ic APIC ID CPU identifier coming from APIC. .It Ic currentldt LDT pointer. .It Ic spin locks held Names of spin locks held. .El .\" .Pp .It Ic show Cm pgrpdump Dump process groups present within the system. .\" .Pp .It Ic show Cm proc Op Ar addr If no .Op Ar addr is specified, print information about the current process. Otherwise, show information about the process at address .Ar addr . .\" .Pp .It Ic show Cm procvm Show process virtual memory layout. .\" .Pp .It Ic show Cm protosw Ar addr Print protocol switch structure .Vt struct protosw at address .Ar addr . .\" .Pp .It Ic show Cm registers Ns Op Li / Ns Cm u Display the register set. If the .Cm u modifier is specified, the register contents of the thread's previous trapframe are displayed instead. Usually, this corresponds to the saved state from userspace. .\" .Pp .It Ic show Cm rman Ar addr Show resource manager object .Vt struct rman at address .Ar addr . Addresses of particular pointers can be gathered with "show allrman" command. .\" .Pp .It Ic show Cm route Ar addr Show route table result for destination .Ar addr . At this time, INET and INET6 formatted addresses are supported. .\" .Pp .It Ic show Cm routetable Oo Ar af Oc Show full route table or tables. If .Ar af is specified, show only routes for the given numeric address family. If no argument is specified, dump the route table for all address families. .\" .Pp .It Ic show Cm rtc Show real time clock value. Useful for long debugging sessions. .\" .Pp .It Ic show Cm sleepchain Deprecated. Now an alias for .Ic show Cm lockchain . .\" .Pp .It Ic show Cm sleepq .It Ic show Cm sleepqueue Both commands provide the same functionality. They show sleepqueue .Vt struct sleepqueue structure. Sleepqueues are used within the .Fx kernel to implement sleepable synchronization primitives (thread holding a lock might sleep or be context switched), which at the time of writing are: .Xr condvar 9 , .Xr sx 9 and standard .Xr msleep 9 interface. .\" .Pp .It Ic show Cm sockbuf Ar addr .It Ic show Cm socket Ar addr Those commands print .Vt struct sockbuf and .Vt struct socket objects placed at .Ar addr . Output consists of all values present in structures mentioned. For exact interpretation and more details, visit .Pa sys/socket.h header file. .\" .Pp .It Ic show Cm sysregs Show system registers (e.g., .Li cr0-4 on i386.) Not present on some platforms. .\" .Pp .It Ic show Cm tcpcb Ar addr Print TCP control block .Vt struct tcpcb lying at address .Ar addr . For exact interpretation of output, visit .Pa netinet/tcp.h header file. .\" .Pp .It Ic show Cm thread Op Ar addr | tid If no .Ar addr or .Ar tid is specified, show detailed information about current thread. Otherwise, print information about the thread with ID .Ar tid or kernel address .Ar addr . (If the argument is a decimal number, it is assumed to be a tid.) .\" .Pp .It Ic show Cm threads Show all threads within the system. Output format is as follows: .Pp .Bl -tag -compact -offset indent -width "Second column" .It Ic First column Thread identifier (TID) .It Ic Second column Thread structure address .It Ic Third column Backtrace. .El .\" .Pp .It Ic show Cm tty Ar addr Display the contents of a TTY structure in a readable form. .\" .Pp .It Ic show Cm turnstile Ar addr Show turnstile .Vt struct turnstile structure at address .Ar addr . Turnstiles are structures used within the .Fx kernel to implement synchronization primitives which, while holding a specific type of lock, cannot sleep or context switch to another thread. Currently, those are: .Xr mutex 9 , .Xr rwlock 9 , .Xr rmlock 9 . .\" .Pp .It Ic show Cm uma Ns Op Li / Ns Cm i Show UMA allocator statistics. If the .Cm i modifier is specified, format output as machine-parseable comma-separated values ("CSV"). The output contains the following columns: .Pp .Bl -tag -compact -offset indent -width "Total Mem" .It Cm "Zone" Name of the UMA zone. The same string that was passed to .Xr uma_zcreate 9 as a first argument. .It Cm "Size" Size of a given memory object (slab). .It Cm "Used" Number of slabs being currently used. .It Cm "Free" Number of free slabs within the UMA zone. .It Cm "Requests" Number of allocations requests to the given zone. .It Cm "Total Mem" Total memory in use (either allocated or free) by a zone, in bytes. .It Cm "XFree" Number of free slabs within the UMA zone that were freed on a different NUMA domain than allocated. (The count in the .Cm "Free" column is inclusive of .Cm "XFree" . ) .El .Pp The same information might be gathered in the userspace with the help of .Dq Nm vmstat Fl z . .\" .Pp .It Ic show Cm unpcb Ar addr Shows UNIX domain socket private control block .Vt struct unpcb present at the address .Ar addr . .\" .Pp .It Ic show Cm vmochk Prints, whether the internal VM objects are in a map somewhere and none have zero ref counts. .\" .Pp .It Ic show Cm vmopag This is supposed to show physical addresses consumed by a VM object. Currently, it is not possible to use this command when .Xr witness 4 is compiled in the kernel. .\" .Pp .It Ic show Cm vnet Ar addr Prints virtualized network stack .Vt struct vnet structure present at the address .Ar addr . .\" .Pp .It Ic show Cm vnode Op Ar addr Prints vnode .Vt struct vnode structure lying at .Op Ar addr . For the exact interpretation of the output, look at the .Pa sys/vnode.h header file. .\" .Pp .It Ic show Cm vnodebufs Ar addr Shows clean/dirty buffer lists of the vnode located at .Ar addr . .\" .Pp .It Ic show Cm vpath Ar addr Walk the namecache to lookup the pathname of the vnode located at .Ar addr . .\" .Pp .It Ic show Cm watches Displays all watchpoints. Shows watchpoints set with "watch" command. .\" .Pp .It Ic show Cm witness Shows information about lock acquisition coming from the .Xr witness 4 subsystem. .El .Ss OFFLINE DEBUGGING COMMANDS .Bl -tag -width indent -compact .It Ic gdb Switches to remote GDB mode. In remote GDB mode, another machine is required that runs -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb using the remote debug feature, with a connection to the serial console port on the target machine. .Pp .It Ic netdump Fl s Ar server Oo Fl g Ar gateway Fl c Ar client Fl i Ar iface Oc Configure .Xr netdump 4 with the provided parameters, and immediately perform a netdump. .Pp There are some known limitations. Principally, .Xr netdump 4 only supports IPv4 at this time. The address arguments to the .Ic netdump command must be dotted decimal IPv4 addresses. (Hostnames are not supported.) At present, the command only works if the machine is in a panic state. Finally, the .Nm .Ic netdump command does not provide any way to configure compression or encryption. .Pp .It Ic netgdb Fl s Ar server Oo Fl g Ar gateway Fl c Ar client Fl i Ar iface Oc Initiate a .Xr netgdb 4 session with the provided parameters. .Pp .Ic netgdb has identical limitations to .Ic netdump . .Pp .It Ic capture on .It Ic capture off .It Ic capture reset .It Ic capture status .Nm supports a basic output capture facility, which can be used to retrieve the results of debugging commands from userspace using .Xr sysctl 3 . .Ic capture on enables output capture; .Ic capture off disables capture. .Ic capture reset will clear the capture buffer and disable capture. .Ic capture status will report current buffer use, buffer size, and disposition of output capture. .Pp Userspace processes may inspect and manage .Nm capture state using .Xr sysctl 8 : .Pp .Va debug.ddb.capture.bufsize may be used to query or set the current capture buffer size. .Pp .Va debug.ddb.capture.maxbufsize may be used to query the compile-time limit on the capture buffer size. .Pp .Va debug.ddb.capture.bytes may be used to query the number of bytes of output currently in the capture buffer. .Pp .Va debug.ddb.capture.data returns the contents of the buffer as a string to an appropriately privileged process. .Pp This facility is particularly useful in concert with the scripting and .Xr textdump 4 facilities, allowing scripted debugging output to be captured and committed to disk as part of a textdump for later analysis. The contents of the capture buffer may also be inspected in a kernel core dump using .Xr kgdb 1 Pq Pa ports/devel/gdb . .Pp .It Ic run .It Ic script .It Ic scripts .It Ic unscript Run, define, list, and delete scripts. See the .Sx SCRIPTING section for more information on the scripting facility. .Pp .It Ic textdump dump .It Ic textdump set .It Ic textdump status .It Ic textdump unset Use the .Ic textdump dump command to immediately perform a textdump. More information may be found in .Xr textdump 4 . The .Ic textdump set command may be used to force the next kernel core dump to be a textdump rather than a traditional memory dump or minidump. .Ic textdump status reports whether a textdump has been scheduled. .Ic textdump unset cancels a request to perform a textdump as the next kernel core dump. .El .Sh VARIABLES The debugger accesses registers and variables as .Li $ Ns Ar name . Register names are as in the .Dq Ic show Cm registers command. Some variables are suffixed with numbers, and may have some modifier following a colon immediately after the variable name. For example, register variables can have a .Cm u modifier to indicate user register (e.g., .Dq Li $eax:u ) . .Pp Built-in variables currently supported are: .Pp .Bl -tag -width ".Va tabstops" -compact .It Va radix Input and output radix. .It Va maxoff Addresses are printed as .Dq Ar symbol Ns Li + Ns Ar offset unless .Ar offset is greater than .Va maxoff . .It Va maxwidth The width of the displayed line. .It Va lines The number of lines. It is used by the built-in pager. Setting it to 0 disables paging. .It Va tabstops Tab stop width. .It Va work Ns Ar xx Work variable; .Ar xx can take values from 0 to 31. .El .Sh EXPRESSIONS Most expression operators in C are supported except .Ql ~ , .Ql ^ , and unary .Ql & . Special rules in .Nm are: .Bl -tag -width ".No Identifiers" .It Identifiers The name of a symbol is translated to the value of the symbol, which is the address of the corresponding object. .Ql \&. and .Ql \&: can be used in the identifier. If supported by an object format dependent routine, .Sm off .Oo Ar filename : Oc Ar func : lineno , .Sm on .Oo Ar filename : Oc Ns Ar variable , and .Oo Ar filename : Oc Ns Ar lineno can be accepted as a symbol. .It Numbers Radix is determined by the first two letters: .Ql 0x : hex, .Ql 0o : octal, .Ql 0t : decimal; otherwise, follow current radix. .It Li \&. .Va dot .It Li + .Va next .It Li .. address of the start of the last line examined. Unlike .Va dot or .Va next , this is only changed by .Ic examine or .Ic write command. .It Li ' last address explicitly specified. .It Li $ Ns Ar variable Translated to the value of the specified variable. It may be followed by a .Ql \&: and modifiers as described above. .It Ar a Ns Li # Ns Ar b A binary operator which rounds up the left hand side to the next multiple of right hand side. .It Li * Ns Ar expr Indirection. It may be followed by a .Ql \&: and modifiers as described above. .El .Sh SCRIPTING .Nm supports a basic scripting facility to allow automating tasks or responses to specific events. Each script consists of a list of DDB commands to be executed sequentially, and is assigned a unique name. Certain script names have special meaning, and will be automatically run on various .Nm events if scripts by those names have been defined. .Pp The .Ic script command may be used to define a script by name. Scripts consist of a series of .Nm commands separated with the .Ql \&; character. For example: .Bd -literal -offset indent script kdb.enter.panic=bt; show pcpu script lockinfo=show alllocks; show lockedvnods .Ed .Pp The .Ic scripts command lists currently defined scripts. .Pp The .Ic run command execute a script by name. For example: .Bd -literal -offset indent run lockinfo .Ed .Pp The .Ic unscript command may be used to delete a script by name. For example: .Bd -literal -offset indent unscript kdb.enter.panic .Ed .Pp These functions may also be performed from userspace using the .Xr ddb 8 command. .Pp Certain scripts are run automatically, if defined, for specific .Nm events. The follow scripts are run when various events occur: .Bl -tag -width kdb.enter.powerfail .It Va kdb.enter.acpi The kernel debugger was entered as a result of an .Xr acpi 4 event. .It Va kdb.enter.bootflags The kernel debugger was entered at boot as a result of the debugger boot flag being set. .It Va kdb.enter.break The kernel debugger was entered as a result of a serial or console break. .It Va kdb.enter.cam The kernel debugger was entered as a result of a .Xr CAM 4 event. .It Va kdb.enter.mac The kernel debugger was entered as a result of an assertion failure in the .Xr mac_test 4 module of the TrustedBSD MAC Framework. .It Va kdb.enter.netgraph The kernel debugger was entered as a result of a .Xr netgraph 4 event. .It Va kdb.enter.panic .Xr panic 9 was called. .It Va kdb.enter.powerpc The kernel debugger was entered as a result of an unimplemented interrupt type on the powerpc platform. .It Va kdb.enter.sysctl The kernel debugger was entered as a result of the .Va debug.kdb.enter sysctl being set. .It Va kdb.enter.unionfs The kernel debugger was entered as a result of an assertion failure in the union file system. .It Va kdb.enter.unknown The kernel debugger was entered, but no reason has been set. .It Va kdb.enter.vfslock The kernel debugger was entered as a result of a VFS lock violation. .It Va kdb.enter.watchdog The kernel debugger was entered as a result of a watchdog firing. .It Va kdb.enter.witness The kernel debugger was entered as a result of a .Xr witness 4 violation. .El .Pp In the event that none of these scripts is found, .Nm will attempt to execute a default script: .Bl -tag -width kdb.enter.powerfail .It Va kdb.enter.default The kernel debugger was entered, but a script exactly matching the reason for entering was not defined. This can be used as a catch-all to handle cases not specifically of interest; for example, .Va kdb.enter.witness might be defined to have special handling, and .Va kdb.enter.default might be defined to simply panic and reboot. .El .Sh HINTS On machines with an ISA expansion bus, a simple NMI generation card can be constructed by connecting a push button between the A01 and B01 (CHCHK# and GND) card fingers. Momentarily shorting these two fingers together may cause the bridge chipset to generate an NMI, which causes the kernel to pass control to .Nm . Some bridge chipsets do not generate a NMI on CHCHK#, so your mileage may vary. The NMI allows one to break into the debugger on a wedged machine to diagnose problems. Other bus' bridge chipsets may be able to generate NMI using bus specific methods. There are many PCI and PCIe add-in cards which can generate NMI for debugging. Modern server systems typically use IPMI to generate signals to enter the debugger. The .Va devel/ipmitool port can be used to send the .Cd chassis power diag command which delivers an NMI to the processor. Embedded systems often use JTAG for debugging, but rarely use it in combination with .Nm . .Pp Serial consoles can break to the debugger by sending a BREAK condition on the serial line. This requires a kernel built with .Cd options BREAK_TO_DEBUGGER is specified in the kernel. Most terminal emulation programs can send a break sequence with a special key sequence or menu selection. Sending the break can be difficult or even happen spuriously in some setups. An alternative method is to build a kernel with .Cd options ALT_BREAK_TO_DEBUGGER then the sequence of CR TILDE CTRL-B enters the debugger; CR TILDE CTRL-P causes a panic; and CR TILDE CTRL-R causes an immediate reboot. In all these sequences, CR represents Carriage Return and is usually sent by pressing the Enter or Return key. TILDE is the ASCII tilde character (~). CTRL-x is Control x, send by pressing the Control key, then x, then releasing both. and then releasing both. .Pp The break-to-debugger behavior can be enabled by setting .Xr sysctl 8 .Va debug.kdb.break_to_debugger to 1. The alt-break-to-debugger behavior can be enabled by setting .Xr sysctl 8 .Va debug.kdb.alt_break_to_debugger to 1. The debugger can be entered by setting .Xr sysctl 8 .Va debug.kdb.enter to 1. .Pp Output can be interrupted, paused, and resumed with the control characters CTRL-C, CTRL-S, and CTRL-Q. Because these control characters are received as in-band data from the console, there is an input buffer, and once that buffer fills .Nm must either stop responding to control characters or drop additional input while continuing to search for control characters. This behavior is controlled by the tunable .Xr sysctl 8 .Va debug.ddb.prioritize_control_input , which defaults to 1. The input buffer size is 512 bytes. .Sh FILES Header files mentioned in this manual page can be found below .Pa /usr/include directory. .Pp .Bl -dash -compact .It .Pa sys/buf.h .It .Pa sys/domain.h .It .Pa netinet/in_pcb.h .It .Pa sys/socket.h .It .Pa sys/vnode.h .El .Sh SEE ALSO -.Xr gdb 1 , +.Xr gdb 1 Pq Pa ports/devel/gdb , .Xr kgdb 1 Pq Pa ports/devel/gdb , .Xr acpi 4 , .Xr CAM 4 , .Xr mac_ddb 4 , .Xr mac_test 4 , .Xr netgraph 4 , .Xr textdump 4 , .Xr witness 4 , .Xr ddb 8 , .Xr sysctl 8 , .Xr panic 9 .Sh HISTORY The .Nm debugger was developed for Mach, and ported to .Bx 386 0.1 . This manual page translated from .Xr man 7 macros by .An Garrett Wollman . .Pp .An Robert N. M. Watson added support for .Nm output capture, .Xr textdump 4 and scripting in .Fx 7.1 . diff --git a/share/man/man4/gdb.4 b/share/man/man4/gdb.4 index de2f4d108048..47a1c9896843 100644 --- a/share/man/man4/gdb.4 +++ b/share/man/man4/gdb.4 @@ -1,603 +1,603 @@ .\" Copyright (c) 2003 Greg Lehey .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. .\" .\" $FreeBSD$ .\" .Dd May 17, 2016 .Dt GDB 4 .Os .Sh NAME .Nm gdb .Nd external kernel debugger .Sh SYNOPSIS .Cd "makeoptions DEBUG=-g" .Cd "options DDB" .Sh DESCRIPTION The .Nm kernel debugger is a variation of -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb which understands some aspects of the .Fx kernel environment. It can be used in a number of ways: .Bl -bullet .It It can be used to examine the memory of the processor on which it runs. .It It can be used to analyse a processor dump after a panic. .It It can be used to debug another system interactively via a serial or firewire link. In this mode, the processor can be stopped and single stepped. .It With a firewire link, it can be used to examine the memory of a remote system without the participation of that system. In this mode, the processor cannot be stopped and single stepped, but it can be of use when the remote system has crashed and is no longer responding. .El .Pp When used for remote debugging, .Nm requires the presence of the .Xr ddb 4 kernel debugger. Commands exist to switch between .Nm and .Xr ddb 4 . .Sh PREPARING FOR DEBUGGING When debugging kernels, it is practically essential to have built a kernel with debugging symbols .Pq Cd "makeoptions DEBUG=-g" . It is easiest to perform operations from the kernel build directory, by default .Pa /usr/obj/usr/src/sys/GENERIC . .Pp First, ensure you have a copy of the debug macros in the directory: .Pp .Dl "make gdbinit" .Pp This command performs some transformations on the macros installed in .Pa /usr/src/tools/debugscripts to adapt them to the local environment. .Ss "Inspecting the environment of the local machine" To look at and change the contents of the memory of the system you are running on, .Pp .Dl "gdb -k -wcore kernel.debug /dev/mem" .Pp In this mode, you need the .Fl k flag to indicate to -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb that the .Dq "dump file" .Pa /dev/mem is a kernel data file. You can look at live data, and if you include the .Fl wcore option, you can change it at your peril. The system does not stop (obviously), so a number of things will not work. You can set breakpoints, but you cannot .Dq continue execution, so they will not work. .Ss "Debugging a crash dump" By default, crash dumps are stored in the directory .Pa /var/crash . Investigate them from the kernel build directory with: .Pp .Dl "gdb -k kernel.debug /var/crash/vmcore.29" .Pp In this mode, the system is obviously stopped, so you can only look at it. .Ss "Debugging a live system with a remote link" In the following discussion, the term .Dq "local system" refers to the system running the debugger, and .Dq "remote system" refers to the live system being debugged. .Pp To debug a live system with a remote link, the kernel must be compiled with the option .Cd "options DDB" . The option .Cd "options BREAK_TO_DEBUGGER" enables the debugging machine stop the debugged machine once a connection has been established by pressing .Ql ^C . .Ss "Debugging a live system with a remote serial link" When using a serial port for the remote link on the i386 platform, the serial port must be identified by setting the flag bit .Li 0x80 for the specified interface. Generally, this port will also be used as a serial console (flag bit .Li 0x10 ) , so the entry in .Pa /boot/device.hints should be: .Pp .Dl hint.sio.0.flags="0x90" .Ss "Debugging a live system with a remote firewire link" As with serial debugging, to debug a live system with a firewire link, the kernel must be compiled with the option .Cd "options DDB" . .Pp A number of steps must be performed to set up a firewire link: .Bl -bullet .It Ensure that both systems have .Xr firewire 4 support, and that the kernel of the remote system includes the .Xr dcons 4 and .Xr dcons_crom 4 drivers. If they are not compiled into the kernel, load the KLDs: .Pp .Dl "kldload firewire" .Pp On the remote system only: .Bd -literal -offset indent kldload dcons kldload dcons_crom .Ed .Pp You should see something like this in the .Xr dmesg 8 output of the remote system: .Bd -literal -offset indent fwohci0: BUS reset fwohci0: node_id=0x8800ffc0, gen=2, non CYCLEMASTER mode firewire0: 2 nodes, maxhop <= 1, cable IRM = 1 firewire0: bus manager 1 firewire0: New S400 device ID:00c04f3226e88061 dcons_crom0: on firewire0 dcons_crom0: bus_addr 0x22a000 .Ed .Pp It is a good idea to load these modules at boot time with the following entry in .Pa /boot/loader.conf : .Pp .Dl dcons_crom_enable="YES" .Pp This ensures that all three modules are loaded. There is no harm in loading .Xr dcons 4 and .Xr dcons_crom 4 on the local system, but if you only want to load the .Xr firewire 4 module, include the following in .Pa /boot/loader.conf : .Pp .Dl firewire_enable="YES" .It Next, use .Xr fwcontrol 8 to find the firewire node corresponding to the remote machine. On the local machine you might see: .Bd -literal -offset indent # fwcontrol 2 devices (info_len=2) node EUI64 status 1 0x00c04f3226e88061 0 0 0x000199000003622b 1 .Ed .Pp The first node is always the local system, so in this case, node 0 is the remote system. If there are more than two systems, check from the other end to find which node corresponds to the remote system. On the remote machine, it looks like this: .Bd -literal -offset indent # fwcontrol 2 devices (info_len=2) node EUI64 status 0 0x000199000003622b 0 1 0x00c04f3226e88061 1 .Ed .It Next, establish a firewire connection with .Xr dconschat 8 : .Pp .Dl "dconschat -br -G 5556 -t 0x000199000003622b" .Pp .Li 0x000199000003622b is the EUI64 address of the remote node, as determined from the output of .Xr fwcontrol 8 above. When started in this manner, .Xr dconschat 8 establishes a local tunnel connection from port .Li localhost:5556 to the remote debugger. You can also establish a console port connection with the .Fl C option to the same invocation .Xr dconschat 8 . See the .Xr dconschat 8 manpage for further details. .Pp The .Xr dconschat 8 utility does not return control to the user. It displays error messages and console output for the remote system, so it is a good idea to start it in its own window. .It Finally, establish connection: .Bd -literal -offset indent # gdb kernel.debug GNU gdb 5.2.1 (FreeBSD) .Em "(political statements omitted)" Ready to go. Enter 'tr' to connect to the remote target with /dev/cuau0, 'tr /dev/cuau1' to connect to a different port or 'trf portno' to connect to the remote target with the firewire interface. portno defaults to 5556. Type 'getsyms' after connection to load kld symbols. If you are debugging a local system, you can use 'kldsyms' instead to load the kld symbols. That is a less obnoxious interface. (gdb) trf 0xc21bd378 in ?? () .Ed .Pp The .Ic trf macro assumes a connection on port 5556. If you want to use a different port (by changing the invocation of .Xr dconschat 8 above), use the .Ic tr macro instead. For example, if you want to use port 4711, run .Xr dconschat 8 like this: .Pp .Dl "dconschat -br -G 4711 -t 0x000199000003622b" .Pp Then establish connection with: .Bd -literal -offset indent (gdb) tr localhost:4711 0xc21bd378 in ?? () .Ed .El .Ss "Non-cooperative debugging a live system with a remote firewire link" In addition to the conventional debugging via firewire described in the previous section, it is possible to debug a remote system without its cooperation, once an initial connection has been established. This corresponds to debugging a local machine using .Pa /dev/mem . It can be very useful if a system crashes and the debugger no longer responds. To use this method, set the .Xr sysctl 8 variables .Va hw.firewire.fwmem.eui64_hi and .Va hw.firewire.fwmem.eui64_lo to the upper and lower halves of the EUI64 ID of the remote system, respectively. From the previous example, the remote machine shows: .Bd -literal -offset indent # fwcontrol 2 devices (info_len=2) node EUI64 status 0 0x000199000003622b 0 1 0x00c04f3226e88061 1 .Ed .Pp Enter: .Bd -literal -offset indent # sysctl -w hw.firewire.fwmem.eui64_hi=0x00019900 hw.firewire.fwmem.eui64_hi: 0 -> 104704 # sysctl -w hw.firewire.fwmem.eui64_lo=0x0003622b hw.firewire.fwmem.eui64_lo: 0 -> 221739 .Ed .Pp Note that the variables must be explicitly stated in hexadecimal. After this, you can examine the remote machine's state with the following input: .Bd -literal -offset indent # gdb -k kernel.debug /dev/fwmem0.0 GNU gdb 5.2.1 (FreeBSD) .Em "(messages omitted)" Reading symbols from /boot/kernel/dcons.ko...done. Loaded symbols for /boot/kernel/dcons.ko Reading symbols from /boot/kernel/dcons_crom.ko...done. Loaded symbols for /boot/kernel/dcons_crom.ko #0 sched_switch (td=0xc0922fe0) at /usr/src/sys/kern/sched_4bsd.c:621 0xc21bd378 in ?? () .Ed .Pp In this case, it is not necessary to load the symbols explicitly. The remote system continues to run. .Sh COMMANDS The user interface to .Nm is via -.Xr gdb 1 , +.Xr gdb 1 Pq Pa ports/devel/gdb , so -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb commands also work. This section discusses only the extensions for kernel debugging that get installed in the kernel build directory. .Ss "Debugging environment" The following macros manipulate the debugging environment: .Bl -tag -width indent .It Ic ddb Switch back to .Xr ddb 4 . This command is only meaningful when performing remote debugging. .It Ic getsyms Display .Ic kldstat information for the target machine and invite user to paste it back in. This is required because .Nm does not allow data to be passed to shell scripts. It is necessary for remote debugging and crash dumps; for local memory debugging use .Ic kldsyms instead. .It Ic kldsyms Read in the symbol tables for the debugging machine. This does not work for remote debugging and crash dumps; use .Ic getsyms instead. .It Ic tr Ar interface Debug a remote system via the specified serial or firewire interface. .It Ic tr0 Debug a remote system via serial interface .Pa /dev/cuau0 . .It Ic tr1 Debug a remote system via serial interface .Pa /dev/cuau1 . .It Ic trf Debug a remote system via firewire interface at default port 5556. .El .Pp The commands .Ic tr0 , tr1 and .Ic trf are convenience commands which invoke .Ic tr . .Ss "The current process environment" The following macros are convenience functions intended to make things easier than the standard -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb commands. .Bl -tag -width indent .It Ic f0 Select stack frame 0 and show assembler-level details. .It Ic f1 Select stack frame 1 and show assembler-level details. .It Ic f2 Select stack frame 2 and show assembler-level details. .It Ic f3 Select stack frame 3 and show assembler-level details. .It Ic f4 Select stack frame 4 and show assembler-level details. .It Ic f5 Select stack frame 5 and show assembler-level details. .It Ic xb Show 12 words in hex, starting at current .Va ebp value. .It Ic xi List the next 10 instructions from the current .Va eip value. .It Ic xp Show the register contents and the first four parameters of the current stack frame. .It Ic xp0 Show the first parameter of current stack frame in various formats. .It Ic xp1 Show the second parameter of current stack frame in various formats. .It Ic xp2 Show the third parameter of current stack frame in various formats. .It Ic xp3 Show the fourth parameter of current stack frame in various formats. .It Ic xp4 Show the fifth parameter of current stack frame in various formats. .It Ic xs Show the last 12 words on stack in hexadecimal. .It Ic xxp Show the register contents and the first ten parameters. .It Ic z Single step 1 instruction (over calls) and show next instruction. .It Ic zs Single step 1 instruction (through calls) and show next instruction. .El .Ss "Examining other processes" The following macros access other processes. The .Nm debugger does not understand the concept of multiple processes, so they effectively bypass the entire .Nm environment. .Bl -tag -width indent .It Ic btp Ar pid Show a backtrace for the process .Ar pid . .It Ic btpa Show backtraces for all processes in the system. .It Ic btpp Show a backtrace for the process previously selected with .Ic defproc . .It Ic btr Ar ebp Show a backtrace from the .Ar ebp address specified. .It Ic defproc Ar pid Specify the PID of the process for some other commands in this section. .It Ic fr Ar frame Show frame .Ar frame of the stack of the process previously selected with .Ic defproc . .It Ic pcb Ar proc Show some PCB contents of the process .Ar proc . .El .Ss "Examining data structures" You can use standard -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb commands to look at most data structures. The macros in this section are convenience functions which typically display the data in a more readable format, or which omit less interesting parts of the structure. .Bl -tag -width indent .It Ic bp Show information about the buffer header pointed to by the variable .Va bp in the current frame. .It Ic bpd Show the contents .Pq Vt "char *" of .Va bp->data in the current frame. .It Ic bpl Show detailed information about the buffer header .Pq Vt "struct bp" pointed at by the local variable .Va bp . .It Ic bpp Ar bp Show summary information about the buffer header .Pq Vt "struct bp" pointed at by the parameter .Ar bp . .It Ic bx Print a number of fields from the buffer header pointed at in by the pointer .Ar bp in the current environment. .It Ic vdev Show some information of the .Vt vnode pointed to by the local variable .Va vp . .El .Ss "Miscellaneous macros" .Bl -tag -width indent .It Ic checkmem Check unallocated memory for modifications. This assumes that the kernel has been compiled with .Cd "options DIAGNOSTIC" . This causes the contents of free memory to be set to .Li 0xdeadc0de . .It Ic dmesg Print the system message buffer. This corresponds to the .Xr dmesg 8 utility. This macro used to be called .Ic msgbuf . It can take a very long time over a serial line, and it is even slower via firewire or local memory due to inefficiencies in .Nm . When debugging a crash dump or over firewire, it is not necessary to start .Nm to access the message buffer: instead, use an appropriate variation of .Bd -literal -offset indent dmesg -M /var/crash/vmcore.0 -N kernel.debug dmesg -M /dev/fwmem0.0 -N kernel.debug .Ed .It Ic kldstat Equivalent of the .Xr kldstat 8 utility without options. .It Ic pname Print the command name of the current process. .It Ic ps Show process status. This corresponds in concept, but not in appearance, to the .Xr ps 1 utility. When debugging a crash dump or over firewire, it is not necessary to start .Nm to display the .Xr ps 1 output: instead, use an appropriate variation of .Bd -literal -offset indent ps -M /var/crash/vmcore.0 -N kernel.debug ps -M /dev/fwmem0.0 -N kernel.debug .Ed .It Ic y Kludge for writing macros. When writing macros, it is convenient to paste them back into the .Nm window. Unfortunately, if the macro is already defined, .Nm insists on asking .Pp .Dl "Redefine foo?" .Pp It will not give up until you answer .Ql y . This command is that answer. It does nothing else except to print a warning message to remind you to remove it again. .El .Sh SEE ALSO -.Xr gdb 1 , +.Xr gdb 1 Pq Pa ports/devel/gdb , .Xr ps 1 , .Xr ddb 4 , .Xr firewire 4 , .Xr dconschat 8 , .Xr dmesg 8 , .Xr fwcontrol 8 , .Xr kldload 8 .Sh AUTHORS This man page was written by .An Greg Lehey Aq Mt grog@FreeBSD.org . .Sh BUGS The -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb debugger was never designed to debug kernels, and it is not a very good match. Many problems exist. .Pp The .Nm implementation is very inefficient, and many operations are slow. .Pp Serial debugging is even slower, and race conditions can make it difficult to run the link at more than 9600 bps. Firewire connections do not have this problem. .Pp The debugging macros .Dq just grew. In general, the person who wrote them did so while looking for a specific problem, so they may not be general enough, and they may behave badly when used in ways for which they were not intended, even if those ways make sense. .Pp Many of these commands only work on the ia32 architecture. diff --git a/share/man/man4/ti.4 b/share/man/man4/ti.4 index a589ec048ebf..3209d9a0359f 100644 --- a/share/man/man4/ti.4 +++ b/share/man/man4/ti.4 @@ -1,425 +1,425 @@ .\" Copyright (c) 1997, 1998, 1999 .\" Bill Paul . 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 Bill Paul. .\" 4. Neither the name of the author nor the names of any co-contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD .\" 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. .\" .\" $FreeBSD$ .\" .Dd November 14, 2011 .Dt TI 4 .Os .Sh NAME .Nm ti .Nd "Alteon Networks Tigon I and Tigon II Gigabit Ethernet driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device ti" .Cd "options TI_SF_BUF_JUMBO" .Cd "options TI_JUMBO_HDRSPLIT" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent if_ti_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for PCI Gigabit Ethernet adapters based on the Alteon Networks Tigon Gigabit Ethernet controller chip. The Tigon contains an embedded R4000 CPU, gigabit MAC, dual DMA channels and a PCI interface unit. The Tigon II contains two R4000 CPUs and other refinements. Either chip can be used in either a 32-bit or 64-bit PCI slot. Communication with the chip is achieved via PCI shared memory and bus master DMA. The Tigon I and II support hardware multicast address filtering, VLAN tag extraction and insertion, and jumbo Ethernet frames sizes up to 9000 bytes. Note that the Tigon I chipset is no longer in active production: all new adapters should come equipped with Tigon II chipsets. .Pp While the Tigon chipset supports 10, 100 and 1000Mbps speeds, support for 10 and 100Mbps speeds is only available on boards with the proper transceivers. Most adapters are only designed to work at 1000Mbps, however the driver should support those NICs that work at lower speeds as well. .Pp Support for jumbo frames is provided via the interface MTU setting. Selecting an MTU larger than 1500 bytes with the .Xr ifconfig 8 utility configures the adapter to receive and transmit jumbo frames. Using jumbo frames can greatly improve performance for certain tasks, such as file transfers and data streaming. .Pp Header splitting support for Tigon 2 boards (this option has no effect for the Tigon 1) can be turned on with the .Dv TI_JUMBO_HDRSPLIT option. See .Xr zero_copy 9 for more discussion on zero copy receive and header splitting. .Pp The .Nm driver uses UMA backed jumbo receive buffers, but can be configured to use .Xr sendfile 2 buffer allocator. To turn on .Xr sendfile 2 buffer allocator, use the .Dv TI_SF_BUF_JUMBO option. .Pp Support for vlans is also available using the .Xr vlan 4 mechanism. See the .Xr vlan 4 man page for more details. .Pp The .Nm driver supports the following media types: .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. The user can manually override the autoselected mode by adding media options to the .Pa /etc/rc.conf file. .It 10baseT/UTP Set 10Mbps operation. The .Ar mediaopt option can also be used to select either .Ar full-duplex or .Ar half-duplex modes. .It 100baseTX Set 100Mbps (Fast Ethernet) operation. The .Ar mediaopt option can also be used to select either .Ar full-duplex or .Ar half-duplex modes. .It 1000baseSX Set 1000Mbps (Gigabit Ethernet) operation. Only .Ar full-duplex mode is supported at this speed. .El .Pp The .Nm driver supports the following media options: .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full-duplex operation. .It half-duplex Force half duplex operation. .El .Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm driver supports Gigabit Ethernet adapters based on the Alteon Tigon I and II chips. The .Nm driver has been tested with the following adapters: .Pp .Bl -bullet -compact .It 3Com 3c985-SX Gigabit Ethernet adapter (Tigon 1) .It 3Com 3c985B-SX Gigabit Ethernet adapter (Tigon 2) .It Alteon AceNIC V Gigabit Ethernet adapter (1000baseSX) .It Alteon AceNIC V Gigabit Ethernet adapter (1000baseT) .It Digital EtherWORKS 1000SX PCI Gigabit adapter .It Netgear GA620 Gigabit Ethernet adapter (1000baseSX) .It Netgear GA620T Gigabit Ethernet adapter (1000baseT) .El .Pp The following adapters should also be supported but have not yet been tested: .Pp .Bl -bullet -compact .It Asante GigaNIX1000T Gigabit Ethernet adapter .It Asante PCI 1000BASE-SX Gigabit Ethernet adapter .It Farallon PN9000SX Gigabit Ethernet adapter .It NEC Gigabit Ethernet .It Silicon Graphics PCI Gigabit Ethernet adapter .El .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width "xxxxxx" .It Va hw.ti.%d.dac If this tunable is set to 0 it will disable DAC (Dual Address Cycle). The default value is 1 which means driver will use full 64bit DMA addressing. .El .Sh SYSCTL VARIABLES The following variables are available as both .Xr sysctl 8 variables and .Xr loader 8 tunables. The interface has to be brought down and up again before a change takes effect when any of the following tunables are changed. The one microsecond clock tick referenced below is a nominal time and the actual hardware may not provide granularity to this level. For example, on Tigon 2 (revision 6) cards with release 12.0 the clock granularity is 5 microseconds. .Bl -tag -width "xxxxxx" .It Va dev.ti.%d.rx_coal_ticks This value, receive coalesced ticks, controls the number of clock ticks (of 1 microseconds each) that must elapse before the NIC DMAs the receive return producer pointer to the Host and generates an interrupt. This parameter works in conjunction with the rx_max_coal_bds, receive max coalesced BDs, tunable parameter. The NIC will return the receive return producer pointer to the Host when either of the thresholds is exceeded. A value of 0 means that this parameter is ignored and receive BDs will only be returned when the receive max coalesced BDs value is reached. The default value is 170. .It Va dev.ti.%d.rx_max_coal_bds This value, receive max coalesced BDs, controls the number of receive buffer descriptors that will be coalesced before the NIC updates the receive return ring producer index. If this value is set to 0 it will disable receive buffer descriptor coalescing. The default value is 64. .It Va dev.ti.%d.ti_tx_coal_ticks This value, send coalesced ticks, controls the number of clock ticks (of 1 microseconds each) that must elapse before the NIC DMAs the send consumer pointer to the Host and generates an interrupt. This parameter works in conjunction with the tx_max_coal_bds, send max coalesced BDs, tunable parameter. The NIC will return the send consumer pointer to the Host when either of the thresholds is exceeded. A value of 0 means that this parameter is ignored and send BDs will only be returned when the send max coalesced BDs value is reached. The default value is 2000. .It Va dev.ti.%d.tx_max_coal_bds This value, send max coalesced BDs, controls the number of send buffer descriptors that will be coalesced before the NIC updates the send consumer index. If this value is set to 0 it will disable send buffer descriptor coalescing. The default value is 32. .It Va dev.ti.%d.tx_buf_ratio This value controls the ratio of the remaining memory in the NIC that should be devoted to transmit buffer vs. receive buffer. The lower 7 bits are used to indicate the ratio in 1/64th increments. For example, setting this value to 16 will set the transmit buffer to 1/4 of the remaining buffer space. In no cases will the transmit or receive buffer be reduced below 68 KB. For a 1 MB NIC the approximate total space for data buffers is 800 KB. For a 512 KB NIC that number is 300 KB. The default value is 21. .It Va dev.ti.%d.stat_ticks The value, stat ticks, controls the number of clock ticks (of 1 microseconds each) that must elapse before the NIC DMAs the statistics block to the Host and generates a STATS_UPDATED event. If set to zero then statistics are never DMAed to the Host. It is recommended that this value be set to a high enough frequency to not mislead someone reading statistics refreshes. Several times a second is enough. The default value is 2000000 (2 seconds). .El .Sh IOCTLS In addition to the standard .Xr socket 2 .Xr ioctl 2 calls implemented by most network drivers, the .Nm driver also includes a character device interface that can be used for additional diagnostics, configuration and debugging. With this character device interface, and a specially patched version of -.Xr gdb 1 , +.Xr gdb 1 Pq Pa ports/devel/gdb , the user can debug firmware running on the Tigon board. .Pp These ioctls and their arguments are defined in the .In sys/tiio.h header file. .Bl -tag -width ".Dv ALT_WRITE_TG_MEM" .It Dv TIIOCGETSTATS Return card statistics DMAed from the card into kernel memory approximately every 2 seconds. (That time interval can be changed via the .Dv TIIOCSETPARAMS ioctl.) The argument is .Vt "struct ti_stats" . .It Dv TIIOCGETPARAMS Get various performance-related firmware parameters that largely affect how interrupts are coalesced. The argument is .Vt "struct ti_params" . .It Dv TIIOCSETPARAMS Set various performance-related firmware parameters that largely affect how interrupts are coalesced. The argument is .Vt "struct ti_params" . .It Dv TIIOCSETTRACE Tell the NIC to trace the requested types of information. The argument is .Vt ti_trace_type . .It Dv TIIOCGETTRACE Dump the trace buffer from the card. The argument is .Vt "struct ti_trace_buf" . .It Dv ALT_ATTACH This ioctl is used for compatibility with Alteon's Solaris driver. They apparently only have one character interface for debugging, so they have to tell it which Tigon instance they want to debug. This ioctl is a noop for .Fx . .It Dv ALT_READ_TG_MEM Read the requested memory region from the Tigon board. The argument is .Vt "struct tg_mem" . .It Dv ALT_WRITE_TG_MEM Write to the requested memory region on the Tigon board. The argument is .Vt "struct tg_mem" . .It Dv ALT_READ_TG_REG Read the requested register from the Tigon board. The argument is .Vt "struct tg_reg" . .It Dv ALT_WRITE_TG_REG Write to the requested register on the Tigon board. The argument is .Vt "struct tg_reg" . .El .Sh FILES .Bl -tag -width ".Pa /dev/ti[0-255]" -compact .It Pa /dev/ti[0-255] Tigon driver character interface. .El .Sh DIAGNOSTICS .Bl -diag .It "ti%d: couldn't map memory" A fatal initialization error has occurred. .It "ti%d: couldn't map interrupt" A fatal initialization error has occurred. .It "ti%d: no memory for softc struct!" The driver failed to allocate memory for per-device instance information during initialization. .It "ti%d: failed to enable memory mapping!" The driver failed to initialize PCI shared memory mapping. This might happen if the card is not in a bus-master slot. .It "ti%d: no memory for jumbo buffers!" The driver failed to allocate memory for jumbo frames during initialization. .It "ti%d: bios thinks we're in a 64 bit slot, but we aren't" The BIOS has programmed the NIC as though it had been installed in a 64-bit PCI slot, but in fact the NIC is in a 32-bit slot. This happens as a result of a bug in some BIOSes. This can be worked around on the Tigon II, but on the Tigon I initialization will fail. .It "ti%d: board self-diagnostics failed!" The ROMFAIL bit in the CPU state register was set after system startup, indicating that the on-board NIC diagnostics failed. .It "ti%d: unknown hwrev" The driver detected a board with an unsupported hardware revision. The .Nm driver supports revision 4 (Tigon 1) and revision 6 (Tigon 2) chips and has firmware only for those devices. .It "ti%d: watchdog timeout" The device has stopped responding to the network, or there is a problem with the network connection (cable). .El .Sh SEE ALSO .Xr sendfile 2 , .Xr altq 4 , .Xr arp 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr vlan 4 , .Xr ifconfig 8 , .Xr zero_copy 9 .Sh HISTORY The .Nm device driver first appeared in .Fx 3.0 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Bill Paul Aq Mt wpaul@bsdi.com . The header splitting firmware modifications, character .Xr ioctl 2 interface and debugging support were written by .An Kenneth Merry Aq Mt ken@FreeBSD.org . Initial zero copy support was written by .An Andrew Gallatin Aq Mt gallatin@FreeBSD.org . diff --git a/share/man/man5/a.out.5 b/share/man/man5/a.out.5 index aa4c7da96929..606c96a4125a 100644 --- a/share/man/man5/a.out.5 +++ b/share/man/man5/a.out.5 @@ -1,456 +1,456 @@ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This manual page is derived from documentation contributed to Berkeley by .\" Donn Seeley at UUNET Technologies, Inc. .\" .\" 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. .\" .\" @(#)a.out.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" .Dd June 10, 2010 .Dt A.OUT 5 .Os .Sh NAME .Nm a.out .Nd format of executable binary files .Sh SYNOPSIS .In a.out.h .Sh DESCRIPTION The include file .In a.out.h declares three structures and several macros. The structures describe the format of executable machine code files .Pq Sq binaries on the system. .Pp A binary file consists of up to 7 sections. In order, these sections are: .Bl -tag -width "text relocations" .It exec header Contains parameters used by the kernel to load a binary file into memory and execute it, and by the link editor .Xr ld 1 to combine a binary file with other binary files. This section is the only mandatory one. .It text segment Contains machine code and related data that are loaded into memory when a program executes. May be loaded read-only. .It data segment Contains initialized data; always loaded into writable memory. .It text relocations Contains records used by the link editor to update pointers in the text segment when combining binary files. .It data relocations Like the text relocation section, but for data segment pointers. .It symbol table Contains records used by the link editor to cross reference the addresses of named variables and functions .Pq Sq symbols between binary files. .It string table Contains the character strings corresponding to the symbol names. .El .Pp Every binary file begins with an .Fa exec structure: .Bd -literal -offset indent struct exec { unsigned long a_midmag; unsigned long a_text; unsigned long a_data; unsigned long a_bss; unsigned long a_syms; unsigned long a_entry; unsigned long a_trsize; unsigned long a_drsize; }; .Ed .Pp The fields have the following functions: .Bl -tag -width a_trsize .It Fa a_midmag This field is stored in host byte-order. It has a number of sub-components accessed by the macros .Fn N_GETFLAG , .Fn N_GETMID , and .Fn N_GETMAGIC , and set by the macro .Fn N_SETMAGIC . .Pp The macro .Fn N_GETFLAG returns a few flags: .Bl -tag -width EX_DYNAMIC .It Dv EX_DYNAMIC indicates that the executable requires the services of the run-time link editor. .It Dv EX_PIC indicates that the object contains position independent code. This flag is set by .Xr as 1 when given the .Sq -k flag and is preserved by .Xr ld 1 if necessary. .El .Pp If both EX_DYNAMIC and EX_PIC are set, the object file is a position independent executable image (e.g.\& a shared library), which is to be loaded into the process address space by the run-time link editor. .Pp The macro .Fn N_GETMID returns the machine-id. This indicates which machine(s) the binary is intended to run on. .Pp .Fn N_GETMAGIC specifies the magic number, which uniquely identifies binary files and distinguishes different loading conventions. The field must contain one of the following values: .Bl -tag -width ZMAGIC .It Dv OMAGIC The text and data segments immediately follow the header and are contiguous. The kernel loads both text and data segments into writable memory. .It Dv NMAGIC As with .Dv OMAGIC , text and data segments immediately follow the header and are contiguous. However, the kernel loads the text into read-only memory and loads the data into writable memory at the next page boundary after the text. .It Dv ZMAGIC The kernel loads individual pages on demand from the binary. The header, text segment and data segment are all padded by the link editor to a multiple of the page size. Pages that the kernel loads from the text segment are read-only, while pages from the data segment are writable. .El .It Fa a_text Contains the size of the text segment in bytes. .It Fa a_data Contains the size of the data segment in bytes. .It Fa a_bss Contains the number of bytes in the .Sq bss segment and is used by the kernel to set the initial break .Pq Xr brk 2 after the data segment. The kernel loads the program so that this amount of writable memory appears to follow the data segment and initially reads as zeroes. .Em ( bss = block started by symbol) .It Fa a_syms Contains the size in bytes of the symbol table section. .It Fa a_entry Contains the address in memory of the entry point of the program after the kernel has loaded it; the kernel starts the execution of the program from the machine instruction at this address. .It Fa a_trsize Contains the size in bytes of the text relocation table. .It Fa a_drsize Contains the size in bytes of the data relocation table. .El .Pp The .In a.out.h include file defines several macros which use an .Fa exec structure to test consistency or to locate section offsets in the binary file. .Bl -tag -width N_BADMAG(exec) .It Fn N_BADMAG exec Nonzero if the .Fa a_magic field does not contain a recognized value. .It Fn N_TXTOFF exec The byte offset in the binary file of the beginning of the text segment. .It Fn N_SYMOFF exec The byte offset of the beginning of the symbol table. .It Fn N_STROFF exec The byte offset of the beginning of the string table. .El .Pp Relocation records have a standard format which is described by the .Fa relocation_info structure: .Bd -literal -offset indent struct relocation_info { int r_address; unsigned int r_symbolnum : 24, r_pcrel : 1, r_length : 2, r_extern : 1, r_baserel : 1, r_jmptable : 1, r_relative : 1, r_copy : 1; }; .Ed .Pp The .Fa relocation_info fields are used as follows: .Bl -tag -width r_symbolnum .It Fa r_address Contains the byte offset of a pointer that needs to be link-edited. Text relocation offsets are reckoned from the start of the text segment, and data relocation offsets from the start of the data segment. The link editor adds the value that is already stored at this offset into the new value that it computes using this relocation record. .It Fa r_symbolnum Contains the ordinal number of a symbol structure in the symbol table (it is .Em not a byte offset). After the link editor resolves the absolute address for this symbol, it adds that address to the pointer that is undergoing relocation. (If the .Fa r_extern bit is clear, the situation is different; see below.) .It Fa r_pcrel If this is set, the link editor assumes that it is updating a pointer that is part of a machine code instruction using pc-relative addressing. The address of the relocated pointer is implicitly added to its value when the running program uses it. .It Fa r_length Contains the log base 2 of the length of the pointer in bytes; 0 for 1-byte displacements, 1 for 2-byte displacements, 2 for 4-byte displacements. .It Fa r_extern Set if this relocation requires an external reference; the link editor must use a symbol address to update the pointer. When the .Fa r_extern bit is clear, the relocation is .Sq local ; the link editor updates the pointer to reflect changes in the load addresses of the various segments, rather than changes in the value of a symbol (except when .Fa r_baserel is also set (see below). In this case, the content of the .Fa r_symbolnum field is an .Fa n_type value (see below); this type field tells the link editor what segment the relocated pointer points into. .It Fa r_baserel If set, the symbol, as identified by the .Fa r_symbolnum field, is to be relocated to an offset into the Global Offset Table. At run-time, the entry in the Global Offset Table at this offset is set to be the address of the symbol. .It Fa r_jmptable If set, the symbol, as identified by the .Fa r_symbolnum field, is to be relocated to an offset into the Procedure Linkage Table. .It Fa r_relative If set, this relocation is relative to the (run-time) load address of the image this object file is going to be a part of. This type of relocation only occurs in shared objects. .It Fa r_copy If set, this relocation record identifies a symbol whose contents should be copied to the location given in .Fa r_address . The copying is done by the run-time link-editor from a suitable data item in a shared object. .El .Pp Symbols map names to addresses (or more generally, strings to values). Since the link-editor adjusts addresses, a symbol's name must be used to stand for its address until an absolute value has been assigned. Symbols consist of a fixed-length record in the symbol table and a variable-length name in the string table. The symbol table is an array of .Fa nlist structures: .Bd -literal -offset indent struct nlist { union { const char *n_name; long n_strx; } n_un; unsigned char n_type; char n_other; short n_desc; unsigned long n_value; }; .Ed .Pp The fields are used as follows: .Bl -tag -width n_un.n_strx .It Fa n_un.n_strx Contains a byte offset into the string table for the name of this symbol. When a program accesses a symbol table with the .Xr nlist 3 function, this field is replaced with the .Fa n_un.n_name field, which is a pointer to the string in memory. .It Fa n_type Used by the link editor to determine how to update the symbol's value. The .Fa n_type field is broken down into three sub-fields using bitmasks. The link editor treats symbols with the .Dv N_EXT type bit set as .Sq external symbols and permits references to them from other binary files. The .Dv N_TYPE mask selects bits of interest to the link editor: .Bl -tag -width N_TEXT .It Dv N_UNDF An undefined symbol. The link editor must locate an external symbol with the same name in another binary file to determine the absolute value of this symbol. As a special case, if the .Fa n_value field is nonzero and no binary file in the link-edit defines this symbol, the link-editor will resolve this symbol to an address in the bss segment, reserving an amount of bytes equal to .Fa n_value . If this symbol is undefined in more than one binary file and the binary files do not agree on the size, the link editor chooses the greatest size found across all binaries. .It Dv N_ABS An absolute symbol. The link editor does not update an absolute symbol. .It Dv N_TEXT A text symbol. This symbol's value is a text address and the link editor will update it when it merges binary files. .It Dv N_DATA A data symbol; similar to .Dv N_TEXT but for data addresses. The values for text and data symbols are not file offsets but addresses; to recover the file offsets, it is necessary to identify the loaded address of the beginning of the corresponding section and subtract it, then add the offset of the section. .It Dv N_BSS A bss symbol; like text or data symbols but has no corresponding offset in the binary file. .It Dv N_FN A filename symbol. The link editor inserts this symbol before the other symbols from a binary file when merging binary files. The name of the symbol is the filename given to the link editor, and its value is the first text address from that binary file. Filename symbols are not needed for link-editing or loading, but are useful for debuggers. .El .Pp The .Dv N_STAB mask selects bits of interest to symbolic debuggers such as -.Xr gdb 1 ; +.Xr gdb 1 Pq Pa ports/devel/gdb ; the values are described in .Xr stab 5 . .It Fa n_other This field provides information on the nature of the symbol independent of the symbol's location in terms of segments as determined by the .Fa n_type field. Currently, the lower 4 bits of the .Fa n_other field hold one of two values: .Dv AUX_FUNC and .Dv AUX_OBJECT (see .In link.h for their definitions). .Dv AUX_FUNC associates the symbol with a callable function, while .Dv AUX_OBJECT associates the symbol with data, irrespective of their locations in either the text or the data segment. This field is intended to be used by .Xr ld 1 for the construction of dynamic executables. .It Fa n_desc Reserved for use by debuggers; passed untouched by the link editor. Different debuggers use this field for different purposes. .It Fa n_value Contains the value of the symbol. For text, data and bss symbols, this is an address; for other symbols (such as debugger symbols), the value may be arbitrary. .El .Pp The string table consists of an .Em unsigned long length followed by null-terminated symbol strings. The length represents the size of the entire table in bytes, so its minimum value (or the offset of the first string) is always 4 on 32-bit machines. .Sh SEE ALSO .Xr as 1 , -.Xr gdb 1 , +.Xr gdb 1 Pq Pa ports/devel/gdb , .Xr ld 1 , .Xr brk 2 , .Xr execve 2 , .Xr nlist 3 , .Xr core 5 , .Xr elf 5 , .Xr link 5 , .Xr stab 5 .Sh HISTORY The .In a.out.h include file appeared in .At v7 . .Sh BUGS Since not all of the supported architectures use the .Fa a_midmag field, it can be difficult to determine what architecture a binary will execute on without examining its actual machine code. Even with a machine identifier, the byte order of the .Fa exec header is machine-dependent. diff --git a/share/man/man5/core.5 b/share/man/man5/core.5 index f109b7932308..09dfbc12e8f6 100644 --- a/share/man/man5/core.5 +++ b/share/man/man5/core.5 @@ -1,190 +1,190 @@ .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. .\" .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" .Dd October 5, 2021 .Dt CORE 5 .Os .Sh NAME .Nm core .Nd memory image file format .Sh SYNOPSIS .In sys/param.h .Sh DESCRIPTION A small number of signals which cause abnormal termination of a process also cause a record of the process's in-core state to be written to disk for later examination by one of the available debuggers. (See .Xr sigaction 2 . ) This memory image is written to a file named by default .Nm programname.core in the working directory; provided the terminated process had write permission in the directory, and provided the abnormality did not cause a system crash. (In this event, the decision to save the core file is arbitrary, see .Xr savecore 8 . ) .Pp The maximum size of a core file is limited by the .Dv RLIMIT_CORE .Xr setrlimit 2 limit. Files which would be larger than the limit are not created. .Pp With a large limit, a process that had mapped a very large, and perhaps sparsely populated, virtual memory region, could take a very long time to create core dumps. The system ignores all signals sent to a process writing a core file, except .Dv SIGKILL which terminates the writing and causes immediate exit of the process. The behavior of .Dv SIGKILL can be disabled by setting tunable .Xr sysctl 8 variable .Va kern.core_dump_can_intr to zero. .Pp The name of the file is controlled via the .Xr sysctl 8 variable .Va kern.corefile . The contents of this variable describes a filename to store the core image to. This filename can be absolute, or relative (which will resolve to the current working directory of the program generating it). .Pp The following format specifiers may be used in the .Va kern.corefile sysctl to insert additional information into the resulting core filename: .Bl -tag -width "1234567890" -compact -offset "12345" .It Em \&%H Machine hostname. .It Em \&%I An index starting at zero until the sysctl .Em debug.ncores is reached. This can be useful for limiting the number of corefiles generated by a particular process. .It Em \&%N process name. .It Em \&%P processes PID. .It Em \&%S signal during core. .It Em \&%U process UID. .El .Pp The name defaults to .Em \&%N.core , yielding the traditional .Fx behaviour. .Pp By default, a process that changes user or group credentials whether real or effective will not create a corefile. This behaviour can be changed to generate a core dump by setting the .Xr sysctl 8 variable .Va kern.sugid_coredump to 1. .Pp Corefiles can be compressed by the kernel if the following item is included in the kernel configuration file: .Bl -tag -width "1234567890" -compact -offset "12345" .It options GZIO .El .Pp The following sysctl control core file compression: .Bl -tag -width "kern.compress_user_cores_level" -compact -offset "12345" .It Em kern.compress_user_cores Enable compression of user cores. A value of 1 configures .Xr gzip 1 compression, and a value of 2 configures .Xr zstd 1 compression. Compressed core files will have a suffix of .Ql .gz or .Ql .zst appended to their filenames depending on the selected format. .It Em kern.compress_user_cores_level Compression level. Defaults to 6. .El .Sh NOTES Corefiles are written with open file descriptor information as an ELF note. By default, file paths are packed to only use as much space as needed. However, file paths can change at any time, including during core dump, and this can result in truncated file descriptor data. .Pp All file descriptor information can be preserved by disabling packing. This potentially wastes up to PATH_MAX bytes per open fd. Packing is disabled with .Dl sysctl kern.coredump_pack_fileinfo=0 . .Pp Similarly, corefiles are written with vmmap information as an ELF note, which contains file paths. By default, they are packed to only use as much space as needed. By the same mechanism as for the open files note, these paths can also change at any time and result in a truncated note. .Pp All vmmap information can be preserved by disabling packing. Like the file information, this potentially wastes up to PATH_MAX bytes per mapped object. Packing is disabled with .Dl sysctl kern.coredump_pack_vmmapinfo=0 . .Sh EXAMPLES In order to store all core images in per-user private areas under .Pa /var/coredumps , the following .Xr sysctl 8 command can be used: .Pp .Dl sysctl kern.corefile=/var/coredumps/\&%U/\&%N.core .Sh SEE ALSO -.Xr gdb 1 , +.Xr gdb 1 Pq Pa ports/devel/gdb , .Xr gzip 1 , .Xr kgdb 1 Pq Pa ports/devel/gdb , .Xr setrlimit 2 , .Xr sigaction 2 , .Xr sysctl 8 .Sh HISTORY A .Nm file format appeared in .At v1 . diff --git a/share/man/man5/elf.5 b/share/man/man5/elf.5 index 95bc183a1f91..9a004bb3d08a 100644 --- a/share/man/man5/elf.5 +++ b/share/man/man5/elf.5 @@ -1,1423 +1,1423 @@ .\" Copyright (c) 1999 Jeroen Ruigrok van der Werven .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. .\" .\" $FreeBSD$ .\" .Dd July 25, 2022 .Dt ELF 5 .Os .Sh NAME .Nm elf .Nd format of ELF executable binary files .Sh SYNOPSIS .In elf.h .Sh DESCRIPTION The header file .In elf.h defines the format of ELF executable binary files. Amongst these files are normal executable files, relocatable object files, core files and shared libraries. .Pp An executable file using the ELF file format consists of an ELF header, followed by a program header table or a section header table, or both. The ELF header is always at offset zero of the file. The program header table and the section header table's offset in the file are defined in the ELF header. The two tables describe the rest of the particularities of the file. .Pp Applications which wish to process ELF binary files for their native architecture only should include .In elf.h in their source code. These applications should need to refer to all the types and structures by their generic names .Dq Elf_xxx and to the macros by .Dq ELF_xxx . Applications written this way can be compiled on any architecture, regardless whether the host is 32-bit or 64-bit. .Pp Should an application need to process ELF files of an unknown architecture then the application needs to include both .In sys/elf32.h and .In sys/elf64.h instead of .In elf.h . Furthermore, all types and structures need to be identified by either .Dq Elf32_xxx or .Dq Elf64_xxx . The macros need to be identified by .Dq ELF32_xxx or .Dq ELF64_xxx . .Pp Whatever the system's architecture is, it will always include .In sys/elf_common.h as well as .In sys/elf_generic.h . .Pp These header files describe the above mentioned headers as C structures and also include structures for dynamic sections, relocation sections and symbol tables. .Pp The following types are being used for 32-bit architectures: .Bd -literal -offset indent Elf32_Addr Unsigned 32-bit program address Elf32_Half Unsigned 16-bit field Elf32_Lword Unsigned 64-bit field Elf32_Off Unsigned 32-bit file offset Elf32_Sword Signed 32-bit field or integer Elf32_Word Unsigned 32-bit field or integer .Ed .Pp For 64-bit architectures we have the following types: .Bd -literal -offset indent Elf64_Addr Unsigned 64-bit program address Elf64_Half Unsigned 16-bit field Elf64_Lword Unsigned 64-bit field Elf64_Off Unsigned 64-bit file offset Elf64_Sword Signed 32-bit field Elf64_Sxword Signed 64-bit field or integer Elf64_Word Unsigned 32-bit field Elf64_Xword Unsigned 64-bit field or integer .Ed .Pp All data structures that the file format defines follow the .Dq natural size and alignment guidelines for the relevant class. If necessary, data structures contain explicit padding to ensure 4-byte alignment for 4-byte objects, to force structure sizes to a multiple of 4, etc. .Pp The ELF header is described by the type Elf32_Ehdr or Elf64_Ehdr: .Bd -literal -offset indent typedef struct { unsigned char e_ident[EI_NIDENT]; Elf32_Half e_type; Elf32_Half e_machine; Elf32_Word e_version; Elf32_Addr e_entry; Elf32_Off e_phoff; Elf32_Off e_shoff; Elf32_Word e_flags; Elf32_Half e_ehsize; Elf32_Half e_phentsize; Elf32_Half e_phnum; Elf32_Half e_shentsize; Elf32_Half e_shnum; Elf32_Half e_shstrndx; } Elf32_Ehdr; .Ed .Bd -literal -offset indent typedef struct { unsigned char e_ident[EI_NIDENT]; Elf64_Half e_type; Elf64_Half e_machine; Elf64_Word e_version; Elf64_Addr e_entry; Elf64_Off e_phoff; Elf64_Off e_shoff; Elf64_Word e_flags; Elf64_Half e_ehsize; Elf64_Half e_phentsize; Elf64_Half e_phnum; Elf64_Half e_shentsize; Elf64_Half e_shnum; Elf64_Half e_shstrndx; } Elf64_Ehdr; .Ed .Pp The fields have the following meanings: .Pp .Bl -tag -width "e_phentsize" -compact -offset indent .It Dv e_ident This array of bytes specifies to interpret the file, independent of the processor or the file's remaining contents. Within this array everything is named by macros, which start with the prefix .Sy EI_ and may contain values which start with the prefix .Sy ELF . The following macros are defined: .Pp .Bl -tag -width "EI_ABIVERSION" -compact .It Dv EI_MAG0 The first byte of the magic number. It must be filled with .Sy ELFMAG0 . .It Dv EI_MAG1 The second byte of the magic number. It must be filled with .Sy ELFMAG1 . .It Dv EI_MAG2 The third byte of the magic number. It must be filled with .Sy ELFMAG2 . .It Dv EI_MAG3 The fourth byte of the magic number. It must be filled with .Sy ELFMAG3 . .It Dv EI_CLASS The fifth byte identifies the architecture for this binary: .Pp .Bl -tag -width "ELFCLASSNONE" -compact .It Dv ELFCLASSNONE This class is invalid. .It Dv ELFCLASS32 This defines the 32-bit architecture. It supports machines with files and virtual address spaces up to 4 Gigabytes. .It Dv ELFCLASS64 This defines the 64-bit architecture. .El .It Dv EI_DATA The sixth byte specifies the data encoding of the processor-specific data in the file. Currently these encodings are supported: .Pp .Bl -tag -width "ELFDATA2LSB" -compact .It Dv ELFDATANONE Unknown data format. .It Dv ELFDATA2LSB Two's complement, little-endian. .It Dv ELFDATA2MSB Two's complement, big-endian. .El .It Dv EI_VERSION The version number of the ELF specification: .Pp .Bl -tag -width "EV_CURRENT" -compact .It Dv EV_NONE Invalid version. .It Dv EV_CURRENT Current version. .El .It Dv EI_OSABI This byte identifies the operating system and ABI to which the object is targeted. Some fields in other ELF structures have flags and values that have platform specific meanings; the interpretation of those fields is determined by the value of this byte. The following values are currently defined: .Pp .Bl -tag -width "ELFOSABI_STANDALONE" -compact .It Dv ELFOSABI_SYSV UNIX System V ABI. .It Dv ELFOSABI_HPUX HP-UX operating system ABI. .It Dv ELFOSABI_NETBSD .Nx operating system ABI. .It Dv ELFOSABI_LINUX GNU/Linux operating system ABI. .It Dv ELFOSABI_HURD GNU/Hurd operating system ABI. .It Dv ELFOSABI_86OPEN 86Open Common IA32 ABI. .It Dv ELFOSABI_SOLARIS Solaris operating system ABI. .It Dv ELFOSABI_MONTEREY Monterey project ABI. .It Dv ELFOSABI_IRIX IRIX operating system ABI. .It Dv ELFOSABI_FREEBSD .Fx operating system ABI. .It Dv ELFOSABI_TRU64 TRU64 UNIX operating system ABI. .It Dv ELFOSABI_ARM ARM architecture ABI. .It Dv ELFOSABI_STANDALONE Standalone (embedded) ABI. .El .It Dv EI_ABIVERSION This byte identifies the version of the ABI to which the object is targeted. This field is used to distinguish among incompatible versions of an ABI. The interpretation of this version number is dependent on the ABI identified by the EI_OSABI field. Applications conforming to this specification use the value 0. .It Dv EI_PAD Start of padding. These bytes are reserved and set to zero. Programs which read them should ignore them. The value for EI_PAD will change in the future if currently unused bytes are given meanings. .It Dv EI_BRAND Start of architecture identification. .It Dv EI_NIDENT The size of the e_ident array. .El .Pp .It Dv e_type This member of the structure identifies the object file type: .Pp .Bl -tag -width "ET_NONE" -compact .It Dv ET_NONE An unknown type. .It Dv ET_REL A relocatable file. .It Dv ET_EXEC An executable file. .It Dv ET_DYN A shared object. .It Dv ET_CORE A core file. .El .Pp .It Dv e_machine This member specifies the required architecture for an individual file: .Pp .Bl -tag -width "EM_MIPS_RS4_BE" -compact .It Dv EM_NONE An unknown machine. .It Dv EM_M32 AT&T WE 32100. .It Dv EM_SPARC Sun Microsystems SPARC. .It Dv EM_386 Intel 80386. .It Dv EM_68K Motorola 68000. .It Dv EM_88K Motorola 88000. .It Dv EM_486 Intel 80486. .It Dv EM_860 Intel 80860. .It Dv EM_MIPS MIPS RS3000 (big-endian only). .It Dv EM_MIPS_RS4_BE MIPS RS4000 (big-endian only). .It Dv EM_SPARC64 SPARC v9 64-bit unofficial. .It Dv EM_PARISC HPPA. .It Dv EM_PPC PowerPC. .It Dv EM_ALPHA Compaq [DEC] Alpha. .El .Pp .It Dv e_version This member identifies the file version: .Pp .Bl -tag -width "EV_CURRENT" -compact .It Dv EV_NONE Invalid version .It Dv EV_CURRENT Current version .El .It Dv e_entry This member gives the virtual address to which the system first transfers control, thus starting the process. If the file has no associated entry point, this member holds zero. .It Dv e_phoff This member holds the program header table's file offset in bytes. If the file has no program header table, this member holds zero. .It Dv e_shoff This member holds the section header table's file offset in bytes. If the file has no section header table this member holds zero. .It Dv e_flags This member holds processor-specific flags associated with the file. Flag names take the form EF_`machine_flag'. Currently no flags have been defined. .It Dv e_ehsize This member holds the ELF header's size in bytes. .It Dv e_phentsize This member holds the size in bytes of one entry in the file's program header table; all entries are the same size. .It Dv e_phnum This member holds the number of entries in the program header table. If the file is using extended program header numbering, then the .Sy e_phnum member will contain the value .Dv PN_XNUM and the actual number of program header table entries will be stored in the .Sy sh_info member of the section header at index .Dv SHN_UNDEF . The product of .Sy e_phentsize and the number of program header table entries gives the program header table's size in bytes. If a file has no program header, .Sy e_phnum holds the value zero. .It Dv e_shentsize This member holds a sections header's size in bytes. A section header is one entry in the section header table; all entries are the same size. .It Dv e_shnum This member holds the number of entries in the section header table. If the file is using extended section numbering, then the .Sy e_shnum member will be zero and the actual section number will be stored in the .Sy sh_size member of the section header at index .Dv SHN_UNDEF . If a file has no section header table, both the .Sy e_shnum and the .Sy e_shoff fields of the ELF header will be zero. The product of .Sy e_shentsize and the number of sections in the file gives the section header table's size in bytes. .It Dv e_shstrndx This member holds the section header table index of the entry associated with the section name string table. If extended section numbering is being used, this field will hold the value .Sy SHN_XINDEX , and the actual section header table index will be present in the .Sy sh_link field of the section header entry at index .Dv SHN_UNDEF . If the file has no section name string table, this member holds the value .Sy SHN_UNDEF . .El .Pp An executable or shared object file's program header table is an array of structures, each describing a segment or other information the system needs to prepare the program for execution. An object file .Em segment contains one or more .Em sections . Program headers are meaningful only for executable and shared object files. A file specifies its own program header size with the ELF header's .Sy e_phentsize and .Sy e_phnum members. As with the Elf executable header, the program header also has different versions depending on the architecture: .Bd -literal -offset indent typedef struct { Elf32_Word p_type; Elf32_Off p_offset; Elf32_Addr p_vaddr; Elf32_Addr p_paddr; Elf32_Word p_filesz; Elf32_Word p_memsz; Elf32_Word p_flags; Elf32_Word p_align; } Elf32_Phdr; .Ed .Bd -literal -offset indent typedef struct { Elf64_Word p_type; Elf64_Word p_flags; Elf64_Off p_offset; Elf64_Addr p_vaddr; Elf64_Addr p_paddr; Elf64_Xword p_filesz; Elf64_Xword p_memsz; Elf64_Xword p_align; } Elf64_Phdr; .Ed .Pp The main difference between the 32-bit and the 64-bit program header lies only in the location of a .Sy p_flags member in the total struct. .Pp .Bl -tag -width "p_offset" -compact -offset indent .It Dv p_type This member of the Phdr struct tells what kind of segment this array element describes or how to interpret the array element's information. .Pp .Bl -tag -width "PT_DYNAMIC" -compact .It Dv PT_NULL The array element is unused and the other members' values are undefined. This lets the program header have ignored entries. .It Dv PT_LOAD The array element specifies a loadable segment, described by .Sy p_filesz and .Sy p_memsz . The bytes from the file are mapped to the beginning of the memory segment. If the segment's memory size .Pq Sy p_memsz is larger than the file size .Pq Sy p_filesz , the .Dq extra bytes are defined to hold the value 0 and to follow the segment's initialized area. The file size may not be larger than the memory size. Loadable segment entries in the program header table appear in ascending order, sorted on the .Sy p_vaddr member. .It Dv PT_DYNAMIC The array element specifies dynamic linking information. .It Dv PT_INTERP The array element specifies the location and size of a null-terminated path name to invoke as an interpreter. This segment type is meaningful only for executable files (though it may occur for shared objects). However it may not occur more than once in a file. If it is present it must precede any loadable segment entry. .It Dv PT_NOTE The array element specifies the location and size for auxiliary information. .It Dv PT_SHLIB This segment type is reserved but has unspecified semantics. Programs that contain an array element of this type do not conform to the ABI. .It Dv PT_PHDR The array element, if present, specifies the location and size of the program header table itself, both in the file and in the memory image of the program. This segment type may not occur more than once in a file. Moreover, it may only occur if the program header table is part of the memory image of the program. If it is present it must precede any loadable segment entry. .It Dv PT_LOPROC This value up to and including .Sy PT_HIPROC are reserved for processor-specific semantics. .It Dv PT_HIPROC This value down to and including .Sy PT_LOPROC are reserved for processor-specific semantics. .El .Pp .It Dv p_offset This member holds the offset from the beginning of the file at which the first byte of the segment resides. .It Dv p_vaddr This member holds the virtual address at which the first byte of the segment resides in memory. .It Dv p_paddr On systems for which physical addressing is relevant, this member is reserved for the segment's physical address. Under .Bx this member is not used and must be zero. .It Dv p_filesz This member holds the number of bytes in the file image of the segment. It may be zero. .It Dv p_memsz This member holds the number of bytes in the memory image of the segment. It may be zero. .It Dv p_flags This member holds flags relevant to the segment: .Pp .Bl -tag -width "PF_X" -compact .It Dv PF_X An executable segment. .It Dv PF_W A writable segment. .It Dv PF_R A readable segment. .El .Pp A text segment commonly has the flags .Sy PF_X and .Sy PF_R . A data segment commonly has .Sy PF_X , .Sy PF_W and .Sy PF_R . .It Dv p_align This member holds the value to which the segments are aligned in memory and in the file. Loadable process segments must have congruent values for .Sy p_vaddr and .Sy p_offset , modulo the page size. Values of zero and one mean no alignment is required. Otherwise, .Sy p_align should be a positive, integral power of two, and .Sy p_vaddr should equal .Sy p_offset , modulo .Sy p_align . .El .Pp An file's section header table lets one locate all the file's sections. The section header table is an array of Elf32_Shdr or Elf64_Shdr structures. The ELF header's .Sy e_shoff member gives the byte offset from the beginning of the file to the section header table. .Sy e_shnum holds the number of entries the section header table contains. .Sy e_shentsize holds the size in bytes of each entry. .Pp A section header table index is a subscript into this array. Some section header table indices are reserved. An object file does not have sections for these special indices: .Pp .Bl -tag -width "SHN_LORESERVE" -compact .It Dv SHN_UNDEF This value marks an undefined, missing, irrelevant, or otherwise meaningless section reference. For example, a symbol .Dq defined relative to section number .Sy SHN_UNDEF is an undefined symbol. .It Dv SHN_LORESERVE This value specifies the lower bound of the range of reserved indices. .It Dv SHN_LOPROC This value up to and including .Sy SHN_HIPROC are reserved for processor-specific semantics. .It Dv SHN_HIPROC This value down to and including .Sy SHN_LOPROC are reserved for processor-specific semantics. .It Dv SHN_ABS This value specifies absolute values for the corresponding reference. For example, symbols defined relative to section number .Sy SHN_ABS have absolute values and are not affected by relocation. .It Dv SHN_COMMON Symbols defined relative to this section are common symbols, such as FORTRAN COMMON or unallocated C external variables. .It Dv SHN_HIRESERVE This value specifies the upper bound of the range of reserved indices. The system reserves indices between .Sy SHN_LORESERVE and .Sy SHN_HIRESERVE , inclusive. The section header table does not contain entries for the reserved indices. .El .Pp The section header has the following structure: .Bd -literal -offset indent typedef struct { Elf32_Word sh_name; Elf32_Word sh_type; Elf32_Word sh_flags; Elf32_Addr sh_addr; Elf32_Off sh_offset; Elf32_Word sh_size; Elf32_Word sh_link; Elf32_Word sh_info; Elf32_Word sh_addralign; Elf32_Word sh_entsize; } Elf32_Shdr; .Ed .Bd -literal -offset indent typedef struct { Elf64_Word sh_name; Elf64_Word sh_type; Elf64_Xword sh_flags; Elf64_Addr sh_addr; Elf64_Off sh_offset; Elf64_Xword sh_size; Elf64_Word sh_link; Elf64_Word sh_info; Elf64_Xword sh_addralign; Elf64_Xword sh_entsize; } Elf64_Shdr; .Ed .Pp .Bl -tag -width "sh_addralign" -compact .It Dv sh_name This member specifies the name of the section. Its value is an index into the section header string table section, giving the location of a null-terminated string. .It Dv sh_type This member categorizes the section's contents and semantics. .Pp .Bl -tag -width "SHT_PROGBITS" -compact .It Dv SHT_NULL This value marks the section header as inactive. It does not have an associated section. Other members of the section header have undefined values. .It Dv SHT_PROGBITS The section holds information defined by the program, whose format and meaning are determined solely by the program. .It Dv SHT_SYMTAB This section holds a symbol table. Typically, .Sy SHT_SYMTAB provides symbols for link editing, though it may also be used for dynamic linking. As a complete symbol table, it may contain many symbols unnecessary for dynamic linking. An object file can also contain a .Sy SHN_DYNSYM section. .It Dv SHT_STRTAB This section holds a string table. An object file may have multiple string table sections. .It Dv SHT_RELA This section holds relocation entries with explicit addends, such as type .Sy Elf32_Rela for the 32-bit class of object files. An object may have multiple relocation sections. .It Dv SHT_HASH This section holds a symbol hash table. All object participating in dynamic linking must contain a symbol hash table. An object file may have only one hash table. .It Dv SHT_DYNAMIC This section holds information for dynamic linking. An object file may have only one dynamic section. .It Dv SHT_NOTE This section holds information that marks the file in some way. .It Dv SHT_NOBITS A section of this type occupies no space in the file but otherwise resembles .Sy SHN_PROGBITS . Although this section contains no bytes, the .Sy sh_offset member contains the conceptual file offset. .It Dv SHT_REL This section holds relocation offsets without explicit addends, such as type .Sy Elf32_Rel for the 32-bit class of object files. An object file may have multiple relocation sections. .It Dv SHT_SHLIB This section is reserved but has unspecified semantics. .It Dv SHT_DYNSYM This section holds a minimal set of dynamic linking symbols. An object file can also contain a .Sy SHN_SYMTAB section. .It Dv SHT_LOPROC This value up to and including .Sy SHT_HIPROC are reserved for processor-specific semantics. .It Dv SHT_HIPROC This value down to and including .Sy SHT_LOPROC are reserved for processor-specific semantics. .It Dv SHT_LOUSER This value specifies the lower bound of the range of indices reserved for application programs. .It Dv SHT_HIUSER This value specifies the upper bound of the range of indices reserved for application programs. Section types between .Sy SHT_LOUSER and .Sy SHT_HIUSER may be used by the application, without conflicting with current or future system-defined section types. .El .Pp .It Dv sh_flags Sections support one-bit flags that describe miscellaneous attributes. If a flag bit is set in .Sy sh_flags , the attribute is .Dq on for the section. Otherwise, the attribute is .Dq off or does not apply. Undefined attributes are set to zero. .Pp .Bl -tag -width "SHF_EXECINSTR" -compact .It Dv SHF_WRITE This section contains data that should be writable during process execution. .It Dv SHF_ALLOC The section occupies memory during process execution. Some control sections do not reside in the memory image of an object file. This attribute is off for those sections. .It Dv SHF_EXECINSTR The section contains executable machine instructions. .It Dv SHF_MASKPROC All bits included in this mask are reserved for processor-specific semantics. .It Dv SHF_COMPRESSED The section data is compressed. .El .Pp .It Dv sh_addr If the section will appear in the memory image of a process, this member holds the address at which the section's first byte should reside. Otherwise, the member contains zero. .It Dv sh_offset This member's value holds the byte offset from the beginning of the file to the first byte in the section. One section type, .Sy SHT_NOBITS , occupies no space in the file, and its .Sy sh_offset member locates the conceptual placement in the file. .It Dv sh_size This member holds the section's size in bytes. Unless the section type is .Sy SHT_NOBITS , the section occupies .Sy sh_size bytes in the file. A section of type .Sy SHT_NOBITS may have a non-zero size, but it occupies no space in the file. .It Dv sh_link This member holds a section header table index link, whose interpretation depends on the section type. .It Dv sh_info This member holds extra information, whose interpretation depends on the section type. .It Dv sh_addralign Some sections have address alignment constraints. If a section holds a doubleword, the system must ensure doubleword alignment for the entire section. That is, the value of .Sy sh_addr must be congruent to zero, modulo the value of .Sy sh_addralign . Only zero and positive integral powers of two are allowed. Values of zero or one mean the section has no alignment constraints. .It Dv sh_entsize Some sections hold a table of fixed-sized entries, such as a symbol table. For such a section, this member gives the size in bytes for each entry. This member contains zero if the section does not hold a table of fixed-size entries. .El .Pp Various sections hold program and control information: .Bl -tag -width ".shstrtab" -compact .It .bss (Block Started by Symbol) This section holds uninitialized data that contributes to the program's memory image. By definition, the system initializes the data with zeros when the program begins to run. This section is of type .Sy SHT_NOBITS . The attributes types are .Sy SHF_ALLOC and .Sy SHF_WRITE . .It .comment This section holds version control information. This section is of type .Sy SHT_PROGBITS . No attribute types are used. .It .data This section holds initialized data that contribute to the program's memory image. This section is of type .Sy SHT_PROGBITS . The attribute types are .Sy SHF_ALLOC and .Sy SHF_WRITE . .It .data1 This section holds initialized data that contribute to the program's memory image. This section is of type .Sy SHT_PROGBITS . The attribute types are .Sy SHF_ALLOC and .Sy SHF_WRITE . .It .debug This section holds information for symbolic debugging. The contents are unspecified. This section is of type .Sy SHT_PROGBITS . No attribute types are used. .It .dynamic This section holds dynamic linking information. The section's attributes will include the .Sy SHF_ALLOC bit. Whether the .Sy SHF_WRITE bit is set is processor-specific. This section is of type .Sy SHT_DYNAMIC . See the attributes above. .It .dynstr This section holds strings needed for dynamic linking, most commonly the strings that represent the names associated with symbol table entries. This section is of type .Sy SHT_STRTAB . The attribute type used is .Sy SHF_ALLOC . .It .dynsym This section holds the dynamic linking symbol table. This section is of type .Sy SHT_DYNSYM . The attribute used is .Sy SHF_ALLOC . .It .fini This section holds executable instructions that contribute to the process termination code. When a program exits normally the system arranges to execute the code in this section. This section is of type .Sy SHT_PROGBITS . The attributes used are .Sy SHF_ALLOC and .Sy SHF_EXECINSTR . .It .got This section holds the global offset table. This section is of type .Sy SHT_PROGBITS . The attributes are processor-specific. .It .hash This section holds a symbol hash table. This section is of type .Sy SHT_HASH . The attribute used is .Sy SHF_ALLOC . .It .init This section holds executable instructions that contribute to the process initialization code. When a program starts to run the system arranges to execute the code in this section before calling the main program entry point. This section is of type .Sy SHT_PROGBITS . The attributes used are .Sy SHF_ALLOC and .Sy SHF_EXECINSTR . .It .interp This section holds the pathname of a program interpreter. If the file has a loadable segment that includes the section, the section's attributes will include the .Sy SHF_ALLOC bit. Otherwise, that bit will be off. This section is of type .Sy SHT_PROGBITS . .It .line This section holds line number information for symbolic debugging, which describes the correspondence between the program source and the machine code. The contents are unspecified. This section is of type .Sy SHT_PROGBITS . No attribute types are used. .It .note This section holds information in the .Dq Note Section format described below. This section is of type .Sy SHT_NOTE . No attribute types are used. .It .plt This section holds the procedure linkage table. This section is of type .Sy SHT_PROGBITS . The attributes are processor-specific. .It .relNAME This section holds relocation information as described below. If the file has a loadable segment that includes relocation, the section's attributes will include the .Sy SHF_ALLOC bit. Otherwise the bit will be off. By convention, .Dq NAME is supplied by the section to which the relocations apply. Thus a relocation section for .Sy .text normally would have the name .Sy .rel.text . This section is of type .Sy SHT_REL . .It .relaNAME This section holds relocation information as described below. If the file has a loadable segment that includes relocation, the section's attributes will include the .Sy SHF_ALLOC bit. Otherwise the bit will be off. By convention, .Dq NAME is supplied by the section to which the relocations apply. Thus a relocation section for .Sy .text normally would have the name .Sy .rela.text . This section is of type .Sy SHT_RELA . .It .rodata This section holds read-only data that typically contributes to a non-writable segment in the process image. This section is of type .Sy SHT_PROGBITS . The attribute used is .Sy SHF_ALLOC . .It .rodata1 This section hold read-only data that typically contributes to a non-writable segment in the process image. This section is of type .Sy SHT_PROGBITS . The attribute used is .Sy SHF_ALLOC . .It .shstrtab This section holds section names. This section is of type .Sy SHT_STRTAB . No attribute types are used. .It .strtab This section holds strings, most commonly the strings that represent the names associated with symbol table entries. If the file has a loadable segment that includes the symbol string table, the section's attributes will include the .Sy SHF_ALLOC bit. Otherwise the bit will be off. This section is of type .Sy SHT_STRTAB . .It .symtab This section holds a symbol table. If the file has a loadable segment that includes the symbol table, the section's attributes will include the .Sy SHF_ALLOC bit. Otherwise the bit will be off. This section is of type .Sy SHT_SYMTAB . .It .text This section holds the .Dq text , or executable instructions, of a program. This section is of type .Sy SHT_PROGBITS . The attributes used are .Sy SHF_ALLOC and .Sy SHF_EXECINSTR . .It .jcr This section holds information about Java classes that must be registered. .It .eh_frame This section holds information used for C++ exception-handling. .El .Pp A section with the .Dv SHF_COMPRESSED flag set contains a compressed copy of the section data. Compressed section data begins with an .Vt Elf64_Chdr or .Vt Elf32_Chdr structure which encodes the compression algorithm and some characteristics of the uncompressed data. .Bd -literal -offset indent typedef struct { Elf32_Word ch_type; Elf32_Word ch_size; Elf32_Word ch_addralign; } Elf32_Chdr; .Ed .Bd -literal -offset indent typedef struct { Elf64_Word ch_type; Elf64_Word ch_reserved; Elf64_Xword ch_size; Elf64_Xword ch_addralign; } Elf64_Chdr; .Ed .Pp .Bl -tag -width "ch_addralign" -compact .It Dv ch_type The compression algorithm used. A value of .Dv ELFCOMPRESS_ZLIB indicates that the data is compressed using .Xr zlib 3 . A value of .Dv ELFCOMPRESS_ZSTD indicates that the data is compressed using Zstandard. .It Dv ch_size The size, in bytes, of the uncompressed section data. This corresponds to the .Sy sh_size field of a section header containing uncompressed data. .It Dv ch_addralign The address alignment of the uncompressed section data. This corresponds to the .Sy sh_addralign field of a section header containing uncompressed data. .El .Pp String table sections hold null-terminated character sequences, commonly called strings. The object file uses these strings to represent symbol and section names. One references a string as an index into the string table section. The first byte, which is index zero, is defined to hold a null character. Similarly, a string table's last byte is defined to hold a null character, ensuring null termination for all strings. .Pp An object file's symbol table holds information needed to locate and relocate a program's symbolic definitions and references. A symbol table index is a subscript into this array. .Bd -literal -offset indent typedef struct { Elf32_Word st_name; Elf32_Addr st_value; Elf32_Word st_size; unsigned char st_info; unsigned char st_other; Elf32_Half st_shndx; } Elf32_Sym; .Ed .Bd -literal -offset indent typedef struct { Elf64_Word st_name; unsigned char st_info; unsigned char st_other; Elf64_Half st_shndx; Elf64_Addr st_value; Elf64_Xword st_size; } Elf64_Sym; .Ed .Pp .Bl -tag -width "st_value" -compact .It Dv st_name This member holds an index into the object file's symbol string table, which holds character representations of the symbol names. If the value is non-zero, it represents a string table index that gives the symbol name. Otherwise, the symbol table has no name. .It Dv st_value This member gives the value of the associated symbol. .It Dv st_size Many symbols have associated sizes. This member holds zero if the symbol has no size or an unknown size. .It Dv st_info This member specifies the symbol's type and binding attributes: .Pp .Bl -tag -width "STT_SECTION" -compact .It Dv STT_NOTYPE The symbol's type is not defined. .It Dv STT_OBJECT The symbol is associated with a data object. .It Dv STT_FUNC The symbol is associated with a function or other executable code. .It Dv STT_SECTION The symbol is associated with a section. Symbol table entries of this type exist primarily for relocation and normally have .Sy STB_LOCAL bindings. .It Dv STT_FILE By convention the symbol's name gives the name of the source file associated with the object file. A file symbol has .Sy STB_LOCAL bindings, its section index is .Sy SHN_ABS , and it precedes the other .Sy STB_LOCAL symbols of the file, if it is present. .It Dv STT_LOPROC This value up to and including .Sy STT_HIPROC are reserved for processor-specific semantics. .It Dv STT_HIPROC This value down to and including .Sy STT_LOPROC are reserved for processor-specific semantics. .El .Pp .Bl -tag -width "STB_GLOBAL" -compact .It Dv STB_LOCAL Local symbols are not visible outside the object file containing their definition. Local symbols of the same name may exist in multiple file without interfering with each other. .It Dv STB_GLOBAL Global symbols are visible to all object files being combined. One file's definition of a global symbol will satisfy another file's undefined reference to the same symbol. .It Dv STB_WEAK Weak symbols resemble global symbols, but their definitions have lower precedence. .It Dv STB_LOPROC This value up to and including .Sy STB_HIPROC are reserved for processor-specific semantics. .It Dv STB_HIPROC This value down to and including .Sy STB_LOPROC are reserved for processor-specific semantics. .Pp There are macros for packing and unpacking the binding and type fields: .Pp .Bl -tag -width "ELF32_ST_INFO(bind, type)" -compact .It Xo .Fn ELF32_ST_BIND info .Xc or .Fn ELF64_ST_BIND info extract a binding from an st_info value. .It Xo .Fn ELF64_ST_TYPE info .Xc or .Fn ELF32_ST_TYPE info extract a type from an st_info value. .It Xo .Fn ELF32_ST_INFO bind type .Xc or .Fn ELF64_ST_INFO bind type convert a binding and a type into an st_info value. .El .El .Pp .It Dv st_other This member currently holds zero and has no defined meaning. .It Dv st_shndx Every symbol table entry is .Dq defined in relation to some section. This member holds the relevant section header table index. .El .Pp Relocation is the process of connecting symbolic references with symbolic definitions. Relocatable files must have information that describes how to modify their section contents, thus allowing executable and shared object files to hold the right information for a process' program image. Relocation entries are these data. .Pp Relocation structures that do not need an addend: .Bd -literal -offset indent typedef struct { Elf32_Addr r_offset; Elf32_Word r_info; } Elf32_Rel; .Ed .Bd -literal -offset indent typedef struct { Elf64_Addr r_offset; Elf64_Xword r_info; } Elf64_Rel; .Ed .Pp Relocation structures that need an addend: .Bd -literal -offset indent typedef struct { Elf32_Addr r_offset; Elf32_Word r_info; Elf32_Sword r_addend; } Elf32_Rela; .Ed .Bd -literal -offset indent typedef struct { Elf64_Addr r_offset; Elf64_Xword r_info; Elf64_Sxword r_addend; } Elf64_Rela; .Ed .Pp .Bl -tag -width "r_offset" -compact .It Dv r_offset This member gives the location at which to apply the relocation action. For a relocatable file, the value is the byte offset from the beginning of the section to the storage unit affected by the relocation. For an executable file or shared object, the value is the virtual address of the storage unit affected by the relocation. .It Dv r_info This member gives both the symbol table index with respect to which the relocation must be made and the type of relocation to apply. Relocation types are processor-specific. When the text refers to a relocation entry's relocation type or symbol table index, it means the result of applying .Sy ELF_[32|64]_R_TYPE or .Sy ELF[32|64]_R_SYM , respectively to the entry's .Sy r_info member. .It Dv r_addend This member specifies a constant addend used to compute the value to be stored into the relocatable field. .El .Ss Note Section ELF note sections consist of entries with the following format: .Bl -column -offset indent "namesz" "32 bits" "Null-terminated originator name" .Sy Field Ta Sy Size Ta Sy Description .It Va namesz Ta 32 bits Ta Size of "name" .It Va descsz Ta 32 bits Ta Size of "desc" .It Va type Ta 32 bits Ta OS-dependent note type .It Va name Ta Va namesz Ta Null-terminated originator name .It Va desc Ta Va descsz Ta OS-dependent note data .El .Pp The .Va name and .Va desc fields are padded to ensure 4-byte alignemnt. .Va namesz and .Va descsz specify the unpadded length. .Pp .Fx defines the following ELF note types .Po with corresponding interpretation of .Va desc Pc : .Bl -tag -width 4n .It Dv NT_FREEBSD_ABI_TAG Pq Value: 1 Indicates the OS ABI version in a form of a 32-bit integer containing expected ABI version .Po i.e., .Dv __FreeBSD_version Pc . .It Dv NT_FREEBSD_NOINIT_TAG Pq Value: 2 Indicates that the C startup does not call initialization routines, and thus .Xr rtld 1 must do so. .Va desc is ignored. .It Dv NT_FREEBSD_ARCH_TAG Pq Value: 3 Contains the MACHINE_ARCH that the executable was built for. .It Dv NT_FREEBSD_FEATURE_CTL Pq Value: 4 Contains a bitmask of mitigations and features to enable: .Bl -tag -width 4n .It NT_FREEBSD_FCTL_ASLR_DISABLE Pq Value: 0x01 Request that address randomization (ASLR) not be performed. See .Xr security 7 . .It NT_FREEBSD_FCTL_PROTMAX_DISABLE Pq Value: 0x02 Request that .Xr mmap 2 calls not set PROT_MAX to the initial value of the .Fa prot argument. .It NT_FREEBSD_FCTL_STKGAP_DISABLE Pq Value: 0x04 Disable stack gap. .It NT_FREEBSD_FCTL_WXNEEDED Pq Value: 0x08 Indicate that the binary requires mappings that are simultaneously writeable and executable. .El .El .Sh SEE ALSO .Xr as 1 , -.Xr gdb 1 , +.Xr gdb 1 Pq Pa ports/devel/gdb , .Xr ld 1 , .Xr objdump 1 , .Xr readelf 1 , .Xr execve 2 , .Xr zlib 3 , .Xr ar 5 , .Xr core 5 .Rs .%A Hewlett Packard .%B Elf-64 Object File Format .Re .Rs .%A Santa Cruz Operation .%B System V Application Binary Interface .Re .Rs .%A Unix System Laboratories .%T Object Files .%B "Executable and Linking Format (ELF)" .Re .Sh HISTORY The ELF header files made their appearance in .Fx 2.2.6 . ELF in itself first appeared in .At V . The ELF format is an adopted standard. .Sh AUTHORS This manual page was written by .An Jeroen Ruigrok van der Werven Aq Mt asmodai@FreeBSD.org with inspiration from BSDi's .Bsx .Nm manpage. diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 473f5b16a30f..d86af5a0f224 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -1,4795 +1,4795 @@ .\" Copyright (c) 1995 .\" Jordan K. Hubbard .\" .\" 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. .\" .\" 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 .\" 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. .\" .\" $FreeBSD$ .\" .Dd July 7, 2022 .Dt RC.CONF 5 .Os .Sh NAME .Nm rc.conf .Nd system configuration information .Sh DESCRIPTION The file .Nm contains descriptive information about the local host name, configuration details for any potential network interfaces and which services should be started up at system initial boot time. In new installations, the .Nm file is generally initialized by the system installation utility. .Pp The purpose of .Nm is not to run commands or perform system startup actions directly. Instead, it is included by the various generic startup scripts in .Pa /etc which conditionalize their internal actions according to the settings found there. .Pp The .Pa /etc/rc.conf file is included from the file .Pa /etc/defaults/rc.conf , which specifies the default settings for all the available options. Options need only be specified in .Pa /etc/rc.conf when the system administrator wishes to override these defaults. The file .Pa /etc/defaults/vendor.conf allows vendors to override .Fx defaults. The file .Pa /etc/rc.conf.local is used to override settings in .Pa /etc/rc.conf for historical reasons. .Pp The sysrc(8) command provides a scripting interface to modify system config files. .Pp In addition to .Pa /etc/rc.conf.local you can also place smaller configuration files for each .Xr rc 8 script in the .Pa /etc/rc.conf.d directory or .Ao Ar dir Ac Ns Pa /rc.conf.d directories specified in .Va local_startup , which will be included by the .Va load_rc_config function. For jail configurations you could use the file .Pa /etc/rc.conf.d/jail to store jail-specific configuration options. If .Va local_startup contains .Pa /usr/local/etc/rc.d and .Pa /opt/conf , .Pa /usr/local/etc/rc.conf.d/jail and .Pa /opt/conf/rc.conf.d/jail will be loaded. If .Ao Ar dir Ac Ns Pa /rc.conf.d/ Ns Ao Ar name Ac is a directory, all of files in the directory will be loaded. Also see the .Va rc_conf_files variable below. .Pp Options are set with .Dq Ar name Ns Li = Ns Ar value assignments that use .Xr sh 1 syntax. The following list provides a name and short description for each variable that can be set in the .Nm file: .Bl -tag -width indent-two .It Va rc_debug .Pq Vt bool If set to .Dq Li YES , enable output of debug messages from rc scripts. This variable can be helpful in diagnosing mistakes when editing or integrating new scripts. Beware that this produces copious output to the terminal and .Xr syslog 3 . .It Va rc_info .Pq Vt bool If set to .Dq Li NO , disable informational messages from the rc scripts. Informational messages are displayed when a condition that is not serious enough to warrant a warning or an error occurs. .It Va rc_startmsgs .Pq Vt bool If set to .Dq Li YES , show .Dq Starting foo: when faststart is used (e.g., at boot time). .It Va early_late_divider .Pq Vt str The name of the script that should be used as the delimiter between the .Dq early and .Dq late stages of the boot process. The early stage should contain all the services needed to get the disks (local or remote) mounted so that the late stage can include scripts contained in the directories listed in the .Va local_startup variable (see below). Thus, the two likely candidates for this value are .Pa mountcritlocal for the typical system, and .Pa mountcritremote if the system needs remote file systems mounted to get access to the .Va local_startup directories; for example when .Pa /usr/local is NFS mounted. For .Pa rc.conf within a .Xr jail 8 .Pa NETWORKING is likely to be an appropriate value. Extreme care should be taken when changing this value, and before changing it one should ensure that there are adequate provisions to recover from a failed boot (such as physical contact with the machine, or reliable remote console access). .It Va always_force_depends .Pq Vt bool Various .Pa rc.d scripts use the force_depend function to check whether required services are already running, and to start them if necessary. By default during boot time this check is bypassed if the required service is enabled in .Pa /etc/rc.conf[.local] . Setting this option will bypass that check at boot time and always test whether or not the service is actually running. Enabling this option is likely to increase your boot time if services are enabled that utilize the force_depend check. .It Ao Ar name Ac Ns Va _chroot .Pq Vt str .Xr chroot 8 to this directory before running the service. .It Ao Ar name Ac Ns Va _fib .Pq Vt int The .Xr setfib 1 value to run the service under. .It Ao Ar name Ac Ns Va _group .Pq Vt str Run the chrooted service under this system group. Unlike the .Ao Ar name Ac Ns Va _user setting, this setting has no effect if the service is not chrooted. .It Ao Ar name Ac Ns Va _limits .Pq Vt str Resource limits to apply to the service using .Xr limits 1 . By default, resource limits are based on the login class defined in .Ao Ar name Ac Ns Va _login_class . .It Ao Ar name Ac Ns Va _login_class .Pq Vt str Login class to be used with .Ao Ar name Ac Ns Va _limits . Defaults to .Dq Li daemon . .It Ao Ar name Ac Ns Va _nice .Pq Vt int The .Xr nice 1 value to run the service under. .It Ao Ar name Ac Ns Va _oomprotect .Pq Vt str Use .Xr protect 1 to prevent the service from being killed when swap space is exhausted. Use .Dq Li YES to protect only the service itself, and .Dq Li ALL to protect the service and all its child processes. .Pp Please note that rc scripts which redefine .Dl ${argument}_cmd .Pq see Xr rc.subr 8 such as PostgreSQL will not inherit the OOM killer protection. .Pp This variable has no effect on services running within a .Xr jail 8 . .It Ao Ar name Ac Ns Va _user .Pq Vt str Run the service under this user account. .It Va apm_enable .Pq Vt bool If set to .Dq Li YES , enable support for Automatic Power Management with the .Xr apm 8 command. .It Va apmd_enable .Pq Vt bool Run .Xr apmd 8 to handle APM event from userland. This also enables support for APM. .It Va apmd_flags .Pq Vt str If .Va apmd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr apmd 8 daemon. .It Va devd_enable .Pq Vt bool Run .Xr devd 8 to handle device added, removed or unknown events from the kernel. .It Va ddb_enable .Pq Vt bool Run .Xr ddb 8 to install .Xr ddb 4 scripts at boot time. .It Va ddb_config .Pq Vt str Configuration file for .Xr ddb 8 . Default .Pa /etc/ddb.conf . .It Va devmatch_enable .Pq Vt bool If set to .Dq Li NO , disable auto-loading of kernel modules with .Xr devmatch 8 . .It Va devmatch_blocklist .Pq Vt str A whitespace-separated list of kernel modules to be ignored by .Xr devmatch 8 . In addition, the .Xr kenv 1 .Va devmatch_blocklist is appended to this variable to allow disabling of .Xr devmatch 8 loaded modules from the boot loader. .It Va devmatch_blacklist .Pq Vt str This variable is deprecated. Use .Va devmatch_blocklist instead. A whitespace-separated list of kernel modules to be ignored by .Xr devmatch 8 . .It Va kld_list .Pq Vt str A whitespace-separated list of kernel modules to load right after the local disks are mounted, without any .Pa .ko extension or path. Loading modules at this point in the boot process is much faster than doing it via .Pa /boot/loader.conf for those modules not necessary for mounting local disks. .It Va kldxref_enable .Pq Vt bool Set to .Dq Li NO by default. Set to .Dq Li YES to automatically rebuild .Pa linker.hints files with .Xr kldxref 8 at boot time. .It Va kldxref_clobber .Pq Vt bool Set to .Dq Li NO by default. If .Va kldxref_enable is true, setting to .Dq Li YES will overwrite existing .Pa linker.hints files at boot time. Otherwise, only missing .Pa linker.hints files are generated. .It Va kldxref_module_path .Pq Vt str Empty by default. A semi-colon .Pq Ql \&; delimited list of paths containing .Xr kld 4 modules. If empty, the contents of the .Va kern.module_path .Xr sysctl 8 are used. .It Va powerd_enable .Pq Vt bool If set to .Dq Li YES , enable the system power control facility with the .Xr powerd 8 daemon. .It Va powerd_flags .Pq Vt str If .Va powerd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr powerd 8 daemon. .It Va tmpmfs Controls the creation of a .Pa /tmp memory file system. Always happens if set to .Dq Li YES and never happens if set to .Dq Li NO . If set to anything else, a memory file system is created if .Pa /tmp is not writable. .It Va tmpsize Controls the size of a created .Pa /tmp memory file system. .It Va tmpmfs_flags Extra options passed to the .Xr mdmfs 8 utility when the memory file system for .Pa /tmp is created. The default is .Dq Li "-S" , which inhibits the use of softupdates on .Pa /tmp so that file system space is freed without delay after file truncation or deletion. See .Xr mdmfs 8 for other options you can use in .Va tmpmfs_flags . .It Va varmfs Controls the creation of a .Pa /var memory file system. Always happens if set to .Dq Li YES and never happens if set to .Dq Li NO . If set to anything else, a memory file system is created if .Pa /var is not writable. .It Va varsize Controls the size of a created .Pa /var memory file system. .It Va varmfs_flags Extra options passed to the .Xr mdmfs 8 utility when the memory file system for .Pa /var is created. The default is .Dq Li "-S" , which inhibits the use of softupdates on .Pa /var so that file system space is freed without delay after file truncation or deletion. See .Xr mdmfs 8 for other options you can use in .Va varmfs_flags . .It Va populate_var Controls the automatic population of the .Pa /var file system. Always happens if set to .Dq Li YES and never happens if set to .Dq Li NO . If set to anything else, a memory file system is created if .Pa /var is not writable. Note that this process requires access to certain commands in .Pa /usr before .Pa /usr is mounted on normal systems. .It Va cleanvar_enable .Pq Vt bool Clean the .Pa /var directory. .It Va local_startup .Pq Vt str List of directories to search for startup script files. .It Va script_name_sep .Pq Vt str The field separator to use for breaking down the list of startup script files into individual filenames. The default is a space. It is not necessary to change this unless there are startup scripts with names containing spaces. .It Va hostapd_enable .Pq Vt bool Set to .Dq Li YES to start .Xr hostapd 8 at system boot time. .It Va hostname .Pq Vt str The fully qualified domain name (FQDN) of this host on the network. This should almost certainly be set to something meaningful, even if there is no network connection. If .Xr dhclient 8 is used to set the hostname via DHCP, this variable should be set to an empty string. Within a .Xr jail 8 the hostname is generally already set and this variable may be absent. If this value remains unset when the system is done booting your console login will display the default hostname of .Dq Amnesiac . .It Va nisdomainname .Pq Vt str The NIS domain name of this host, or .Dq Li NO if NIS is not used. .It Va dhclient_program .Pq Vt str Path to the DHCP client program .Pa ( /sbin/dhclient , the .Ox DHCP client, is the default). .It Va dhclient_flags .Pq Vt str Additional flags to pass to the DHCP client program. For the .Ox DHCP client, see the .Xr dhclient 8 manpage for a description of the command line options available. .It Va dhclient_flags_ Ns Aq Ar iface Additional flags to pass to the DHCP client program running on .Ar iface only. When specified, this variable overrides .Va dhclient_flags . .It Va background_dhclient .Pq Vt bool Set to .Dq Li YES to start the DHCP client in background. This can cause trouble with applications depending on a working network, but it will provide a faster startup in many cases. .It Va background_dhclient_ Ns Aq Ar iface When specified, this variable overrides the .Va background_dhclient variable for interface .Ar iface only. .It Va synchronous_dhclient .Pq Vt bool Set to .Dq Li YES to start .Xr dhclient 8 synchronously at startup. This behavior can be overridden on a per-interface basis by replacing the .Dq Li DHCP keyword in the .Va ifconfig_ Ns Aq Ar interface variable with .Dq Li SYNCDHCP or .Dq Li NOSYNCDHCP . .It Va defaultroute_delay .Pq Vt int When set to a positive value, wait up to this long after configuring DHCP interfaces at startup to give the interfaces time to receive a lease. .It Va firewall_enable .Pq Vt bool Set to .Dq Li YES to load firewall rules at startup. If the kernel was not built with .Cd "options IPFIREWALL" , the .Pa ipfw.ko kernel module will be loaded. See also .Va ipfilter_enable . .It Va firewall_script .Pq Vt str This variable specifies the full path to the firewall script to run. The default is .Pa /etc/rc.firewall . .It Va firewall_type .Pq Vt str Names the firewall type from the selection in .Pa /etc/rc.firewall , or the file which contains the local firewall ruleset. Valid selections from .Pa /etc/rc.firewall are: .Pp .Bl -tag -width ".Li workstation" -compact .It Li open unrestricted IP access .It Li closed all IP services disabled, except via .Dq Li lo0 .It Li client basic protection for a workstation .It Li workstation basic protection for a workstation using stateful firewalling .It Li simple basic protection for a LAN. .El .Pp If a filename is specified, the full path must be given. .Pp Most of the predefined rulesets define additional configuration variables. These are documented in .Pa /etc/rc.firewall . .It Va firewall_quiet .Pq Vt bool Set to .Dq Li YES to disable the display of firewall rules on the console during boot. .It Va firewall_logging .Pq Vt bool Set to .Dq Li YES to enable firewall event logging. This is equivalent to the .Dv IPFIREWALL_VERBOSE kernel option. .It Va firewall_logif .Pq Vt bool Set to .Dq Li YES to create pseudo interface .Li ipfw0 for logging. For more details, see .Xr ipfw 8 manual page. .It Va firewall_flags .Pq Vt str Flags passed to .Xr ipfw 8 if .Va firewall_type specifies a filename. .It Va firewall_coscripts .Pq Vt str List of executables and/or rc scripts to run after firewall starts/stops. Default is empty. .\" ----- firewall_nat_enable setting -------------------------------- .It Va firewall_nat_enable .Pq Vt bool The .Xr ipfw 8 equivalent of .Va natd_enable . Setting this to .Dq Li YES will automatically load the .Xr ipfw 8 NAT kernel module if .Va firewall_enable is also set to .Dq Li YES . .It Va firewall_nat_interface .Pq Vt str The .Xr ipfw 8 equivalent of .Va natd_interface . This is the name of the public interface or IP address on which kernel NAT should run. .It Va firewall_nat_flags .Pq Vt str Additional configuration parameters for kernel NAT should be placed here. .It Va firewall_nat64_enable .Pq Vt bool Setting this to .Dq Li YES will automatically load the .Xr ipfw 8 NAT64 kernel module if .Va firewall_enable is also set to .Dq Li YES . .It Va firewall_nptv6_enable .Pq Vt bool Setting this to .Dq Li YES will automatically load the .Xr ipfw 8 NPTv6 kernel module if .Va firewall_enable is also set to .Dq Li YES . .It Va firewall_pmod_enable .Pq Vt bool Setting this to .Dq Li YES will automatically load the .Xr ipfw 8 pmod kernel module if .Va firewall_enable is also set to .Dq Li YES . .It Va dummynet_enable .Pq Vt bool Setting this to .Dq Li YES will automatically load the .Xr dummynet 4 module if .Va firewall_enable is also set to .Dq Li YES . .\" ------------------------------------------------------------------- .It Va ipfw_netflow_enable .Pq Vt bool Setting this to .Dq Li YES will enable netflow logging via .Xr ng_netflow 4 .Pp By default a ipfw rule is inserted and all packets are duplicated with the ngtee command and netflow packets are sent to 127.0.0.1 on the netflow port using protocol version 5. .It Va ipfw_netflow_hook .Pq Vt int netflow hook name, must be numerical (default .Pa 9995 ) . .It Va ipfw_netflow_rule .Pq Vt int ipfw rule number (default .Pa 1000 ) . .It Va ipfw_netflow_ip .Pq Vt str Destination server ip for receiving netflow data (default .Pa 127.0.0.1 ) . .It Va ipfw_netflow_port .Pq Vt int Destination server port for receiving netflow data (default .Pa 9995 ) . .It Va ipfw_netflow_version .Pq Vt int Do not set for using version 5 of the netflow protocol, set it to 9 for using version 9. .It Va ipfw_netflow_fib .Pq Vt int Only match packet in FIB .Pa ipfw_netflow_fib (default is undefined meaning all FIBs). .It Va natd_program .Pq Vt str Path to .Xr natd 8 . .It Va natd_enable .Pq Vt bool Set to .Dq Li YES to enable .Xr natd 8 . .Va firewall_enable must also be set to .Dq Li YES , and .Xr divert 4 sockets must be enabled in the kernel. If the kernel was not built with .Cd "options IPDIVERT" , the .Pa ipdivert.ko kernel module will be loaded. .It Va natd_interface .Pq Vt str This is the name of the public interface on which .Xr natd 8 should run. The interface may be given as an interface name or as an IP address. .It Va natd_flags .Pq Vt str Additional .Xr natd 8 flags should be placed here. The .Fl n or .Fl a flag is automatically added with the above .Va natd_interface as an argument. .\" ----- ipfilter_enable setting -------------------------------- .It Va ipfilter_enable .Pq Vt bool Set to .Dq Li NO by default. Setting this to .Dq Li YES enables .Xr ipf 8 packet filtering. .Pp Typical usage will require putting .Bd -literal ipfilter_enable="YES" ipnat_enable="YES" ipmon_enable="YES" ipfs_enable="YES" .Ed .Pp into .Pa /etc/rc.conf and editing .Pa /etc/ipf.rules and .Pa /etc/ipnat.rules appropriately. .Pp Note that .Va ipfilter_enable and .Va ipnat_enable can be enabled independently. .Va ipmon_enable and .Va ipfs_enable both require at least one of .Va ipfilter_enable and .Va ipnat_enable to be enabled. .Pp Having .Bd -literal options IPFILTER options IPFILTER_LOG options IPFILTER_DEFAULT_BLOCK .Ed .Pp in the kernel configuration file is a good idea, too. .\" ----- ipfilter_program setting ------------------------------ .It Va ipfilter_program .Pq Vt str Path to .Xr ipf 8 (default .Pa /sbin/ipf ) . .\" ----- ipfilter_rules setting -------------------------------- .It Va ipfilter_rules .Pq Vt str Set to .Pa /etc/ipf.rules by default. This variable contains the name of the filter rule definition file. The file is expected to be readable for the .Xr ipf 8 command to execute. .\" ----- ipfilter_flags setting -------------------------------- .It Va ipfilter_flags .Pq Vt str Empty by default. This variable contains flags passed to the .Xr ipf 8 program. .\" ----- ipnat_enable setting ---------------------------------- .It Va ipnat_enable .Pq Vt bool Set to .Dq Li NO by default. Set it to .Dq Li YES to enable .Xr ipnat 8 network address translation. See .Va ipfilter_enable for a detailed discussion. .\" ----- ipnat_program setting --------------------------------- .It Va ipnat_program .Pq Vt str Path to .Xr ipnat 8 (default .Pa /sbin/ipnat ) . .\" ----- ipnat_rules setting ----------------------------------- .It Va ipnat_rules .Pq Vt str Set to .Pa /etc/ipnat.rules by default. This variable contains the name of the file holding the network address translation definition. This file is expected to be readable for the .Xr ipnat 8 command to execute. .\" ----- ipnat_flags setting ----------------------------------- .It Va ipnat_flags .Pq Vt str Empty by default. This variable contains flags passed to the .Xr ipnat 8 program. .\" ----- ipmon_enable setting ---------------------------------- .It Va ipmon_enable .Pq Vt bool Set to .Dq Li NO by default. Set it to .Dq Li YES to enable .Xr ipmon 8 monitoring (logging .Xr ipf 8 and .Xr ipnat 8 events). Setting this variable needs setting .Va ipfilter_enable or .Va ipnat_enable too. See .Va ipfilter_enable for a detailed discussion. .\" ----- ipmon_program setting --------------------------------- .It Va ipmon_program .Pq Vt str Path to .Xr ipmon 8 (default .Pa /sbin/ipmon ) . .\" ----- ipmon_flags setting ----------------------------------- .It Va ipmon_flags .Pq Vt str Set to .Dq Li -Ds by default. This variable contains flags passed to the .Xr ipmon 8 program. Another typical example would be .Dq Fl D Pa /var/log/ipflog to have .Xr ipmon 8 log directly to a file bypassing .Xr syslogd 8 . Make sure to adjust .Pa /etc/newsyslog.conf in such case like this: .Bd -literal /var/log/ipflog 640 10 100 * Z /var/run/ipmon.pid .Ed .\" ----- ipfs_enable setting ----------------------------------- .It Va ipfs_enable .Pq Vt bool Set to .Dq Li NO by default. Set it to .Dq Li YES to enable .Xr ipfs 8 saving the filter and NAT state tables during shutdown and reloading them during startup again. Setting this variable needs setting .Va ipfilter_enable or .Va ipnat_enable to .Dq Li YES too. See .Va ipfilter_enable for a detailed discussion. Note that if .Va kern_securelevel is set to 3, .Va ipfs_enable cannot be used because the raised securelevel will prevent .Xr ipfs 8 from saving the state tables at shutdown time. .\" ----- ipfs_program setting ---------------------------------- .It Va ipfs_program .Pq Vt str Path to .Xr ipfs 8 (default .Pa /sbin/ipfs ) . .\" ----- ipfs_flags setting ------------------------------------ .It Va ipfs_flags .Pq Vt str Empty by default. This variable contains flags passed to the .Xr ipfs 8 program. .\" ----- end of added ipf hook --------------------------------- .It Va pf_enable .Pq Vt bool Set to .Dq Li NO by default. Setting this to .Dq Li YES enables .Xr pf 4 packet filtering. .Pp Typical usage will require putting .Pp .Dl pf_enable="YES" .Pp into .Pa /etc/rc.conf and editing .Pa /etc/pf.conf appropriately. Adding .Pp .Dl "device pf" .Pp builds support for .Xr pf 4 into the kernel, otherwise the kernel module will be loaded. .It Va pf_rules .Pq Vt str Path to .Xr pf 4 ruleset configuration file (default .Pa /etc/pf.conf ) . .It Va pf_program .Pq Vt str Path to .Xr pfctl 8 (default .Pa /sbin/pfctl ) . .It Va pf_flags .Pq Vt str If .Va pf_enable is set to .Dq Li YES , these flags are passed to the .Xr pfctl 8 program when loading the ruleset. .It Va pf_fallback_rules_enable .Pq Vt bool Set to .Dq Li NO by default. Setting this to .Dq Li YES enables loading .Va pf_fallback_rules_file or .Va pf_fallback_rules in case of a problem when loading the ruleset in .Va pf_rules . .It Va pf_fallback_rules_file .Pq Vt str Path to a pf ruleset to load in case of failure when loading the ruleset in .Va pf_rules (default .Pa /etc/pf-fallback.conf ) . .It Va pf_fallback_rules .Pq Vt str A pf ruleset to load in case of failure when loading the ruleset in .Va pf_rules and .Va pf_fallback_rules_file is not found. Multiple rules can be set as follows: .Bd -literal pf_fallback_rules="\\ block drop log all\\ pass in quick on em0" .Pp .Ed The default fallback rule is .Dq block drop log all .It Va pflog_enable .Pq Vt bool Set to .Dq Li NO by default. Setting this to .Dq Li YES enables .Xr pflogd 8 which logs packets from the .Xr pf 4 packet filter. .It Va pflog_logfile .Pq Vt str If .Va pflog_enable is set to .Dq Li YES this controls where .Xr pflogd 8 stores the logfile (default .Pa /var/log/pflog ) . Check .Pa /etc/newsyslog.conf to adjust logfile rotation for this. .It Va pflog_program .Pq Vt str Path to .Xr pflogd 8 (default .Pa /sbin/pflogd ) . .It Va pflog_flags .Pq Vt str Empty by default. This variable contains additional flags passed to the .Xr pflogd 8 program. .It Va pflog_instances .Pq Vt str If logging to more than one .Xr pflog 4 interface is desired, .Va pflog_instances is set to the list of .Xr pflogd 8 instances that should be started at system boot time. If .Va pflog_instances is set, for each whitespace-separated .Ar element in the list, .Ao Ar element Ac Ns Va _dev and .Ao Ar element Ac Ns Va _logfile elements are assumed to exist. .Ao Ar element Ac Ns Va _dev must contain the .Xr pflog 4 interface to be watched by the named .Xr pflogd 8 instance. .Ao Ar element Ac Ns Va _logfile must contain the name of the logfile that will be used by the .Xr pflogd 8 instance. .It Va ftpproxy_enable .Pq Vt bool Set to .Dq Li NO by default. Setting this to .Dq Li YES enables .Xr ftp-proxy 8 which supports the .Xr pf 4 packet filter in translating ftp connections. .It Va ftpproxy_flags .Pq Vt str Empty by default. This variable contains additional flags passed to the .Xr ftp-proxy 8 program. .It Va ftpproxy_instances .Pq Vt str Empty by default. If multiple instances of .Xr ftp-proxy 8 are desired at boot time, .Va ftpproxy_instances should contain a whitespace-separated list of instance names. For each .Ar element in the list, a variable named .Ao Ar element Ac Ns Va _flags should be defined, containing the command-line flags to be passed to the .Xr ftp-proxy 8 instance. .It Va pfsync_enable .Pq Vt bool Set to .Dq Li NO by default. Setting this to .Dq Li YES enables exposing .Xr pf 4 state changes to other hosts over the network by means of .Xr pfsync 4 . The .Va pfsync_syncdev variable must also be set then. .It Va pfsync_syncdev .Pq Vt str Empty by default. This variable specifies the name of the network interface .Xr pfsync 4 should operate through. It must be set accordingly if .Va pfsync_enable is set to .Dq Li YES . .It Va pfsync_syncpeer .Pq Vt str Empty by default. This variable is optional. By default, state change messages are sent out on the synchronisation interface using IP multicast packets. The protocol is IP protocol 240, PFSYNC, and the multicast group used is 224.0.0.240. When a peer address is specified using the .Va pfsync_syncpeer option, the peer address is used as a destination for the pfsync traffic, and the traffic can then be protected using .Xr ipsec 4 . See the .Xr pfsync 4 manpage for more details about using .Xr ipsec 4 with .Xr pfsync 4 interfaces. .It Va pfsync_ifconfig .Pq Vt str Empty by default. This variable can contain additional options to be passed to the .Xr ifconfig 8 command used to set up .Xr pfsync 4 . .It Va tcp_extensions .Pq Vt bool Set to .Dq Li YES by default. Setting this to .Dq Li NO disables certain TCP options as described by .Rs .%T "RFC 1323" .Re Setting this to .Dq Li NO might help remedy such problems with connections as randomly hanging or other weird behavior. Some network devices are known to be broken with respect to these options. .It Va log_in_vain .Pq Vt int Set to 0 by default. The .Xr sysctl 8 variables, .Va net.inet.tcp.log_in_vain and .Va net.inet.udp.log_in_vain , as described in .Xr tcp 4 and .Xr udp 4 , are set to the given value. .It Va tcp_keepalive .Pq Vt bool Set to .Dq Li YES by default. Setting to .Dq Li NO will disable probing idle TCP connections to verify that the peer is still up and reachable. .It Va tcp_drop_synfin .Pq Vt bool Set to .Dq Li NO by default. Setting to .Dq Li YES will cause the kernel to ignore TCP frames that have both the SYN and FIN flags set. This prevents OS fingerprinting, but may break some legitimate applications. .It Va icmp_drop_redirect .Pq Vt bool Set to .Dq Li AUTO by default. This setting will be identical to .Dq Li YES , if a dynamicrouting daemon is enabled, because redirect processing may cause performance issues for large routing tables. If no such service is enabled, this setting behaves like a .Dq Li NO . Setting to .Dq Li YES will cause the kernel to ignore ICMP REDIRECT packets. Setting to .Dq Li NO will cause the kernel to process ICMP REDIRECT packets. Refer to .Xr icmp 4 for more information. .It Va icmp_log_redirect .Pq Vt bool Set to .Dq Li NO by default. Setting to .Dq Li YES will cause the kernel to log ICMP REDIRECT packets. Note that the log messages are not rate-limited, so this option should only be used for troubleshooting networks. Refer to .Xr icmp 4 for more information. .It Va icmp_bmcastecho .Pq Vt bool Set to .Dq Li YES to respond to broadcast or multicast ICMP ping packets. Refer to .Xr icmp 4 for more information. .It Va ip_portrange_first .Pq Vt int If not set to .Dq Li NO , this is the first port in the default portrange. Refer to .Xr ip 4 for more information. .It Va ip_portrange_last .Pq Vt int If not set to .Dq Li NO , this is the last port in the default portrange. Refer to .Xr ip 4 for more information. .It Va network_interfaces .Pq Vt str Set to the list of network interfaces to configure on this host or .Dq Li AUTO (the default) for all current interfaces. Setting the .Va network_interfaces variable to anything other than the default is deprecated. Interfaces that the administrator wishes to store configuration for, but not start at boot should be configured with the .Dq Li NOAUTO keyword in their .Va ifconfig_ Ns Aq Ar interface variables as described below. .Pp An .Va ifconfig_ Ns Aq Ar interface variable is also assumed to exist for each value of .Ar interface . When an interface name contains any of the characters .Dq Li .-/+ they are translated to .Dq Li _ before lookup. The variable can contain arguments to .Xr ifconfig 8 , as well as special case-insensitive keywords described below. Such keywords are removed before passing the value to .Xr ifconfig 8 while the order of the other arguments is preserved. .Pp It is possible to add IP alias entries using .Xr ifconfig 8 syntax with the address family keyword such as .Li inet . Assuming that the interface in question was .Li em0 , it might look something like this: .Bd -literal ifconfig_em0_alias0="inet 127.0.0.253 netmask 0xffffffff" ifconfig_em0_alias1="inet 127.0.0.254 netmask 0xffffffff" .Ed .Pp It also possible to configure multiple IP addresses in Classless Inter-Domain Routing .Pq CIDR address notation, whose each address component can be a range like .Li inet 192.0.2.5-23/24 or .Li inet6 2001:db8:1-f::1/64 . This notation allows address and prefix length part only, not the other address modifiers. Note that the maximum number of the generated addresses from a range specification is limited to an integer value specified in .Va netif_ipexpand_max in .Nm because a small typo can unexpectedly generate a large number of addresses. The default value is .Li 2048 . It can be increased by adding the following line into .Nm : .Bd -literal netif_ipexpand_max="4096" .Ed .Pp In the case of .Li 192.0.2.5-23/24 , the address 192.0.2.5 will be configured with the netmask /24 and the addresses 192.0.2.6 to 192.0.2.23 with the non-conflicting netmask /32 as explained in the .Xr ifconfig 8 alias section. Note that this special netmask handling is only for .Li inet , not for the other address families such as .Li inet6 . .Pp With the interface in question being .Li em0 , an example could look like: .Bd -literal ifconfig_em0_alias2="inet 192.0.2.129/27" ifconfig_em0_alias3="inet 192.0.2.1-5/28" .Ed .Pp and so on. .Pp Note that deprecated .Va ipv4_addrs_ Ns Aq Ar interface variable was supported for IPv4 CIDR address notation. The .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n variable replaces it, though .Va ipv4_addrs_ Ns Aq Ar interface is still supported for backward compatibility. .Pp For each .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n entry with an address family keyword, its contents are passed to .Xr ifconfig 8 . Execution stops at the first unsuccessful access, so if something like this is present: .Bd -literal ifconfig_em0_alias0="inet 127.0.0.251 netmask 0xffffffff" ifconfig_em0_alias1="inet 127.0.0.252 netmask 0xffffffff" ifconfig_em0_alias2="inet 127.0.0.253 netmask 0xffffffff" ifconfig_em0_alias4="inet 127.0.0.254 netmask 0xffffffff" .Ed .Pp Then note that alias4 would .Em not be added since the search would stop with the missing .Dq Li alias3 entry. Because of this difficult to manage behavior, there is .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _aliases variable, which has the same functionality as .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n and can have all of entries in a variable like the following: .Bd -literal ifconfig_em0_aliases="\\ inet 127.0.0.251 netmask 0xffffffff \\ inet 127.0.0.252 netmask 0xffffffff \\ inet 127.0.0.253 netmask 0xffffffff \\ inet 127.0.0.254 netmask 0xffffffff" .Ed .Pp It also supports CIDR notation. .Pp If the .Pa /etc/start_if . Ns Aq Ar interface file is present, it is read and executed by the .Xr sh 1 interpreter before configuring the interface as specified in the .Va ifconfig_ Ns Aq Ar interface and .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n variables. .Pp If a .Va vlans_ Ns Aq Ar interface variable is set, a .Xr vlan 4 interface will be created for each item in the list with the .Ar vlandev argument set to .Ar interface . If a vlan interface's name is a number, then that number is used as the vlan tag and the new vlan interface is named .Ar interface . Ns Ar tag . Otherwise, the vlan tag must be specified via a .Va vlan parameter in the .Va create_args_ Ns Aq Ar interface variable. .Pp To create a vlan device named .Li em0.101 on .Li em0 with the vlan tag 101 and the optional the IPv4 address 192.0.2.1/24: .Bd -literal vlans_em0="101" ifconfig_em0_101="inet 192.0.2.1/24" .Ed .Pp To create a vlan device named .Li myvlan on .Li em0 with the vlan tag 102: .Bd -literal vlans_em0="myvlan" create_args_myvlan="vlan 102" .Ed .Pp If a .Va wlans_ Ns Aq Ar interface variable is set, an .Xr wlan 4 interface will be created for each item in the list with the .Ar wlandev argument set to .Ar interface . Further wlan cloning arguments may be passed to the .Xr ifconfig 8 .Cm create command by setting the .Va create_args_ Ns Aq Ar interface variable. One or more .Xr wlan 4 devices must be created for each wireless devices as of .Fx 8.0 . Debugging flags for .Xr wlan 4 devices as set by .Xr wlandebug 8 may be specified with an .Va wlandebug_ Ns Aq Ar interface variable. The contents of this variable will be passed directly to .Xr wlandebug 8 . .Pp If the .Va ifconfig_ Ns Aq Ar interface contains the keyword .Dq Li NOAUTO then the interface will not be configured at boot or by .Pa /etc/pccard_ether when .Va network_interfaces is set to .Dq Li AUTO . .Pp It is possible to bring up an interface with DHCP by adding .Dq Li DHCP to the .Va ifconfig_ Ns Aq Ar interface variable. For instance, to initialize the .Li em0 device via DHCP, it is possible to use something like: .Bd -literal ifconfig_em0="DHCP" .Ed .Pp If you want to configure your wireless interface with .Xr wpa_supplicant 8 for use with WPA, EAP/LEAP or WEP, you need to add .Dq Li WPA to the .Va ifconfig_ Ns Aq Ar interface variable. .Pp On the other hand, if you want to configure your wireless interface with .Xr hostapd 8 , you need to add .Dq Li HOSTAP to the .Va ifconfig_ Ns Aq Ar interface variable. .Xr hostapd 8 will use the settings from .Pa /etc/hostapd- Ns Ao Ar interface Ac Ns .conf .Pp Finally, you can add .Xr ifconfig 8 options in this variable, in addition to the .Pa /etc/start_if . Ns Aq Ar interface file. For instance, to configure an .Xr ath 4 wireless device in station mode with an address obtained via DHCP, using WPA authentication and 802.11b mode, it is possible to use something like: .Bd -literal wlans_ath0="wlan0" ifconfig_wlan0="DHCP WPA mode 11b" .Ed .Pp In addition to the .Va ifconfig_ Ns Aq Ar interface form, a fallback variable .Va ifconfig_DEFAULT may be configured. It will be used for all interfaces with no .Va ifconfig_ Ns Aq Ar interface variable. This is intended to replace the no longer supported .Va pccard_ifconfig variable. .Pp It is also possible to rename an interface by doing: .Bd -literal ifconfig_em0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" .Ed .It Va ipv6_enable .Pq Vt bool This variable is deprecated. Use .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 and .Va ipv6_activate_all_interfaces if necessary. .Pp If the variable is .Dq Li YES , .Dq Li inet6 accept_rtadv is added to all of .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 and the .Va ipv6_activate_all_interfaces is defined as .Dq Li YES . .It Va ipv6_prefer .Pq Vt bool This variable is deprecated. Use .Va ip6addrctl_policy instead. .Pp If the variable is .Dq Li YES , the default address selection policy table set by .Xr ip6addrctl 8 will be IPv6-preferred. .Pp If the variable is .Dq Li NO , the default address selection policy table set by .Xr ip6addrctl 8 will be IPv4-preferred. .It Va ipv6_activate_all_interfaces .Pq Vt bool This controls initial configuration on IPv6-capable interfaces with no corresponding .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 variable. Note that it is not always necessary to set this variable to .Dq YES to use IPv6 functionality on .Fx . In most cases, just configuring .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 variables works. .Pp If the variable is .Dq Li NO , all interfaces which do not have a corresponding .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 variable will be marked as .Dq Li IFDISABLED at creation. This means that all of IPv6 functionality on that interface is completely disabled to enforce a security policy. If the variable is set to .Dq YES , the flag will be cleared on all of the interfaces. .Pp In most cases, just defining an .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 for an IPv6-capable interface should be sufficient. However, if an interface is added dynamically .Pq by some tunneling protocols such as PPP, for example , it is often difficult to define the variable in advance. In such a case, configuring the .Dq Li IFDISABLED flag can be disabled by setting this variable to .Dq YES . .Pp For more details of the .Dq Li IFDISABLED flag and keywords .Dq Li inet6 ifdisabled , see .Xr ifconfig 8 . .Pp Default is .Dq Li NO . .It Va ipv6_privacy .Pq Vt bool If the variable is .Dq Li YES privacy addresses will be generated for each IPv6 interface as described in RFC 4941. .It Va ipv6_network_interfaces .Pq Vt str This is the IPv6 equivalent of .Va network_interfaces . Normally manual configuration of this variable is not needed. .It Va ipv6_cpe_wanif .Pq Vt str If the variable is set to an interface name, the .Xr ifconfig 8 options .Dq inet6 -no_radr accept_rtadv will be added to the specified interface automatically before evaluating .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 , and two .Xr sysctl 8 variables .Va net.inet6.ip6.rfc6204w3 and .Va net.inet6.ip6.no_radr will be set to 1. .Pp This means the specified interface will accept ICMPv6 Router Advertisement messages on that link and add the discovered routers into the Default Router List. While the other interfaces can still accept RA messages if the .Dq inet6 accept_rtadv option is specified, adding routes into the Default Router List will be disabled by .Dq inet6 no_radr option by default. See .Xr ifconfig 8 for more details. .Pp Note that ICMPv6 Router Advertisement messages will be accepted even when .Va net.inet6.ip6.forwarding is 1 .Pq packet forwarding is enabled when .Va net.inet6.ip6.rfc6204w3 is set to 1. .Pp Default is .Dq Li NO . .It Va ifconfig_ Ns Ao Ar interface Ac Ns _descr .Pq Vt str This assigns arbitrary description to an interface. The .Xr sysctl 8 variable .Va net.ifdescr_maxlen limits its length. This static setting may be overridden by commands started with dynamic interface configuration utilities like .Xr dhclient 8 hooks. The description can be seen with .Xr ifconfig 8 command and it may be exported with .Xr bsnmpd 1 daemon using its MIB-2 module. .It Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 .Pq Vt str IPv6 functionality on an interface should be configured by .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 , instead of setting ifconfig parameters in .Va ifconfig_ Ns Aq Ar interface . If this variable is empty, all of IPv6 configurations on the specified interface by other variables such as .Va ipv6_prefix_ Ns Ao Ar interface Ac will be ignored. .Pp Aliases should be set by .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n with .Dq Li inet6 keyword. For example: .Bd -literal ifconfig_em0_ipv6="inet6 2001:db8:1::1 prefixlen 64" ifconfig_em0_alias0="inet6 2001:db8:2::1 prefixlen 64" .Ed .Pp Interfaces that have an .Dq Li inet6 accept_rtadv keyword in .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 setting will be automatically configured by SLAAC .Pq StateLess Address AutoConfiguration described in .Rs .%T "RFC 4862" .Re .Pp Note that a link-local address will be automatically configured in addition to the configured global-scope addresses because the IPv6 specifications require it on each link. The address is calculated from the MAC address by using an algorithm defined in .Rs .%T "RFC 4862" .%O "Section 5.3" .Re .Pp If only a link-local address is needed on the interface, the following configuration can be used: .Bd -literal ifconfig_em0_ipv6="inet6 auto_linklocal" .Ed .Pp A link-local address can also be configured manually. This is useful for the default router address of an IPv6 router so that it does not change when the network interface card is replaced. For example: .Bd -literal ifconfig_em0_ipv6="inet6 fe80::1 prefixlen 64" .Ed .It Va ipv6_prefix_ Ns Aq Ar interface .Pq Vt str If one or more prefixes are defined in .Va ipv6_prefix_ Ns Aq Ar interface addresses based on each prefix and the EUI-64 interface index will be configured on that interface. Note that this variable will be ignored when .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 is empty. .Pp For example, the following configuration .Bd -literal ipv6_prefix_em0="2001:db8:1:0 2001:db8:2:0" .Ed .Pp is equivalent to the following: .Bd -literal ifconfig_em0_alias0="inet6 2001:db8:1:: eui64 prefixlen 64" ifconfig_em0_alias1="inet6 2001:db8:1:: prefixlen 64 anycast" ifconfig_em0_alias2="inet6 2001:db8:2:: eui64 prefixlen 64" ifconfig_em0_alias3="inet6 2001:db8:2:: prefixlen 64 anycast" .Ed .Pp These Subnet-Router anycast addresses will be added only when .Va ipv6_gateway_enable is YES. .It Va ipv6_default_interface .Pq Vt str If not set to .Dq Li NO , this is the default output interface for scoped addresses. This works only with ipv6_gateway_enable="NO". .It Va ip6addrctl_enable .Pq Vt bool This variable is to enable configuring default address selection policy table .Pq RFC 3484 . The table can be specified in another variable .Va ip6addrctl_policy . For .Va ip6addrctl_policy the following keywords can be specified: .Dq Li ipv4_prefer , .Dq Li ipv6_prefer , or .Dq Li AUTO . .Pp If .Dq Li ipv4_prefer or .Dq Li ipv6_prefer is specified, .Xr ip6addrctl 8 installs a pre-defined policy table described in Section 10.3 .Pq IPv4-preferred or 2.1 .Pq IPv6-preferred of RFC 3484. .Pp If .Dq Li AUTO is specified, it attempts to read a file .Pa /etc/ip6addrctl.conf first. If this file is found, .Xr ip6addrctl 8 reads and installs it. If not found, a policy is automatically set according to .Va ipv6_activate_all_interfaces variable; if the variable is set to .Dq Li YES the IPv6-preferred one is used. Otherwise IPv4-preferred. .Pp The default value of .Va ip6addrctl_enable and .Va ip6addrctl_policy are .Dq Li YES and .Dq Li AUTO , respectively. .It Va cloned_interfaces .Pq Vt str Set to the list of clonable network interfaces to create on this host. Further cloning arguments may be passed to the .Xr ifconfig 8 .Cm create command for each interface by setting the .Va create_args_ Ns Aq Ar interface variable. If an interface name is specified with .Dq :sticky keyword, the interface will not be destroyed even when .Pa rc.d/netif script is invoked with .Dq stop argument. This is useful when reconfiguring the interface without destroying it. Entries in .Va cloned_interfaces are automatically appended to .Va network_interfaces for configuration. .It Va cloned_interfaces_sticky .Pq Vt bool This variable is to globally enable functionality of .Dq :sticky keyword in .Va cloned_interfaces for all interfaces. The default value is .Dq NO . Even if this variable is specified to .Dq YES , .Dq :nosticky keyword can be used to override it on per interface basis. .It Va gif_interfaces Set to the list of .Xr gif 4 tunnel interfaces to configure on this host. A .Va gifconfig_ Ns Aq Ar interface variable is assumed to exist for each value of .Ar interface . The value of this variable is used to configure the link layer of the tunnel using the .Cm tunnel option to .Xr ifconfig 8 . Additionally, this option ensures that each listed interface is created via the .Cm create option to .Xr ifconfig 8 before attempting to configure it. .Pp For example, configure two .Xr gif 4 interfaces with: .Bd -literal gif_interfaces="gif0 gif1" gifconfig_gif0="100.64.0.1 100.64.0.2" ifconfig_gif0="inet 10.0.0.1 10.0.0.2 netmask 255.255.255.252" gifconfig_gif1="inet6 2a00::1 2a01::1" ifconfig_gif1="inet 10.1.0.1 10.1.0.2 netmask 255.255.255.252" .Ed .It Va ppp_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr ppp 8 daemon. .It Va ppp_profile .Pq Vt str The name of the profile to use from .Pa /etc/ppp/ppp.conf . Also used for per-profile overrides of .Va ppp_mode and .Va ppp_nat , and .Va ppp_ Ns Ao Ar profile Ac Ns _unit . When the profile name contains any of the characters .Dq Li .-/+ they are translated to .Dq Li _ for the proposes of the override variable names. .It Va ppp_mode .Pq Vt str Mode in which to run the .Xr ppp 8 daemon. .It Va ppp_ Ns Ao Ar profile Ac Ns _mode .Pq Vt str Overrides the global .Va ppp_mode for .Ar profile . Accepted modes are .Dq Li auto , .Dq Li ddial , .Dq Li direct and .Dq Li dedicated . See the manual for a full description. .It Va ppp_nat .Pq Vt bool If set to .Dq Li YES , enables network address translation. Used in conjunction with .Va gateway_enable allows hosts on private network addresses access to the Internet using this host as a network address translating router. Default is .Dq Li YES . .It Va ppp_ Ns Ao Ar profile Ac Ns _nat .Pq Vt str Overrides the global .Va ppp_nat for .Ar profile . .It Va ppp_ Ns Ao Ar profile Ac Ns _unit .Pq Vt int Set the unit number to be used for this profile. See the manual description of .Fl unit Ns Ar N for details. .It Va ppp_user .Pq Vt str The name of the user under which .Xr ppp 8 should be started. By default, .Xr ppp 8 is started as .Dq Li root . .It Va rc_conf_files .Pq Vt str This option is used to specify a list of files that will override the settings in .Pa /etc/defaults/rc.conf . The files will be read in the order in which they are specified and should include the full path to the file. By default, the files specified are .Pa /etc/rc.conf and .Pa /etc/rc.conf.local .It Va zfs_enable .Pq Vt bool If set to .Dq Li YES , .Pa /etc/rc.d/zfs will attempt to automatically mount ZFS file systems and initialize ZFS volumes (ZVOLs). .It Va zpool_reguid .Pq Vt str A space-separated list of ZFS pool names for which new pool GUIDs should be assigned upon first boot. This is useful when using a ZFS pool copied from a template, such as a virtual machine image. .It Va gptboot_enable .Pq Vt bool If set to .Dq Li YES , .Pa /etc/rc.d/gptboot will log if the system successfully (or not) booted from a GPT partition, which had the .Ar bootonce attribute set using .Xr gpart 8 utility. .It Va gbde_autoattach_all .Pq Vt bool If set to .Dq Li YES , .Pa /etc/rc.d/gbde will attempt to automatically initialize your .bde devices in .Pa /etc/fstab . .It Va gbde_devices .Pq Vt str List the devices that the script should try to attach, or .Dq Li AUTO . .It Va gbde_lockdir .Pq Vt str The directory where the .Xr gbde 4 lockfiles are located. The default lockfile directory is .Pa /etc . .Pp The lockfile for each individual .Xr gbde 4 device can be overridden by setting the variable .Va gbde_lock_ Ns Aq Ar device , where .Ar device is the encrypted device without the .Dq Pa /dev/ and .Dq Pa .bde parts. .It Va gbde_attach_attempts .Pq Vt int Number of times to attempt attaching to a .Xr gbde 4 device, i.e., how many times the user is asked for the pass-phrase. Default is 3. .It Va geli_devices .Pq Vt str List of devices to automatically attach on boot. Note that .eli devices from .Pa /etc/fstab are automatically appended to this list. .It Va geli_groups .Pq Vt str List of groups containing devices to automatically attach on boot with the same keyfiles and passphrase. This must be accompanied with a corresponding .Va geli_ Ns Ao Ar group Ac Ns Va _devices variable. .It Va geli_tries .Pq Vt int Number of times user is asked for the pass-phrase. If empty, it will be taken from .Va kern.geom.eli.tries sysctl variable. .It Va geli_default_flags .Pq Vt str Default flags to use by .Xr geli 8 when configuring disk encryption. Flags can be configured for every device separately by defining the .Va geli_ Ns Ao Ar device Ac Ns Va _flags variable, and for every group separately by defining the .Va geli_ Ns Ao Ar group Ac Ns Va _flags variable. .It Va geli_autodetach .Pq Vt str Specifies if GELI devices should be marked for detach on last close after file systems are mounted. Default is .Dq Li YES . This can be changed for every device separately by defining the .Va geli_ Ns Ao Ar device Ac Ns Va _autodetach variable. .It Va root_rw_mount .Pq Vt bool Set to .Dq Li YES by default. After the file systems are checked at boot time, the root file system is remounted as read-write if this is set to .Dq Li YES . Diskless systems that mount their root file system from a read-only remote NFS share should set this to .Dq Li NO in their .Pa rc.conf . .It Va fsck_y_enable .Pq Vt bool If set to .Dq Li YES , .Xr fsck 8 will be run with the .Fl y flag if the initial preen of the file systems fails. .It Va background_fsck .Pq Vt bool If set to .Dq Li NO , the system will not attempt to run .Xr fsck 8 in the background where possible. .It Va background_fsck_delay .Pq Vt int The amount of time in seconds to sleep before starting a background .Xr fsck 8 . It defaults to sixty seconds to allow large applications such as the X server to start before disk I/O bandwidth is monopolized by .Xr fsck 8 . If set to a negative number, the background file system check will be delayed indefinitely to allow the administrator to run it at a more convenient time. For example it may be run from .Xr cron 8 by adding a line like .Pp .Dl "0 4 * * * root /etc/rc.d/bgfsck forcestart" .Pp to .Pa /etc/crontab . .It Va netfs_types .Pq Vt str List of file system types that are network-based. This list should generally not be modified by end users. Use .Va extra_netfs_types instead. .It Va extra_netfs_types .Pq Vt str If set to something other than .Dq Li NO (the default), this variable extends the list of file system types for which automatic mounting at startup by .Xr rc 8 should be delayed until the network is initialized. It should contain a whitespace-separated list of network file system descriptor pairs, each consisting of a file system type as passed to .Xr mount 8 and a human-readable, one-word description, joined with a colon .Pq Ql \&: . Extending the default list in this way is only necessary when third party file system types are used. .It Va syslogd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr syslogd 8 daemon. .It Va syslogd_program .Pq Vt str Path to .Xr syslogd 8 (default .Pa /usr/sbin/syslogd ) . .It Va syslogd_flags .Pq Vt str If .Va syslogd_enable is set to .Dq Li YES , these are the flags to pass to .Xr syslogd 8 . .It Va inetd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr inetd 8 daemon. .It Va inetd_program .Pq Vt str Path to .Xr inetd 8 (default .Pa /usr/sbin/inetd ) . .It Va inetd_flags .Pq Vt str If .Va inetd_enable is set to .Dq Li YES , these are the flags to pass to .Xr inetd 8 . .It Va hastd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr hastd 8 daemon. .It Va hastd_program .Pq Vt str Path to .Xr hastd 8 (default .Pa /sbin/hastd ) . .It Va hastd_flags .Pq Vt str If .Va hastd_enable is set to .Dq Li YES , these are the flags to pass to .Xr hastd 8 . .It Va local_unbound_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr unbound 8 daemon as a local caching resolver. .It Va kdc_enable .Pq Vt bool Set to .Dq Li YES to start a Kerberos 5 authentication server at boot time. .It Va kdc_program .Pq Vt str If .Va kdc_enable is set to .Dq Li YES this is the path to Kerberos 5 Authentication Server. .It Va kdc_flags .Pq Vt str Empty by default. This variable contains additional flags to be passed to the Kerberos 5 authentication server. .It Va kadmind_enable .Pq Vt bool Set to .Dq Li YES to start .Xr kadmind 8 , the Kerberos 5 Administration Daemon; set to .Dq Li NO on a slave server. .It Va kadmind_program .Pq Vt str If .Va kadmind_enable is set to .Dq Li YES this is the path to Kerberos 5 Administration Daemon. .It Va kpasswdd_enable .Pq Vt bool Set to .Dq Li YES to start .Xr kpasswdd 8 , the Kerberos 5 Password-Changing Daemon; set to .Dq Li NO on a slave server. .It Va kpasswdd_program .Pq Vt str If .Va kpasswdd_enable is set to .Dq Li YES this is the path to Kerberos 5 Password-Changing Daemon. .It Va kfd_enable .Pq Vt bool Set to .Dq Li YES to start .Xr kfd 8 , the Kerberos 5 ticket forwarding daemon, at the boot time. .It Va kfd_program .Pq Vt str Path to .Xr kfd 8 (default .Pa /usr/libexec/kfd ) . .It Va rwhod_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr rwhod 8 daemon at boot time. .It Va rwhod_flags .Pq Vt str If .Va rwhod_enable is set to .Dq Li YES , these are the flags to pass to it. .It Va update_motd .Pq Vt bool If set to .Dq Li YES , .Pa /etc/motd will be updated at boot time to reflect the kernel release being run. If set to .Dq Li NO , .Pa /etc/motd will not be updated. .It Va nfs_client_enable .Pq Vt bool If set to .Dq Li YES , run the NFS client daemons at boot time. .It Va nfs_access_cache .Pq Vt int If .Va nfs_client_enable is set to .Dq Li YES , this can be set to .Dq Li 0 to disable NFS ACCESS RPC caching, or to the number of seconds for which NFS ACCESS results should be cached. A value of 2-10 seconds will substantially reduce network traffic for many NFS operations. .It Va nfs_server_enable .Pq Vt bool If set to .Dq Li YES , run the NFS server daemons at boot time. .It Va nfs_server_flags .Pq Vt str If .Va nfs_server_enable is set to .Dq Li YES , these are the flags to pass to the .Xr nfsd 8 daemon. .It Va nfsv4_server_enable .Pq Vt bool If .Va nfs_server_enable is set to .Dq Li YES and .Va nfsv4_server_enable is set to .Dq Li YES , enable the server for NFSv4 as well as NFSv2 and NFSv3. .It Va nfsv4_server_only .Pq Vt bool If .Va nfs_server_enable is set to .Dq Li YES and .Va nfsv4_server_only is set to .Dq Li YES , enable the NFS server for NFSv4 only. .It Va nfs_server_maxio .Pq Vt int value to set vfs.nfsd.srvmaxio to, which is the maximum I/O size for the NFS server. .It Va tlsclntd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr rpc.tlsclntd 8 daemon, which is needed for NFS-over-TLS NFS mounts. .It Va tlsservd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr rpc.tlsservd 8 daemon, which is needed for the .Xr nfsd 8 to support NFS-over-TLS NFS mounts. .It Va nfsuserd_enable .Pq Vt bool If .Va nfsuserd_enable is set to .Dq Li YES , run the nfsuserd daemon, which is needed for NFSv4 in order to map between user/group names vs uid/gid numbers. If .Va nfsv4_server_enable is set to .Dq Li YES , this will be forced enabled. .It Va nfsuserd_flags .Pq Vt str If .Va nfsuserd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr nfsuserd 8 daemon. .It Va nfscbd_enable .Pq Vt bool If .Va nfscbd_enable is set to .Dq Li YES , run the nfscbd daemon, which enables callbacks/delegations for the NFSv4 client. .It Va nfscbd_flags .Pq Vt str If .Va nfscbd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr nfscbd 8 daemon. .It Va mountd_enable .Pq Vt bool If set to .Dq Li YES , and no .Va nfs_server_enable is set, start .Xr mountd 8 , but not .Xr nfsd 8 daemon. It is commonly needed to run CFS without real NFS used. .It Va mountd_flags .Pq Vt str If .Va mountd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr mountd 8 daemon. .It Va weak_mountd_authentication .Pq Vt bool If set to .Dq Li YES , allow services like PCNFSD to make non-privileged mount requests. .It Va nfs_reserved_port_only .Pq Vt bool If set to .Dq Li YES , provide NFS services only on a secure port. .It Va nfs_bufpackets .Pq Vt int If set to a number, indicates the number of packets worth of socket buffer space to reserve on an NFS client. The kernel default is typically 4. Using a higher number may be useful on gigabit networks to improve performance. The minimum value is 2 and the maximum is 64. .It Va rpc_lockd_enable .Pq Vt bool If set to .Dq Li YES and also an NFS server or client, run .Xr rpc.lockd 8 at boot time. .It Va rpc_lockd_flags .Pq Vt str If .Va rpc_lockd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr rpc.lockd 8 daemon. .It Va rpc_statd_enable .Pq Vt bool If set to .Dq Li YES and also an NFS server or client, run .Xr rpc.statd 8 at boot time. .It Va rpc_statd_flags .Pq Vt str If .Va rpc_statd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr rpc.statd 8 daemon. .It Va rpcbind_program .Pq Vt str Path to .Xr rpcbind 8 (default .Pa /usr/sbin/rpcbind ) . .It Va rpcbind_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr rpcbind 8 service at boot time. .It Va rpcbind_flags .Pq Vt str If .Va rpcbind_enable is set to .Dq Li YES , these are the flags to pass to the .Xr rpcbind 8 daemon. .It Va keyserv_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr keyserv 8 daemon on boot for running Secure RPC. .It Va keyserv_flags .Pq Vt str If .Va keyserv_enable is set to .Dq Li YES , these are the flags to pass to .Xr keyserv 8 daemon. .It Va pppoed_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr pppoed 8 daemon at boot time to provide PPP over Ethernet services. .It Va pppoed_ Ns Aq Ar provider .Pq Vt str .Xr pppoed 8 listens to requests to this .Ar provider and ultimately runs .Xr ppp 8 with a .Ar system argument of the same name. .It Va pppoed_flags .Pq Vt str Additional flags to pass to .Xr pppoed 8 . .It Va pppoed_interface .Pq Vt str The network interface to run .Xr pppoed 8 on. This is mandatory when .Va pppoed_enable is set to .Dq Li YES . .It Va ntpdate_enable .Pq Vt bool If set to .Dq Li YES , run .Xr ntpdate 8 at system startup. This command is intended to synchronize the system clock only .Em once from some standard reference. .Pp Note that the use of the .Va ntpd_sync_on_start variable is a preferred alternative to the .Xr ntpdate 8 utility as .Xr ntpdate 8 is to be retired from the NTP distribution. .It Va ntpdate_config .Pq Vt str Configuration file for .Xr ntpdate 8 . Default .Pa /etc/ntp.conf . .It Va ntpdate_hosts .Pq Vt str A whitespace-separated list of NTP servers to synchronize with at startup. The default is to use the servers listed in .Va ntpdate_config , if that file exists. .It Va ntpdate_program .Pq Vt str Path to .Xr ntpdate 8 (default .Pa /usr/sbin/ntpdate ) . .It Va ntpdate_flags .Pq Vt str If .Va ntpdate_enable is set to .Dq Li YES , these are the flags to pass to the .Xr ntpdate 8 command (typically a hostname). .It Va ntpd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr ntpd 8 command at boot time. .It Va ntpd_program .Pq Vt str Path to .Xr ntpd 8 (default .Pa /usr/sbin/ntpd ) . .It Va ntpd_config .Pq Vt str Path to .Xr ntpd 8 configuration file. Default .Pa /etc/ntp.conf . .It Va ntpd_flags .Pq Vt str If .Va ntpd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr ntpd 8 daemon. .It Va ntpd_sync_on_start .Pq Vt bool If set to .Dq Li YES , .Xr ntpd 8 is run with the .Fl g flag, which syncs the system's clock on startup. See .Xr ntpd 8 for more information regarding the .Fl g option. This is a preferred alternative to using .Xr ntpdate 8 or specifying the .Va ntpdate_enable variable. .It Va nis_client_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr ypbind 8 service at system boot time. .It Va nis_client_flags .Pq Vt str If .Va nis_client_enable is set to .Dq Li YES , these are the flags to pass to the .Xr ypbind 8 service. .It Va nis_ypldap_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr ypldap 8 daemon at system boot time. .It Va nis_ypldap_flags .Pq Vt str If .Va nis.ypldap_enable is set to .Dq Li YES , these are the flags to pass to the .Xr ypldap 8 daemon. .It Va nis_ypset_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr ypset 8 daemon at system boot time. .It Va nis_ypset_flags .Pq Vt str If .Va nis_ypset_enable is set to .Dq Li YES , these are the flags to pass to the .Xr ypset 8 daemon. .It Va nis_server_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr ypserv 8 daemon at system boot time. .It Va nis_server_flags .Pq Vt str If .Va nis_server_enable is set to .Dq Li YES , these are the flags to pass to the .Xr ypserv 8 daemon. .It Va nis_ypxfrd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr rpc.ypxfrd 8 daemon at system boot time. .It Va nis_ypxfrd_flags .Pq Vt str If .Va nis_ypxfrd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr rpc.ypxfrd 8 daemon. .It Va nis_yppasswdd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr rpc.yppasswdd 8 daemon at system boot time. .It Va nis_yppasswdd_flags .Pq Vt str If .Va nis_yppasswdd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr rpc.yppasswdd 8 daemon. .It Va rpc_ypupdated_enable .Pq Vt bool If set to .Dq Li YES , run the .Nm rpc.ypupdated daemon at system boot time. .It Va bsnmpd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr bsnmpd 1 daemon at system boot time. Be sure to understand the security implications of running SNMP daemon on your host. .It Va bsnmpd_flags .Pq Vt str If .Va bsnmpd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr bsnmpd 1 daemon. .It Va defaultrouter .Pq Vt str If not set to .Dq Li NO , create a default route to this host name or IP address (use an IP address if this router is also required to get to the name server!). .It Va defaultrouter_fibN .Pq Vt str If not set to .Dq Li NO , create a default route in FIB N to this host name or IP address. .It Va ipv6_defaultrouter .Pq Vt str The IPv6 equivalent of .Va defaultrouter . .It Va ipv6_defaultrouter_fibN .Pq Vt str The IPv6 equivalent of .Va defaultrouter_fibN . .It Va static_arp_pairs .Pq Vt str Set to the list of static ARP pairs that are to be added at system boot time. For each whitespace separated .Ar element in the value, a .Va static_arp_ Ns Aq Ar element variable is assumed to exist whose contents will later be passed to a .Dq Nm arp Cm -S operation. For example .Bd -literal static_arp_pairs="gw" static_arp_gw="192.168.1.1 00:01:02:03:04:05" .Ed .It Va static_ndp_pairs .Pq Vt str Set to the list of static NDP pairs that are to be added at system boot time. For each whitespace separated .Ar element in the value, a .Va static_ndp_ Ns Aq Ar element variable is assumed to exist whose contents will later be passed to a .Dq Nm ndp Cm -s operation. For example .Bd -literal static_ndp_pairs="gw" static_ndp_gw="2001:db8:3::1 00:01:02:03:04:05" .Ed .It Va static_routes .Pq Vt str Set to the list of static routes that are to be added at system boot time. If not set to .Dq Li NO then for each whitespace separated .Ar element in the value, a .Va route_ Ns Aq Ar element variable is assumed to exist whose contents will later be passed to a .Dq Nm route Cm add operation. For example: .Bd -literal static_routes="ext mcast:gif0 gif0local:gif0" route_ext="-net 10.0.0.0/24 -gateway 192.168.0.1" route_mcast="-net 224.0.0.0/4 -iface gif0" route_gif0local="-host 169.254.1.1 -iface lo0" .Ed .Pp When an .Ar element is in the form of .Li name:ifname , the route is specific to the interface .Li ifname . .It Va ipv6_static_routes .Pq Vt str The IPv6 equivalent of .Va static_routes . If not set to .Dq Li NO then for each whitespace separated .Ar element in the value, a .Va ipv6_route_ Ns Aq Ar element variable is assumed to exist whose contents will later be passed to a .Dq Nm route Cm add Fl inet6 operation. .It Va gateway_enable .Pq Vt bool If set to .Dq Li YES , configure host to act as an IP router, e.g.\& to forward packets between interfaces. .It Va ipv6_gateway_enable .Pq Vt bool The IPv6 equivalent of .Va gateway_enable . .It Va routed_enable .Pq Vt bool If set to .Dq Li YES , run a routing daemon of some sort, based on the settings of .Va routed_program and .Va routed_flags . .It Va route6d_enable .Pq Vt bool The IPv6 equivalent of .Va routed_enable . If set to .Dq Li YES , run a routing daemon of some sort, based on the settings of .Va route6d_program and .Va route6d_flags . .It Va routed_program .Pq Vt str If .Va routed_enable is set to .Dq Li YES , this is the name of the routing daemon to use. .It Va route6d_program .Pq Vt str The IPv6 equivalent of .Va routed_program . .It Va routed_flags .Pq Vt str If .Va routed_enable is set to .Dq Li YES , these are the flags to pass to the routing daemon. .It Va route6d_flags .Pq Vt str The IPv6 equivalent of .Va routed_flags . .It Va rtadvd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr rtadvd 8 daemon at boot time. The .Xr rtadvd 8 utility sends ICMPv6 Router Advertisement messages to the interfaces specified in .Va rtadvd_interfaces . This should only be enabled with great care. You may want to fine-tune .Xr rtadvd.conf 5 . .It Va rtadvd_interfaces .Pq Vt str If .Va rtadvd_enable is set to .Dq Li YES this is the list of interfaces to use. .It Va arpproxy_all .Pq Vt bool If set to .Dq Li YES , enable global proxy ARP. .It Va forward_sourceroute .Pq Vt bool If set to .Dq Li YES and .Va gateway_enable is also set to .Dq Li YES , source-routed packets are forwarded. .It Va accept_sourceroute .Pq Vt bool If set to .Dq Li YES , the system will accept source-routed packets directed at it. .It Va rarpd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr rarpd 8 daemon at system boot time. .It Va rarpd_flags .Pq Vt str If .Va rarpd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr rarpd 8 daemon. .It Va bootparamd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr bootparamd 8 daemon at system boot time. .It Va bootparamd_flags .Pq Vt str If .Va bootparamd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr bootparamd 8 daemon. .It Va stf_interface_ipv4addr .Pq Vt str If not set to .Dq Li NO , this is the local IPv4 address for 6to4 (IPv6 over IPv4 tunneling interface). Specify this entry to enable the 6to4 interface. .It Va stf_interface_ipv4plen .Pq Vt int Prefix length for 6to4 IPv4 addresses, to limit peer address range. An effective value is 0-31. .It Va stf_interface_ipv6_ifid .Pq Vt str IPv6 interface ID for .Xr stf 4 . This can be set to .Dq Li AUTO . .It Va stf_interface_ipv6_slaid .Pq Vt str IPv6 Site Level Aggregator for .Xr stf 4 . .It Va ipv6_ipv4mapping .Pq Vt bool If set to .Dq Li YES this enables IPv4 mapped IPv6 address communication (like .Li ::ffff:a.b.c.d ) . .It Va rtsold_enable .Pq Vt bool Set to .Dq Li YES to enable the .Xr rtsold 8 daemon to send ICMPv6 Router Solicitation messages. .It Va rtsold_flags .Pq Vt str If .Va rtsold_enable is set to .Dq Li YES , these are the flags to pass to .Xr rtsold 8 . .It Va rtsol_flags .Pq Vt str For interfaces configured with the .Dq Li inet6 accept_rtadv keyword, these are the flags to pass to .Xr rtsol 8 . .Pp Note that .Va rtsold_enable is mutually exclusive to .Va rtsol_flags ; .Va rtsold_enable takes precedence. .It Va keybell .Pq Vt str The keyboard bell sound. Set to .Dq Li normal , .Dq Li visual , .Dq Li off , or .Dq Li NO if the default behavior is desired. For details, refer to the .Xr kbdcontrol 1 manpage. .It Va keyboard .Pq Vt str If set to a non-null string, the virtual console's keyboard input is set to this device. .It Va keymap .Pq Vt str If set to .Dq Li NO , no keymap is installed, otherwise the value is used to install the keymap file found in .Pa /usr/share/syscons/keymaps/ Ns Ao Ar value Ac Ns Pa .kbd (if using .Xr syscons 4 ) or .Pa /usr/share/vt/keymaps/ Ns Ao Ar value Ac Ns Pa .kbd (if using .Xr vt 4 ) . .It Va keyrate .Pq Vt str The keyboard repeat speed. Set to .Dq Li slow , .Dq Li normal , .Dq Li fast , or .Dq Li NO if the default behavior is desired. .It Va keychange .Pq Vt str If not set to .Dq Li NO , attempt to program the function keys with the value. The value should be a single string of the form: .Dq Ar funkey_number new_value Op Ar funkey_number new_value ... . .It Va cursor .Pq Vt str Can be set to the value of .Dq Li normal , .Dq Li blink , .Dq Li destructive , or .Dq Li NO to set the cursor behavior explicitly or choose the default behavior. .It Va scrnmap .Pq Vt str If set to .Dq Li NO , no screen map is installed, otherwise the value is used to install the screen map file in .Pa /usr/share/syscons/scrnmaps/ Ns Aq Ar value . This parameter is ignored when using .Xr vt 4 as the console driver. .It Va font8x16 .Pq Vt str If set to .Dq Li NO , the default 8x16 font value is used for screen size requests, otherwise the value in .Pa /usr/share/syscons/fonts/ Ns Aq Ar value or .Pa /usr/share/vt/fonts/ Ns Aq Ar value is used (depending on the console driver being used). .It Va font8x14 .Pq Vt str If set to .Dq Li NO , the default 8x14 font value is used for screen size requests, otherwise the value in .Pa /usr/share/syscons/fonts/ Ns Aq Ar value or .Pa /usr/share/vt/fonts/ Ns Aq Ar value is used (depending on the console driver being used). .It Va font8x8 .Pq Vt str If set to .Dq Li NO , the default 8x8 font value is used for screen size requests, otherwise the value in .Pa /usr/share/syscons/fonts/ Ns Aq Ar value or .Pa /usr/share/vt/fonts/ Ns Aq Ar value is used (depending on the console driver being used). .It Va blanktime .Pq Vt int If set to .Dq Li NO , the default screen blanking interval is used, otherwise it is set to .Ar value seconds. .It Va saver .Pq Vt str If not set to .Dq Li NO , this is the actual screen saver to use .Li ( blank , snake , daemon , etc). .It Va moused_nondefault_enable .Pq Vt str If set to .Dq Li NO , the mouse device specified on the command line is not automatically treated as enabled by the .Pa /etc/rc.d/moused script. Having this variable set to .Dq Li YES allows a .Xr usb 4 mouse, for example, to be enabled as soon as it is plugged in. .It Va moused_enable .Pq Vt str If set to .Dq Li YES , the .Xr moused 8 daemon is started for doing cut/paste selection on the console. .It Va moused_type .Pq Vt str This is the protocol type of the mouse connected to this host. This variable must be set if .Va moused_enable is set to .Dq Li YES . The .Xr moused 8 daemon is able to detect the appropriate mouse type automatically in many cases. Set this variable to .Dq Li auto to let the daemon detect it, or select one from the following list if the automatic detection fails. .Pp If the mouse is attached to the PS/2 mouse port, choose .Dq Li auto or .Dq Li ps/2 , regardless of the brand and model of the mouse. Likewise, if the mouse is attached to the bus mouse port, choose .Dq Li auto or .Dq Li busmouse . All other protocols are for serial mice and will not work with the PS/2 and bus mice. If this is a USB mouse, .Dq Li auto is the only protocol type which will work. .Pp .Bl -tag -width ".Li x10mouseremote" -compact .It Li microsoft Microsoft mouse (serial) .It Li intellimouse Microsoft IntelliMouse (serial) .It Li mousesystems Mouse systems Corp.\& mouse (serial) .It Li mmseries MM Series mouse (serial) .It Li logitech Logitech mouse (serial) .It Li busmouse A bus mouse .It Li mouseman Logitech MouseMan and TrackMan (serial) .It Li glidepoint ALPS GlidePoint (serial) .It Li thinkingmouse Kensington ThinkingMouse (serial) .It Li ps/2 PS/2 mouse .It Li mmhittab MM HitTablet (serial) .It Li x10mouseremote X10 MouseRemote (serial) .It Li versapad Interlink VersaPad (serial) .El .Pp Even if the mouse is not in the above list, it may be compatible with one in the list. Refer to the manual page for .Xr moused 8 for compatibility information. .Pp It should also be noted that while this is enabled, any other client of the mouse (such as an X server) should access the mouse through the virtual mouse device, .Pa /dev/sysmouse , and configure it as a .Dq Li sysmouse type mouse, since all mouse data is converted to this single canonical format when using .Xr moused 8 . If the client program does not support the .Dq Li sysmouse type, specify the .Dq Li mousesystems type. It is the second preferred type. .It Va moused_port .Pq Vt str If .Va moused_enable is set to .Dq Li YES , this is the actual port the mouse is on. It might be .Pa /dev/cuau0 for a COM1 serial mouse, or .Pa /dev/psm0 for a PS/2 mouse, for example. .It Va moused_flags .Pq Vt str If .Va moused_flags is set, its value is used as an additional set of flags to pass to the .Xr moused 8 daemon. .It Va "moused_" Ns Ar XXX Ns Va "_flags" When .Va moused_nondefault_enable is enabled, and a .Xr moused 8 daemon is started for a non-default port, the .Va "moused_" Ns Ar XXX Ns Va "_flags" set of options has precedence over and replaces the default .Va moused_flags (where .Ar XXX is the name of the non-default port, i.e.,\& .Ar ums0 ) . By setting .Va "moused_" Ns Ar XXX Ns Va "_flags" it is possible to set up a different set of default flags for each .Xr moused 8 instance. For example, you can use .Dq Li "-3" for the default .Va moused_flags to make your laptop's touchpad more comfortable to use, but an empty set of options for .Va moused_ums0_flags when your .Xr usb 4 mouse has three or more buttons. .It Va mousechar_start .Pq Vt int If set to .Dq Li NO , the default mouse cursor character range .Li 0xd0 Ns - Ns Li 0xd3 is used, otherwise the range start is set to .Ar value character, see .Xr vidcontrol 1 . Use if the default range is occupied in the language code table. .It Va allscreens_flags .Pq Vt str If set, .Xr vidcontrol 1 is run with these options for each of the virtual terminals .Pq Pa /dev/ttyv* . For example, .Dq Fl m Cm on will enable the mouse pointer on all virtual terminals if .Va moused_enable is set to .Dq Li YES . .It Va allscreens_kbdflags .Pq Vt str If set, .Xr kbdcontrol 1 is run with these options for each of the virtual terminals .Pq Pa /dev/ttyv* . For example, .Dq Fl h Li 200 will set the .Xr syscons 4 or .Xr vt 4 scrollback (history) buffer to 200 lines. .It Va cron_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr cron 8 daemon at system boot time. .It Va cron_program .Pq Vt str Path to .Xr cron 8 (default .Pa /usr/sbin/cron ) . .It Va cron_flags .Pq Vt str If .Va cron_enable is set to .Dq Li YES , these are the flags to pass to .Xr cron 8 . .It Va cron_dst .Pq Vt bool If set to .Dq Li YES , enable the special handling of transitions to and from the Daylight Saving Time in .Xr cron 8 (equivalent to using the flag .Fl s ) . .It Va lpd_program .Pq Vt str Path to .Xr lpd 8 (default .Pa /usr/sbin/lpd ) . .It Va lpd_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr lpd 8 daemon at system boot time. .It Va lpd_flags .Pq Vt str If .Va lpd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr lpd 8 daemon. .It Va chkprintcap_enable .Pq Vt bool If set to .Dq Li YES , run the .Xr chkprintcap 8 command before starting the .Xr lpd 8 daemon. .It Va chkprintcap_flags .Pq Vt str If .Va lpd_enable and .Va chkprintcap_enable are set to .Dq Li YES , these are the flags to pass to the .Xr chkprintcap 8 program. The default is .Dq Li -d , which causes missing directories to be created. .It Va mta_start_script .Pq Vt str This variable specifies the full path to the script to run to start a mail transfer agent. The default is .Pa /etc/rc.sendmail . The .Va sendmail_* variables which .Pa /etc/rc.sendmail uses are documented in the .Xr rc.sendmail 8 manual page. .It Va dumpdev .Pq Vt str Indicates the device (usually a swap partition) to which a crash dump should be written in the event of a system crash. If the value of this variable is .Dq Li AUTO , the first suitable swap device listed in .Pa /etc/fstab will be used as dump device. Otherwise, the value of this variable is passed as the argument to .Xr dumpon 8 and .Xr savecore 8 . To disable crash dumps, set this variable to .Dq Li NO . .It Va dumpon_flags .Pq Vt str Flags to pass to .Xr dumpon 8 when configuring .Va dumpdev as the system dump device. .It Va dumpdir .Pq Vt str When the system reboots after a crash and a crash dump is found on the device specified by the .Va dumpdev variable, .Xr savecore 8 will save that crash dump and a copy of the kernel to the directory specified by the .Va dumpdir variable. The default value is .Pa /var/crash . Set to .Dq Li NO to not run .Xr savecore 8 at boot time when .Va dumpdir is set. .It Va savecore_enable .Pq Vt bool If set to .Dq Li NO , disable automatic extraction of the crash dump from the .Va dumpdev . .It Va savecore_flags .Pq Vt str If crash dumps are enabled, these are the flags to pass to the .Xr savecore 8 utility. .It Va quota_enable .Pq Vt bool Set to .Dq Li YES to turn on user and group disk quotas on system startup via the .Xr quotaon 8 command for all file systems marked as having quotas enabled in .Pa /etc/fstab . The kernel must be built with .Cd "options QUOTA" for disk quotas to function. .It Va check_quotas .Pq Vt bool Set to .Dq Li YES to enable user and group disk quota checking via the .Xr quotacheck 8 command. .It Va quotacheck_flags .Pq Vt str If .Va quota_enable is set to .Dq Li YES , and .Va check_quotas is set to .Dq Li YES , these are the flags to pass to the .Xr quotacheck 8 utility. The default is .Dq Li "-a" , which checks quotas for all file systems with quotas enabled in .Pa /etc/fstab . .It Va quotaon_flags .Pq Vt str If .Va quota_enable is set to .Dq Li YES , these are the flags to pass to the .Xr quotaon 8 utility. The default is .Dq Li "-a" , which enables quotas for all file systems with quotas enabled in .Pa /etc/fstab . .It Va quotaoff_flags .Pq Vt str If .Va quota_enable is set to .Dq Li YES , these are the flags to pass to the .Xr quotaoff 8 utility when shutting down the quota system. The default is .Dq Li "-a" , which disables quotas for all file systems with quotas enabled in .Pa /etc/fstab . .It Va accounting_enable .Pq Vt bool Set to .Dq Li YES to enable system accounting through the .Xr accton 8 facility. .It Va firstboot_sentinel .Pq Vt str This variable specifies the full path to a .Dq first boot sentinel file. If a file exists with this path, .Pa rc.d scripts with the .Dq firstboot keyword will be run on startup and the sentinel file will be deleted after the boot process completes. The sentinel file must be located on a writable file system which is mounted no later than .Va early_late_divider to function properly. The default is .Pa /firstboot . .It Va linux_enable .Pq Vt bool Set to .Dq Li YES to enable Linux/ELF binary emulation at system initial boot time. .It Va sysvipc_enable .Pq Vt bool If set to .Dq Li YES , load System V IPC primitives at boot time. .It Va clear_tmp_enable .Pq Vt bool Set to .Dq Li YES to have .Pa /tmp cleaned at startup. .It Va clear_tmp_X .Pq Vt bool Set to .Dq Li NO to disable removing of X11 lock files, and the removal and (secure) recreation of the various socket directories for X11 related programs. .It Va ldconfig_paths .Pq Vt str Set to the list of shared library paths to use with .Xr ldconfig 8 . NOTE: .Pa /lib and .Pa /usr/lib will always be added first, so they need not appear in this list. .It Va ldconfig32_paths .Pq Vt str Set to the list of 32-bit compatibility shared library paths to use with .Xr ldconfig 8 . .It Va ldconfig_insecure .Pq Vt bool The .Xr ldconfig 8 utility normally refuses to use directories which are writable by anyone except root. Set this variable to .Dq Li YES to disable that security check during system startup. .It Va ldconfig_local_dirs .Pq Vt str Set to the list of local .Xr ldconfig 8 directories. The names of all files in the directories listed will be passed as arguments to .Xr ldconfig 8 . .It Va ldconfig_local32_dirs .Pq Vt str Set to the list of local 32-bit compatibility .Xr ldconfig 8 directories. The names of all files in the directories listed will be passed as arguments to .Dq Nm ldconfig Fl 32 . .It Va kern_securelevel_enable .Pq Vt bool Set to .Dq Li YES to set the kernel security level at system startup. .It Va kern_securelevel .Pq Vt int The kernel security level to set at startup. The allowed range of .Ar value ranges from \-1 (the compile time default) to 3 (the most secure). See .Xr security 7 for the list of possible security levels and their effect on system operation. .It Va sshd_program .Pq Vt str Path to the SSH server program .Pa ( /usr/sbin/sshd is the default). .It Va sshd_enable .Pq Vt bool Set to .Dq Li YES to start .Xr sshd 8 at system boot time. .It Va sshd_flags .Pq Vt str If .Va sshd_enable is set to .Dq Li YES , these are the flags to pass to the .Xr sshd 8 daemon. .It Va ftpd_program .Pq Vt str Path to the FTP server program .Pa ( /usr/libexec/ftpd is the default). .It Va ftpd_enable .Pq Vt bool Set to .Dq Li YES to start .Xr ftpd 8 as a stand-alone daemon at system boot time. .It Va ftpd_flags .Pq Vt str If .Va ftpd_enable is set to .Dq Li YES , these are the additional flags to pass to the .Xr ftpd 8 daemon. .It Va watchdogd_enable .Pq Vt bool If set to .Dq Li YES , start the .Xr watchdogd 8 daemon at boot time. This requires that the kernel have been compiled with a .Xr watchdog 4 compatible device. .It Va watchdogd_flags .Pq Vt str If .Va watchdogd_enable is set to .Dq Li YES , these are the flags passed to the .Xr watchdogd 8 daemon. .It Va watchdogd_timeout .Pq Vt int If .Va watchdogd_enable is set to .Dq Li YES , this is a timeout that will be used by the .Xr watchdogd 8 daemon. If this option is set, it overrides .Fl t in .Va watchdogd_flags . .It Va watchdogd_shutdown_timeout .Pq Vt int If .Va watchdogd_enable is set to .Dq Li YES , this is a timeout that will be set by the .Xr watchdogd 8 daemon when it exits during the system shutdown. This timeout will not be set when returning to the single-user mode or when the watchdogd service is stopped individually using the .Xr service 8 command or the rc.d script. Note that the timeout will be applied if .Xr watchdogd 8 is stopped outside of .Xr rc 8 framework. If this option is set, it overrides .Fl x in .Va watchdogd_flags . .It Va devfs_rulesets .Pq Vt str List of files containing sets of rules for .Xr devfs 8 . .It Va devfs_system_ruleset .Pq Vt str Rule name(s) to apply to the system .Pa /dev itself. .It Va devfs_set_rulesets .Pq Vt str Pairs of already-mounted .Pa dev directories and rulesets that should be applied to them. For example: /mount/dev=ruleset_name .It Va devfs_load_rulesets .Pq Vt bool If set, always load the default rulesets listed in .Va devfs_rulesets . .It Va performance_cx_lowest .Pq Vt str CPU idle state to use while on AC power. The string .Dq Li LOW indicates that .Xr acpi 4 should use the lowest power state available while .Dq Li HIGH indicates that the lowest latency state (less power savings) should be used. .It Va performance_cpu_freq .Pq Vt str CPU clock frequency to use while on AC power. The string .Dq Li LOW indicates that .Xr cpufreq 4 should use the lowest frequency available while .Dq Li HIGH indicates that the highest frequency (less power savings) should be used. .It Va economy_cx_lowest .Pq Vt str CPU idle state to use when off AC power. The string .Dq Li LOW indicates that .Xr acpi 4 should use the lowest power state available while .Dq Li HIGH indicates that the lowest latency state (less power savings) should be used. .It Va economy_cpu_freq .Pq Vt str CPU clock frequency to use when off AC power. The string .Dq Li LOW indicates that .Xr cpufreq 4 should use the lowest frequency available while .Dq Li HIGH indicates that the highest frequency (less power savings) should be used. .It Va jail_enable .Pq Vt bool If set to .Dq Li NO , any configured jails will not be started. .It Va jail_conf .Pq Vt str The configuration filename used by .Xr jail 8 utility. The default value is .Pa /etc/jail.conf . .Pa /etc/jail. Ns Ao Ar jname Ac Ns Va .conf and .Pa /etc/jail.conf.d/ Ns Ao Ar jname Ac Ns Va .conf will also be used if .Va Ao Ar jname Ac Va is set in .Va jail_list . .It Va jail_parallel_start .Pq Vt bool If set to .Dq Li YES , all configured jails will be started in the background (in parallel). .It Va jail_flags .Pq Vt str Unset by default. When set, use as default value for .Va jail_ Ns Ao Ar jname Ac Ns Va _flags for every jail in .Va jail_list . .It Va jail_list .Pq Vt str A space-delimited list of jail names. When left empty, all of the .Xr jail 8 instances defined in the configuration file are started. The names specified in this list control the jail startup order. .Xr jail 8 instances missing from .Va jail_list must be started manually. Note that a jail's .Va depend parameter in the configuration file may override this list. .It Va jail_reverse_stop .Pq Vt bool When set to .Dq Li YES , all configured jails in .Va jail_list are stopped in reverse order. .It Va jail_ Ns * variables Note that older releases supported per-jail configuration via .Nm variables. For example, hostname of a jail named .Li vjail was able to be set by .Li jail_vjail_hostname . These per-jail configuration variables are now obsolete in favor of .Xr jail 8 configuration file. For backward compatibility, when per-jail configuration variables are defined, .Xr jail 8 configuration files are created as .Pa /var/run/jail . Ns Ao Ar jname Ac Ns Pa .conf and used. .Pp The following per-jail parameters are handled by .Pa rc.d/jail script out of their corresponding .Nm variables. In addition to them, parameters in .Va jail_ Ns Ao Ar jname Ac Ns Va _parameters will be added to the configuration file. They must be a semi-colon .Pq Ql \&; delimited list of .Dq key=value . For more details, see .Xr jail 8 manual page. .Bl -tag -width "host.hostname" -offset indent .It Li path set from .Va jail_ Ns Ao Ar jname Ac Ns Va _rootdir .It Li host.hostname set from .Va jail_ Ns Ao Ar jname Ac Ns Va _hostname .It Li exec.consolelog set from .Va jail_ Ns Ao Ar jname Ac Ns Va _consolelog . The default value is .Pa /var/log/jail_ Ns Ao Ar jname Ac Ns Pa _console.log . .It Li interface set from .Va jail_ Ns Ao Ar jname Ac Ns Va _interface . .It Li vnet.interface set from .Va jail_ Ns Ao Ar jname Ac Ns Va _vnet_interface . This implies .Li vnet parameter will be enabled and cannot be specified with .Va jail_ Ns Ao Ar jname Ac Ns Va _interface , .Va jail_ Ns Ao Ar jname Ac Ns Va _ip and/or .Va jail_ Ns Ao Ar jname Ac Ns Va _ip_multi Ns Aq Ar n at the same time. .It Li fstab set from .Va jail_ Ns Ao Ar jname Ac Ns Va _fstab .It Li mount set from .Va jail_ Ns Ao Ar jname Ac Ns Va _procfs_enable . .It Li exec.fib set from .Va jail_ Ns Ao Ar jname Ac Ns Va _fib .It Li exec.start set from .Va jail_ Ns Ao Ar jname Ac Ns Va _exec_start . The parameter name was .Li command in some older releases. .It Li exec.prestart set from .Va jail_ Ns Ao Ar jname Ac Ns Va _exec_prestart .It Li exec.poststart set from .Va jail_ Ns Ao Ar jname Ac Ns Va _exec_poststart .It Li exec.stop set from .Va jail_ Ns Ao Ar jname Ac Ns Va _exec_stop .It Li exec.prestop set from .Va jail_ Ns Ao Ar jname Ac Ns Va _exec_prestop .It Li exec.poststop set from .Va jail_ Ns Ao Ar jname Ac Ns Va _exec_poststop .It Li ip4.addr set if .Va jail_ Ns Ao Ar jname Ac Ns Va _ip or .Va jail_ Ns Ao Ar jname Ac Ns Va _ip_multi Ns Aq Ar n contain IPv4 addresses .It Li ip6.addr set if .Va jail_ Ns Ao Ar jname Ac Ns Va _ip or .Va jail_ Ns Ao Ar jname Ac Ns Va _ip_multi Ns Aq Ar n contain IPv6 addresses .It Li allow.mount set from .Va jail_ Ns Ao Ar jname Ac Ns Va _mount_enable .It Li mount.devfs set from .Va jail_ Ns Ao Ar jname Ac Ns Va _devfs_enable .It Li devfs_ruleset set from .Va jail_ Ns Ao Ar jname Ac Ns Va _devfs_ruleset . This must be an integer, not a string. .It Li mount.fdescfs set from .Va jail_ Ns Ao Ar jname Ac Ns Va _fdescfs_enable .It Li allow.set_hostname set from .Va jail_ Ns Ao Ar jname Ac Ns Va _set_hostname_allow .It Li allow.rawsocket set from .Va jail_ Ns Ao Ar jname Ac Ns Va _socket_unixiproute_only .It Li allow.sysvipc set from .Va jail_ Ns Ao Ar jname Ac Ns Va _sysvipc_allow .El .\" ----------------------------------------------------- .It Va harvest_mask .Pq Vt int Set to a bit-mask representing the entropy sources you wish to harvest. Refer to .Xr random 4 for more information. .It Va entropy_dir .Pq Vt str Set to .Dq Li NO to disable caching entropy via .Xr cron 8 . Otherwise set to the directory in which the entropy files are stored. To be useful, there must be a system cron job that regularly writes and rotates files here. All files found will be used at boot time. The default is .Pa /var/db/entropy . .It Va entropy_file .Pq Vt str Set to .Dq Li NO to disable caching entropy through reboots. Otherwise set to the name of a file used to store cached entropy. This file should be located on a file system that is readable before all the volumes specified in .Xr fstab 5 are mounted. By default, .Pa /entropy is used, but if .Pa /var/db/entropy-file is found it will also be used. This will be of some use to .Xr bsdinstall 8 . .It Va entropy_boot_file .Pq Vt str Set to .Dq Li NO to disable very early caching entropy through reboots. Otherwise set to the filename used to read very early reboot cached entropy. This file should be located where .Xr loader 8 can read it. See also .Xr loader.conf 5 . The default location is .Pa /boot/entropy . .It Va entropy_save_sz .Pq Vt int Size of the entropy cache files saved by .Nm save-entropy periodically. .It Va entropy_save_num .Pq Vt int Number of entropy cache files to save by .Nm save-entropy periodically. .It Va ipsec_enable .Pq Vt bool Set to .Dq Li YES to run .Xr setkey 8 on .Va ipsec_file at boot time. .It Va ipsec_file .Pq Vt str Configuration file for .Xr setkey 8 . .It Va dmesg_enable .Pq Vt bool Set to .Dq Li YES to save .Xr dmesg 8 to .Pa /var/run/dmesg.boot on boot. .It Va rcshutdown_timeout .Pq Vt int If set, start a watchdog timer in the background which will terminate .Pa rc.shutdown if .Xr shutdown 8 has not completed within the specified time (in seconds). Notice that in addition to this soft timeout, .Xr init 8 also applies a hard timeout for the execution of .Pa rc.shutdown . This is configured via .Xr sysctl 8 variable .Va kern.init_shutdown_timeout and defaults to 120 seconds. Setting the value of .Va rcshutdown_timeout to more than 120 seconds will have no effect until the .Xr sysctl 8 variable .Va kern.init_shutdown_timeout is also increased. .It Va virecover_enable .Pq Vt bool Set to .Dq Li NO to prevent the system from trying to recover pre-maturely terminated .Xr vi 1 sessions. .It Va ugidfw_enable .Pq Vt bool Set to .Dq Li YES to load the .Xr mac_bsdextended 4 module upon system initialization and load a default ruleset file. .It Va bsdextended_script .Pq Vt str The default .Xr mac_bsdextended 4 ruleset file to load. The default value of this variable is .Pa /etc/rc.bsdextended . .It Va newsyslog_enable .Pq Vt bool If set to .Dq Li YES , run .Xr newsyslog 8 command at startup. .It Va newsyslog_flags .Pq Vt str If .Va newsyslog_enable is set to .Dq Li YES , these are the flags to pass to the .Xr newsyslog 8 program. The default is .Dq Li -CN , which causes log files flagged with a .Cm C to be created. .It Va mdconfig_md Ns Aq Ar X .Pq Vt str Arguments to .Xr mdconfig 8 for .Xr md 4 device .Ar X . At minimum a .Fl t Ar type must be specified and either a .Fl s Ar size for malloc or swap backed .Xr md 4 devices or a .Fl f Ar file for vnode backed .Xr md 4 devices. Note that .Va mdconfig_md Ns Aq Ar X variables are evaluated until one variable is unset or null. .It Va mdconfig_md Ns Ao Ar X Ac Ns Va _newfs .Pq Vt str Optional arguments passed to .Xr newfs 8 to initialize .Xr md 4 device .Ar X . .It Va mdconfig_md Ns Ao Ar X Ac Ns Va _owner .Pq Vt str An ownership specification passed to .Xr chown 8 after the specified .Xr md 4 device .Ar X has been mounted. Both the .Xr md 4 device and the mount point will be changed. .It Va mdconfig_md Ns Ao Ar X Ac Ns Va _perms .Pq Vt str A mode string passed to .Xr chmod 1 after the specified .Xr md 4 device .Ar X has been mounted. Both the .Xr md 4 device and the mount point will be changed. .It Va mdconfig_md Ns Ao Ar X Ac Ns Va _files .Pq Vt str Files to be copied to the mount point of the .Xr md 4 device .Ar X after it has been mounted. .It Va mdconfig_md Ns Ao Ar X Ac Ns Va _cmd .Pq Vt str Command to execute after the specified .Xr md 4 device .Ar X has been mounted. Note that the command is passed to .Ic eval and that both .Va _dev and .Va _mp variables can be used to reference respectively the .Xr md 4 device and the mount point. Assuming that the .Xr md 4 device is .Li md0 , one could set the following: .Bd -literal mdconfig_md0_cmd="tar xfzC /var/file.tgz \e${_mp}" .Ed .It Va autobridge_interfaces .Pq Vt str Set to the list of bridge interfaces that will have newly arriving interfaces checked against to be automatically added. If not set to .Dq Li NO then for each whitespace separated .Ar element in the value, a .Va autobridge_ Ns Aq Ar element variable is assumed to exist which has a whitespace separated list of interface names to match, these names can use wildcards. For example: .Bd -literal autobridge_interfaces="bridge0" autobridge_bridge0="tap* dc0 vlan[345]" .Ed .It Va mixer_enable .Pq Vt bool If set to .Dq Li YES , enable support for sound mixer. .It Va hcsecd_enable .Pq Vt bool If set to .Dq Li YES , enable Bluetooth security daemon. .It Va hcsecd_config .Pq Vt str Configuration file for .Xr hcsecd 8 . Default .Pa /etc/bluetooth/hcsecd.conf . .It Va sdpd_enable .Pq Vt bool If set to .Dq Li YES , enable Bluetooth Service Discovery Protocol daemon. .It Va sdpd_control .Pq Vt str Path to .Xr sdpd 8 control socket. Default .Pa /var/run/sdp . .It Va sdpd_groupname .Pq Vt str Sets .Xr sdpd 8 group to run as after it initializes. Default .Dq Li nobody . .It Va sdpd_username .Pq Vt str Sets .Xr sdpd 8 user to run as after it initializes. Default .Dq Li nobody . .It Va bthidd_enable .Pq Vt bool If set to .Dq Li YES , enable Bluetooth Human Interface Device daemon. .It Va bthidd_config .Pq Vt str Configuration file for .Xr bthidd 8 . Default .Pa /etc/bluetooth/bthidd.conf . .It Va bthidd_hids .Pq Vt str Path to a file, where .Xr bthidd 8 will store information about known HID devices. Default .Pa /var/db/bthidd.hids . .It Va rfcomm_pppd_server_enable .Pq Vt bool If set to .Dq Li YES , enable Bluetooth RFCOMM PPP wrapper daemon. .It Va rfcomm_pppd_server_profile .Pq Vt str The name of the profile to use from .Pa /etc/ppp/ppp.conf . Multiple profiles can be specified here. Also used to specify per-profile overrides. When the profile name contains any of the characters .Dq Li .-/+ they are translated to .Dq Li _ for the proposes of the override variable names. .It Va rfcomm_pppd_server_ Ns Ao Ar profile Ac Ns _bdaddr .Pq Vt str Overrides local address to listen on. By default .Xr rfcomm_pppd 8 will listen on .Dq Li ANY address. The address can be specified as BD_ADDR or name. .It Va rfcomm_pppd_server_ Ns Ao Ar profile Ac Ns _channel .Pq Vt str Overrides local RFCOMM channel to listen on. By default .Xr rfcomm_pppd 8 will listen on RFCOMM channel 1. Must set properly if multiple profiles used in the same time. .It Va rfcomm_pppd_server_ Ns Ao Ar profile Ac Ns _register_sp .Pq Vt bool Tells .Xr rfcomm_pppd 8 if it should register Serial Port service on the specified RFCOMM channel. Default .Dq Li NO . .It Va rfcomm_pppd_server_ Ns Ao Ar profile Ac Ns _register_dun .Pq Vt bool Tells .Xr rfcomm_pppd 8 if it should register Dial-Up Networking service on the specified RFCOMM channel. Default .Dq Li NO . .It Va ubthidhci_enable .Pq Vt bool If set to .Dq Li YES , change the USB Bluetooth controller from HID mode to HCI mode. You also need to specify the location of USB Bluetooth controller with the .Va ubthidhci_busnum and .Va ubthidhci_addr variables. .It Va ubthidhci_busnum Bus number where the USB Bluetooth controller is located. Check the output of .Xr usbconfig 8 on your system to find this information. .It Va ubthidhci_addr Bus address of the USB Bluetooth controller. Check the output of .Xr usbconfig 8 on your system to find this information. .It Va netwait_enable .Pq Vt bool If set to .Dq Li YES , delays the start of network-reliant services until .Va netwait_if is up and ICMP packets to a destination defined in .Va netwait_ip are flowing. Link state is examined first, followed by .Dq Li pinging an IP address to verify network usability. If no destination can be reached or timeouts are exceeded, network services are started anyway with no guarantee that the network is usable. Use of this variable requires both .Va netwait_ip and .Va netwait_if to be set. .It Va netwait_ip .Pq Vt str Empty by default. This variable contains a space-delimited list of IP addresses to .Xr ping 8 . DNS hostnames should not be used as resolution is not guaranteed to be functional at this point. If multiple IP addresses are specified, each will be tried until one is successful or the list is exhausted. .It Va netwait_timeout .Pq Vt int Indicates the total number of seconds to perform a .Dq Li ping against each IP address in .Va netwait_ip , at a rate of one ping per second. If any of the pings are successful, full network connectivity is considered reliable. The default is 60. .It Va netwait_if .Pq Vt str Empty by default. Defines the name of the network interface on which watch for link. .Xr ifconfig 8 is used to monitor the interface, looking for .Dq Li status: no carrier . Once gone, the link is considered up. This can be a .Xr vlan 4 interface if desired. .It Va netwait_if_timeout .Pq Vt int Defines the total number of seconds to wait for link to become usable, polled at a 1-second interval. The default is 30. .It Va rctl_enable .Pq Vt bool If set to .Dq Li YES , load .Xr rctl 8 rules from the defined ruleset. The kernel must be built with .Cd "options RACCT" and .Cd "options RCTL" . .It Va rctl_rules .Pq Vt str Set to .Pa /etc/rctl.conf by default. This variables contains the .Xr rctl.conf 5 ruleset to load for .Xr rctl 8 . .It Va iovctl_files .Pq Vt str A space-separated list of configuration files used by .Xr iovctl 8 . The default value is an empty string. .It Va autofs_enable .Pq Vt bool If set to .Dq Li YES , start the .Xr automount 8 utility and the .Xr automountd 8 and .Xr autounmountd 8 daemons at boot time. .It Va automount_flags .Pq Vt str If .Va autofs_enable is set to .Dq Li YES , these are the flags to pass to the .Xr automount 8 program. By default no flags are passed. .It Va automountd_flags .Pq Vt str If .Va autofs_enable is set to .Dq Li YES , these are the flags to pass to the .Xr automountd 8 daemon. By default no flags are passed. .It Va autounmountd_flags .Pq Vt str If .Va autofs_enable is set to .Dq Li YES , these are the flags to pass to the .Xr autounmountd 8 daemon. By default no flags are passed. .It Va ctld_enable .Pq Vt bool If set to .Dq Li YES , start the .Xr ctld 8 daemon at boot time. .It Va iscsid_enable .Pq Vt bool If set to .Dq Li YES , start the .Xr iscsid 8 daemon at boot time. .It Va iscsictl_enable .Pq Vt bool If set to .Dq Li YES , start the .Xr iscsictl 8 utility at boot time. .It Va iscsictl_flags .Pq Vt str If .Va iscsictl_enable is set to .Dq Li YES , these are the flags to pass to the .Xr iscsictl 8 program. The default is .Dq Li -Aa , which configures sessions based on the .Pa /etc/iscsi.conf configuration file. .It Va cfumass_enable .Pq Vt bool If set to .Dq Li YES , create and export an USB LUN using .Xr cfumass 4 at boot time. .It Va cfumass_dir .Pq Vt str The directory where the files exported by USB LUN are located. The default directory is .Pa /var/cfumass . .It Va service_delete_empty .Pq Vt bool If set to .Dq Li YES , .Ql Li service delete removes empty .Dq Li rc.conf.d files. .It Va zfs_bootonce_activate .Pq Vt bool If set to .Dq Li YES , and a boot environment marked bootonce is successfully booted, it will be made permanently active. .It Va zfskeys_enable .Pq Vt bool If set to .Dq Li YES , enable auto-loading of encryption keys for encrypted ZFS datasets. For every dataset the script will first load the appropriate encryption key and then attempt to unlock the dataset. .Pp The script operates only on datasets which are encrypted with ZFS native encryption and have a ZFS .Dq Li keylocation dataset property beginning with .Dq Li file:// . .It Va zfskeys_datasets .Pq Vt str A whitespace-separated list of ZFS datasets to unlock. The list is empty by default, which means that the script will attempt to unlock all datasets. .It Va zfskeys_timeout .Pq Vt int Define the total number of seconds to wait for the zfskeys script to unlock an encrypted dataset. The default is 10. .El .Sh FILES .Bl -tag -width "/etc/defaults/rc.conf" -compact .It Pa /etc/defaults/rc.conf .It Pa /etc/defaults/vendor.conf .It Pa /etc/rc.conf .It Pa /etc/rc.conf.local .It Pa /etc/rc.conf.d/ .El .Sh SEE ALSO .Xr chmod 1 , -.Xr gdb 1 , +.Xr gdb 1 Pq Pa ports/devel/gdb , .Xr info 1 , .Xr kbdcontrol 1 , .Xr limits 1 , .Xr protect 1 , .Xr sh 1 , .Xr vi 1 , .Xr vidcontrol 1 , .Xr bridge 4 , .Xr dummynet 4 , .Xr ip 4 , .Xr ipf 4 , .Xr ipfw 4 , .Xr ipnat 4 , .Xr kld 4 , .Xr pf 4 , .Xr pflog 4 , .Xr pfsync 4 , .Xr tcp 4 , .Xr udp 4 , .Xr exports 5 , .Xr fstab 5 , .Xr ipf 5 , .Xr ipnat 5 , .Xr jail.conf 5 , .Xr loader.conf 5 , .Xr login.conf 5 , .Xr motd 5 , .Xr newsyslog.conf 5 , .Xr pf.conf 5 , .Xr firewall 7 , .Xr growfs 7 , .Xr security 7 , .Xr tuning 7 , .Xr accton 8 , .Xr apm 8 , .Xr bsdinstall 8 , .Xr bthidd 8 , .Xr chkprintcap 8 , .Xr chown 8 , .Xr cron 8 , .Xr devfs 8 , .Xr dhclient 8 , .Xr ftpd 8 , .Xr geli 8 , .Xr hcsecd 8 , .Xr ifconfig 8 , .Xr inetd 8 , .Xr iovctl 8 , .Xr ipf 8 , .Xr ipfw 8 , .Xr ipnat 8 , .Xr jail 8 , .Xr kldxref 8 , .Xr loader 8 , .Xr lpd 8 , .Xr makewhatis 8 , .Xr mdconfig 8 , .Xr mdmfs 8 , .Xr mixer 8 , .Xr mountd 8 , .Xr moused 8 , .Xr newfs 8 , .Xr newsyslog 8 , .Xr nfsd 8 , .Xr ntpd 8 , .Xr ntpdate 8 , .Xr pfctl 8 , .Xr pflogd 8 , .Xr ping 8 , .Xr powerd 8 , .Xr quotacheck 8 , .Xr quotaon 8 , .Xr rc 8 , .Xr rc.sendmail 8 , .Xr rc.subr 8 , .Xr rcorder 8 , .Xr rfcomm_pppd 8 , .Xr route 8 , .Xr routed 8 , .Xr rpc.lockd 8 , .Xr rpc.statd 8 , .Xr rpc.tlsclntd 8 , .Xr rpc.tlsservd 8 , .Xr rpcbind 8 , .Xr rwhod 8 , .Xr savecore 8 , .Xr sdpd 8 , .Xr service 8 , .Xr sshd 8 , .Xr swapon 8 , .Xr sysctl 8 , .Xr syslogd 8 , .Xr sysrc 8 , .Xr unbound 8 , .Xr usbconfig 8 , .Xr wlandebug 8 , .Xr yp 8 , .Xr ypbind 8 , .Xr ypserv 8 , .Xr ypset 8 .Sh HISTORY The .Nm file appeared in .Fx 2.2.2 . .Sh AUTHORS .An Jordan K. Hubbard . diff --git a/share/man/man9/ktr.9 b/share/man/man9/ktr.9 index cfe9cacf8611..2bb6f9991ee9 100644 --- a/share/man/man9/ktr.9 +++ b/share/man/man9/ktr.9 @@ -1,172 +1,172 @@ .\" Copyright (c) 2001 John H. Baldwin .\" .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. .\" .\" $FreeBSD$ .\" .Dd April 12, 2022 .Dt KTR 9 .Os .Sh NAME .Nm CTR0 , CTR1 , CTR2 , CTR3 , CTR4 , CTR5 .Nd kernel tracing facility .Sh SYNOPSIS .In sys/param.h .In sys/ktr.h .Vt "extern int ktr_cpumask" ; .Vt "extern int ktr_entries" ; .Vt "extern int ktr_extend" ; .Vt "extern int ktr_mask" ; .Vt "extern int ktr_verbose" ; .Vt "extern struct ktr_entry ktr_buf[]" ; .Ft void .Fn CTR "u_int mask" "char *format" "..." .Ft void .Fn CTR0 "u_int mask" "char *format" .Ft void .Fn CTR1 "u_int mask" "char *format" "arg1" .Ft void .Fn CTR2 "u_int mask" "char *format" "arg1" "arg2" .Ft void .Fn CTR3 "u_int mask" "char *format" "arg1" "arg2" "arg3" .Ft void .Fn CTR4 "u_int mask" "char *format" "arg1" "arg2" "arg3" "arg4" .Ft void .Fn CTR5 "u_int mask" "char *format" "arg1" "arg2" "arg3" "arg4" "arg5" .Ft void .Fn CTR6 "u_int mask" "char *format" "arg1" "arg2" "arg3" "arg4" "arg5" "arg6" .Sh DESCRIPTION KTR provides a circular buffer of events that can be logged in a .Xr printf 9 style fashion. These events can then be dumped with .Xr ddb 4 , -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb or .Xr ktrdump 8 . .Pp Events are created and logged in the kernel via the .Dv CTR and .Dv CTR Ns Ar x macros. The first parameter is a mask of event types .Pq Dv KTR_* defined in .In sys/ktr_class.h . The event will be logged only if any of the event types specified in .Fa mask are enabled in the global event mask stored in .Va ktr_mask . The .Fa format argument is a .Xr printf 9 style format string used to build the text of the event log message. Following the .Fa format string are zero to six arguments referenced by .Fa format . Each event is logged with a file name and source line number of the originating CTR call, and a timestamp in addition to the log message. .Pp The event is stored in the circular buffer with supplied arguments as is, and formatting is done at the dump time. Do not use pointers to the objects with limited lifetime, for instance, strings, because the pointer may become invalid when buffer is printed. .Pp The .Dv CTR Ns Ar x macros differ only in the number of arguments each one takes, as indicated by its name. .Pp The .Va ktr_entries variable contains the number of entries in the .Va ktr_buf array. These variables are mostly useful for post-mortem crash dump tools to locate the base of the circular trace buffer and its length. .Pp The .Va ktr_mask variable contains the run time mask of events to log. .Pp The CPU event mask is stored in the .Va ktr_cpumask variable. .Pp The .Va ktr_verbose variable stores the verbose flag that controls whether events are logged to the console in addition to the event buffer. .Sh EXAMPLES This example demonstrates the use of tracepoints at the .Dv KTR_PROC logging level. .Bd -literal void mi_switch() { ... /* * Pick a new current process and record its start time. */ ... CTR3(KTR_PROC, "mi_switch: old proc %p (pid %d)", p, p->p_pid); ... cpu_switch(); ... CTR3(KTR_PROC, "mi_switch: new proc %p (pid %d)", p, p->p_pid); ... } .Ed .Sh SEE ALSO .Xr ktr 4 , .Xr ktrdump 8 .Sh HISTORY The KTR kernel tracing facility first appeared in .Bsx 3.0 and was imported into .Fx 5.0 . .Pp The .Fn CTR macro accepting a variable number of arguments first appeared in .Fx 14.0 . .Sh BUGS Currently there is one global buffer shared among all CPUs. It might be profitable at some point in time to use per-CPU buffers instead so that if one CPU halts or starts spinning, then the log messages it emitted just prior to halting or spinning will not be drowned out by events from the other CPUs. .Pp The arguments given in .Fn CTRx macros are stored as .Vt u_long , so do not pass arguments larger than size of an .Vt u_long type. For example passing 64bit arguments on 32bit architectures will give incorrect results. diff --git a/usr.bin/gcore/gcore.1 b/usr.bin/gcore/gcore.1 index aa93a5ef1fe0..60a99d8a1a62 100644 --- a/usr.bin/gcore/gcore.1 +++ b/usr.bin/gcore/gcore.1 @@ -1,106 +1,106 @@ .\" Copyright (c) 1983, 1990, 1992, 1993 .\" The Regents of the University of California. 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. .\" .\" @(#)gcore.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" .Dd April 24, 2021 .Dt GCORE 1 .Os .Sh NAME .Nm gcore .Nd get core images of running process .Sh SYNOPSIS .Nm .Op Fl f .Op Fl k .Op Fl c Ar core .Op Ar executable .Ar pid .Sh DESCRIPTION The .Nm utility creates a core image of the specified process, suitable for use with -.Xr gdb 1 . +.Xr gdb 1 Pq Pa ports/devel/gdb . By default, the core is written to the file .Dq Pa core. . The process identifier, .Ar pid , must be given on the command line. .Pp The following options are available: .Bl -tag -width indent .It Fl c Write the core file to the specified file instead of .Dq Pa core. . .It Fl f Dumps all available segments, excluding only malformed and undumpable segments. Unlike the default invocation, this flag dumps mappings of devices which may invalidate the state of device transactions or trigger other unexpected behavior. As a result, this flag should only be used when the behavior of the application and any devices it has mapped is fully understood and any side effects can be controlled or tolerated. .It Fl k Use the .Xr ptrace 2 .Dv PT_COREDUMP kernel facility to write the core dump, instead of reading the process' memory and constructing the dump file in .Nm itself. This is faster, and the dump is written by the same kernel code that writes core dumps upon fatal signals. .El .Sh FILES .Bl -tag -width /var/log/messages -compact .It Pa core. the core image .El .Sh HISTORY A .Nm utility appeared in .Bx 4.2 . .Sh BUGS Because of the .Xr ptrace 2 usage .Nm may not work with processes which are actively being investigated with .Xr truss 1 or -.Xr gdb 1 . +.Xr gdb 1 Pq Pa ports/devel/gdb . Additionally, interruptable sleeps may exit with EINTR. .Pp The .Nm utility is not compatible with the original .Bx 4.2 version. diff --git a/usr.sbin/config/config.8 b/usr.sbin/config/config.8 index 929607712ef8..77a0618527c0 100644 --- a/usr.sbin/config/config.8 +++ b/usr.sbin/config/config.8 @@ -1,278 +1,278 @@ .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. .\" .\" @(#)config.8 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" .Dd April 9, 2021 .Dt CONFIG 8 .Os .Sh NAME .Nm config .Nd build system configuration files .Sh SYNOPSIS .Nm .Op Fl CVgp .Op Fl I Ar path .Op Fl d Ar destdir .Op Fl s Ar srcdir .Ar SYSTEM_NAME .Nm .Op Fl x Ar kernel .Sh DESCRIPTION The .Nm utility builds a set of system configuration files from the file .Ar SYSTEM_NAME which describes the system to configure. A second file tells .Nm what files are needed to generate a system and can be augmented by configuration specific set of files that give alternate files for a specific machine (see the .Sx FILES section below). .Pp Available options and operands: .Bl -tag -width "SYSTEM_NAME" .It Fl V Print the .Nm version number. .It Fl C If the INCLUDE_CONFIG_FILE is present in a configuration file, kernel image will contain full configuration files included literally (preserving comments). This flag is kept for backward compatibility. .It Fl I Ar path Search in .Ar path for any file included by the .Ic include directive. This option may be specified more than once. .It Fl d Ar destdir Use .Ar destdir as the output directory, instead of the default one. Note that .Nm does not append .Ar SYSTEM_NAME to the directory given. .It Fl s Ar srcdir Use .Ar srcdir as the source directory, instead of the default one. .It Fl m Print the MACHINE and MACHINE_ARCH values for this kernel and exit. .It Fl g Configure a system for debugging. .It Fl x Ar kernel Print kernel configuration file embedded into a kernel file. This option makes sense only if .Cd "options INCLUDE_CONFIG_FILE" entry was present in your configuration file. .It Ar SYSTEM_NAME Specify the name of the system configuration file containing device specifications, configuration options and other system parameters for one system configuration. .El .Pp The .Nm utility should be run from the .Pa conf subdirectory of the system source (usually .Pa /sys/ Ns Va ARCH Ns Pa /conf ) , where .Va ARCH represents one of the architectures supported by .Fx . The .Nm utility creates the directory .Pa ../compile/ Ns Ar SYSTEM_NAME or the one given with the .Fl d option as necessary and places all output files there. The output of .Nm consists of a number of files; for the .Tn i386 , they are: .Pa Makefile , used by .Xr make 1 in building the system; header files, definitions of the number of various devices that will be compiled into the system. .Pp The .Nm utility looks for kernel sources in the directory .Pa ../.. or the one given with the .Fl s option. .Pp After running .Nm , it is necessary to run .Dq Li make depend in the directory where the new makefile was created. The .Nm utility prints a reminder of this when it completes. .Pp If any other error messages are produced by .Nm , the problems in the configuration file should be corrected and .Nm should be run again. Attempts to compile a system that had configuration errors are likely to fail. .Sh DEBUG KERNELS Traditional .Bx kernels are compiled without symbols due to the heavy load on the system when compiling a .Dq debug kernel. A debug kernel contains complete symbols for all the source files, and enables an experienced kernel programmer to analyse the cause of a problem. The debuggers available prior to .Bx 4.4 Lite were able to find some information from a normal kernel; -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb provides very little support for normal kernels, and a debug kernel is needed for any meaningful analysis. .Pp For reasons of history, time and space, building a debug kernel is not the default with .Fx : a debug kernel takes up to 30% longer to build and requires about 30 MB of disk storage in the build directory, compared to about 6 MB for a non-debug kernel. A debug kernel is about 11 MB in size, compared to about 2 MB for a non-debug kernel. This space is used both in the root file system and at run time in memory. Use the .Fl g option to build a debug kernel. With this option, .Nm causes two kernel files to be built in the kernel build directory: .Bl -bullet .It .Pa kernel.debug is the complete debug kernel. .It .Pa kernel is a copy of the kernel with the debug symbols stripped off. This is equivalent to the normal non-debug kernel. .El .Pp There is currently little sense in installing and booting from a debug kernel, since the only tools available which use the symbols do not run on-line. There are therefore two options for installing a debug kernel: .Bl -bullet .It .Dq Li "make install" installs .Pa kernel in the root file system. .It .Dq Li "make install.debug" installs .Pa kernel.debug in the root file system. .El .Sh FILES .Bl -tag -width "/sys/ARCH/compile/SYSTEM_NAME" -compact .It Pa /sys/conf/files list of common files system is built from .It Pa /sys/conf/Makefile . Ns Va ARCH generic makefile for the .Va ARCH .It Pa /sys/conf/files . Ns Va ARCH list of .Va ARCH specific files .It Pa /sys/ Ns Va ARCH Ns Pa /compile/ Ns Ar SYSTEM_NAME default kernel build directory for system .Ar SYSTEM_NAME on .Va ARCH . .El .Sh SEE ALSO .Xr config 5 .Pp The .Sx SYNOPSIS portion of each device in section 4. .Rs .\" 4.4BSD SMM:2 .%A S. J. Leffler .%A M. J. Karels .%T "Building 4.3 BSD UNIX System with Config" .%B 4.4BSD System Manager's Manual (SMM) .Re .Sh HISTORY The .Nm utility appeared in .Bx 4.1 . .Pp Before support for .Fl x was introduced, .Cd "options INCLUDE_CONFIG_FILE" included entire configuration file that used to be embedded in the new kernel. This meant that .Xr strings 1 could be used to extract it from a kernel: to extract the configuration information, you had to use the command: .Pp .Dl "strings -n 3 kernel | sed -n 's/^___//p'" .Sh BUGS The line numbers reported in error messages are usually off by one. diff --git a/usr.sbin/dconschat/dconschat.8 b/usr.sbin/dconschat/dconschat.8 index 330f44c530c5..98e79752bf58 100644 --- a/usr.sbin/dconschat/dconschat.8 +++ b/usr.sbin/dconschat/dconschat.8 @@ -1,329 +1,329 @@ .\" Copyright (c) 2003 Hidetoshi Shimokawa .\" 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. .\" .\" 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 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. .\" .\" $FreeBSD$ .\" .\" .Dd February 11, 2003 .Dt DCONSCHAT 8 .Os .Sh NAME .Nm dconschat .Nd user interface to .Xr dcons 4 .Sh SYNOPSIS .Nm .Op Fl brvwRT1 .Op Fl e Ar escape-char .Op Fl h Ar hz .Op Fl C Ar console_port .Op Fl G Ar gdb_port .Op Fl M Ar core .Op Fl N Ar system .Nm .Op Fl brvwR1 .Op Fl h Ar hz .Op Fl C Ar console_port .Op Fl G Ar gdb_port .Op Fl a Ar address .Op Fl u Ar bus_num .Fl t Ar target_eui64 .Sh DESCRIPTION The .Nm utility is designed to provide a way for users to access .Xr dcons 4 (dumb console device) on a local or remote system. The .Nm utility interacts with .Xr dcons 4 using .Xr kvm 3 or .Xr firewire 4 , and interacts with the user over TTY or TCP/IP. To access remote .Xr dcons 4 using .Xr firewire 4 , you have to specify target EUI64 address using the .Fl t option. Physical DMA should be enabled on the target machine for access via FireWire. .Pp The .Nm utility and the .Xr dcons 4 driver communicate using 2 ports, one for the console port and another for remote -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb port. Users are supposed to access .Nm using TTY, .Xr telnet 1 and -.Xr gdb 1 . +.Xr gdb 1 Pq Pa ports/devel/gdb . You can specify listen ports for console and -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb port using the .Fl C and .Fl G options respectively. The port number 0 has special meaning that current TTY (stdin/stdout) is used instead of TCP/IP. A negative port number will disable the port. By analogy with .Xr pty 4 device, the .Xr dcons 4 acts as a slave device and .Nm acts as a master device with .Xr telnetd 8 . .Pp Typed characters are normally transmitted directly to .Xr dcons 4 . A escape character (the default is .Ql ~ ) appearing as the first character of a line is an escape signal; the following are recognized: .Bl -tag -width ident .It Ic ~. Drop the connection and exit. .It Ic ~^G Invoke kgdb on the terminal on which dconschat is running. .It Ic ~^R Reset the target over FireWire if a reset address is registered in Configuration ROM. .It Ic ~^Z Suspend the dconschat process. .El .Pp The following options are supported. .Bl -tag -width indent .It Fl b Translate Ctrl-C to ALT_BREAK (CR + .Ql ~ + Ctrl-B) on -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb port. .It Fl r Replay old buffer on connection. .It Fl v Verbose debug output. Multiple .Fl v options increase verbosity. .It Fl w Listen on a wildcard address rather than localhost. .It Fl R Read-only. Do not write anything to the .Xr dcons 4 buffer. .It Fl T Enable ad-hoc workaround for the TELNET protocol to remove unnecessary byte sequences. It should be set when you access .Nm using .Xr telnet 1 . .It Fl 1 One-shot. Read available buffer, then exit. This implies the .Fl r option. .It Fl e Ar escape-char Specify escape character. The default is '~'. .It Fl h Ar hz Specify polling rate. The default value is 100. .It Fl C Ar console_port Specify the console port. The default value is 0 (stdin/stdout). .It Fl G Ar gdb_port Specify -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb port. The default value is \-1 (disabled). .It Fl M Ar core Specify core file. .It Fl N Ar system Specify system file such as .Pa /boot/kernel/kernel . .It Fl t Ar target_eui64 Specify the 64-bit extended unique identifier of the target, and use FireWire to access remote .Xr dcons 4 . .It Fl a Ar address Specify the physical I/O address of the .Xr dcons 4 buffer. See .Xr dcons 4 for details. If this option is not specified, .Nm tries to get the address from the Configuration ROM on the target. You are supposed to enable .Xr dcons_crom 4 on the target to omit this option. .It Fl u Ar bus_num Specify FireWire bus number. The default is 0. .El .Sh FILES .Bl -tag -width indent -compact .It Pa /dev/fwmem0.0 .It Pa /dev/mem .It Pa /dev/kmem .El .Sh EXAMPLES To use .Nm with FireWire for remote .Xr dcons 4 , you have to specify the EUI64 of the target. You can obtain EUI64 by running .Xr fwcontrol 8 without options. The first EUI64 is of the host running .Xr fwcontrol 8 and others on the bus follow. .Bd -literal -offset indent # fwcontrol 2 devices (info_len=2) node EUI64 status 1 77-66-55-44-33-22-11-00 0 0 00-11-22-33-44-55-66-77 1 .Ed .Pp The EUI64 does not change unless you change the hardware as the ethernet address. .Pp Now we can run .Nm . .Bd -literal -offset indent # dconschat -br -G 12345 -t 00-11-22-33-44-55-66-77 .Ed .Pp You will get console output of the target and login prompt if a .Xr getty 8 is running on .Xr dcons 4 . You can break to DDB with ALT_BREAK (CR + .Ql ~ + Ctrl-B) if .Dv DDB and .Dv ALT_BREAK_TO_DEBUGGER are enabled in the target kernel. To quit the session, type CR + .Ql ~ + .Ql \&. in the console port. .Pp Using -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb port is almost the same as remote -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb over serial line except using TCP/IP instead of .Pa /dev/cu* . See .Sx "On-line Kernel Debugging Using Remote GDB" section of .%T "The FreeBSD Developers Handbook" and .Xr gdb 4 for details. .Bd -literal -offset indent % gdb -k kernel.debug (kgdb) target remote :12345 .Ed .Pp Once -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb is attached and you specified the .Fl b option to .Nm , typing Ctrl-C in -.Xr gdb 1 +.Xr gdb 1 Pq Pa ports/devel/gdb causes a break to debugger. .Pp The following command gets the console log from the crash dump: .Bd -literal -offset indent # dconschat -1 -M vmcore.0 -N kernel.0 .Ed .Pp If you want access to the console using .Xr telnet 1 , try the following: .Bd -literal -offset indent # dconschat -rTC 5555 & # telnet localhost 5555 .Ed .Pp You may want to keep logging console output of several machines. .Nm conserver-com in the Ports collection may help you. Insert the following lines in .Pa conserver.cf : .Bd -literal -offset indent console local { master localhost; type exec; exec /usr/sbin/dconschat -rh 25; } console remote { master localhost; type exec; exec /usr/sbin/dconschat -rh 25 -t 00-11-22-33-44-55-66-77; } .Ed .Sh SEE ALSO -.Xr gdb 1 , +.Xr gdb 1 Pq Pa ports/devel/gdb , .Xr telnet 1 , .Xr kvm 3 , .Xr dcons 4 , .Xr dcons_crom 4 , .Xr ddb 4 , .Xr firewire 4 , .Xr fwohci 4 , .Xr gdb 4 , .Xr eui64 5 , .Xr fwcontrol 8 .Sh AUTHORS .An Hidetoshi Shimokawa Aq Mt simokawa@FreeBSD.org .Sh BUGS This utility is .Ud