core/conio.inc: when reading the serial port, drop read of IIR syslinux-3.81-pre5
authorH. Peter Anvin <hpa@zytor.com>
Mon, 18 May 2009 21:57:37 +0000 (14:57 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 18 May 2009 21:57:37 +0000 (14:57 -0700)
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>
core/conio.inc

index d1b92f5..2d8c61a 100644 (file)
@@ -1,6 +1,7 @@
 ;; -----------------------------------------------------------------------
 ;;
 ;;   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
@@ -331,9 +332,7 @@ getchar:
                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