diff options
| author | hpa <hpa> | 2001-11-21 20:48:04 +0000 |
|---|---|---|
| committer | hpa <hpa> | 2001-11-21 20:48:04 +0000 |
| commit | 3927e753dbe5b61efdcc106f2b1de73bb725ab2f (patch) | |
| tree | 529d4596526e190a30ac291e6dcabe3925720620 /ldlinux.asm | |
| parent | 2d784ce8cd7a707d2eda5594504b34a1428e0c20 (diff) | |
| download | syslinux-3927e753dbe5b61efdcc106f2b1de73bb725ab2f.tar.gz | |
Make an attempt at detecting nonexistent serial port hardware.syslinux-1.64-pre6
Diffstat (limited to 'ldlinux.asm')
| -rw-r--r-- | ldlinux.asm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ldlinux.asm b/ldlinux.asm index 65b93303..f9552f95 100644 --- a/ldlinux.asm +++ b/ldlinux.asm @@ -1320,8 +1320,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 @@ -1334,6 +1335,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 @@ -1351,6 +1355,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 |
