doubts in vkernel
abhinavjainc87 at gmail.com
Fri Mar 13 19:59:27 PDT 2009
Hello all,I have been trying to read the dragon fly bsd code understanding the concepts behind the architecture and also read the article a peek at the vkernel . I have not been able to understand certain subtle concepts, if anyone can pls clear my doubts I will be very thankful
Firstly,Since the vkernel code and static data are not part of the Virtual RAM , so how are the virtual to physical mapping done in this case, I mean while initialization it executes the code from outside the V RAM , which is fine, but after starting of user process and then context switching into the vkernel again, how is control passed to code and data outside the mmap'ed backing store or V RAM
Secondly,In case of page faults the way i understand the architecture is that when a fault is taken it is an exception so it is directly transferred to the real kernel, which knows that this fault is of the vproc, so it reads the virtual page tables in software and do the corresponding change in the real page table also and transfer control back vproc. Again if the entry is not found in the virtual page tables, the real kernel switches the address space to that of vkernel and also switches the CR3 to tht of the page table corresponding to that of the vkernel. Now the control is transferred to vm_fault() of vkernel which makes appropriate entries into its page tables and then lets the real kernel do the rest .
So we have 2 scenarios in page faults, can anyone pls explain me with a practical eg. how 2 scenarios come into picture. I have also not understood the use of system call vmspace_mmap(), I mean if the real kernel maintains a simple structure of vproc with a single entry of vm_map_entry with address from 0 to VM_MAX_USER_ADDRESS then how does the vmspace_mmap help.
More information about the Kernel