Currently I've written the following short code segment:
struct task_struct *task_list;
struct mm_struct *mm = task_list->mm;
My goal is to take a snapshot of the process during runtime (or while its state is waiting - whichever is easier).
Process Address Soace Structures
Above I have included a graph of what mm_struct holds and I guess what I'm having trouble with is actually figuring out where the "vm_end" and "vm_start" sections of the struct are and if they actually contain the start/stop address I need in order to copy the memory of a process. Because vm_start and vm_end are a part of a struct called vm_region, not mm_struct. So, how do I take these values which are the beginning and ends of a memory region and how do I actually reference them in memory?
Would I need to access struct vm_area_struct *mmap
? Since it is a list of VMA's?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…