summaryrefslogtreecommitdiff
path: root/pxelinux.asm
diff options
context:
space:
mode:
Diffstat (limited to 'pxelinux.asm')
-rw-r--r--pxelinux.asm12
1 files changed, 10 insertions, 2 deletions
diff --git a/pxelinux.asm b/pxelinux.asm
index 5a6976d9..85faf63e 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -1037,8 +1037,9 @@ pc_serial: call getint ; "serial" command
cmp di,3
ja .port_is_io ; If port > 3 then port is I/O addr
shl di,1
- mov di,[di+serial_base]
-.port_is_io: mov [SerialPort],di
+ mov di,[di+serial_base] ; Get the I/O port from the BIOS
+.port_is_io:
+ mov [SerialPort],di
lea dx,[di+3] ; DX -> LCR
mov al,83h ; Enable DLAB
call slow_out
@@ -1051,6 +1052,9 @@ pc_serial: call getint ; "serial" command
mov al,03h ; Disable DLAB
add dx,byte 2 ; DX -> LCR
call slow_out
+ 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
sub dx,byte 2 ; DX -> IER
xor al,al ; IRQ disable
call slow_out
@@ -1068,6 +1072,10 @@ pc_serial: call getint ; "serial" command
jmp short parse_config_3
+.serial_port_bad:
+ mov [SerialPort], word 0
+ jmp short parse_config_3
+
pc_fkey: sub ah,'1'
jnb pc_fkey1
mov ah,9 ; F10