how does the linux shell in a multi-processor computer read the keyboard inputs?

58 views Asked by At

After reading this document, I know that the keyboard input will activate irq 1 pointed to some interrupt. Then our processors will decode the input and do something else.

My question is how a shell knows the keyboard input if the other processor handles the interrupt?

For example:

processor A is running shell

processor B handles the interrupt.

1

There are 1 answers

0
pndc On BEST ANSWER

The interrupt handler will either directly add the key press to a queue, or trigger a pop-up thread to do so. The queue is in shared memory, so can be read by any CPU.