The std::io module in Rust handles all input/output operations. These operations can vary from keyboard/mouse input to reading a file, or from using TCP/IP sockets to command-line utilities (stdio/stderr). But how does it work internally?
Instead of understanding how the Rust standard library does it, we will dig some levels deeper to understand how it works at CPU level. We will later go back to see how the kernel provides this functionality to Rust. This will be based mostly in the x86_64 platform and Linux kernel, but other platforms handle these things similarly.
There are two main types of I/O architecture: channel-based I/O and memory-mapped I/O. Channel-based I/O is really niche and is not used in modern ...