2012/11/11

Those Things about Memory Mapping ... / Memory Mapping 的那些事


I have just learned computer architecture but OS so never linked them at all. These days I finished tracing a sample bootcode and read the arm programming guide. A sentence caught my eye which means every process has its own memory mapping, there are many page tables on runtime. I was too stupid to think there was only one page table where one program occupied part of memory and the code followed the rules in the part of memory, instructions on the bottom, stack on the top... Another impact was that it could allocate new memory by updating the page tables. I never knew it.

Several days after that day, I continuously construct the imagination of the code arrangement in the memory mapping, how the OS deals with the page tables. I only know that one program must ask the OS to get more space.


Discussing with one of my colleagues in SW team and looking for some information, my imagination is very close to the real case but remains some problems to solve, e.g. share libraries. Understanding Memory describes very clearly.



My Descriptions

Codes in a process are mapped to whole virtual memory space, i.e. 4GB in 32b system. OS finds unused spaces and updates the page table to map these codes to appropriate spaces. When it needs to allocate more space, OS searches free spaces in memory then update the page table of the process so that it can access the spaces.



沒有留言:

張貼留言