在 Linux 上查找并行端口的内存地址

发布于 2024-12-26 02:34:19 字数 1431 浏览 2 评论 0原文

我试图找到通过 PCI Express 卡连接到笔记本电脑的并行端口的基址(内存)地址。运行lspci -v 显示我的计算机识别并行端口并给出 I/O 端口(1000 和 1008),但不提供内存地址(其他条目既有端口又有内存位置......这张卡是唯一没有内存地址的条目)。另外,当我查看 /proc/ioports 时,我得到了 lspci 中给出的相同端口。但是,当我尝试在正在运行的程序中使用这些地址中的任何一个(EMC2 来控制步进电机)时,它在该地址处找不到并行端口。

如果有一个类似于 Windows 设备管理器的东西那就太好了 ->端口->资源。在 Ubuntu 中有什么办法可以做到这一点吗? PCIe 设备是否有标准的内存位置?

编辑: lspci -v 的输出

04:00.0 Parallel controller: Oxford Semiconductor Ltd Device c110 (prog-if 02)
Subsystem: Oxford Semiconductor Ltd Device c110
Flags: bus master, fast devsel, latency 0, IRQ 18
I/O ports at 1000 [size=8]
I/O ports at 1008 [size=4]
Capabilities: [40] Power Management version 3
Capabilities: [50] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [70] Express Legacy Endpoint, MSI 00
Capabilities: [100] Device Serial Number 10-01-00-11-11-e0-30-00
Capabilities: [110] Power Budgeting <?>
Kernel driver in use: parport_pc
Kernel modules: parport_pc

作为参考,另一个显示内存位置的条目:

0c:03.0 FireWire (IEEE 1394): Agere Systems FW322/323 (rev 61) (prog-if 10)
Subsystem: Agere Systems FW322/323
Flags: bus master, fast Back2Back, medium devsel, latency 248, IRQ 19
Memory at 8c000000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [44] Power Management version 2
Kernel driver in use: ohci1394
Kernel modules: firewire-ohci, ohci1394

I'm trying to find the base (memory) address of a parallel port I have connected to my laptop via a PCI express card. Running lspci -v shows that my computer recognizes the parallel port and gives the I/O ports (1000 and 1008) but not the memory address (other entries have both ports and memory locations…this card is the only entry without a memory address). Also, when I look in /proc/ioports I get the same ports given in lspci. However, when I try to use either of those addresses in the program I'm running (EMC2 to control stepper motors), it does not find a parallel port at that address.

What would be really great is if there were an analogue to the Windows Device Manager -> Ports -> Resources. Is there any way to do this in Ubuntu? Is there a standard memory location for PCIe devices?

Edit:
The output from lspci -v

04:00.0 Parallel controller: Oxford Semiconductor Ltd Device c110 (prog-if 02)
Subsystem: Oxford Semiconductor Ltd Device c110
Flags: bus master, fast devsel, latency 0, IRQ 18
I/O ports at 1000 [size=8]
I/O ports at 1008 [size=4]
Capabilities: [40] Power Management version 3
Capabilities: [50] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [70] Express Legacy Endpoint, MSI 00
Capabilities: [100] Device Serial Number 10-01-00-11-11-e0-30-00
Capabilities: [110] Power Budgeting <?>
Kernel driver in use: parport_pc
Kernel modules: parport_pc

And for reference, another entry that shows the memory location:

0c:03.0 FireWire (IEEE 1394): Agere Systems FW322/323 (rev 61) (prog-if 10)
Subsystem: Agere Systems FW322/323
Flags: bus master, fast Back2Back, medium devsel, latency 248, IRQ 19
Memory at 8c000000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [44] Power Management version 2
Kernel driver in use: ohci1394
Kernel modules: firewire-ohci, ohci1394

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

腹黑女流氓 2025-01-02 02:34:19

尝试cat /proc/ioports | grep parport 过滤 ioports 的输出。

Try cat /proc/ioports | grep parport to filter the output of ioports.

黒涩兲箜 2025-01-02 02:34:19

快速回答:并行端口没有内存位置。并行端口仅分配有 IO 端口。这就是并行端口接口几十年来的工作方式,没有人觉得有必要制作一个需要特殊驱动程序的不兼容的内存映射接口。

现在我必须问,你为什么要寻找端口的内存位置?你想用它做什么?

Quick answer: there is no memory location for the parallel port. Parallel ports only ever have IO ports allocated to them. This is the way parallel port interfaces have worked for decades, and nobody has felt the need to make an incompatible memory mapped interface that would need special drivers.

Now I must ask, why are you intent on finding the port's memory location? What do you want to do with it?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文