summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2001-11-21 20:48:04 +0000
committerhpa <hpa>2001-11-21 20:48:04 +0000
commit3927e753dbe5b61efdcc106f2b1de73bb725ab2f (patch)
tree529d4596526e190a30ac291e6dcabe3925720620
parent2d784ce8cd7a707d2eda5594504b34a1428e0c20 (diff)
downloadsyslinux-3927e753dbe5b61efdcc106f2b1de73bb725ab2f.tar.gz
Make an attempt at detecting nonexistent serial port hardware.syslinux-1.64-pre6
-rw-r--r--isolinux.asm12
-rw-r--r--ldlinux.asm12
-rw-r--r--pxelinux.asm12
-rw-r--r--syslinux.doc4
4 files changed, 34 insertions, 6 deletions
diff --git a/isolinux.asm b/isolinux.asm
index fdf54de0..2abd748b 100644
--- a/isolinux.asm
+++ b/isolinux.asm
@@ -1222,8 +1222,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
@@ -1236,6 +1237,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
@@ -1253,6 +1257,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
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
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
diff --git a/syslinux.doc b/syslinux.doc
index 3a064858..71cbbe4f 100644
--- a/syslinux.doc
+++ b/syslinux.doc
@@ -234,6 +234,10 @@ SERIAL port [[baudrate] flowcontrol]
For the SERIAL directive to be guaranteed to work properly, it
should be the first directive in the configuration file.
+ NOTE: "port" values from 0 to 3 means the first four serial
+ ports detected by the BIOS. They may or may not correspond to
+ the legacy port values 0x3F8, 0x2F8, 0x3E8, 0x2E8.
+
FONT filename
Load a font in .psf format before displaying any output
(except the copyright line, which is output as ldlinux.sys