码迷,mamicode.com
首页 > 其他好文 > 详细

Operating System: Three Easy Pieces --- Beyond Physical Memory: Mechanisms (Note)

时间:2015-10-07 08:34:19      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

Thus far, we have assumed that an address space is unrealistically small and fits into the physical

memory. In fact, we have been assuming that every address space of ervery running process fits

into memory. We will now relax these big assumptions, and assume that we wish to support many

concurrently-running large address space. To do so, we require an additional level in the memory

hierarchy. Thus far, we have assumed that all page tables in physical memory. However, to support

large address space, the OS will need a place to stash away portions of address spaces that currently

are not in great demand. In general, the characteristics of such a location are that it should have more

capacity than memory; as a result, it is generally slower (if it were faster, we would just use it as

memory, no?). In modern systems, this role is usually served by a hard disk dirve. Thus in our memory

hierarchy, big and slow hard drive sit at the bottom, with memory just above. And thus, we arrive

at the crux of the problem: How to go beyond physical memory? How can the OS make use of a larger,

slower device to transparently provide the illusion of a large virtual address space ? One question you

might have: why do we want to support a single large address space for a process ? Once again, the

answer is covenience and ease of use. With a large address space, you do not have to worry about

if there is room enough in memory for your program‘s data structure; rather, you just write the program

naturally, allocating memory as needed. It is a powerful illusion that the OS provides; and makes your

life vastly simpler. You are welcome! A contrast is found in older systems that used memory overlays,

which require programmers to manually move pieces of code or data in and out of memory as they

were needed. Try imagining what this would like: before calling a function or accessing some data,

you need to first arrange for the code or data to be in memory. Yuck!

Operating System: Three Easy Pieces --- Beyond Physical Memory: Mechanisms (Note)

标签:

原文地址:http://www.cnblogs.com/miaoyong/p/4858185.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!