You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
896 B

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

鼠标的驱动:
鼠标驱动的实现:
调用宏set_trap_gate(0x2c,&mouse_interrupt);
放在控制台设备初始化函数con_init()中与键盘中断初始化设置语句放在一起
还没修改makefile文件
通过文件里的12.2.2 键盘控制器i8042和中断控制器8259A
由于0x60这个端口对应的数据寄存器在键盘控制器上同时也被应用于鼠标输入的读取。所以在调用set_trap_gate(0x2c,&mouse interrupt) 之前还要设置i8042令其允许鼠标操作。
而且在把鼠标初始化并设置了鼠标中断的响应函数后应该把相应的中断请求位屏蔽打开还需向8259A发送OCW来打开屏蔽。
现在测试还是只能处理一次鼠标中断后续中断还是不能被正常捕获。所以应在mouse_interrupt处理完中断后给8259A发送结束中断命令