zoukankan      html  css  js  c++  java
  • Paging

    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION

    Both unequal fixed-size and variable-size partitions are inefficient in the use of
    memory. Suppose, however, that memory is partitioned into equal fixed-size chunks
    that are relatively small, and that each process is also divided into small fixed-size
    chunks of some size. Then the chunks of a program, known as
    pages
    , could be
    assigned to available chunks of memory, known as
    frames
    , or page frames. At most,
    then, the wasted space in memory for that process is a fraction of the last page.
     
    Figure 8.15 shows an example of the use of pages and frames. At a given point
    in time, some of the frames in memory are in use and some are free. The list of free
    frames is maintained by the OS. Process A, stored on disk, consists of four pages.
    When it comes time to load this process, the OS finds four free frames and loads the
    four pages of the process A into the four frames.
     
     
    Now suppose, as in this example, that there are not sufficient unused con-
    tiguous frames to hold the process. Does this prevent the OS from loading A?
    The answer is no, because we can once again use the concept of logical address. A
    simple base address will no longer suffice. Rather, the OS maintains a
    page table
    for each process. The page table shows the frame location for each page of the
    process. Within the program, each logical address consists of a page number and
    a relative address within the page. Recall that in the case of simple partitioning, a
    logical address is the location of a word relative to the beginning of the program;
    the processor translates that into a physical address. With paging, the logical-
    to-physical address translation is still done by processor hardware. The processor
    must know how to access the page table of the current process. Presented with a
    logical address (page number, relative address), the processor uses the page table
    to produce a physical address (frame number, relative address). An example is
    shown in Figure 8.16.
     
    This approach solves the problems raised earlier. Main memory is divided
    into many small equal-size frames. Each process is divided into frame-size pages:
    smaller processes require fewer pages, larger processes require more. When a
    process is brought in, its pages are loaded into available frames, and a page table
    is set up.
     
  • 相关阅读:
    UBUNTU开机时出现“waiting for network configuration” 问题的解决 (转) 沉沉_
    模拟地与数字地(转) 沉沉_
    转 parsing error:expected ")" 解决方法 沉沉_
    转 按Enter键或者ESC键,程序退出的解决方法 沉沉_
    C语言中的常量 沉沉_
    TI C64X DSP中断向量表的配置(硬件中断) 转自新浪博客 沉沉_
    只用串口和网络裸机开发ARM程序(OK6410开发板) 沉沉_
    ubuntu 上开启 网络文件系统(NFS) 沉沉_
    Visual Studio 2010 Express for Windows Phone 新建项目时为何不显示 XNA
    Win32汇编菜单进阶之右键弹出菜单
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6216603.html
Copyright © 2011-2022 走看看