CST 334: Week 3
Write a 1 - 2 paragraph journal post, of at least 250 words, of what you learned this week in CST 334.
This week we learned more about address spaces. For example, we learned that each location in RAM memory has a physical address. When we are working in a code editor, we refer to values with variable names, while when the program is compiled, they are turned into memory addresses. Additionally, each process has its own address space, which is a set of addresses the compiler can use to address memory. Compiled code consists of virtual memory addresses, which are translated into physical addresses if they fit within a designated address space. If a program tries to address memory outside the address space, a trap occurs. The name of the hardware component that is used to implement virtual memory into physical memory is called the memory management unit, or the MMU. As part of the MMU, the base and bounds registers are used to determine the size of a process’ virtual space and the physical address of its virtual ‘0’ address. Before the OS runs a process, it places the process’ base and bounds values into the registers. At process creation, the OS will find physical memory for it and reclaim that physical memory once the process is terminated. Should a context switch occur, the OS will save the base and bounds values of the process that is stopped and restores the registers with values of the process to be run. Lastly, we had learned that not all address spaces are contiguous and that some can be segmented into different places. Segmentation helps simplify the way we handle memory, but this can also lead to fragmentation, where free memory can end up in unusable chunks.
Comments
Post a Comment