X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=HACKING;h=2fb11795d6624bbac87ce30157338897d987b236;hb=5a960be177bdfbbb1d62f96490e355e3e3e54f12;hp=52b9829550e250790ad5b24229138475f5567659;hpb=4b1de82d204510ea22b0af47b9b3476dee8f59e7;p=virt-mem.git diff --git a/HACKING b/HACKING index 52b9829..2fb1179 100644 --- a/HACKING +++ b/HACKING @@ -1,3 +1,6 @@ +Source files +------------ + We build all the tools into a single virt-mem executable, in order to share the most runtime. Almost all the code between individual tools is shared anyway. @@ -7,15 +10,56 @@ lib/ - The common core of all the tools. Library, kernel symbols, command line handling, memory images, etc. - lib/virt_mem.ml contains most of the important code. + lib/virt_mem.ml contains most of the important 'glue' code. uname/ dmesg/ etc. - - The code specific to each tool, usually rather small. + - The code specific to each tool. This is usually rather small because + the code in lib/ does the hard work. mem/ - This brings everything together and links it into a single executable. Other than that purpose, there is almost nothing in this directory. + +kernels/ + + - The database of known kernels and the layout of their structures. + +extract/ + + - Tools to extract the structure layout data from kernels. Various + subdirectories here correspond to the different Linux distributions + and methods of getting at their kernels. + +General structure of lib/virt_mem.ml +------------------------------------ + +We start with a bare kernel memory image ('Virt_mem_types.image0') +which gets successively enhanced with extra data along the way: + + Parse command line arguments, + work out what virtual machines to + process, load kernel images + + | + | (passes a 'Virt_mem_types.image0') + V + + Find kernel symbols + + | + | (enhanced into a 'Virt_mem_types.image1') + V + + Find kernel version (uname) + + | + | (enhanced into a 'Virt_mem_types.image2') + V + + Call tool's "run" function. + +Tools can register other callbacks which get called at earlier stages. \ No newline at end of file