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

@@ -7,6 +7,7 @@ Version 3.5
- WBW: Allow front panel LED/Switch bits to be inverted in config - WBW: Allow front panel LED/Switch bits to be inverted in config
- WBW: Add API to expose application banks available - WBW: Add API to expose application banks available
- WBW: Added console takeover at boot loader prompt - WBW: Added console takeover at boot loader prompt
- L?N: Fixed Propeller font vertical line character to align properly
Version 3.4 Version 3.4
----------- -----------

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,7 +3,7 @@
**RomWBW ReadMe** \ **RomWBW ReadMe** \
Version 3.5 \ Version 3.5 \
Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \ Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \
04 Feb 2024 07 Feb 2024
# Overview # Overview

View File

@@ -1,6 +1,6 @@
RomWBW ReadMe RomWBW ReadMe
Wayne Warthen (wwarthen@gmail.com) Wayne Warthen (wwarthen@gmail.com)
04 Feb 2024 07 Feb 2024

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 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 the alternate character devices the active console. This is called a
console takeover request. This functionality must be enabled in the ROM 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 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 twice in a row at the port or terminal that you want to move the console
terminal or communication software **must** be configured for the to. The terminal or communication software **must** be configured for
default serial port speed and data bits for this to work. the default serial port speed and data bits for this to work.
A takeover request is only possible while the active console is A takeover request is only possible while the active console is
showing the Boot Loader prompt prior to typing any characters at showing the Boot Loader prompt prior to typing any characters at
the active console. In other words, once you start typing at the the active console. In other words, once you start typing at the
active console prompt, the takeover polling is suspended. If you have active console prompt, the takeover polling is suspended. If you have
started typing characters, you can press \<enter\> at the active 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 If you have built a custom ROM that includes an automatic boot
command with a timeout, then performing a console takeover will 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. performed.
## Front Panel ## Front Panel

View File

@@ -265,6 +265,18 @@ prompt:
call dsky_beep call dsky_beep
call dsky_l2on call dsky_l2on
#endif #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: wtkey:
; wait for a key or timeout ; wait for a key or timeout
@@ -319,9 +331,10 @@ clrbuf1:
;======================================================================= ;=======================================================================
; ;
; Poll all character units in system for a console takeover request. ; Poll all character units in system for a console takeover request.
; A takeover request is just pressing <space> at the port that wants ; A takeover request consists of pressing the <space> twice in a row.
; to takeover. Return with ZF set if a console takeover was requested. ; at the character unit that wants to be the console. Return with ZF
; If so, the requested console unit will be recorded in (newcon). ; set if a console takeover was requested. If so, the requested console
; unit will be recorded in (newcon).
; ;
#if (BIOS == BIOS_WBW) #if (BIOS == BIOS_WBW)
#if (AUTOCON) #if (AUTOCON)
@@ -329,7 +342,6 @@ clrbuf1:
conpoll: conpoll:
; save active console unit ; save active console unit
ld a,(curcon) ld a,(curcon)
;ld (savcon),a
ld e,a ; save in E ld e,a ; save in E
; ;
; loop through all char ports ; loop through all char ports
@@ -347,7 +359,14 @@ conpoll1:
call cin ; get char call cin ; get char
cp ' ' ; space char? cp ' ' ; space char?
jr nz,conpoll2 ; if not, move on 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: conpoll2:
inc c ; next char unit inc c ; next char unit
@@ -2498,6 +2517,7 @@ dskyact .db 0 ; DSKY active if != 0
curcon .db CIO_CONSOLE ; current console unit curcon .db CIO_CONSOLE ; current console unit
ciocnt .db 1 ; count of char units ciocnt .db 1 ; count of char units
savcon .db 0 ; con save for conpoll savcon .db 0 ; con save for conpoll
conpend .db $ff ; pending con unit (first <space> pressed)
#endif #endif
; ;

View File

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

View File

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