Tweak Console Takeover Mechanism

Based on input from Martin R, the console takeover mechanism has been modified to require that the space bar be pressed twice in a row on the character unit desiring to be the console.  This reduces the chance of a spurious console takeover due to garbage input on serial ports.
This commit is contained in:
Wayne Warthen
2024-02-07 13:14:27 -08:00
parent 0b1bbf3d2b
commit 807999928e
13 changed files with 37 additions and 16 deletions

View File

@@ -903,23 +903,23 @@ If your system has more than one character unit, then the Boot Loader
will "poll" all of the character devices for a request to make any of
the alternate character devices the active console. This is called a
console takeover request. This functionality must be enabled in the ROM
build configuration, but it is for all standard ROMs.
build configuration, but currently it is for all standard ROMs.
To request a console takeover, you just press the \<space\> character
at the port or terminal that you want to move the console to. The
terminal or communication software **must** be configured for the
default serial port speed and data bits for this to work.
To request a console takeover, you just press the \<space\> character
twice in a row at the port or terminal that you want to move the console
to. The terminal or communication software **must** be configured for
the default serial port speed and data bits for this to work.
A takeover request is only possible while the active console is
showing the Boot Loader prompt prior to typing any characters at
the active console. In other words, once you start typing at the
active console prompt, the takeover polling is suspended. If you have
started typing characters, you can press \<enter\> at the active
console to get a new Boot Loader prompt and reactivate the polling.
console to get a fresh Boot Loader prompt and reactivate the polling.
If you have built a custom ROM that includes an automatic boot
command with a timeout, then performing a console takeover will
abort the timeout process and the automatic command will not be
abort the timeout process and the automatic boot command will not be
performed.
## Front Panel

View File

@@ -265,6 +265,18 @@ prompt:
call dsky_beep
call dsky_l2on
#endif
;
; purge any garbage on the line
call delay ; wait for prompt to be sent
ld b,0 ; failsafe max iterations
purge:
call cst ; anything there?
jr z,wtkey ; if not, move on
call cin ; read and discard
djnz purge ; and loop till no more
;
or $ff ; initial value
ld (conpend),a ; ... for conpoll routine
;
wtkey:
; wait for a key or timeout
@@ -319,9 +331,10 @@ clrbuf1:
;=======================================================================
;
; Poll all character units in system for a console takeover request.
; A takeover request is just pressing <space> at the port that wants
; to takeover. Return with ZF set if a console takeover was requested.
; If so, the requested console unit will be recorded in (newcon).
; A takeover request consists of pressing the <space> twice in a row.
; at the character unit that wants to be the console. Return with ZF
; set if a console takeover was requested. If so, the requested console
; unit will be recorded in (newcon).
;
#if (BIOS == BIOS_WBW)
#if (AUTOCON)
@@ -329,7 +342,6 @@ clrbuf1:
conpoll:
; save active console unit
ld a,(curcon)
;ld (savcon),a
ld e,a ; save in E
;
; loop through all char ports
@@ -347,7 +359,14 @@ conpoll1:
call cin ; get char
cp ' ' ; space char?
jr nz,conpoll2 ; if not, move on
jr conpoll3 ; space char typed, take console
;
; a <space> char was typed. check to see if we just saw a
; <space> from this same unit.
ld a,(conpend) ; pending con unit to A
cp c ; compare to active unit
jr z,conpoll3 ; if =, second <space>, take con
ld a,c ; if not, unit to A
ld (conpend),a ; and update pending console
;
conpoll2:
inc c ; next char unit
@@ -2498,6 +2517,7 @@ dskyact .db 0 ; DSKY active if != 0
curcon .db CIO_CONSOLE ; current console unit
ciocnt .db 1 ; count of char units
savcon .db 0 ; con save for conpoll
conpend .db $ff ; pending con unit (first <space> pressed)
#endif
;

View File

@@ -2,7 +2,7 @@
#DEFINE RMN 5
#DEFINE RUP 0
#DEFINE RTP 0
#DEFINE BIOSVER "3.5.0-dev.7"
#DEFINE BIOSVER "3.5.0-dev.8"
#define rmj RMJ
#define rmn RMN
#define rup RUP

View File

@@ -3,5 +3,5 @@ rmn equ 5
rup equ 0
rtp equ 0
biosver macro
db "3.5.0-dev.7"
db "3.5.0-dev.8"
endm