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