xref: /original-bsd/lib/libkvm/kvm.3 (revision c3e32dec)
1.\" Copyright (c) 1992, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software developed by the Computer Systems
5.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract
6.\" BG 91-66 and contributed to Berkeley.
7.\"
8.\" %sccs.include.redist.man%
9.\"
10.\"     @(#)kvm.3	8.1 (Berkeley) 06/04/93
11.\"
12.Dd
13.Dt KVM 3
14.Os
15.Sh NAME
16.Nm kvm
17.Nd kernel memory interface
18.Sh DESCRIPTION
19The
20.Xr kvm 3
21library provides a uniform interface for accessing kernel virtual memory
22images, including live systems and crashdumps.
23Access to live systems is via
24/dev/mem
25while crashdumps can be examined via the core file generated by
26.Xr savecore 8 .
27The interface behaves identically in both cases.
28Memory can be read and written, kernel symbol addresses can be
29looked up efficiently, and information about user processes can
30be gathered.
31.Pp
32.Fn kvm_open
33is first called to obtain a descriptor for all subsequent calls.
34.Sh COMPATIBILITY
35The kvm interface was first introduced in SunOS.  A considerable
36number of programs have been developed that use this interface,
37making backward compatibility highly desirable.
38In most respects, the Sun kvm interface is consistent and clean.
39Accordingly, the generic portion of the interface (i.e.,
40.Fn kvm_open ,
41.Fn kvm_close ,
42.Fn kvm_read ,
43.Fn kvm_write ,
44and
45.Fn kvm_nlist )
46has been incorporated into the BSD interface.  Indeed, many kvm
47applications (i.e., debuggers and statistical monitors) use only
48this subset of the interface.
49.Pp
50The process interface was not kept.  This is not a portability
51issue since any code that manipulates processes is inherently
52machine dependent.
53.Pp
54Finally, the Sun kvm error reporting semantics are poorly defined.
55The library can be configured either to print errors to stderr automatically,
56or to print no error messages at all.
57In the latter case, the nature of the error cannot be determined.
58To overcome this, the BSD interface includes a
59routine,
60.Xr kvm_geterr 3 ,
61to return (not print out) the error message
62corresponding to the most recent error condition on the
63given descriptor.
64.Sh SEE ALSO
65.Xr kvm_close 3 ,
66.Xr kvm_getargv 3 ,
67.Xr kvm_getenvv 3 ,
68.Xr kvm_geterr 3 ,
69.Xr kvm_getloadavg 3 ,
70.Xr kvm_getprocs 3 ,
71.Xr kvm_nlist 3 ,
72.Xr kvm_open 3 ,
73.Xr kvm_openfiles 3 ,
74.Xr kvm_read 3 ,
75.Xr kvm_write 3
76