Page 1 of 1
In/Out - Bochs problem
Posted: Mon Feb 24, 2003 12:51 pm
by Hornet
Hello.
I'm using the following code to control the lock LEDs:
Code: Select all
mov dx, 0x60
mov ax, 0xED
out dx, ax
mov ax, 0xFF
out dx, ax
This code works in VMware and on my Computer. But Bochs is exiting with the following message:
[KBD ] kbd: io write to address 00000060, len=2!
Can anyone help me?
Hornet (german)
Re:In/Out - Bochs problem
Posted: Mon Feb 24, 2003 3:03 pm
by distantvoices
bochs protests, when you want to say out [port],ax f. ex. I've had this error in my implementation too.
use al instead. this will work i think. It has to do with the registers length.
p. ex.
mov al,0x20
out 0x20,al
hope this helps.
Re:In/Out - Bochs problem
Posted: Tue Feb 25, 2003 2:11 am
by Pype.Clicker
when you use "out dx,ax", what is actually done is sending al on IO[dx] and ah on IO[dx+1]. This is probably not what you want to do. If this was not a typo, I suggest you go back to the keyboard definitions and read it once again.
out 0x60,eax ; out 0x60,ax and out 0x60,al have definitely *NOT* the same behaviour.
Re:In/Out - Bochs problem
Posted: Tue Feb 25, 2003 11:12 am
by distantvoices
Have peeked in to my own holy grail of assembly and found out:
al = 8 bit length
ax=16 bit length
eax=32 bit length
Some ports only accept a value which is 8 bits long - in these cases bochs kicks the code out and refuses to continue work. It is a box - what do you expect it to do else?*ggg*