Subversion Repositories SvarDOS

Rev

Rev 975 | Rev 987 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 975 Rev 983
Line 145... Line 145...
145
    pop ds
145
    pop ds
146
    pop dx
146
    pop dx
147
    pop ax
147
    pop ax
148
  }
148
  }
149
 
149
 
-
 
150
  /* mark the input buffer as empty */
-
 
151
  myptr = MK_FP(rmodseg, RMOD_OFFSET_INPUTBUF);
-
 
152
  myptr[0] = 128;
-
 
153
  myptr[1] = 0;
-
 
154
  myptr[2] = '\r';
-
 
155
 
150
  /* prepare result (rmod props) */
156
  /* prepare result (rmod props) */
151
  res = MK_FP(rmodseg, 0x100 + rmodcore_len);
157
  res = MK_FP(rmodseg, 0x100 + rmodcore_len);
152
  _fmemset(res, 0, sizeof(*res));  /* zero out */
158
  _fmemset(res, 0, sizeof(*res));  /* zero out */
153
  res->rmodseg = rmodseg;          /* rmod segment */
159
  res->rmodseg = rmodseg;          /* rmod segment */
154
  res->inputbuf[0] = 128;          /* input buffer for INT 0x21, AH=0Ah*/
-
 
155
  res->origenvseg = origenvseg;    /* original environment segment */
160
  res->origenvseg = origenvseg;    /* original environment segment */
156
 
161
 
157
  /* write env segment to rmod's PSP */
162
  /* write env segment to rmod's PSP */
158
  owner = MK_FP(rmodseg, RMOD_OFFSET_ENVSEG);
163
  owner = MK_FP(rmodseg, RMOD_OFFSET_ENVSEG);
159
  *owner = envseg;
164
  *owner = envseg;
Line 194... Line 199...
194
}
199
}
195
 
200
 
196
 
201
 
197
/* look up my parent: if it's rmod then return a ptr to its props struct,
202
/* look up my parent: if it's rmod then return a ptr to its props struct,
198
 * otherwise return NULL
203
 * otherwise return NULL
199
 * since RMOD sets itself as the CTRL+BREAK handler, I look at the int23
-
 
200
 * field of the PSP to locate it. Previously I was looking at PSP[Ch] (ie.
204
 * I look at PSP[Ch] to locate RMOD (ie. the "terminate address") */
201
 * "terminate address" but this was failing when using the LINK/LN TSR that
-
 
202
 * intercepts DOS EXEC calls and sets itself as the parent of all launched
-
 
203
 * applications */
-
 
204
struct rmod_props far *rmod_find(unsigned short rmodcore_len) {
205
struct rmod_props far *rmod_find(unsigned short rmodcore_len) {
205
  unsigned short *parent = (void *)0x10; /* look in PSP[10h] ("prev. int23 handler") */
206
  unsigned short *parent = (void *)0x0C;
206
  unsigned short far *ptr;
207
  unsigned short far *ptr;
207
  const unsigned short sig[] = {0x1983, 0x1985, 0x2017, 0x2019};
208
  const unsigned short sig[] = {0x1983, 0x1985, 0x2017, 0x2019};
208
  unsigned char *cmdtail = (void *)0x80;
209
  unsigned char *cmdtail = (void *)0x80;
209
  unsigned char i;
210
  unsigned char i;
210
  /* is it rmod? */
211
  /* is it rmod? */