Am Mon, 10 Mar 2008 03:16:43 +0100 schrieb polemon:
> Hi!
>
> I found an old IBM Model M keyboard in the dumpster of my university.
>
> The keyboard works fine, every key still has its legendary click...
>
> This Keyboard has a speaker, and I'd like to access it.
>
> I wrote this tiny x86 Assembler program some time ago, to set the LEDs
> on it:
>
> section .text
> global _start
>
> _start:
Before you write to the keyboard-controller, it is better to check the
status if the input buffer is empty, otherwise it is possible that the
command won´t progress.
A1: in al, 64h
test al, 2
jnz A1
> mov al, 0EDh ; command to set LEDs to keyboard
> out 60h, al ; write command
> mov al, 111b ; set flags
> out 60h, al ; write flags
>
> mov al,1 ; system call number (sys_exit)
> int 0x80 ; call kernel
>
>
> I don't know much about I/O-Registers, obviously 60h is for the
keyboard.
> Now I'd like to know two things:
>
> 1. What is the command code (sequence) to access the speaker of an old
> IBM Model M (1993 made)
I am not familar with that old modell.
> 2. How can I read keyboard data (what register and how should I access
it)
Here you can also check the status, in this case if the output buffer is
filled with a byte and than check if it recieved from a PS2-mouse.
A2: in al, 64h
test al, 1
jz A2
test al, 20h
jnz A2
in al, 60h
Additional take a look into Ralf Browns Interrupt List:
RBIL->inter61d.zip->****ts.a->****T 0060-006F
http://www.pobox.com/~ralf
http://www.pobox.com/~ralf/files.html
ftp://ftp.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/pub/
Dirk


|