Program to extract kernels from Fedora's Koji, parse the debug info
[virt-mem.git] / HACKING
1 Source files
2 ------------
3
4 We build all the tools into a single virt-mem executable, in order to
5 share the most runtime.  Almost all the code between individual tools
6 is shared anyway.
7
8 lib/
9
10  - The common core of all the tools.  Library, kernel symbols, command
11    line handling, memory images, etc.
12
13    lib/virt_mem.ml contains most of the important 'glue' code.
14
15 uname/
16 dmesg/
17   etc.
18
19  - The code specific to each tool.  This is usually rather small because
20    the code in lib/ does the hard work.
21
22 mem/
23
24  - This brings everything together and links it into a single executable.
25    Other than that purpose, there is almost nothing in this directory.
26
27 kernels/
28
29  - The database of known kernels and the layout of their structures.
30
31 extract/
32
33  - Tools to extract the structure layout data from kernels.  Various
34    subdirectories here correspond to the different Linux distributions
35    and methods of getting at their kernels.
36
37 General structure of lib/virt_mem.ml
38 ------------------------------------
39
40 We start with a bare kernel memory image ('Virt_mem_types.image0')
41 which gets successively enhanced with extra data along the way:
42
43         Parse command line arguments,
44         work out what virtual machines to
45         process, load kernel images
46
47                 |
48                 |       (passes a 'Virt_mem_types.image0')
49                 V
50
51         Find kernel symbols
52
53                 |
54                 |       (enhanced into a 'Virt_mem_types.image1')
55                 V
56
57         Find kernel version (uname)
58
59                 |
60                 |       (enhanced into a 'Virt_mem_types.image2')
61                 V
62
63         Call tool's "run" function.
64
65 Tools can register other callbacks which get called at earlier stages.