annotate level1/cmds/inetd.a @ 2695:c321d41cd8d3 lwtools-port

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