kvar(8) — RISC
Name
kvar − modify RISC kernel variables in memory or on disk
Syntax
/usr/etc/kvar -r(b|w|l) [options] vmunix
/usr/etc/kvar -w(b|w|l) [options] vmunix
Description
The kvar command allows you to read or write RISC kernel variables, either in the on-disk image of vmunix or the active in-memory image. The −r form of the command does variable reads; the −w form does variable writes. The variable length qualifiers are: b (1 byte), w (word, or 2 bytes), and l (longword, or 4 bytes).
Variable contents are displayed in hexadecimal format.
Options
−a address Specifies the address of the kernel variable. Either the −a or −s option must be specified. The address is specified as either a positive decimal or hexadecimal constant.
−k Instructs kvar to use the in-memory image of vmunix (/dev/kmem). The default is to use the on-disk copy.
−l Searches for a local symbol. The default is a global symbol search.
−o offset Adds an offset to the address (or address of the symbol name). The offset value is specified as either a positive decimal or hexadecimal constant.
−s name Specifies the name of the kernel variable.
−v value Specifies the new value to be assigned by the −w form of kvar. The −v option is ignored if the −r form of kvar is being used. The value is specified as either a positive decimal or hexadecimal constant.
Restrictions
You must have appropriate file access permissions for /vmunix (and for /dev/kmem with the −k option).
The kvar command is available only on RISC systems. For VAX systems, use adb() to modify kernel variables.
Examples
This example reads the variable ‘udpcksum’ from the running kernel image:
% kvar −k −rl −s udpcksum /vmunix
This example sets the ‘xyz’ variable to zero in the running kernel image:
% kvar −k −wl −s xyz −v 0 /vmunix
This example sets the variable ‘xyz’ to -1 in the on-disk image of vmunix making this value persistent across reboots:
% kvar −wl −s xyz −v 0xffffffff /vmunix
This example sets to zero 1 byte at offset 2 from address 0x80161a98 in the running kernel image:
% kvar −k −wb −o 2 −a 0x80161a98 /vmunix
Files
/dev/kmem
/vmunix