当前位置:网站首页>Tianshu night reading notes -- memory paging mechanism
Tianshu night reading notes -- memory paging mechanism
2022-06-25 01:17:00 【ma_ de_ hao_ mei_ le】
Friend chain
In modern operating systems , Will use the paging mechanism
stay 32bit Operating system , For a process , He has 4GB Of memory space
Which is low 2G Belonging to the process itself , high 2G Is the kernel space , All processes see the same value in kernel space , In other words, it's shared , But the process does not have permission to access this memory directly , Different processes also cannot directly access the low level of other processes 2GB Memory space ( User space )
All processes see the same memory address , These addresses are actually virtual addresses , They have a translation relationship with the physical address
The transformation relationship is as follows :
Catalog : Paging Directory , You can think of it as a table of contents , Each item points to a page table ( We agreed that this table is called CNMDTABLE), It's an address , Add... To this address cr3 Register value , Get the address of the page table
page : Used to indicate that we want CNMDTABLE Which item in the , Or an address ( We use positioning WCNMADDR)
The offset : Use this offset +WCNMADDR You can get the physical address
When calculating the page , We can determine whether this page exists , Because the status of the page is recorded in the page table , If this page does not exist , It triggers a page failure interrupt , Change pages from disk to memory
12 The offset of bit indicates , Each page can reach a maximum of 4MB, But actually a page is 4kb
When switching between different processes ,cr3 The value of is different , In this way, different physical addresses can be calculated from the same virtual memory address
Page memory protection mechanism
The detailed structure of each item in the page table

P Used to indicate whether this page exists
W Used to indicate whether it is writable
U:1 Represented as a user page R3 level ,0 Represented as a system page R0 level
But there is no flag bit indicating whether the page can be executed
Later, CPU Architecture solves this problem
Page table entries are expanded to 64bit, among NX If enabled, the page is not executable

边栏推荐
- 4 ans d'expérience de travail, 5 modes de communication Multi - thread ne peuvent pas être décrits, vous osez croire?
- 最新QQ微信域名防红PHP程序源码+强制跳转打开
- VB 学习笔记
- Which securities company should I choose to open an account online? Is it safe to open an account online?
- 2022 simulated 100 questions of safety officer-c certificate examination and online simulated examination
- Tencent cloud wecity Industry joint collaborative innovation to celebrate the New Year!
- Danish Technical University pioneered the application of quantum computing to power flow modeling of energy system
- Introduction to smart contract security audit delegatecall (2)
- TC对象结构和简称
- 丹麦技术大学首创将量子计算应用于能源系统潮流建模
猜你喜欢

Bi SQL constraints

Bi-sql Union

JS Chapter 1 Summary

Bi-sql - join

“一个优秀程序员可抵五个普通程序员!”

Library management system code source code (php+css+js+mysql) complete code source code

Première application de l'informatique quantique à la modélisation des flux de puissance dans les systèmes énergétiques à l'Université technique danoise

QT (35) - operate excel qxlsx qaxobject

Text editor for QT project practice -- Episode 9

丹麥技術大學首創將量子計算應用於能源系統潮流建模
随机推荐
Introduction to smart contract security audit delegatecall (2)
QT (36) -rapidjson parsing nested JSON
1. 封装自己的脚手架 2.创建代码模块
Text editor of QT project practice ---------- episode 8
Deep learning LSTM model for stock analysis and prediction
Powerbi - for you who are learning
Scala object blending trait
Bi SQL alias
Text editor of QT project practice ---------- episode 11
What to learn in VB [easy to understand]
Linux64Bit下安装MySQL5.6-不能修改root密码
[practical series] full WiFi coverage at home
2022 crane driver (limited to bridge crane) examination question bank simulated examination platform operation
Bi-sql between
Bi-sql create
Golang example renewal lock: redis+channel+sync Mutex
戴尔为何一直拒绝将商用本的超薄推向极致?
How about compass stock trading software? Is it safe?
【实用系列】家内wifi全覆盖
Bi-sql delete