My question is, how does CPU IO ports really work?
我的问题是,CPU IO端口是如何工作的?
As far as I understand now, there is one bus, which is connected to CPU and all the devices, and all devices have their addresses assigned.
据我所知,有一条总线连接到CPU和所有设备,所有设备都分配了地址。
when CPU decides to read or write, it sets address on this bus and only the device with corresponding address responds right? and those addresses must be static, assigned when manufacturing device yes?
当CPU决定读或写时,它设置该总线上的地址,只有具有相应地址的设备响应正确?那些地址必须是静态的,在制造设备时分配是吗?
and also, linux /proc/ioports gives information about only those devices which are in use by certain drivers, is there anyway to list all the addresses assigned?
而且,linux / proc / ioports只提供有关某些驱动程序正在使用的设备的信息,无论如何列出所有分配的地址?
for example, it didn't show paralell port address when I typed it.
例如,当我键入它时,它没有显示并行端口地址。
Thanks very much if anybody decides to answer:D
非常感谢,如果有人决定回答:D
and also, which place is for PCI? bus from CPU is connected to PCI first and from PCI to every device as far as I understand, am I right? Thanks
而且,哪个地方用于PCI?据我所知,CPU的总线首先连接到PCI,然后从PCI连接到每个设备,对不对?谢谢
1 个解决方案
#1
1
Parallel ports are very "old" in the sense that they have been present even in the ancient IBM PC, connected to the ISA bus, and there's no way to enumerate ISA devices except by probing for the hardware. So unless a driver actually checks if the hardware is there, there's no way to find out.
并行端口非常“老”,即使在连接到ISA总线的古老IBM PC中也存在,并且除了通过探测硬件之外无法枚举ISA设备。因此,除非驱动程序实际检查硬件是否存在,否则无法找到。
To distinguish between I/O ports and memory, the processor has an extra signal line. Putting address 0x378 on the address bus and setting the signal line means the processor wants to access the parallel port; putting 0x378 on the address bus and NOT setting the signal line means the processor wants to read memory. By the way, not all processors make this distinction; the 6502 processor used in old Commodore 64 computers for example did not, which means on this hardware some addresses were actually reserved for i/o and the hardware didn't support memory at those addresses.
为区分I / O端口和存储器,处理器有一条额外的信号线。将地址0x378放在地址总线上并设置信号线意味着处理器想要访问并行端口;将0x378放在地址总线上而不设置信号线意味着处理器想要读取内存。顺便说一句,并非所有的处理器都有这种区别;例如旧的Commodore 64计算机中使用的6502处理器没有,这意味着在这个硬件上,一些地址实际上是为i / o保留的,而硬件不支持这些地址的内存。
#1
1
Parallel ports are very "old" in the sense that they have been present even in the ancient IBM PC, connected to the ISA bus, and there's no way to enumerate ISA devices except by probing for the hardware. So unless a driver actually checks if the hardware is there, there's no way to find out.
并行端口非常“老”,即使在连接到ISA总线的古老IBM PC中也存在,并且除了通过探测硬件之外无法枚举ISA设备。因此,除非驱动程序实际检查硬件是否存在,否则无法找到。
To distinguish between I/O ports and memory, the processor has an extra signal line. Putting address 0x378 on the address bus and setting the signal line means the processor wants to access the parallel port; putting 0x378 on the address bus and NOT setting the signal line means the processor wants to read memory. By the way, not all processors make this distinction; the 6502 processor used in old Commodore 64 computers for example did not, which means on this hardware some addresses were actually reserved for i/o and the hardware didn't support memory at those addresses.
为区分I / O端口和存储器,处理器有一条额外的信号线。将地址0x378放在地址总线上并设置信号线意味着处理器想要访问并行端口;将0x378放在地址总线上而不设置信号线意味着处理器想要读取内存。顺便说一句,并非所有的处理器都有这种区别;例如旧的Commodore 64计算机中使用的6502处理器没有,这意味着在这个硬件上,一些地址实际上是为i / o保留的,而硬件不支持这些地址的内存。