changeset 2372:bfb8eefc19e1

Renamed S$Peer to S$HUP
author boisy
date Thu, 21 Jan 2010 00:16:19 +0000
parents 1317b044e8bf
children 5abd316e16d6
files 3rdparty/customboots/boisy/makefile defs/os9defs level1/cmds/shell_21.asm level1/cmds/shellplus.asm level1/modules/dw3.asm level1/modules/scdwn.asm level1/modules/scdwndesc.asm lib/os9defs.a
diffstat 8 files changed, 74 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/3rdparty/customboots/boisy/makefile	Wed Jan 20 21:33:26 2010 +0000
+++ b/3rdparty/customboots/boisy/makefile	Thu Jan 21 00:16:19 2010 +0000
@@ -1,3 +1,6 @@
+# NitrOS-9/6309 Level 2 bootfile for a 128K CoCo 3 with a Hitachi 6309
+# For Boisy's thesis work
+
 include $(NITROS9DIR)/rules.mak
 
 vpath %.asm ../../../utils/boisy:..:$(LEVEL2)/cmds:$(LEVEL1)/cmds:$(LEVEL1)/modules:$(NITROS9DIR)/3rdparty/packages/basic09
@@ -47,7 +50,6 @@
 		$(MD)/n10_scdwn.dd $(MD)/n11_scdwn.dd $(MD)/n12_scdwn.dd \
 		$(MD)/n13_scdwn.dd $(MD)/n14_scdwn.dd \
 		$(MD)/scdwp.dr $(MD)/p_scdwp.dd \
-		$(MD)/vrn.dr $(MD)/nil.dd \
 		$(MD)/pipeman.mn $(MD)/piper.dr $(MD)/pipe.dd \
 		$(MD)/clock_60hz $(MD)/clock2_dw3 \
 		$(MD)/sysgo_dd
--- a/defs/os9defs	Wed Jan 20 21:33:26 2010 +0000
+++ b/defs/os9defs	Thu Jan 21 00:16:19 2010 +0000
@@ -263,7 +263,7 @@
 S$Abort        RMB       1                   Keyboard Abort
 S$Intrpt       RMB       1                   Keyboard Interrupt
 S$Window       RMB       1                   Window Change
-S$Peer         EQU       S$Window            Peer disconnected (scdwt)
+S$HUP          EQU       S$Window            Hang Up
 S$Alarm        RMB       1                   CoCo individual process' alarm signal
 
                PAG       
--- a/level1/cmds/shell_21.asm	Wed Jan 20 21:33:26 2010 +0000
+++ b/level1/cmds/shell_21.asm	Thu Jan 21 00:16:19 2010 +0000
@@ -13,7 +13,7 @@
 * CHD no longer sets WRITE. permission.
 *
 *  22      2010/01/19  Boisy Pitre
-* Added code to honor S$Peer signal and exit when received to support
+* Added code to honor S$HUP signal and exit when received to support
 * networking. 
 
          nam   Shell
@@ -93,8 +93,8 @@
 DefPrmL  equ   *-DefPrmpt
 
 IcptRtn  stb   <kbdsignl
-* +++ BGP added for peer disconnect
-         cmpb  #S$Peer
+* +++ BGP added for Hang Up
+         cmpb  #S$HUP
          lbeq  exit
 * +++
          rti
--- a/level1/cmds/shellplus.asm	Wed Jan 20 21:33:26 2010 +0000
+++ b/level1/cmds/shellplus.asm	Thu Jan 21 00:16:19 2010 +0000
@@ -15,7 +15,7 @@
 * History and numerous features added.
 *
 *  23      2010/01/19  Boisy G. Pitre
-* Added code to honor S$Peer signal and exit when received to support
+* Added code to honor S$HUP signal and exit when received to support
 * networking.
 
          nam   Shell
@@ -204,8 +204,9 @@
          fcb   C$CR
 * Intercept routine
 L006B    stb   <u000E         Save signal code & return
-* +++ BGP added for peer disconnect
-         cmpb  #S$Peer
+* +++ BGP added for Hang Up
+* +++ Note we are exiting even if shell is immortal!
+         cmpb  #S$HUP
          lbeq  exit
 * +++
          rti
--- a/level1/modules/dw3.asm	Wed Jan 20 21:33:26 2010 +0000
+++ b/level1/modules/dw3.asm	Thu Jan 21 00:16:19 2010 +0000
@@ -330,7 +330,7 @@
           lda     a,x
           bne		IRQCont		; if A is 0, then this device is not active, so exit
           puls    d
-          bra     IRQExit
+          lbra    IRQExit
 IRQCont
           clrb
           tfr     d,u
@@ -350,7 +350,7 @@
 
 		 * in status events, databyte is split, 4bits status, 4bits port #          
 dostat	 	bitb	#$F0	;mask low bits
-			bne		IRQExit	;we only implement code 0000, term
+			lbne	IRQExit	;we only implement code 0000, term
 			* set u to port #
 			IFGT    Level-1
 			ldx   	<D.DWStat
@@ -359,14 +359,62 @@
 			ENDC
 			lda     b,x
 			bne		statcont		; if A is 0, then this device is not active, so exit
-			bra     IRQExit
+			lbra    IRQExit
+
+* This routine roots through process descriptors in a queue and
+* checks to see if the process has a path that is open to the device
+* represented by the static storage pointer in U. if so, the S$HUP
+* signal is sent to that process
+*
+* Entry: X = process descriptor to evaluate
+*        U = static storage of device we want to check against
+RootThrough
+                        ldb     #NumPaths
+                        leay    P$Path,x
+                        pshs    x
+loop                    decb
+                        bmi     out
+                        lda     ,y+
+                        beq     loop
+                        pshs    y
+                        IFGT    Level-1
+                        ldx     <D.PthDBT
+                        ELSE
+                        ldx     >D.PthDBT
+                        ENDC
+                        os9     F$Find64
+                        ldx     PD.DEV,y
+                        leax    V$STAT,x
+                        puls    y
+                        bcs     out
+                        
+                        cmpu    ,x
+                        bne     loop
+                        
+                        ldx     ,s
+                        lda     P$ID,x
+                        ldb     #S$HUP
+                        os9     F$Send
+
+out                     puls    x                        
+                        ldx     P$Queue,x
+                        bne     RootThrough
+                        rts
+
 statcont	clrb
           	tfr     d,u
-			lda		<V.LPRC,u
-			beq		IRQExit ; no last process, bail
-			ldb		#S$Peer
-*			ldb		#S$Kill
-			os9		F$Send	; send signal, don't think we can do anything about an error result anyway.. so
+* NEW: root through all process descriptors. if any has a path open to this
+* device, send then S$HUP
+                        ldx             <D.AProcQ
+                        beq             dowait
+                        bsr             RootThrough
+dowait                  ldx             <D.WProcQ
+                        beq             dosleep
+                        bsr             RootThrough
+dosleep                 ldx             <D.SProcQ
+                        beq             CkSuspnd
+                        bsr             RootThrough
+
 			bra		CkSuspnd  ; do we need to go check suspend?
 
 ; put byte B in port As buffer - optimization help from Darren Atkinson       
--- a/level1/modules/scdwn.asm	Wed Jan 20 21:33:26 2010 +0000
+++ b/level1/modules/scdwn.asm	Thu Jan 21 00:16:19 2010 +0000
@@ -295,7 +295,7 @@
           ldx   	>D.Proc		; process descriptor address
           ldb   	P$Signal,x 	; pending signal for this process?
           beq   	ChkState  	; no, go check process state...
-          cmpb  	#S$Peer  	; (S$Peer or lower)
+          cmpb  	#S$HUP  	; (S$HUP or lower)
           bls  	ErrExit    	; yes, go do it...
 
 ChkState 	equ   	*
--- a/level1/modules/scdwndesc.asm	Wed Jan 20 21:33:26 2010 +0000
+++ b/level1/modules/scdwndesc.asm	Thu Jan 21 00:16:19 2010 +0000
@@ -46,8 +46,13 @@
          fcb   $00        case:0=up&lower,1=upper only
          fcb   $01        backspace:0=bsp,1=bsp then sp & bsp
          fcb   $00        delete:0=bsp over line,1=return
+         IFEQ  Addr-0
+         fcb   $01        echo:0=no echo
+         fcb   $01        auto line feed:0=off
+         ELSE
          fcb   $00        echo:0=no echo
          fcb   $00        auto line feed:0=off
+         ENDC
          fcb   $00        end of line null count
          fcb   $00        pause:0=no end of page pause
          fcb   24         lines per page (not a safe assumption anymore!)
--- a/lib/os9defs.a	Wed Jan 20 21:33:26 2010 +0000
+++ b/lib/os9defs.a	Thu Jan 21 00:16:19 2010 +0000
@@ -262,7 +262,7 @@
 S$Abort:       RMB       1                   Keyboard Abort
 S$Intrpt:      RMB       1                   Keyboard Interrupt
 S$Window:      RMB       1                   Window Change
-S$Peer:        EQU       S$Window            Peer disconnected (scdwt)
+S$HUP:         EQU       S$Window            Hang up
 S$Alarm:       RMB       1                   CoCo individual process' alarm signal
                endsect