I've written custom handler for mouse (adapted form Sanik's Mouse Driver). It works flawlessly with QEMU but doesn't work with BOCHS at all. When I move the mouse at any direction, the mouse cursor goes left+down when I use Bochs but when I use Qemu it works absolutely fine. As a part of test, I tried to decode the individual bytes sent by the mouse when handling interrupt and I found that there's problem with the 2nd and 3rd byte.The first byte tracks the left and right button well but it's also buggy. Furthermore, there's problem with mouse scaling also. That is if I set Mouse scaling to 1 for Bochs we can't even track the mouse cursor because it's too quick while Mouse scaling factor 1 works fine with Qemu.
The handler code is attached.
Please have a look on it and please help. For your convinience you may just look at the handler code(there are some other functions as well which you may want to ignore). But please try to figure out where's the mistake.
Mouse doesn't work well with Bochs [SOLVED]
Mouse doesn't work well with Bochs [SOLVED]
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Re: Mouse doesn't work well with Bochs [SOLVED]
It seems quite funny to post a problem and reply myself. The problem which strucked me for more than a week was all due to my silly mistakes. The actual problem was I misused the type of the variables and function. I mean, I used 'int' for the one that should be 'char' and 'unsigned char' for the one that should be 'signed char'. Furthermore, I mixed up the bytes reieved from the mouse port due to which my cursor was behaving strangely.
And one strange thing................I was doing so much mistakes but still my driver code was working perfectly well with QEMU.
Never mind, I got the solution. ( Thanks to God )
And one strange thing................I was doing so much mistakes but still my driver code was working perfectly well with QEMU.
Never mind, I got the solution. ( Thanks to God )
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Re: Mouse doesn't work well with Bochs [SOLVED]
why don't u use cursor, cursor_area as character, so u can save memory. because these 2 variable containing data are only for putting pixels on screen, Then if u take it as character also then there is no problem. and make progam accordingly...........