CST 334 Week 3
WELCOME TO WEEK 3
This week I learned a lot of new things that focused on the virtualization of memory. Among the things I learned was the abstraction called address space, which is the running program's view of the memory in the system. The address space for each process contains the code of the program, the heap which is used to dynamically allocate memory, and the stack, which can allocate local variables. Programs use a virtual address, and the OS, with the support of the hardware, ensures the load goes to the appropriate physical address.
There are a few goals that must be considered for the virtualization of memory. These goals are transparency, efficiency, and protection. Protection also enables isolation, which is very important to maintain among the processes. It is also important that when allocating memory, it is done correctly. For example, using the malloc( ) call with the appropriate arguments and ensuring we request enough memory. When we are done with these pointers, it is also important to use the free( ) call to clean our memory and have the free space available.
As mentioned before, the OS and hardware are able to turn the virtual address into a physical address through a process called address translation. We focus on limited direct execution while keeping efficiency and control in mind. To do this, two hardware registers within each CPU are needed. The base register places the base address. To get the physical address, we need to add the base to the virtual address. Once we do this, we will get the physical address. However, it is important to know that the bounds register will check if the physical address is legal. If the process generates a virtual address bigger than the bounds, the CPU will raise an exception. Otherwise, it will perform the dynamic relocation.
Comments
Post a Comment