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

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

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.

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

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

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

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.

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

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.

“虛擬內(nèi)存”就是利用物理內(nèi)存和磁盤來對CPU的線性地址進行模擬(kemin:高級語言源碼指定的是符號地址,是虛的,有了虛擬內(nèi)存即便是用匯編指定一 固定地址也是虛的。問題是這些虛存是怎么管理的)。當使用分頁時,進程的每個段都會被分成大小固定的頁,這些頁可能在內(nèi)存中,也可能在磁盤。操作系統(tǒng)用了 一張頁目錄(page directory)和多張頁表來管理這些頁。當進程試圖訪問線性地址空間的某個位置,處理器會通過頁目錄和頁表先將線性地址轉(zhuǎn)換成物理地址,然后再訪問 (讀或?qū)懀╧emin:轉(zhuǎn)換細節(jié)沒有講)。如果被訪問的頁當前不在內(nèi)存,處理就會中斷進程的運行(通過產(chǎn)生缺頁異常中斷)(kemin:怎么判斷某頁不 在內(nèi)存?)。操作系統(tǒng)負責從磁盤讀入該頁并繼續(xù)執(zhí)行該進程(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 閱讀(575) 評論(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>
            亚洲自拍偷拍视频| 9国产精品视频| 亚洲人在线视频| 亚洲国产精品99久久久久久久久| 国模大胆一区二区三区| 国产日韩欧美日韩大片| 国产欧美一区二区色老头| 国模精品一区二区三区| 激情欧美一区二区三区在线观看| 国产一区二区三区在线观看视频| 国产一区二区三区免费观看| 狠狠网亚洲精品| 亚洲国产免费| 亚洲午夜女主播在线直播| 午夜精品av| 欧美一区二区三区在线视频| 久久国产婷婷国产香蕉| 美日韩精品免费| 欧美成人xxx| 99国产精品国产精品毛片| 亚洲欧美电影院| 欧美国产日韩一区二区三区| 国产精品久久久久久久久搜平片| 黄色在线一区| 午夜精品免费| 久久视频在线免费观看| avtt综合网| 久久国产精品一区二区三区四区| 欧美久久久久中文字幕| 国内成人在线| 亚洲免费在线精品一区| 欧美黄色一区| 亚洲欧美日本在线| 免费国产自线拍一欧美视频| 国产日韩精品一区二区三区在线 | 久久久久久久综合色一本| 欧美成人在线影院| 韩国v欧美v日本v亚洲v| 亚洲欧美成人一区二区三区| 亚洲电影有码| 久久xxxx精品视频| 国产精品久久二区二区| 亚洲免费av片| 欧美大片在线看| 欧美一级成年大片在线观看| 国产精品高潮呻吟久久av无限| 亚洲人成在线影院| 久久米奇亚洲| 亚洲欧美日韩在线一区| 欧美福利视频在线| 亚洲第一区中文99精品| 久久精品导航| 亚洲特级片在线| 欧美极品在线视频| 亚洲欧洲日韩在线| 欧美国产三区| 久久综合一区二区三区| 国产精品爽黄69| 欧美亚洲一区三区| 亚洲一区视频在线| 国产精品久久999| 亚洲一区二区伦理| 最新日韩在线视频| 老司机午夜精品| 91久久国产精品91久久性色| 欧美激情bt| 欧美激情亚洲| 亚洲在线播放| 香蕉尹人综合在线观看| 激情综合久久| 激情成人综合网| 1024国产精品| 亚洲狠狠丁香婷婷综合久久久| 你懂的国产精品| 亚洲每日更新| 99www免费人成精品| 国产精品久久久久久久浪潮网站 | 欧美精品在欧美一区二区少妇| 亚洲国产经典视频| 亚洲精选中文字幕| 欧美日韩精品二区| 亚洲视频中文| 午夜免费电影一区在线观看 | 亚洲国产日韩在线| 模特精品裸拍一区| 久久人人看视频| 一区二区三区高清在线 | 亚洲福利视频网| 欧美成人一区二区三区| 亚洲一区自拍| 久久精品一区二区三区中文字幕| 91久久国产精品91久久性色| 亚洲免费成人av电影| 国产一本一道久久香蕉| 蜜桃伊人久久| 国产精品成人免费| 久久精品国产91精品亚洲| 欧美www视频| 欧美一区二区日韩一区二区| 久久精品一区二区三区不卡| 一区二区三区视频观看| 亚洲影院色在线观看免费| 伊人久久久大香线蕉综合直播| 久久综合网络一区二区| 欧美国产高潮xxxx1819| 久久久精品国产免大香伊| 欧美精品久久天天躁| 久久九九精品99国产精品| 欧美成人国产一区二区| 午夜激情综合网| 久久午夜色播影院免费高清| 久久国产视频网| 欧美日韩国产美| 欧美激情欧美狂野欧美精品| 国产精品久久久久久模特| 亚洲国产电影| 国产一区二区三区最好精华液| 欧美激情精品久久久久| 国产精品欧美精品| 亚洲人精品午夜| 国产一区二区黄| 亚洲一区二区三区四区中文| 亚洲美女在线视频| 欧美福利专区| 亚洲欧洲一区二区天堂久久 | 亚洲网站视频福利| 99精品国产在热久久| 久久久99爱| 久久精品一区二区| 国产日韩欧美精品综合| 亚洲视频精品| 亚洲免费视频网站| 欧美日韩国产成人在线免费 | 欧美激情91| 亚洲二区精品| 欧美一级片在线播放| 先锋影音一区二区三区| 国产精品影片在线观看| 亚洲一区二区在| 欧美在线观看网站| 国产一区在线免费观看| 久久精品99国产精品酒店日本| 欧美一区深夜视频| 国产一区二区三区在线观看精品 | 宅男噜噜噜66国产日韩在线观看| 欧美1级日本1级| 亚洲免费电影在线观看| 亚洲性线免费观看视频成熟| 欧美天堂亚洲电影院在线播放| 亚洲免费精品| 欧美影院视频| 怡红院av一区二区三区| 欧美国产综合视频| 一区二区av在线| 久久精品视频播放| 在线播放不卡| 欧美精品久久一区| 亚洲女性裸体视频| 欧美不卡视频| 亚洲天堂成人在线视频| 国产日韩欧美自拍| 牛牛影视久久网| 在线视频欧美一区| 麻豆成人av| 亚洲在线免费视频| 国产主播精品| 欧美另类在线播放| 亚洲欧美在线一区二区| 欧美成ee人免费视频| 一区二区三区蜜桃网| 国产亚洲精品aa午夜观看| 欧美精品久久久久a| 小嫩嫩精品导航| 亚洲人体大胆视频| 久久久在线视频| 亚洲图片欧美日产| 在线成人激情| 国产精品久久久久久久久免费樱桃 | 亚洲视频电影图片偷拍一区| 国产人成精品一区二区三| 欧美xart系列高清| 性做久久久久久免费观看欧美| 欧美国产一区视频在线观看| 午夜精品久久久久久久99樱桃| 亚洲高清在线| 国产一区二三区| 国产精品成人久久久久| 免费在线一区二区| 久久国产色av| 午夜精品区一区二区三| 亚洲福利视频免费观看| 狠狠综合久久av一区二区老牛| 一本久道综合久久精品| 久久一区二区三区四区| 亚洲一区制服诱惑| 一区二区电影免费观看| 亚洲电影在线播放| 国产综合第一页| 国产精品日韩欧美一区| 欧美日韩免费在线观看|