annotate level1/cmds/inetd.as @ 2909:b71f67993fe0

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