本文介绍了0x80端口地址连接到什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在发送命令并从某个芯片(例如RTC)读取数据时,不同的文档说我们应该等待一段时间才能从设备读取数据以确保数据可用.许多代码使虚拟对象从端口 0x80 读取.我想知道此地址位置连接到什么设备(如果有).我说的是IA-32 PC架构.

When sending a command and reading the data from a certain chip, say the RTC, different documents say that we should wait for some time before reading from the device to make sure the data is available. Many pieces of code make a dummy read from the port 0x80. I wanted to know to what device this address location is connected, if any. I am talking with respect to the IA-32 PC architecture.

推荐答案

I/O端口0x80传统上用于POST代码.(POST =开机自检)

I/O port 0x80 is traditionally used for POST Codes. (POST = Power On Self Test)

在系统引导时,BIOS将向I/O端口0x80输出一系列调试代码.这些旨在用于调试非引导系统.

While the system is booting, the BIOS will output a series of debug codes to I/O port 0x80. These are indended for debugging a non-booting system.

在大多数台式机中,您可以安装POST代码调试板,该板基本上是一个小的PCI(或ISA)插槽板,可解码对I/O端口0x80的I/O写入,并通过7段LED显示值

In most desktop PCs, you can install a POST code debug board, which is basically a small PCI (or ISA) slot board that decodes I/O writes to I/O port 0x80 and displays the value via 7-segment LEDs.

通常,POST代码会快速闪烁.但是,如果系统在引导时挂起,则可以查看最新的POST代码是什么,然后使用此信息对系统进行故障排除.

Normally, POST codes flash by very quickly. However, if your system hangs while booting, you can see what the last POST code was, and use this information to troubleshoot the system.

此站点 包含大多数BIOS的标准POST代码列表.但是,计算机/主板制造商可能会插入自己的POST代码,因此该列表并非100%全面.

This site contains a list of the standard POST codes for most BIOSes. However, a Computer/Motherboard manufacturer may insert their own POST codes, so the list is not 100% comprehensive.

系统开始启动操作系统后,POST代码不是很相关.但是,某些OS供应商可能会将POST代码板用作调试工具,尤其是在代码中可能无法使用printf()的地方(例如,中断服务例程).

After a system has begun to boot the Operating System, the POST codes are not very relevant. However, some OS vendors may use POST code boards as a debugging tool, particularly for places in the code where a printf() may not be practical (e.g. Interrupt Service Routines).

某些操作系统将对I/O端口0x80的读取和写入用作延迟机制.如果您需要等待几微秒才能完成某件事,那么使用成熟的sleep()或delay()定时器可能是不切实际的,因此执行虚拟"读/写到安全" I/O地址的做法是轻量级的解决方案.基本保证对0x80的读写不会对系统的运行产生不利影响,因此,对于此类虚拟操作而言,它是一个不错的选择.

Some operating systems will use reads and writes to I/O port 0x80 as a delaying mechanism. If you need to wait a few microseconds for something to complete, it may be impractical to use full-blown sleep() or delay() timers, so performing a "dummy" read/write to a "safe" I/O address is a light-weight solution. Reads and writes to 0x80 are basically gauranteed to not adversely affect the operation of the system, so it is a good choice for such dummy operations.

您会发现,对于许多较旧/较慢的外围设备(例如RTC芯片),有时需要等待几个usec来进行I/O写入操作才能生效".虚拟访问0x80是一种方便的方法.

You will find that with many older/slower peripheral devices (like your RTC chip), it is sometimes necessary to wait a few usec for an I/O write operation to "take effect". A dummy access to 0x80 is a convenient way to do it.

您还可能会找到对虚拟设备写入0x80的代码,以刷新"任何电气回声信号"的总线.在某些平台上,可以将一个值写入一个未使用/无效的I/O地址,从该地址读回,并查看您刚刚写入的值, ,即使该地址上实际上没有硬件 .但是,如果您对两者之间的另一个地址(例如I/O端口0x80)进行了虚拟写入,则可以防止这种情况.

You may also find code that does dummy writes to 0x80 to "flush" the bus of any electrical "echos". On certains platforms, it is possible to write a value to an unused/invalid I/O address, read back from that address, and see the value you just wrote, even though no hardware is actually at that address. However, if you do a dummy write to another address in between (say, I/O port 0x80), you can guard against this.

这篇关于0x80端口地址连接到什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-01 10:04