A Simple Example And Overview
Understand paging further by studying the brief overview and the demonstration of paging provided in this lesson.
We'll cover the following...
To help make this approach more clear, let’s illustrate it with a simple example.
Example
The figure below presents an example of a tiny address space, only 64 bytes total in size, with four 16-byte pages (virtual pages 0, 1, 2, and 3).
Real address spaces are much bigger, of course, commonly 32 bits and thus 4-GB of address space or even 64 bits; in the course, we’ll often use tiny examples to make them easier to digest.
Physical memory, as shown in the figure below, also consists of a number of fixed-sized slots, in this case, eight page frames (making for a 128-byte physical memory, also ridiculously small).
As you can see in the diagram, the pages of the virtual address space have been placed at different locations throughout physical memory. The diagram also shows the OS using some of the physical memory for itself.
Advantages of paging
Paging, as we will see, has a number of advantages over our previous approaches.
Flexibility
Probably the most important improvement will be flexibility: with a fully-developed paging approach, the system will be able to support the abstraction of an address space effectively, regardless of how a process uses the address space; we won’t, for example, make assumptions about the direction the heap and stack grow and how they are used.
Simplicity
Another advantage is the simplicity of ...