From: H. Peter Anvin Date: Thu, 17 Jul 2008 21:54:31 +0000 (-0700) Subject: Correctly parse "serial" statements with no baud rate X-Git-Tag: syslinux-3.71-pre15~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e21e687111c7dcb234690de6c4175b4e69161cfd;p=platform%2Fupstream%2Fsyslinux.git Correctly parse "serial" statements with no baud rate People often don't bother specifying a baud rate for virtual serial ports. Handle parsing correctly. --- diff --git a/core/parseconfig.inc b/core/parseconfig.inc index 2975a8b..7fb6ddf 100644 --- a/core/parseconfig.inc +++ b/core/parseconfig.inc @@ -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