
The 68010 175
the tenth word in the virtual page corresponds to the tenth word in the
physical page. Since the virtual address space is normally much larger
than the physical memory, it is necessary to temporarily store the pages
that won’t fit into physical memory. For example, we might have just
1 megabyte of physical memory, while the 68010 can address up to 16
megabytes. Normally a disk memory is used to store the pages that are
not in physical memory. This is sometimes called a backing store. The
backing store does not have to be as large as the addressing capability of
the CPU if the size of the virtual address space is reduced.
Now we can tie up the loose ends. If an instruction references an
address that is mapped to physical memory, the memory management
hardware makes that address immediately available and no bus error
is generated. If a reference is made to an address that is not currently
mapped, a bus error exception will occur. This is normally called a page
fault when paging is used. The operating system now gets control. It is
responsible for finding the proper page on the backing store and bringing
it into memory. Once it is in memory, the operating system can execute
the RTE instruction with the stack pointer pointing at the same place it
was when the bus error was initially processed. This will return control
to the instruction that generated the bus error, and it will now be able to
access the address.
This may sound simple, but an operating system has a lot of bookeep-
ing to do in order to get all the pages mapped correctly. Many operating
systems textbooks will provide more information on the techniques used
to implement paging. Figure 15 shows a possible mapping of virtual pages
to physical page frames. Notice that some of the pages are not mapped.
Any reference to an address in one of these pages will generate a bus
error and hence a page fault.
Virtual Machines
Like virtual memory, a virtual machine provides the illusion of a
bare-bones machine. In other words, it appears to the user that all the
functionality of the machine is available. The user must not be aware
that a virtual machine operating system is running underneath her own
operating system.
In order to implement a true virtual machine, not only does the CPU
have to appear as a bare CPU, but any input/output devices must also
be made available to each user. Virtual memory can provide the illusion
of a specific physical memory (all users must have access to the same
addressing range). Since input/output devices are memory-mapped, they
can be replicated or shared for each user and appear at the same physical
Kommentare zu diesen Handbüchern