Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.os.development    |    Operating system development chatter    |    4,255 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,934 of 4,255    |
|    wolfgang kern to Robert Pengelly    |
|    Re: Does a PS/2 mouse get detected if pl    |
|    17 Nov 23 04:37:03    |
      From: nowhere@never.at              On 16/11/2023 14:39, Robert Pengelly wrote:       > On Thursday, 16 November 2023 at 06:35:59 UTC, wolfgang kern wrote:       >> On 15/11/2023 09:27, Robert Pengelly wrote:       >> ...       >>> Right, I rewrite all the IRQ12 related stuff and it seems to work as I get       an A printed in the handler when I capture the mouse with qemu, how do I tell       the controller that I've got the data? I've tried:       >>>       >>> in al, 0x20       >>> out 0x20, al       >>>       >>> in al, 0x60       >>> out 0x60, al       >>>       >>> and       >>>       >>> in al 0x64       >>> out 0x64, al       >>>       >>> and nothing happens as I only get the A printed once       >> END of INTERRUPT(IRQ12):       >> MOV AL, 0xA0       >> OUT 0xA0,AL ;release IRQ 12       >> OUT 0x20,AL ;and the cascaded IRQ0..7       >>       >> END OF INTERRUPT(IRQ4):       >> MOV AL,0x20       >> OUT 0x20,AL       >>       >> but if the mouse is out of sync it may need a reset       >> __       >> wolfgang       > Right, I have:              > ps2_handler:       > push ax       > in al, HEX (60)              OK this releases the IRQ-pin              > mov al, 'A'       > call writechr              hope this call doesn't alter any SEGreg, IE-bit or rely on PIC timer.              **; mov al, HEX (A0)               MOV AL,0x20              > out HEX (A0), al              **; mov al, HEX (20)               it is still 0x20       > out HEX (20), al       >       > pop ax       > iret              > and I get three A's printed every time I move the mouse so that's a good       sign. Looking at the PS/2 packets on https://roborooter.com/post/serial-mice/       it has:              > D7 D6 D5 D4 D3 D2 D1 D0       > Byte 1 XV XV YS XS 1 M R L       > Byte 2 X7 X6 X5 X4 X3 X2 X1 X0       > Byte 3 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0       >       > L Left button state (1 = pressed down)       > M Middle button state (1 = pressed down)       > R Right button state (1 = pressed down)       > X0-X7 Movement in X direction       > Y0-Y7 Movement in Y direction       > XS,YS Movement data sign bits (1 = negative)       > XV,YV Movement data overflow bits (1 = overflow has occurred)       >       > Is the D3 the status bit? Also, what is the XV/YV for? It says overflow       bit but I'm a little confused as to what I do with it.              in case of overflow discard movement data and read again.       someone tried to use OV-bits for movement expansion but worked rare.       __       wolfgang              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca