




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、LibraryModule#1Module#2Module#nLinkerLoadModuleLoaderRAM Maintains the states of partitionsUsing the logical segment no as the index to find the correspondent physics segment(使用邏輯段號作(使用邏輯段號作為索引查段表得到物理段號);為索引查段表得到物理段號);Physics address= offset in logical address + start address in segment table entry;
2、 Protection: If the offset in logical address is large than the length in the segment table entry, a protection error will generate and OS will process the error. const int BUFFSIZE=256; int main() char * buff=(char *)malloc(BUFFSIZE);/平臺無關(guān)sprintf(buff,”%s”,”Hello World”);/sleep(10000);/for kswapdfr
3、ee(buff); /平臺無關(guān)return SUCCESS; ./ hello world /實(shí)現(xiàn)映射,使用物理內(nèi)存,運(yùn)行時分配,運(yùn)行完回收v Modify BitP h y s i c a l M e m o r y P a g e T a b l e P a g e D i r e c t o r y T w o L e v e l P a g e T a b l e Virtual Address Page# Offset Page# Entry Chain (Hash) Frame# Hash Table Inverted Page Table Frame# Offset Real A
4、ddress Invert Page Table v Segment Limit Check OS uses special register to maintain the length of segment table and the length of every segment.v Access Control Every segment table entry has several access control bits to define the access limit.v Privilege Ring Every segment table entry has define
5、the privilege for process running in a ring.v A program can access the data which is in the same ring or lower privilege ring.v A program can call the functions which are in the same ring or higher privilege ring.v Paging, which is transparent to the programmer, eliminates external fragmentation and
6、 reduces the internal fragmentation, and thus provides efficient use of main memory.v Segmentation, which is visible to the programmer, has the ability to handle growing data structures, modularity, and support for sharing and protection.v To combine the advantages of both, using segmentation/paging
7、.v The design of memory management portion of an OS depends on three fundamental areas of choice:v The choices made in the first two areas depend on the hardware platform available. All important OS provide virtual memory. Pure segmentation systems are becoming rare.v The choices in the third areas
8、are the domain of OS. Gives a process a fixed number of pages within which to execute. The number is decided at initial load time and may be determined based on the type of process. When a page fault occurs, one of the pages of that process must be replaced by the needed page. The number of page fra
9、mes allocated to a process to be varied over the lifetime of the process. The number of pages allocated to a process can be decided by the page fault rate.v On a nonuniform memory access (NUMA), multiprocessor, the distributed, shared memory of the machine can be referenced by any processor on the m
10、achine, but the time for accessing a particular physical location varies with the distance between the processor and the memory module.v Thus, performance depends on the extent to which data reside close to the processors that use them. A page is brought into main memory only when a reference is mad
11、e to a location on that page. As more and more pages are brought in, page faults should drop to a very low level. Chooses only among the resident pages of the process that generated the page fault in selecting a page to replace.v How to determine resident set size and the timing of changes.-working
12、set strategy Page Address Stream 2 3 2 1 5 2 4 5 3 2 5 2 2 2 2 2 2 2 4 4 4 2 2 2 3 3 3 3 3 3 3 3 3 3 3 1 5 5 5 5 5 5 5 5 F F F F F F O OP PT T a al lg go or ri it th hm m Page Address Stream 2 3 2 1 5 2 4 5 3 2 5 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 1 1 1 4 4 4 2 2 2 F F F F F F F L LR RU
13、 U a al lg go or ri it th hm m v Examination of large numbers of traces of programs with sequential reference patterns shows that LRU performs poorly. Page Address Stream 2 3 2 1 5 2 4 5 3 2 5 2 2 2 2 2 5 5 5 5 3 3 3 3 3 3 3 3 2 2 2 2 2 5 5 1 1 1 4 4 4 4 4 2 F F F F F F F F F F FI IF FO O a al lg go or ri it th hm m v FIFO is a simple algorithm and is easy to implement.v For a program that has sequential reference patterns, FIFO can get good performanc
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 優(yōu)化中小學(xué)生校服管理的實(shí)施路徑
- 推動新型城鎮(zhèn)化戰(zhàn)略落地的路徑與對策
- 森林草原火災(zāi)風(fēng)險防范全方位應(yīng)對方案
- 跨學(xué)科視角下的物理教學(xué)策略與實(shí)踐探索
- 激發(fā)餐飲消費(fèi)潛力的多元策略與實(shí)施路徑
- 城市供水管網(wǎng)升級與漏損控制方案研究
- 搶救病人的心得體會
- 幼兒園語言發(fā)展工作計劃
- 加強(qiáng)內(nèi)部培訓(xùn)的工作總結(jié)與計劃
- 周主題活動的實(shí)施與評估計劃
- 智慧樹知到《演講學(xué)(同濟(jì)大學(xué))》2025章節(jié)測試附答案
- 高等數(shù)學(xué)(慕課版)教案 教學(xué)設(shè)計-3.4函數(shù)的單調(diào)性與極值;3.5函數(shù)的最值及其應(yīng)用
- 3.1《百合花》課件 統(tǒng)編版高一語文必修上冊
- 政府審計 課件 第五章 金融審計
- 2025年度文化產(chǎn)業(yè)競業(yè)禁止與知識產(chǎn)權(quán)保護(hù)協(xié)議
- 孕產(chǎn)婦分娩恐懼預(yù)防和管理的最佳證據(jù)總結(jié)
- 2025年國核鈾業(yè)發(fā)展有限責(zé)任公司招聘筆試參考題庫含答案解析
- 國家開放大學(xué)《小企業(yè)管理基礎(chǔ)》綜合練習(xí)題形成性考核參考答案
- 吊裝設(shè)備知識培訓(xùn)課件
- 《兒童保健學(xué)緒論》課件
- 2025山東能源集團(tuán)中級人才庫選拔高頻重點(diǎn)提升(共500題)附帶答案詳解
評論
0/150
提交評論