"CPU生成逻辑地址空间"是什么意思? [英] What is meant by "CPU generates logical address space"?

查看:302
本文介绍了"CPU生成逻辑地址空间"是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我从书中读到的(对不起,我错了),在编译器将编译后的代码放入存储器后,CPU创建逻辑地址,并且这些逻辑地址通过MMU(内存管理单元)映射到物理内存.我也知道,CPU除了物理内存之外不能直接访问任何其他东西.

As far as I read from the book(correct me I am wrong) after a compiler puts the compiled code in the storage, the CPU creates logical addresses and those logical addresses are mapped to physical memory through MMU(Memory Management Unit).Also I know that CPU directly cannot access anything other than the physical memory.

那么CPU首先如何为进程生成逻辑地址?

Then how does CPU produce logical addresses for the process in the first place?

推荐答案

听起来您对所做的事情有些困惑.

It sounds like you have a bit of confusion about what things do.

操作系统通过设置将逻辑页转换为物理页框架的页表来定义逻辑地址空间.操作系统会加载CPU的硬件寄存器,以便了解其已定义的页表.

The operating system defines the logical address space by setting up page tables that logical pages to physical page frames. The operating system loads hardware registers of the CPU so that it knows about the page tables it has defined.

这种使用页表定义逻辑地址空间的方法是现代CPU不可或缺的一部分.在某些系统中,物理地址的唯一用途是在页表中.

This use of page tables to define logical address spaces is an integral part of a modern CPU. In some systems, the only use of physical addresses is within page tables.

编译器生成一个目标代码文件,该文件描述了使用和创建的指令和数据.

The compiler generates an object code file that describes the instructions and data used and created.

链接器将目标代码组合到可执行文件中,该可执行文件定义了如何将程序加载到内存中.

The linker combines object code into an executable file that defines how the program will be loaded into memory.

加载程序读取可执行文件中的指令,并设置逻辑地址空间以运行程序.加载程序调用设置页表的系统例程来定义逻辑地址空间.

The loader reads the instructions in an executable file and sets up the logical addresses space to run the program. The loader calls system routines that set up the page tables the define the logical addresses space.

例如,在可执行文件具有只读数据的情况下,加载程序将调用OS例程,以在逻辑地址空间中创建只读页面并将其映射到可执行文件中的数据.

For example, where the executable has read-only data, the loader will call OS routines to creates read-only pages in the logical address space and map them to the data in the executable file.

这篇关于"CPU生成逻辑地址空间"是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆