Q
Q
Qreen2022-03-13 13:50:48
C++ / C#
Qreen, 2022-03-13 13:50:48

Why is the mouse driver using the same port as the keyboard driver?

Looking at this article https://github.com/stevej/osdev/blob/master/kernel... I noticed these lines:

#define MOUSE_PORT   0x60
#define MOUSE_STATUS 0x64

The same ports are used when finding the pressed key on the keyboard, so how can they be here and there? As far as I understood from the main function - the principle of finding a bit is exactly the same (0x01), I don’t understand at all how this can be

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2022-03-14
@jcmvbkbc

The same ports are used when finding the pressed key on the keyboard, so how can they be here and there?

This is called multiplexing. After all, PS/2 is a rather complicated interface that works with commands, not that the keyboard is directly connected to one of the PC's ports. See https://wiki.osdev.org/Mouse_Input#Keyboard.2FAux_...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question