ok , what we have until now is :

The code works almost perfectly when booting to a command prompt only (DOS). in BIOS i made it not to halt on keyboard errors, but this only removed the ( No keyboard or keyboard error) that appears when switching on. But still it FREEZES when trying to send a character in notepad ( in windows). why is it working over DOS but windows Freezes?

in the code i made no initialization (When the PC is booting, the keyboard must send and receive several commands to tell the PC what it is, what mode it's using, etc.) and still the DOS recognizes the data sent to the PS/2 port by the PIC.

what to do so that windows doesn't freeze?

thanks again