Page 1 of 1

scancode 3 on AT-Compatible machines

Posted: Thu Jul 15, 2004 8:06 am
by firas981
My machine is AT-compatible so its default scancode-set is 2 .
I used this function to set scancode-set to 3 :

Byte KB_Set_ScanCode_Mode ( Byte mode )
{
   KB_Write_To_DataRegister ( KB_READ_OR_SET_SCANCODE_COM ) ;
   if ( KB_Read_From_OutputRegister ( ) != KB_ACK_REPLY ) return 0;//FAILED
   
   KB_Write_To_DataRegister ( mode ) ;
   if ( KB_Read_From_OutputRegister ( ) != KB_ACK_REPLY ) return 0;//FAILED
   
   return 1 ;
}

After that I checked the scancode-set and it was 3 , so the previous code succeeded .
but when I press anykey the IRQ1_handler craches . although it works well when using scancode set 2 .

thanks

Re:scancode 3 on AT-Compatible machines

Posted: Thu Jul 15, 2004 10:53 pm
by Brendan
Hi,
firas981 wrote: After that I checked the scancode-set and it was 3 , so the previous code succeeded .
but when I press anykey the IRQ1_handler craches . although it works well when using scancode set 2 .
Scancode sets 1 and 3 aren't recommended as they aren't supported by all keyboards. Despite this your keyboard driver should never crash (even if the keyboard is sending random numbers). Why did it crash (which exception, etc)?


Cheers,

Brendan

Re:scancode 3 on AT-Compatible machines

Posted: Sat Jul 17, 2004 8:19 am
by firas981
manuals say that there is internal translation from set 2 to set 1 in some AT-compatibles , so I wrote my driver according on set 1 .....
it succeeded !

thanks

Re:scancode 3 on AT-Compatible machines

Posted: Sat Jul 17, 2004 12:11 pm
by Pype.Clicker
i second that. Those "'multiple scancode sets" are things people that write code for a microcontroller that talks *directly* with the keyboard need to take into account. In our case, there's *already* a microcontroller doing this (the 8042) and doing it well. So we can be happy and stick with scancode set #1, which is the plain compatible set you get if you're running under DOS...

Re:scancode 3 on AT-Compatible machines

Posted: Sun Jul 18, 2004 2:29 am
by Brendan
Hi,
Pype.Clicker wrote: i second that. Those "'multiple scancode sets" are things people that write code for a microcontroller that talks *directly* with the keyboard need to take into account. In our case, there's *already* a microcontroller doing this (the 8042) and doing it well. So we can be happy and stick with scancode set #1, which is the plain compatible set you get if you're running under DOS...
Ever wondered what happens when you plug another keyboard into the second PS/2 port (where the mouse usually goes)? I've got a PS/2 (keyboard & mouse) driver that allows this..

2 keyboards + 2 video cards + 2 serial mice = a multi-user computer ;D


Cheers,
Brendan