How do I control access to memory via virtual addresses?
Posted: Mon Feb 24, 2020 3:03 am
Hi.
I write MMU. And I have 4 questions about this.
1. I want to store page addresses and their busy status, for this I will create an array of 1048575 elements, is this correct?
2. I want to search for pages using a loop that will go through all the pages and search for free pages, on a virtual machine iterating over such a large array takes about 0.04-0.07 seconds and it seems to me that this is normal. Is this correct?
3. Upon request of memory, you will be given a virtual address, how can I when queried, the virtual address to give the physical address?
4. Do I use virtual addresses when allocating memory in the kernel?
I am particularly interested in the answer to question 2 and 3.
Thanks.
I write MMU. And I have 4 questions about this.
1. I want to store page addresses and their busy status, for this I will create an array of 1048575 elements, is this correct?
2. I want to search for pages using a loop that will go through all the pages and search for free pages, on a virtual machine iterating over such a large array takes about 0.04-0.07 seconds and it seems to me that this is normal. Is this correct?
3. Upon request of memory, you will be given a virtual address, how can I when queried, the virtual address to give the physical address?
4. Do I use virtual addresses when allocating memory in the kernel?
I am particularly interested in the answer to question 2 and 3.
Thanks.