summaryrefslogtreecommitdiff
path: root/ldlinux.asm
diff options
context:
space:
mode:
authorhpa <hpa>2001-11-20 22:42:11 +0000
committerhpa <hpa>2001-11-20 22:42:11 +0000
commitfd37fce3feff5f87cb00f3ff3e0dbb963c19e43c (patch)
treeb0501565d9e381c9ff61b4aae22c4a12bddd2f55 /ldlinux.asm
parenteeced4194301664a7c9a9d56c53a4ff2acd4e3c5 (diff)
downloadsyslinux-fd37fce3feff5f87cb00f3ff3e0dbb963c19e43c.tar.gz
Even more tweaks at flow control supportsyslinux-1.64-pre4
Diffstat (limited to 'ldlinux.asm')
-rw-r--r--ldlinux.asm25
1 files changed, 21 insertions, 4 deletions
diff --git a/ldlinux.asm b/ldlinux.asm
index c9b723b7..722e748d 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -326,6 +326,7 @@ VidRows resb 1 ; Rows on screen-1
FlowControl equ $
FlowOutput resb 1 ; Outputs to assert for serial flow
FlowInput resb 1 ; Input bits for serial flow
+FlowIgnore resb 1 ; Ignore input unless these bits set
RetryCount resb 1 ; Used for disk access retries
KbdFlags resb 1 ; Check for keyboard escapes
LoadFlags resb 1 ; Loadflags from kernel
@@ -1295,8 +1296,11 @@ pc_serial: call getint ; "serial" command
call ungetc
call getint ; Hardware flow control?
jnc .valid_flow
- xor bl,bl ; Default -> no flow control
+ xor bx,bx ; Default -> no flow control
.valid_flow:
+ and bh,0Fh ; FlowIgnore
+ shl bh,4
+ mov [FlowIgnore],bh
mov bh,bl
and bx,0F003h ; Valid bits
mov [FlowControl],bx
@@ -1335,8 +1339,7 @@ pc_serial: call getint ; "serial" command
add dx,byte 3 ; DX -> MCR
in al,dx
- mov ah,[FlowOutput] ; DTR and RTS control
- or al,ah ; Assert bits
+ or al,[FlowOutput] ; Assert bits
call slow_out
; Show some life
@@ -3415,6 +3418,14 @@ pollchar:
add dx,byte 5 ; DX -> LSR
in al,dx
test al,1 ; ZF = 0 if data pending
+ jz .done
+ inc dx ; DX -> MSR
+ mov ah,[FlowIgnore] ; Required status bits
+ in al,dx
+ and al,ah
+ cmp al,ah
+ setne al
+ dec al ; Set ZF = 0 if equal
.done: popad
ret
@@ -3428,10 +3439,16 @@ getchar:
mov bx,[SerialPort]
and bx,bx
jz .again
- lea dx,[bx+5] ; Serial status register
+ lea dx,[bx+5] ; DX -> LSR
in al,dx
test al,1
jz .again
+ inc dx ; DX -> MSR
+ mov ah,[FlowIgnore]
+ in al,dx
+ and al,ah
+ cmp al,ah
+ jne .again
.serial: xor ah,ah ; Avoid confusion
xchg dx,bx ; Data port
in al,dx