内存映射 IO - 它是如何完成的? [英] Memory mapped IO - how is it done?

查看:36
本文介绍了内存映射 IO - 它是如何完成的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经了解了端口映射 IO 和内存映射 IO 之间的区别,但我无法弄清楚在现代操作系统(windows 或 linux)中如何实现内存映射 Io

I've read about the difference between port mapped IO and memory mapped IO, but I can't figure out how memory mapped Io is implemented in modern operating systems (windows or linux)

我所知道的是,物理内存的一部分被保留用于与硬件通信,并且有一个 MMIO 单元参与处理总线通信和其他与内存相关的事情

What I know is that a part of the physical memory is reserved to communicate with the hardware and there's a MMIO Unit involved in taking care of the bus communication and other memory-related stuff

驱动程序如何与底层硬件通信?驱动程序会使用哪些功能?与视频卡通信的地址是固定的,还是在使用它们之前有某种协议"?

How would a driver communicate with underlying hardware? What are the functions that the driver would use? Are the addresses to communicate with a video card fixed or is there some kind of "agreement" before using them?

我还是比较迷茫

推荐答案

你的问题下面的说法是错误的:

The following statement in your question is wrong:

我所知道的是保留了一部分物理内存用于与硬件通信

物理内存的一部分保留用于与硬件通信.物理内存和内存映射 IO 映射到的物理地址空间的一部分是.这种内存布局是永久性的,但用户程序不会直接看到它 - 相反,它们会运行到自己的虚拟地址空间,内核可以决定将物理内存和 IO 范围映射到任何地方.

A part of the physical memory is not reserved for communication with the hardware. A part of the physical address space, to which the physical memory and memory mapped IO are mapped, is. This memory layout is permanent, but user programs do not see it directly - instead, they run into their own virtual address space to which the kernel can decide to map, wherever it wants, physical memory and IO ranges.

您可能想阅读以下文章,我相信这些文章包含了您大部分问题的答案:

You may want to read the following articles which I believe contain answers to most of your questions:

这篇关于内存映射 IO - 它是如何完成的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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