问题
I am developing a realmode operating system in x86 assembly. I managed to move cursor with keyboard, but I want to move the cursor with mouse. I don't know how. I found int 33h deals with the mouse, but I can't seem to move the cursor using int 33h.
回答1:
Interrupts int 10h
to int 1Fh
are BIOS interrupts; they can be used before the OS is booted.
Interrupts int 20h
to int 2Fh
are DOS interrupts; they can only be used when DOS has already been loaded.
Other interrupts (e.g. int 33h
) are interrupts used by device drivers; int 33h
can only be used when a DOS mouse driver is loaded.
When you want to access the mouse when there is no mouse driver installed (e.g. in your own boot loader), you'll directly have to access the hardware.
See the following articles in OSDEV:
https://wiki.osdev.org/%228042%22_PS/2_Controller
https://wiki.osdev.org/PS/2_Mouse
来源:https://stackoverflow.com/questions/54042732/how-to-move-cursor-with-mouse