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
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
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
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
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
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
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
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
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
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