青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 297,  comments - 15,  trackbacks - 0

CHAPTER 3 PROTECTED-MODE MEMORY MANAGEMENT

3.1. MEMORY MANAGEMENT OVERVIEW

The memory management facilities of the IA-32 architecture are divided into two parts: segmentation and paging. Segmentation provides a mechanism of isolating individual code, data, and stack modules so that multiple programs (or tasks) can run on the same processor without interfering with one another. Paging provides a mechanism for implementing a conventional demand-paged, virtual-memory system where sections of a program’s execution environment are mapped into physical memory as needed. Paging can also be used to provide isolation between multiple tasks. When operating in protected mode, some form of segmentation must be used. There is no mode bit to disable segmentation. The use of paging, however, is optional.

IA-32架構的內存管理機構(facilities)可劃分為兩個部分:分段(segmentation)和分頁(paging)。分段功能提供了分隔 代碼、數據和堆棧的機制,從而使多個進程運行在同一個CPU物理地址空間內而互不影響;分頁可用來實現一種“請求頁式(demand-paged)”的虛 擬內存機制,從而頁化程序執行環境,在程序運行時可將所需要的頁映射到物理內存。分頁機制也可用作隔離多進程任務。分段功能是CPU保護模式必須的,沒有 設置位可以屏蔽內存分段;不過內存分頁則是可選的。

These two mechanisms (segmentation and paging) can be configured to support simple single-program (or single-task) systems, multitasking systems, or multiple-processor systems that used shared memory.

As shown in Figure 3-1, segmentation provides a mechanism for dividing the processor’s addressable memory space (called the linear address space) into smaller protected address spaces called segments. Segments can be used to hold the code, data, and stack for a program or to hold system data structures (such as a TSS or LDT). If more than one program (or task) is running on a processor, each program can be assigned its own set of segments. The processor then enforces the boundaries between these segments and insures that one program does not interfere with the execution of another program by writing into the other program’s segments.

分段和分頁機制被配置成支持單任務系統、多任務系統或多處理器系統。

如圖3-1,內存分段將CPU的可尋址空間(稱為線性地址空間)劃分更小的受保護的內存段,這些段存放程序的數據(代碼、數據和堆棧)和系統的數據結構 (像TSS 或 LDT)。如果處理器運行著多個任務,那么每個任務都有一集自己獨立的內存段。

The segmentation mechanism also allows typing of segments so that the operations that may be performed on a particular type of segment can be restricted.

All the segments in a system are contained in the processor’s linear address space. To locate a byte in a particular segment, a logical address (also called a far pointer) must be provided. A logical address consists of a segment selector and an offset. The segment selector is a unique identifier for a segment. Among other things it provides an offset into a descriptor table (such as the global descriptor table, GDT) to a data structure called a segment descriptor. Each segment has a segment descriptor, which specifies the size of the segment, the access rights and privilege level for the segment, the segment type, and the location of the first byte of the segment in the linear address space (called the base address of the segment). The offset part of the logical address is added to the base address for the segment to locate a byte within the segment. The base address plus the offset thus forms a linear address in the processor’s linear address space.

進程的各個段都必須位于CPU的線性空間之內,進程要訪問某段的一個字節,必須給出該字節 的邏輯地址(也叫遠指針)。邏輯地址由段選擇子(segment selector )和偏移值組成。段選擇子是段的唯一標識,指向一個叫段描述符的數據結構;段描述符位于一個叫描述表之內(如全局描述表GDT); 每個段必須都有相應的段描述符,用以指定段大小、訪問權限和段的特權級別(privilege level)、段類型和段的首地址在線性地址空間的位置(叫段的基地址)。邏輯地址通過基地址加上段內偏移得到。

If paging is not used, the linear address space of the processor is mapped directly into the physical address space of processor. The physical address space is defined as the range of addresses that the processor can generate on its address bus.

Because multitasking computing systems commonly define a linear address space much larger than it is economically feasible to contain all at once in physical memory, some method of “virtualizing” the linear address space is needed. This virtualization of the linear address space is handled through the processor’s paging mechanism.

如果不用分頁功能,處理器的[線性地址空間]就會直接映射到[物理地址空間]。[物理地址空間]的大小就是處理器能通過地址總線產生的地址范圍。為了直接 使用線性地址空間從而簡化編程和實現多進程而提高內存的利用率,需要實現某種對線性地址空間進行“虛擬化(virtualizing)”,CPU的分頁機 制實現了這種虛擬化。

Paging supports a “virtual memory” environment where a large linear address space is simulated with a small amount of physical memory (RAM and ROM) and some disk storage. When using paging, each segment is divided into pages (typically 4 KBytes each in size), which are stored either in physical memory or on the disk. The operating system or executive maintains a page directory and a set of page tables to keep track of the pages. When a program (or task) attempts to access an address location in the linear address space, the processor uses the page directory and page tables to translate the linear address into a physical address and then performs the requested operation (read or write) on the memory location. If the page being accessed is not currently in physical memory, the processor interrupts execution of the program (by generating a page-fault exception). The operating system or executive then reads the page into physical memory from the disk and continues executing the program.

“虛擬內存”就是利用物理內存和磁盤來對CPU的線性地址進行模擬(kemin:高級語言源碼指定的是符號地址,是虛的,有了虛擬內存即便是用匯編指定一 固定地址也是虛的。問題是這些虛存是怎么管理的)。當使用分頁時,進程的每個段都會被分成大小固定的頁,這些頁可能在內存中,也可能在磁盤。操作系統用了 一張頁目錄(page directory)和多張頁表來管理這些頁。當進程試圖訪問線性地址空間的某個位置,處理器會通過頁目錄和頁表先將線性地址轉換成物理地址,然后再訪問 (讀或寫)(kemin:轉換細節沒有講)。如果被訪問的頁當前不在內存,處理就會中斷進程的運行(通過產生缺頁異常中斷)(kemin:怎么判斷某頁不 在內存?)。操作系統負責從磁盤讀入該頁并繼續執行該進程(kemin:頁讀入的前前后后沒有講)。

When paging is implemented properly in the operating-system or executive, the swapping of pages between physical memory and the disk is transparent to the correct execution of a program. Even programs written for 16-bit IA-32 processors can be paged (transparently) when they are run in virtual-8086 mode.


from:

http://blog.csdn.net/keminlau/archive/2008/10/19/3090337.aspx

posted on 2010-03-25 15:03 chatler 閱讀(586) 評論(0)  編輯 收藏 引用 所屬分類: OS
<2010年3月>
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

常用鏈接

留言簿(10)

隨筆分類(307)

隨筆檔案(297)

algorithm

Books_Free_Online

C++

database

Linux

Linux shell

linux socket

misce

  • cloudward
  • 感覺這個博客還是不錯,雖然做的東西和我不大相關,覺得看看還是有好處的

network

OSS

  • Google Android
  • Android is a software stack for mobile devices that includes an operating system, middleware and key applications. This early look at the Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.
  • os161 file list

overall

搜索

  •  

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            免费不卡在线视频| 美女黄色成人网| 国产精品日本精品| 亚洲欧美日本视频在线观看| 夜夜嗨av一区二区三区四季av | 久久久久久91香蕉国产| 午夜精品视频一区| 一色屋精品视频在线看| 欧美国产大片| 欧美午夜不卡视频| 欧美一区二区视频观看视频| 久久成人人人人精品欧| 亚洲激精日韩激精欧美精品| 亚洲黄网站在线观看| 欧美日韩成人综合在线一区二区| 亚洲色图自拍| 欧美一级片在线播放| 136国产福利精品导航网址应用| 亚洲电影第1页| 国产精品萝li| 欧美高清在线观看| 国产精品美腿一区在线看| 久久综合狠狠综合久久综青草| 欧美aaa级| 欧美一区二区三区在线视频 | 欧美激情片在线观看| 欧美精品不卡| 久久久亚洲影院你懂的| 欧美成人午夜激情在线| 欧美在线一二三| 欧美成人高清视频| 欧美一区久久| 欧美激情在线有限公司| 欧美一区二区观看视频| 欧美精品999| 噜噜爱69成人精品| 国产精品成人v| 亚洲国产精品一区制服丝袜| 国产伦精品一区二区三区高清版| 亚洲高清在线观看一区| 国产亚洲精久久久久久| 在线一区观看| 日韩系列在线| 麻豆精品一区二区av白丝在线| 欧美一区二区三区视频| 欧美日韩一区二区三区视频 | 亚洲欧美日韩一区| 欧美高清影院| 美日韩精品视频| 国产精品一二一区| 亚洲麻豆国产自偷在线| 亚洲高清资源| 久久久成人网| 久久综合影音| 国模私拍视频一区| 欧美一区二区三区婷婷月色| 亚洲自拍高清| 国产精品美女999| 一本久道久久综合狠狠爱| 亚洲伦理精品| 欧美人在线观看| 亚洲国产成人在线视频| 亚洲国产高清自拍| 久久综合九色| 亚洲第一精品电影| 91久久精品视频| 欧美高清不卡在线| 亚洲欧洲精品一区二区| 亚洲高清精品中出| 欧美国产免费| 亚洲国产日韩综合一区| 日韩网站在线| 国产精品v欧美精品∨日韩| av不卡在线观看| 午夜精品免费| 国外精品视频| 久久全国免费视频| 亚洲国产小视频在线观看| 亚洲精品免费在线播放| 欧美激情欧美狂野欧美精品| 亚洲精品综合精品自拍| 亚洲小说欧美另类社区| 国产噜噜噜噜噜久久久久久久久| 亚洲欧美日韩综合国产aⅴ| 久久久99精品免费观看不卡| 精品99视频| 欧美另类在线播放| 一区二区激情| 久久美女艺术照精彩视频福利播放| 极品少妇一区二区三区| 欧美黄在线观看| 亚洲无亚洲人成网站77777| 久久精品国产精品 | 国产网站欧美日韩免费精品在线观看 | 亚洲精品中文字幕有码专区| 欧美日韩系列| 久久se精品一区二区| 亚洲国产精品尤物yw在线观看| 亚洲视频第一页| 国产一区视频观看| 欧美黄色aaaa| 亚欧成人精品| 亚洲精品九九| 久久色在线播放| 一区二区三区|亚洲午夜| 国产欧美日韩一区| 欧美激情一区二区三区在线视频观看| 亚洲影音一区| 欧美激情久久久| 欧美一区二区私人影院日本| 最新中文字幕亚洲| 国产精品一二三四| 欧美精品一区在线发布| 久久激情视频久久| 亚洲视频免费在线| 亚洲国产精品精华液网站| 欧美中文在线观看| 亚洲一级二级在线| 亚洲激情黄色| 国内不卡一区二区三区| 欧美日韩亚洲高清| 免费看精品久久片| 久久久777| 午夜精品国产更新| 中国日韩欧美久久久久久久久| 免费不卡中文字幕视频| 久久成人国产| 午夜精品亚洲| 亚洲综合欧美日韩| 一区二区欧美激情| 亚洲美女淫视频| 亚洲福利免费| 一区国产精品| 伊人久久亚洲影院| 激情成人综合| 激情综合色综合久久| 国产一区亚洲| 国产有码一区二区| 国产综合在线视频| 国产一区欧美| 国产一区二区精品久久| 国产欧美日韩91| 国产日韩欧美二区| 国产精品一区二区三区成人| 国产精品日韩欧美一区二区三区| 欧美日韩一区二区在线观看| 欧美巨乳在线| 欧美午夜视频在线| 国产精品红桃| 国产欧美在线视频| 国产性天天综合网| 在线播放中文字幕一区| 亚洲国产成人久久综合| 亚洲黄页视频免费观看| 亚洲美女黄色| 亚洲影院在线| 久久久久国产成人精品亚洲午夜| 久久久久.com| 欧美激情片在线观看| 最新国产乱人伦偷精品免费网站 | 久久国内精品视频| 老鸭窝毛片一区二区三区| 美女999久久久精品视频| 欧美大胆成人| 99精品欧美一区| 午夜在线精品偷拍| 葵司免费一区二区三区四区五区| 免费91麻豆精品国产自产在线观看| 牛夜精品久久久久久久99黑人| 欧美成人一区二免费视频软件| 欧美日韩高清在线观看| 国产精品网站在线观看| 狠狠88综合久久久久综合网| 亚洲日本欧美天堂| 亚洲综合视频网| 免费av成人在线| 日韩亚洲欧美高清| 欧美在线视频在线播放完整版免费观看 | 一区二区三区四区五区视频| 欧美一区二区三区男人的天堂| 久久一区二区精品| 欧美三区在线| 在线日韩成人| 亚洲男女自偷自拍| 欧美激情1区| 亚洲综合另类| 欧美经典一区二区三区| 国产精品系列在线播放| 亚洲人成在线播放网站岛国| 欧美亚洲日本网站| 亚洲欧洲精品一区二区三区 | 亚洲欧美在线看| 欧美不卡在线视频| 国产午夜精品一区二区三区欧美| 亚洲精品国产日韩| 久久精品夜色噜噜亚洲a∨| 亚洲美洲欧洲综合国产一区| 久久久久www| 国产一区二区三区在线播放免费观看| 亚洲久久视频|