Overview

Address spaces are an essential concept in operating systems. An address space is a set of addresses that a process can use to access memory locations. It provides a logical view of how a process can access memory, while the operating system is responsible for mapping these logical addresses to the physical memory locations. Address spaces help in ensuring that the memory is used efficiently, and programs can run without interfering with each other.

Dynamic relocation is an essential aspect of address spaces. It allows programs to be loaded into memory at different locations, so that they do not interfere with other programs. Dynamic relocation requires hardware support from the processor, which includes a Memory Management Unit (MMU) and Virtual Memory.

The advantages of dynamic relocation are that it enables the operating system to load multiple programs into memory, ensuring that they do not interfere with each other. This feature allows programs to be written and tested independently, reducing the risk of bugs and errors in the code. Additionally, it provides a level of security by preventing processes from accessing memory outside of their address space.

Base and bounds are two techniques used in implementing address spaces. The base register contains the starting address of the process's memory, while the bounds register specifies the range of memory that the process can access. Base and bounds can be used to ensure that a process can only access memory within its address space.

Internal and external fragmentation are two issues that can arise when managing address spaces. Internal fragmentation occurs when a process allocates memory that is larger than what it needs, leading to wasted space. External fragmentation, on the other hand, occurs when there is free memory, but it is not contiguous, leading to the inability to allocate large blocks of memory.

To summarize, address spaces are an essential concept in operating systems, allowing processes to access memory locations. Dynamic relocation, base and bounds, and memory management hardware are all essential features of address spaces. While fragmentation can be a problem, proper management of address spaces can ensure that memory is used efficiently and processes can run without interfering with each other.

Assigned Reading

I know, there are many chapters here. But, really, it is not as much as you think. Chapter 12 is short, but you should read it. Chapter 13 is about 6 pages of material. Chapter 14 is 8 pages, but material you should already know. Chapter 15 is 13 pages and is the real meat of the material which you should pay attention to. You should read a chapter a day for the next four days after reading this paragraph. It will keep you on target with what you should know.

Slides

https://docs.google.com/presentation/d/1AKJgdFE3Ory0ZYU6gUr1Uhbny685glq_Cz3GLikiMrU/edit?usp=sharing

Example Code

Take a look at the associated code for this chapter on GitHub.

ostep-code/vm-intro at master ยท remzi-arpacidusseau/ostep-code

References / Resources