As keyboard input as scan codes can be obtained from calling interrupt 09 IRQ1 or similar ones or by directly accessing the BIOS keyboard buffer at segment 0040h
why is there a requirement for a separate keyboard driver ? or does the keyboard driver itself does one of the above for the OS?
what i mean is for taking keyboard input when we can BIOS keyboard buffer or some interrupt routines why is there a requirement to write a “keyboard driver” because in some OSs like minix there is a separate keyboard river in the list of drivers of that OS?
There’s a requirement for the driver because the driver is the mechanism of abstraction that the OS uses to interact with devices, both real and imaginary.
Consider /dev/random, which is a random number generator. The OS knows that it can “read” from that device and get a random number. How is the random number generated? The OS doesn’t care. That process is isolated and abstracted away by the driver. It could be a pseudo random algorithm. It could be a special device on the motherboard. It could be a video camera watching rush hour traffic. Who knows. The point is that the OS doesn’t care “how” it is done, it only knows that by using assorted drivers it can talk to most any piece of hardware, real or synthetic.
Just like if you were writing the OS you wouldn’t simply load memory from the keyboard buffer, but you would instead write the code once and call a subroutine, a driver is a higher level mechanism of abstraction that performs a similar task.