Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to read directly PS/2 port?  (Read 6086 times)

0 Members and 1 Guest are viewing this topic.

MIRKOSOFT

    Topic Starter


    Hopeful

    Thanked: 2
    How to read directly PS/2 port?
    « on: October 26, 2018, 07:07:01 PM »
    Hi!

    Really I found not correct forum for coding which member I'm 'cause all forums are PL specific.

    I need help - how to read PS/2 keyboard/mouse port directly by C or assembly code.

    Can anybody recommend me any forum or any web where I find req'd info?
    I'm lost in Google results.

    Thank you for each word.
    Miro

    Salmon Trout

    • Guest
    Re: How to read directly PS/2 port?
    « Reply #1 on: October 27, 2018, 02:55:30 AM »
    Don't have any experience of writing drivers myself, but this looks like a fairly simple summary:

    http://www.cas.mcmaster.ca/~se3f03/content/assignment4tips.pdf

    Example:

    Code: [Select]
    Here's a small example of how
    you might install your IRQ handler:
    install_handler:
    push ax
    push es
    xor ax, ax ; set es to the IVT
    mov es, ax
    cli ; disable interrupts
    mov ax, irq_handler ; irq_handler is declared elsewhere
    mov [es:0x1d0], ax ; store pointer to the offset
    mov ax, cs ; we also need the CS value
    mov [es:0x1d2], ax ; store segment at 0x1d0 + 2
    ; interrupt handler is now fully installed
    sti ; enable interrupts
    pop es
    pop ax
    ret

    Also here:

    https://wiki.osdev.org/Mouse_Input#PS2_Mouse_Commands






    MIRKOSOFT

      Topic Starter


      Hopeful

      Thanked: 2
      Re: How to read directly PS/2 port?
      « Reply #2 on: October 27, 2018, 09:02:25 PM »
      Thank you very much.
      For beginning it is lot.

      BTW:
      I had simple Q on Slovak forums (I'm from Slovakia) and there is at first place irony and contempt - I never ask Slovak forums again.
      Really it is bad.

      Thank you very very much!
      Miro