annotate level1/cmds/inetd.as @ 2783:03f26e88b809 lwtools-port

Renamed files and setup for lwasm/lwlink work
author Boisy Pitre <boisy.pitre@nuance.com>
date Sat, 26 Jan 2013 17:18:24 -0600
parents level1/cmds/inetd.a@aaba193af04f
children 28b6ec8a14d5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
1 ********************************************************************
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
2 * inetd - internet daemon
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
3 *
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
4 * $Id$
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
5 *
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
7 * Comment
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
9 * 1 2010/01/08 Boisy G. Pitre
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
10 * Started.
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
11 *
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
12 * 2 2010/01/22 Boisy G. Pitre
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
13 * Now reads inetd.conf file.
2578
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
14 *
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
15 * 3 2011/08/07 Boisy G. Pitre
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
16 * Fixed bug where conf file wasn't being processed correctly.
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
17
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
18 nam inetd
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
19 ttl internet daemon
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
20
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
21 tylg set $01 Prgrm+Objct
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
22 atrv set $80+rev ReEnt+rev
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
23 rev set $00
2578
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
24 edition set 3
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
25
2782
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2722
diff changeset
26 section data
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
27 targetport rmb 2
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
28 netdatardy rmb 1
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
29 nbufferl equ 128
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
30 nbuffer rmb nbufferl
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
31 lbufferl equ 128
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
32 lbuffer rmb lbufferl
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
33 nnext rmb 2
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
34 token rmb 2
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
35 orgstdin rmb 1
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
36 orgstdout rmb 1
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
37 orgstderr rmb 1
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
38 childnetpath rmb 1
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
39 netpath rmb 1
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
40 targetprog rmb 128
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
41 targetparams rmb 128
2579
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
42 tmodeparamlen rmb 1
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
43 tmodeparams rmb 128
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
44 endsect
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
45
2782
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2722
diff changeset
46 * psect inetd_a,$01,$80,1,200,start
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2722
diff changeset
47 section text
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2722
diff changeset
48
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2722
diff changeset
49 DEBUG equ 1
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2722
diff changeset
50
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2722
diff changeset
51
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
52 NetSig equ 2
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
53
2579
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
54 tmode fcs /tmode/
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
55
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
56 * signal intercept routine
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
57 sigint cmpb #NetSig
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
58 bne sigex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
59 inc netdatardy,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
60 sigex rti
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
61
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
62 **** Entry Point ****
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
63 start:
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
64 * setup signal intercept
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
65 leax sigint,pcr
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
66 os9 F$Icpt
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
67
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
68 clr netdatardy,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
69
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
70 leax nbuffer,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
71 stx nnext,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
72
2702
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2579
diff changeset
73 * Turn off pause in standard out
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2579
diff changeset
74 ldd #$01*256+SS.Opt
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2579
diff changeset
75 leas -32,s
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2579
diff changeset
76 tfr s,x
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2579
diff changeset
77 os9 I$GetStt
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2579
diff changeset
78 bcs opterr
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2579
diff changeset
79 clr PD.PAU-PD.OPT,x
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2579
diff changeset
80 os9 I$SetStt
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2579
diff changeset
81 opterr
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2579
diff changeset
82 leas 32,s
2bd966ffd6d5 Fixed longstanding issue with processes not going away when a network path closed. Also inetd now turns of pause
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2579
diff changeset
83
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
84 * open the path to the control channel
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
85 lbsr TCPOpen
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
86 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
87 sta netpath,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
88 leax SetupPorts,pcr
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
89 lbsr ProcInetd
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
90 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
91
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
92 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
93 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
94 fcc /Got netpath and setup ports/
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
95 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
96 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
97 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
98
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
99 ssignetpath
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
100 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
101 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
102 fcc /SS.SSig on NetPath/
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
103 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
104 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
105 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
106
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
107 lda netpath,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
108 ldb #SS.SSig send signal on data ready
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
109 ldx #NetSig
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
110 os9 I$SetStt
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
111 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
112
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
113 **** MAIN LOOP ****
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
114 mainloop
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
115 pshs cc
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
116 orcc #IntMasks
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
117 tst netdatardy,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
118 bne gotdata
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
119
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
120 * wait for a child to die (or wake up via signal)
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
121 os9 F$Wait
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
122 bcc chkrdy
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
123 cmpb #E$NoChld
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
124 bne chkrdy got error other than "no children"
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
125 * if no children, go to sleep
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
126 ldx #$0000
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
127 os9 F$Sleep
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
128
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
129 chkrdy puls cc
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
130 bra ssignetpath
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
131
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
132 gotdata puls cc
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
133 dec netdatardy,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
134 * read the data from netpath
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
135 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
136 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
137 fcc /Reading data from netpath/
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
138 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
139 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
140 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
141
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
142 lda netpath,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
143 ldb #SS.Ready
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
144 os9 I$GetStt
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
145 bcs ssignetpath
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
146
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
147 clra
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
148 tfr d,y
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
149 lda netpath,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
150 ldx nnext,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
151 os9 I$Read
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
152 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
153 tfr y,d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
154 leax d,x
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
155 stx nnext,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
156 lda -1,x
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
157 cmpa #C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
158 lbne ssignetpath
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
159
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
160 leax nbuffer,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
161 stx nnext,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
162
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
163 lda #1
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
164 ldy #256
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
165 os9 I$WritLn
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
166
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
167 * determine response
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
168 lda ,x
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
169 cmpa #'9
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
170 ble incoming
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
171
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
172 cmpa #'F
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
173 lbra ssignetpath
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
174
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
175 * get token number
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
176 incoming
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
177 lbsr DEC_BIN
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
178 std token,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
179 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
180 pshs d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
181 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
182 fcc /Got token /
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
183 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
184 puls d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
185 lbsr PRINT_DEC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
186 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
187 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
188 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
189 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
190
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
191 * skip over token number
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
192 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
193 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
194 fcc /To Space.../
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
195 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
196 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
197 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
198 lbsr TO_SP
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
199 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
200 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
201 fcc /To Non-Space.../
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
202 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
203 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
204 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
205 lbsr TO_NON_SP
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
206
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
207 * get port number
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
208 lbsr DEC_BIN
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
209 std targetport,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
210
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
211 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
212 pshs d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
213 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
214 fcc /Got request for port /
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
215 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
216 ldd ,s
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
217 lbsr PRINT_DEC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
218 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
219 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
220 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
221 puls d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
222 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
223
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
224 leax ForkProcForPort,pcr
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
225 lbsr ProcInetd
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
226 lbra ssignetpath we may want to tell server we have no app
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
227
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
228 errex os9 F$Exit
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
229
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
230
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
231 * Process inetd.conf file
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
232 *
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
233 * Entry: X = processor routine
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
234 *
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
235 * - open conf file
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
236 * - read each line and get first parameter (port number)
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
237 * - send it to the processor routine at x
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
238 * - if error or end of file, close and return
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
239 ProcInetd pshs x
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
240 leax inetdconf,pcr
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
241 lda #READ.
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
242 os9 I$Open
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
243 bcs adex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
244 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
245 pshs d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
246 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
247 fcc /Opened inetd.conf ok/
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
248 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
249 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
250 puls d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
251 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
252 nextline leax lbuffer,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
253 ldy #lbufferl-1
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
254 lbsr FGETS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
255 bcs closeup
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
256 lbsr TO_NON_SP skip any leading spaces
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
257 ldb ,x check for EOL or comment
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
258 cmpb #C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
259 beq nextline
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
260 cmpb #'#
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
261 beq nextline
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
262 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
263 pshs d,x
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
264 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
265 fcc /Reading line: /
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
266 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
267 ldx 2,s
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
268 lbsr PUTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
269 puls d,x
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
270 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
271 pshs a
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
272 jsr [1,s]
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
273 puls a
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
274 bcc nextline
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
275 closeup cmpb #E$EOF
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
276 bne closeandex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
277 clrb
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
278 closeandex pshs b,cc
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
279 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
280 puls b,cc
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
281 adex puls x,pc
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
282
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
283
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
284 * Setup ports
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
285 * Extract first parameter at X and send to server
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
286 SetupPorts lbsr DEC_BIN
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
287 cmpd #0
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
288 beq ret0
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
289 * find comma and change it to nul
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
290 tfr x,y
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
291 setuploop lda ,y+
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
292 cmpa #C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
293 beq ret0
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
294 cmpa #',
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
295 bne setuploop
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
296 setuplisten
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
297 clr -1,y
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
298 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
299 pshs d,x
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
300 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
301 fcc /Send listen/
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
302 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
303 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
304 puls d,x
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
305 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
306 lda netpath,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
307 lbsr TCPListen
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
308 ret0 rts
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
309
2578
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
310 retcc clrb
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
311 rts
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
312
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
313 * Fork Proccess that matches target port
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
314 * Extract first parameter at X and see if it matches target port
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
315 * if so, read rest of line and fork the process
2579
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
316 * Line looks like this: portnumberplusoptions,prog,params,path opts
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
317 ForkProcForPort
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
318 * get port number
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
319 lbsr DEC_BIN
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
320 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
321 pshs d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
322 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
323 fcc /Reading port /
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
324 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
325 ldd ,s
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
326 lbsr PRINT_DEC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
327 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
328 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
329 fcb $00
2578
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
330 lbsr PRINTS
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
331 fcc /Comparing to port /
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
332 fcb $00
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
333 ldd targetport,u
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
334 lbsr PRINT_DEC
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
335 lbsr PRINTS
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
336 fcb C$CR
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
337 fcb $00
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
338 puls d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
339 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
340 cmpd targetport,u
2578
48e3cadb6222 Fixed issue in inetd.a
boisy
parents: 2475
diff changeset
341 lbne retcc
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
342 * point Y to byte after comma
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
343 portloop lda ,y+
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
344 cmpa #C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
345 beq ret0
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
346 cmpa #',
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
347 bne portloop
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
348 tfr y,x
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
349 * copy bytes up to comma at X
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
350 leay targetprog,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
351 prgloop lda ,x+
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
352 cmpa #',
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
353 beq sethi
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
354 cmpa #C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
355 lbeq ret
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
356 sta ,y+
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
357 bra prgloop
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
358 sethi lda -1,y
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
359 ora #$80
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
360 sta -1,y
2579
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
361 copypar clr tmodeparamlen,u
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
362 leay targetparams,u
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
363 parloop lda ,x+
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
364 sta ,y+
2579
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
365 cmpa #',
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
366 beq procopts
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
367 cmpa #C$CR
2579
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
368 beq gotprocparms
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
369
2579
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
370 procopts
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
371 leay tmodeparams,u
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
372 procoptsloop lda ,x+
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
373 sta ,y+
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
374 inc targetparams,u
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
375 cmpa #C$CR
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
376 beq procoptsloop
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
377
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
378 gotprocparms
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
379 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
380 pshs d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
381 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
382 fcc /Got proc and params to fork/
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
383 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
384 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
385 puls d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
386 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
387
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
388 * ignore client port number and hostname for now
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
389 lbsr TCPOpen
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
390 bcc savechild
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
391
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
392 ldd token,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
393 leas -8,s
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
394 leax ,s
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
395 lbsr BIN_DEC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
396 lda netpath,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
397 tfr x,y
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
398 lbsr TCPKill
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
399 leas 8,s
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
400 lbra forkex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
401
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
402 savechild
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
403 sta childnetpath,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
404 ldd token,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
405 leas -8,s
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
406 leax ,s
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
407 lbsr BIN_DEC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
408 lda childnetpath,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
409 tfr x,y
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
410 lbsr TCPJoin
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
411 leas 8,s
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
412 bcc turnonechoalf
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
413 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
414 lbra forkex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
415
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
416 turnonechoalf
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
417 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
418 pshs d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
419 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
420 fcc /Turning on PD.EKO and PD.ALF/
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
421 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
422 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
423 puls d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
424 ENDC
2721
06d492093592 Fixed echo problem with TCPOpen now always turning echo off
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2702
diff changeset
425 lbsr SetEchoOn
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
426 lbcs ret
2722
82b12ff069d7 Also turning off autolf on TCPOpen
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2721
diff changeset
427 lbsr SetAutoLFOn
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
428 lbcs ret
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
429
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
430 * dup paths
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
431 duper
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
432 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
433 pshs d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
434 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
435 fcc /Duping paths/
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
436 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
437 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
438 puls d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
439 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
440
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
441 clra
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
442 os9 I$Dup
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
443 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
444 sta orgstdin,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
445 lda #1
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
446 os9 I$Dup
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
447 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
448 sta orgstdout,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
449 lda #2
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
450 os9 I$Dup
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
451 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
452 sta orgstderr,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
453
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
454 * close original stdin/out/err paths
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
455 clra
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
456 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
457 inca
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
458 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
459 inca
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
460 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
461
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
462 * Dup child net path to stdin/stdout/stderr
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
463 lda childnetpath,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
464 os9 I$Dup
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
465 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
466 os9 I$Dup
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
467 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
468 os9 I$Dup
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
469 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
470
2579
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
471 * fork tmode process if tmode param length > 0
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
472 tst tmodeparamlen,u
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
473 beq forkchild
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
474 pshs u
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
475 leax tmode,pcr
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
476 leau tmodeparams,u
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
477 lda #Objct
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
478 clrb
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
479 ldy #256
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
480 os9 F$Fork
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
481 puls u
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
482 os9 F$Wait
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
483
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
484 * fork child process
2579
2b4283c91c98 Added support for tmode (forking)
boisy
parents: 2578
diff changeset
485 forkchild
2475
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
486 pshs u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
487 leax targetprog,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
488 leau targetparams,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
489 lda #Objct
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
490 clrb
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
491 ldy #256
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
492 os9 F$Fork
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
493 puls u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
494 * If our F$Fork fails, do not error out...
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
495 * bcs ret2
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
496
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
497 * restore orginal paths
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
498 clra
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
499 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
500 inca
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
501 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
502 inca
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
503 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
504
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
505 lda orgstdin,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
506 os9 I$Dup
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
507 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
508 lda orgstdout,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
509 os9 I$Dup
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
510 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
511 lda orgstderr,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
512 os9 I$Dup
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
513 lbcs errex
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
514 lda orgstdin,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
515 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
516 lda orgstdout,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
517 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
518 lda orgstderr,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
519 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
520 lda childnetpath,u
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
521 os9 I$Close
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
522
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
523 IFNE DEBUG
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
524 pshs d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
525 lbsr PRINTS
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
526 fcc /Proc forked/
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
527 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
528 fcb $00
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
529 puls d
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
530 ENDC
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
531
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
532 forkex comb
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
533 ldb #E$EOF
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
534 ret rts
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
535
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
536 inetdconf fcc "....../SYS/inetd.conf"
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
537 fcb C$CR
c249cc490a83 Moved dw commands into main tree
boisy
parents:
diff changeset
538 endsect