What does the 0x80 port address connect to?

前端 未结 3 1625
情话喂你
情话喂你 2021-02-07 14:26

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 su

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 14:53

    Those dummy reads implement a delay; from Linux I/O port programming mini-HOWTO:

    The inb_p(), outb_p(), inw_p(), and outw_p() macros work otherwise identically to the ones above, but they do an additional short (about one microsecond) delay after the port access; you can make the delay about four microseconds with #define REALLY_SLOW_IO before you #include .

    These macros normally (unless you #define SLOW_IO_BY_JUMPING, which is probably less accurate) use a port output to port 0x80 for their delay, so you need to give access to port 0x80 with ioperm() first (outputs to port 0x80 should not affect any part of the system). For more versatile methods of delaying, read on.

提交回复
热议问题