0

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.

gnosis
  • 107
  • 8
  • 1
    so? it's still just one kernel running the whole show, so processor B handles the kernel's "process keyboard input" stuff, the input goes into a queue somewhere, and the kernel will figure out what process has focus and should be notified that there's input available. – Marc B Dec 04 '14 at 15:51
  • The keyboard is read by the kernel. – Basile Starynkevitch Dec 04 '14 at 16:37

1 Answers1

1

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.

pndc
  • 3,710
  • 2
  • 23
  • 34