Correctly parse "serial" statements with no baud rate
authorH. Peter Anvin <hpa@zytor.com>
Thu, 17 Jul 2008 21:54:31 +0000 (14:54 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 17 Jul 2008 21:54:31 +0000 (14:54 -0700)
People often don't bother specifying a baud rate for virtual serial
ports.  Handle parsing correctly.

core/parseconfig.inc

index 2975a8b..7fb6ddf 100644 (file)
@@ -183,14 +183,13 @@ pc_include:       inc word [IncludeLevel]
 pc_serial:     call getint
                jc .err
                push bx                         ; Serial port #
+               xor ax,ax
+               mov [FlowControl],ax            ; Default to no flow control
+               mov [FlowIgnore],al
                call skipspace
-               jnc .ok
-               pop bx
-.err:          ret
-.ok:
+               jc .nobaud
                call ungetc
                call getint
-               mov [FlowControl], word 0       ; Default to no flow control
                jc .nobaud
 .valid_baud:
                push ebx
@@ -250,7 +249,7 @@ pc_serial:  call getint
 
                in al,dx                        ; Read back LCR (detect missing hw)
                cmp al,03h                      ; If nothing here we'll read 00 or FF
-               jne .serial_port_bad            ; Assume serial port busted
+               jne .err                        ; Assume serial port busted
                dec dx
                dec dx                          ; DX -> IER
                xor al,al                       ; IRQ disable
@@ -284,7 +283,7 @@ pc_serial:  call getint
 .notfirst:
                ret
 
-.serial_port_bad:
+.err:
                mov [SerialPort], word 0
                ret