I thought a lot about the keyboard. How it works? It seems I can’t explain me a good explanation.
I know that keyboard interrupt is executed every time a key is pressed. The processor stops everything that it processes and loads keyboard data from the keyboard buffer, storing it in the system-level buffer.
But what will happen next? Let's take a practical example. What happens when I run the following code snippet:
...
std::string s;
std::cin >> s;
....
Is it read cinfrom the user level of the system buffer of the system level keyboard? This makes sense in my head, because then 2 or more processes can be read from the same buffer, and thus I do not lose any keystrokes. But does it work like that?
I know that I speak in the most general terms. I am using OS OS.
mslot source
share