Found the error in my ATA-1 controller (Using the Sourcetree Checkout option). The ATA-1 control port address was listening to BAR1+2 and BAR1+3(BAR1=0, so it's base port 3F6). The controller was thus listening to port 3F8&3F9(which are also used by the UART data port and Interrupt Enable register). This causes the input from the UART data port (COM1 has a serial mouse attached) to be combined with data read from the ATA-1 alternate status port address(which reads/writes to the same address), causing the software to read mingled data (OR'ed data of the mouse and IDE ATA-1 controller).When the UART data port is read, it actually reads the mouse data (any input data from the mouse) OR'ed with the data in the IDE ATA-1 controller (0x10). When the mouse is returning byte 0x80 and the ATA-1 status got 0x10 in it's register, the software reads 0x90 (0x80 from the mouse OR'ed with 0x10 from the ATA-1 alternate status register). This was causing the problem. It's fixed now.