From 66bd2050fe1c851765622d8291ff8d0188ffc295 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Fri, 20 Sep 2024 19:25:42 +0100 Subject: [PATCH] Better Ctrl+C handling --- build/chimaera.img | Bin 368640 -> 368640 bytes build/chimaera.vhd | Bin 34120704 -> 34120704 bytes src/apps/pcomm/cbreak.asm | 49 ++------------ src/apps/pcomm/pcomm.asm | 130 +++++++++++++++++++++++++++++--------- src/apps/pcomm/type.asm | 7 +- src/kernel/int23.asm | 18 ++++-- 6 files changed, 121 insertions(+), 83 deletions(-) diff --git a/build/chimaera.img b/build/chimaera.img index 3a86ddacd4e7672947429944b112c67088e2b842..2adf2a53172857dae64074002e0be338b6bf81fa 100644 GIT binary patch delta 6666 zcmb7I3sh89+ur94%y69IOy^ zMiA3oe|@P0LaCqy4*wT8eKJOhX_JawDD2|(+tcJKr3^*ofA={cn)R>svli#<+3()( ze$TU?_p*1DBecp9`f8lV-UzQBI;JJCl8mZRTa(Ybl1^_K(Y1L2fWDSdcs4#F>lC-0gBt^mZmfix!xcEXd{lL>_`#3J{u?w|H^( zlKC9GITRo)Jifp*B%NbBHS%Bno5JLaZ?#NZndiss;^5?eD6)IcXVYV zeLtCl(;tswVsYW)CnMgPUH!3#I}9EgM|ps%?s)yz#`T8FMzR(!ej+}|LdDg+>^<%? zwT8>}4icG;FQi7`X{%%Klo<-Ve03OhKk*&YfDf;p%shsFS*=QQWs&n)%~MFsY;aT9XhLwAC=#yQOinJ6c;ViJBEAB`KE$Gsfv7)Qs$?Yttf%+E(yBQTWBWd zrvqj`Yqo2bd79jd`TPM)PNJ7nZo?TR`5)-oUKm69h-s`=i;pUEt*ft z6RQuhMxwK+)_uV!8Z&sSt|5bO-Ubc61+#V2ybs5=&m#w7U3xsDZdSZCw%v!k7z^uK zjHO? zVoqP78r%|Mj_G8MA|rV$pe(Gtgv_TiX44tzbVh27#nl*4bBrY5PuI^0a%(_(UIWro z8jzmUxN@+%o{R3H{WjYF9_`<$DY3YM0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SFvyal`s6aa<5Lf{>s2zVEG4|pF~1QY{CU@=evECH4RrN9TkGT=ktBj96TIj{mK z11Rtb@F}no_zYMDd=9Jz)&OgPa$p@$0jvi$0RIC14SWH732X#50h@s>z*oT6Kqash z*amC|s(^2R9Y8fu1JnXLfjZz@;5%R!P!BW!yMaA`3HToP0oV)d1NH+y0zUzbzyY8M zXa)`fhk(OC3-B{=1UL#D1AYOH11Er!z$xG~a0X}veg)0~zX87kZ9qG44)_B&4=}(C zTmUSQ}SFQZ;Ty^4Ab zH5)Ytm4nJf<)QLXb5Zk9^HHy(-ax&HT7Y^B^){*iRft-MdIwd6dKdK`>V4EAR58kk zT8t_|EkP|sm7+dCEkk{X`Uv$gYB_2JstiR@pP)WPtweo>T7~)?wHmbswH8&5T8FAY ztw(J@{R{PP)EB5PQ5#X4P@7R(P+y_GMpdG=qPC&7qpDEfpmw0DQ8lPq)J{|#>RZ%z zs9mUfR0C=^Y7feU`X2QIYANx5I>LltE>NM&MsulGs>MZIv)bFS^R6FV%>JQX;6hoO&7f=?|MbstKpQy{IE2yie zYp4#?b<_>iP1G$^C+arp4yp@v7j+MHAJxsn@F#%{9wk9ZQFbVMlnf=8)Wh&6NzH=4 u)o53*BNAWf+kwN^1i)74fD6-guSSd*sSkc7Y~rj(rYSPg;D3i~=Klv_aOJxI diff --git a/src/apps/pcomm/cbreak.asm b/src/apps/pcomm/cbreak.asm index 6ead948..c0e901c 100644 --- a/src/apps/pcomm/cbreak.asm +++ b/src/apps/pcomm/cbreak.asm @@ -11,51 +11,16 @@ global _cbreak_handler _cbreak_handler: - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Preserve registers. - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - push es - push ax - push bx - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Reset our history index (bp should be unchanged). - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - mov ax, cs:[_vec_history + 4] - mov cs:[_history_idx], ax - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Free the current command history if there is one. - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - mov ax, cs:[_curr_scratch] - - and ax, ax - jz .L1 - - push ax - - call _free - add sp, 2 - - xor ax, ax - mov cs:[_curr_scratch], ax - -.L1: - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Reset the console to the prompt state. - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - call _prompt - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Restore registers. - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - pop bx - pop ax - pop es + mov word ptr cs:[_cbreak], 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Clear the carry flag and return. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; clc retf 2 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Data area. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +global _cbreak +_cbreak: dw HEX (0000) diff --git a/src/apps/pcomm/pcomm.asm b/src/apps/pcomm/pcomm.asm index c32bb43..c24c1a1 100644 --- a/src/apps/pcomm/pcomm.asm +++ b/src/apps/pcomm/pcomm.asm @@ -20,6 +20,24 @@ _main: .L5: + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Free the current command history if there is one. + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + mov ax, cs:[_curr_scratch] + + and ax, ax + jz .L82 + + push ax + + call _free + add sp, 2 + + xor ax, ax + mov cs:[_curr_scratch], ax + +.L82: + mov ah, HEX (19) int HEX (21) @@ -36,7 +54,7 @@ _main: .L7: mov word ptr cs:[_need_ext], 0 - call _prompt + mov word ptr cs:[_cbreak], 0 mov cl, cs:[_scratch_size] xor ch, ch @@ -45,21 +63,35 @@ _main: mov cs:[_history_idx], ax mov di, offset _scratch + xor al, al push di push cx - - xor al, al rep stosb + mov cs:[_scratch_len], al pop cx pop di + + call _prompt .L11: + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Clear the carry flag. + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + clc + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Try to get a key press. + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; mov ah, HEX (08) int HEX (21) + jc .L5 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; If AL is zero then we have an extended key press. + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; and al, al jnz .L10 @@ -124,6 +156,31 @@ _main: .L10: + push ax + + mov ax, cs:[_vec_history + 4] + mov cs:[_history_idx], ax + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Free the current command history if there is one. + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + mov ax, cs:[_curr_scratch] + + and ax, ax + jz .L83 + + push ax + + call _free + add sp, 2 + + xor ax, ax + mov cs:[_curr_scratch], ax + +.L83: + + pop ax + cmp al, HEX (09) jne .L14 @@ -1732,9 +1789,43 @@ _handler_cls: ;****************************************************************************** _handler_echo: - call _writestr - call _crlf + push ax + push dx + push si + + mov si, bx + +_handler_echo.check: + + cmp word ptr cs:[_cbreak], 1 + je _handler_echo.done + + lodsb + + and al, al + jz _handler_echo.newline + + mov ah, HEX (02) + mov dl, al + int HEX (21) + jmp _handler_echo.check + +_handler_echo.newline: + + mov ah, HEX (02) + mov dl, HEX (0D) + int HEX (21) + + mov ah, HEX (02) + mov dl, HEX (0A) + int HEX (21) + +_handler_echo.done: + + pop si + pop dx + pop ax ret ;****************************************************************************** @@ -1814,40 +1905,23 @@ _handler_reboot: ;****************************************************************************** ; @function _prompt ;****************************************************************************** -global _prompt _prompt: push ax push bx + push cx push dx - push si - push es push ds mov ax, cs mov ds, ax - mov es, ax .L17: - mov di, offset _scratch - xor al, al - - mov cl, cs:[_scratch_size] - xor ch, ch - - push cx - push di - rep stosb - - xor al, al - mov cs:[_scratch_len], al - - mov al, cs:[_curr_drive] - add al, 'A' + mov dl, cs:[_curr_drive] + add dl, 'A' mov ah, HEX (02) - mov dl, al int HEX (21) mov ah, HEX (02) @@ -1888,13 +1962,9 @@ _prompt: .L18: - pop di - pop cx - pop ds - pop es - pop si pop dx + pop cx pop bx pop ax ret diff --git a/src/apps/pcomm/type.asm b/src/apps/pcomm/type.asm index 95c126a..c6bf67d 100644 --- a/src/apps/pcomm/type.asm +++ b/src/apps/pcomm/type.asm @@ -475,18 +475,17 @@ _read_file.clear_and_read: _read_file.print_loop: + cmp word ptr cs:[_cbreak], 1 + je _read_file.close + lodsb cmp al, HEX (0A) jne _read_file.char_ok - push ax - mov ah, HEX (02) mov dl, HEX (0D) int HEX (21) - - pop ax _read_file.char_ok: diff --git a/src/kernel/int23.asm b/src/kernel/int23.asm index 5f1074e..35b3fd0 100644 --- a/src/kernel/int23.asm +++ b/src/kernel/int23.asm @@ -15,9 +15,9 @@ _check_handle_break: push bx push ax - xor bx, bx + mov bx, HEX (40) mov es, bx - mov bx, HEX (0471) + mov bx, HEX (71) mov al, es:[bx] @@ -71,14 +71,20 @@ _regain_control_int23: _int23_ign_carry: pop ax - pop bp - jnc _int23_respawn + xor ah, ah + pop bp + + jmp _int21_dispatch _int23_respawn: - jmp _int21_dispatch + mov bp, sp + or byte ptr [bp + 6], 1 ; set carry + + pop bp + iret ;****************************************************************************** ; @function _int23_handler @@ -119,8 +125,6 @@ _spawn_int23: mov word ptr [bp + 5], cs xchg word ptr [bp - 4], bp - clc - retf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- 2.34.1