Drop the read of the IIR when reading the serial port. First of all,
we weren't protecting AL so we clobbered the actual data; second of
all, this isn't actually necessary as reading RDR will clear the
interrupt condition per the UART spec.
It's worth noting that enabling interrupts here will do bad things if
the interrupts aren't edge-triggered (since we don't actually have an
interrupt routine to clear the interrupt condition); this also means
bad things will happen if the interrupt line is shared.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
;; -----------------------------------------------------------------------
;;
;; Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
+;; Copyright 2009 Intel Corporation; author: H. Peter Anvin
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
jne .again
.serial: xor ah,ah ; Avoid confusion
mov dx,bx ; Data port
- in al,dx
- lea dx,[bx+2] ; DX -> IIR
- in al,dx ; Read IIR to discard any IRQ bits
+ in al,dx ; Read data
ret
.kbd: mov ah,10h ; Get keyboard input
int 16h