当前位置:网站首页>Virtual address space
Virtual address space
2022-07-07 08:28:00 【Scroll_ C】
Virtual address space
- project
- 2021/11/27
Is this page helpful ?
When the processor reads or writes to a memory location , It uses a virtual address . During a read or write operation , The processor converts the virtual address to the physical address . Accessing memory through a virtual address has the following advantages :
Programs can use a series of contiguous virtual addresses to access discontinuous large memory buffers in physical memory .
A program can use a series of virtual addresses to access memory buffers larger than the available physical memory . When the supply of physical memory changes , The memory manager will put physical memory pages ( Usually the size is 4 KB) Save to disk file . Data or code pages move between physical memory and disk as needed .
Virtual addresses used by different processes are isolated from each other . Code in one process cannot change the physical memory being used by another process or operating system .
The range of virtual addresses available to a process is called the “ Virtual address space ” . Each user mode process has its own private virtual address space . about 32 Bit process , The virtual address space is usually 2 GB, Range from 0x00000000 to 0x7FFFFFFF. about 64 position Windows Upper 64 Bit process , The virtual address space is 128 TB, Range from 0x000'00000000 to 0x7FFF'FFFFFFFF. A series of virtual addresses is sometimes called a series “ Virtual memory ” . For more information , see also Memory and address space limitations .
This figure illustrates some important functions of virtual address space .
The figure shows two 64 Virtual address space of bit process :Notepad.exe and MyApp.exe. Each process has its own virtual address space , Range from 0x000'0000000 to 0x7FF'FFFFFFFF. Each shadow block represents a page of virtual memory or physical memory ( The size is 4 KB). Be careful ,Notepad Process use from 0x7F7'93950000 Three consecutive pages of the starting virtual address . However, these three consecutive pages of the virtual address will be mapped to discontinuous pages in physical memory . Attention, please. , Both processes use from 0x7F7'93950000 Start virtual memory page , But these virtual pages map to different pages of physical memory .
User space and system space
Such as Notepad.exe and MyApp.exe The process of runs in user mode . The core operating system components and multiple drivers run in a more privileged kernel mode . More about processor mode , see also User mode and kernel mode . Each user mode process has its own private virtual address space , But all code running in kernel mode is shared as “ System space ” A single virtual address space . The virtual address space of user mode processes is called “ User space ” .
stay 32 position Windows in , The total virtual address space available is 2^32 byte (4 GB). Usually , Lower 2 GB For user space , Higher 2 GB For system space .
stay 32 position Windows in , You can choose to specify ( When it starts ) exceed 2 GB Available in user space . As a result, less virtual addresses are available in the system space . You can increase the size of user space to 3 GB, under these circumstances , The system space is only 1 GB You can use . To increase the size of user space , Please use BCDEdit /set increaseuserva.
stay 64 position Windows in , The theoretical size of virtual address space is 2^64 byte (16 Ebyte ), But in fact, only 16 A small part of the byte range .
Code running in user mode can access user space , But you cannot access the system space . This restriction prevents user mode code from reading or changing protected operating system data structures . Code running in kernel mode can access user space , You can also access system space . namely , Code running in kernel mode can access the system space and the virtual address space of the current user mode process .
Drivers running in kernel mode must be very careful when reading or writing these addresses directly from user space addresses . This scheme explains the reason .
The user mode program initiates a request to read some data from the device . The program provides the starting address of the buffer to receive data .
The device driver routine running in kernel mode starts the read operation and returns control to its caller .
later , The device interrupts any currently running thread to show that the read operation is complete . Interrupt this arbitrary thread ( Belongs to any process ) Kernel mode driver routines running on .
here , The driver must not write data to the user mode program in step 1 The starting address provided in . This address is in the virtual address space of the process that initiated the request , This process is likely to be different from the current process .
Paging buffer pool and non paging buffer pool
In user space , All physical memory pages can be called out to disk files as needed . In system space , Some physical pages can be called , Other physical pages cannot . The system space has two areas for dynamically allocating memory : Paging buffer pool and non paging buffer pool .
The memory allocated in the paging buffer pool can be called out to disk files as needed . The memory allocated in the non paged buffer pool can never be called out to disk files .
边栏推荐
- GFS分布式文件系统
- Open3D ISS关键点
- XCiT学习笔记
- A method for quickly viewing pod logs under frequent tests (grep awk xargs kuberctl)
- Using nocalhost to develop microservice application on rainbow
- 柯基数据通过Rainbond完成云原生改造,实现离线持续交付客户
- POJ - 3616 Milking Time(DP+LIS)
- Opencv learning notes 1 -- several methods of reading images
- [quick start of Digital IC Verification] 13. SystemVerilog interface and program learning
- Ebpf cilium practice (1) - team based network isolation
猜你喜欢
在Rainbond中实现数据库结构自动化升级
Interpreting the practical application of maker thinking and mathematics curriculum
[quick start of Digital IC Verification] 13. SystemVerilog interface and program learning
Opencv learning note 4 - expansion / corrosion / open operation / close operation
Opencv learning notes 1 -- several methods of reading images
漏洞复现-Fastjson 反序列化
Splunk中single value视图使用将数值替换为文字
eBPF Cilium实战(2) - 底层网络可观测性
使用 Nocalhost 开发 Rainbond 上的微服务应用
SSM 整合
随机推荐
opencv学习笔记五——梯度计算/边缘检测
Detailed explanation of apply, also, let, run functions and principle analysis of internal source code in kotlin
Use of out covariance and in inversion in kotlin
The reified keyword in kotlin is used for generics
Several ways of lambda used in functions in kotlin (higher-order functions)
藏书馆App基于Rainbond实现云原生DevOps的实践
Obsidan之数学公式的输入
Caractéristiques de bisenet
Analysis of maker education in innovative education system
The truth of robot education in hands-on practice
grpc、oauth2、openssl、双向认证、单向认证等专栏文章目录
解读创客思维与数学课程的实际运用
Use of any superclass and generic extension function in kotlin
GFS分布式文件系统
Practice of implementing cloud native Devops based on rainbow library app
[quick start of Digital IC Verification] 14. Basic syntax of SystemVerilog learning 1 (array, queue, structure, enumeration, string... Including practical exercises)
IP-guard助力能源企业完善终端防泄密措施,保护机密资料安全
Battery and motor technology have received great attention, but electric control technology is rarely mentioned?
Golang 编译约束/条件编译 ( // +build <tags> )
AVL平衡二叉搜索树