why 'Delay is needed after doing I/O'?
Posted: Mon Aug 05, 2019 11:40 pm
When I read the Linux kernel source code(Linux 3.10.0), I noticed following codes in the file 'arch/x86/boot/pm.c':
The function call 'io_delay()' here is to let the CPU wait for some time (by 'outb' a byte to the diagnostics IO Port 0x80), and my question is:
Why does it need to wait for some delay after doing I/O?
Code: Select all
22 static void realmode_switch_hook(void)
23 {
24 if (boot_params.hdr.realmode_swtch) {
25 asm volatile("lcallw *%0"
26 : : "m" (boot_params.hdr.realmode_swtch)
27 : "eax", "ebx", "ecx", "edx");
28 } else {
29 asm volatile("cli");
30 outb(0x80, 0x70); /* Disable NMI */
31 io_delay();
32 }
33 }
Why does it need to wait for some delay after doing I/O?