File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
#include "mouse.h"
2
+ #include <log/log.h>
3
+ #include <asm/io.h>
2
4
3
5
void mouse_driver (){
4
6
mouse_drvr_platypusos .init_mouse ();
@@ -11,4 +13,16 @@ void init_mouse(){
11
13
int left_butt_pressed = 0 ; // I did that on purpose xD
12
14
int middle_butt_pressed = 0 ;
13
15
int right_butt_pressed = 0 ;
16
+ log (INFO , "Mouse initialized!" );
17
+ }
18
+
19
+ void work_mouse (){
20
+ outb (0xD4 , 0x64 ); // tell the controller to address the mouse
21
+ outb (0xF3 , 0x60 ); // write the mouse command code to the controller's data port
22
+ while (!(inb (0x64 ) & 1 ) asm("pause" ); // wait until we can read
23
+ ack = inb (0x60 ); // read back acknowledge. This should be 0xFA
24
+ outb (0xD4 , 0x64 ); // tell the controller to address the mouse
25
+ outb (100 , 0x60 ); // write the parameter to the controller's data port
26
+ while (!(inb (0x64 ) & 1 ) asm("pause" ); // wait until we can read
27
+ ack = inb (0x60 ); // read back acknowledge. This should be 0xFA
14
28
}
You can’t perform that action at this time.
0 commit comments