物理寻址和虚拟寻址概念之间的区别 [英] Difference between physical addressing and virtual addressing concept

查看:500
本文介绍了物理寻址和虚拟寻址概念之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是重新提交的内容,因为我没有收到superuser.com的任何回复.抱歉造成误会.

This is a re-submission, because I am not getting any response from superuser.com. Sorry for the misunderstanding.

我需要了解嵌入式系统中物理寻址和虚拟寻址概念之间的区别.

I need to know the difference between physical addressing and virtual addressing concept in embedded systems.

为什么在嵌入式系统中实现虚拟寻址概念?

Why virtual addressing concept is implemented in embedded systems?

与嵌入式系统中具有物理寻址概念的系统相比,虚拟寻址有何优势?

What is the advantage of the virtual addressing over a system with physical addressing concept in embedded systems?

如何在嵌入式系统中完成虚拟寻址与物理寻址之间的映射?

How the mapping between virtual addressing to physical addressing is done in embedded systems?

请以一些简单的体系结构中的一些简单示例来说明上述概念.

Please, explain the above concept with some simple examples in some simple architecture.

推荐答案

物理寻址意味着您的程序实际上知道RAM的实际布局.当您访问地址为0x8746b3的变量时,它实际上就是存储在物理RAM芯片中的位置.

Physical addressing means that your program actually knows the real layout of RAM. When you access a variable at address 0x8746b3, that's where it's really stored in the physical RAM chips.

使用虚拟寻址时,所有应用程序内存访问都将转到页表,然后该页表将从虚拟地址映射到物理地址.因此,每个应用程序都有其自己的专用"地址空间,并且任何程序都无法读取或写入另一个程序的内存.这称为分段.

With virtual addressing, all application memory accesses go to a page table, which then maps from the virtual to the physical address. So every application has its own "private" address space, and no program can read or write to another program's memory. This is called segmentation.

虚拟寻址有很多好处.它可以防止程序因指针操作不当而彼此崩溃.由于每个程序都有其自己独特的虚拟内存集,因此任何程序都无法读取他人的数据-这既安全又具有安全性.虚拟内存还启用了 paging ,其中程序的物理RAM可以在不使用时存储在磁盘上(或现在速度较慢的闪存)中,然后在应用程序尝试访问该页面时回调.同样,由于在一个物理物理页面上只能驻留一个程序,因此在物理分页系统中,或者a)必须编译所有程序以将其加载到不同的内存地址,或者b)每个程序都必须使用Position -独立代码,或c)某些程序集无法同时运行.

Virtual addressing has many benefits. It protects programs from crashing each other through poor pointer manipulation, etc. Because each program has its own distinct virtual memory set, no program can read another's data - this is both a safety and a security plus. Virtual memory also enables paging, where a program's physical RAM may be stored on a disk (or, now, slower flash) when not in use, then called back when an application attempts to access the page. Also, since only one program may be resident at a particular physical page, in a physical paging system, either a) all programs must be compiled to load at different memory addresses or b) every program must use Position-Independent Code, or c) some sets of programs cannot run simultaneously.

物理-虚拟映射可以在软件(具有对内存陷阱的硬件支持)中或在纯硬件中完成.有时甚至页表本身也位于一组特殊的硬件内存中.我不知道哪个嵌入式系统可以做什么,但是每个台式机都有一个硬件TLB(转换后备缓冲区,基本上是虚拟物理映射的缓存),有些现在具有高级内存映射单元,可以帮助您虚拟机之类的东西.

The physical-virtual mapping may be done in software (with hardware support for memory traps) or in pure hardware. Sometimes even the page tables themselves are on a special set of hardware memory. I don't know off the top of my head which embedded system does what, but every desktop has a hardware TLB (Translation Lookaside Buffer, basically a cache for the virtual-physical mappings) and some now have advanced Memory Mapping Units that help with virtual machines and the like.

虚拟内存的唯一缺点是增加了硬件实现的复杂性并降低了性能.

The only downsides of virtual memory are added complexity in the hardware implementation and slower performance.

这篇关于物理寻址和虚拟寻址概念之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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