【譯】x86程序員手冊23-6.5組合頁與段保護


6.5 Combining Page and Segment Protection 組合頁與段保護

When paging is enabled, the 80386 first evaluates segment protection, then evaluates page protection. If the processor detects a protection violation at either the segment or the page level, the requested operation cannot proceed; a protection exception occurs instead.

當分頁被啟用,80386首先評估段保護,然后評估頁保護。如果處理器偵測到保護違例,無論在段上或頁上,請求的操作都不被執行;替代的結果是發生保護異常。

For example, it is possible to define a large data segment which has some subunits that are read-only and other subunits that are read-write. In this case, the page directory (or page table) entries for the read-only subunits would have the U/S and R/W bits set to x0, indicating no write rights for all the pages described by that directory entry (or for individual pages).

 

例如,定義了一個大的數據段,其中有只讀部分和可讀寫部分。在這種情況下,只讀部分的頁目錄(或頁表)項會將U/S和R/W位設置為0,表明這些目錄項(或分開的頁)所描述的頁沒有寫權限。

This technique might be used, for example, in a UNIX-like system to define a large data segment, part of which is read only (for shared data or ROMmed constants). This enables UNIX-like systems to define a "flat" data space as one large segment, use "flat" pointers to address within this "flat" space, yet be able to protect shared data, shared files mapped into the virtual space, and supervisor areas.

這種技術可以使用,例如在類UNIX系統中,定義了一個大的數據段,一部分是只讀的(用來共享數據或只讀的靜態變量)。這使得類UNIX系統定義一個扁平的數據空間做為一個大的段,使用扁平指針在扁平的空間中尋址,然后也能實現保護共享數據,將共享的文件映射到虛擬空間,超級用戶區域。


注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2021 ITdaan.com