Skip to main content

Posts

Showing posts from August 4, 2020

mmap.c

mmap.c 1. 3 kinds of protection: Read, Write and Execute 2. 2 kinds of mappings: Private and Shared 3. VMA flags are set in vm area struct . This is in the lask struct structure (aka current for the currently executing process 4. Arch may decide to not have its page protection returned - This is why the page protection part is within a config loop.     1. Note that this is different from the way config options are generally used in kernel. Generally the entire function is either callable (with correct behavior) or callable (with no behavior) => The second case pertains to config option not being specified. 5. There is a concept of write notify. Need to understand this better. Specific question - How will the VMA user get notified?     1.  if (vma_wants_writenotify(vma, vm_page_prot)) { 6. Something called interval tree - Find out what it is.     vma_interval_tree_remove(vma, &mapping->i_mmap); 7. Main concepts are rb_tree and vma_cache ##Important functions **void vma_set_pag