2000-05-06 21:34:20 +02:00
|
|
|
/****************************************************************/
|
|
|
|
/* */
|
|
|
|
/* process.h */
|
|
|
|
/* */
|
|
|
|
/* DOS exec data structures & declarations */
|
|
|
|
/* */
|
|
|
|
/* November 23, 1991 */
|
|
|
|
/* */
|
|
|
|
/* Copyright (c) 1995 */
|
|
|
|
/* Pasquale J. Villani */
|
|
|
|
/* All Rights Reserved */
|
|
|
|
/* */
|
|
|
|
/* This file is part of DOS-C. */
|
|
|
|
/* */
|
|
|
|
/* DOS-C is free software; you can redistribute it and/or */
|
|
|
|
/* modify it under the terms of the GNU General Public License */
|
|
|
|
/* as published by the Free Software Foundation; either version */
|
|
|
|
/* 2, or (at your option) any later version. */
|
|
|
|
/* */
|
|
|
|
/* DOS-C is distributed in the hope that it will be useful, but */
|
|
|
|
/* WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
|
|
|
|
/* the GNU General Public License for more details. */
|
|
|
|
/* */
|
|
|
|
/* You should have received a copy of the GNU General Public */
|
|
|
|
/* License along with DOS-C; see the file COPYING. If not, */
|
|
|
|
/* write to the Free Software Foundation, 675 Mass Ave, */
|
|
|
|
/* Cambridge, MA 02139, USA. */
|
|
|
|
/****************************************************************/
|
|
|
|
|
|
|
|
#ifdef MAIN
|
|
|
|
#ifdef VERSION_STRINGS
|
2001-11-18 15:01:12 +01:00
|
|
|
static BYTE *process_hRcsId =
|
|
|
|
"$Id$";
|
2000-05-06 21:34:20 +02:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Modes available as first argument to the spawnxx functions. */
|
|
|
|
|
|
|
|
#define P_WAIT 0 /* child runs separately, parent waits until exit */
|
|
|
|
#define P_NOWAIT 1 /* both concurrent -- not implemented */
|
|
|
|
#define P_OVERLAY 2 /* child replaces parent, parent no longer exists */
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
typedef struct {
|
|
|
|
union {
|
|
|
|
struct {
|
2000-05-06 21:34:20 +02:00
|
|
|
UWORD load_seg;
|
|
|
|
UWORD reloc;
|
2001-11-18 15:01:12 +01:00
|
|
|
} _load;
|
|
|
|
struct {
|
2000-05-06 21:34:20 +02:00
|
|
|
UWORD env_seg;
|
|
|
|
CommandTail FAR *cmd_line;
|
2000-08-06 06:18:21 +02:00
|
|
|
fcb FAR *fcb_1;
|
|
|
|
fcb FAR *fcb_2;
|
2000-05-06 21:34:20 +02:00
|
|
|
BYTE FAR *stack;
|
|
|
|
BYTE FAR *start_addr;
|
2001-11-18 15:01:12 +01:00
|
|
|
} _exec;
|
|
|
|
} ldata;
|
|
|
|
} exec_blk;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
#define exec ldata._exec
|
|
|
|
#define load ldata._load
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
typedef struct {
|
2001-11-04 20:47:39 +01:00
|
|
|
UWORD ps_exit; /* 00 CP/M-like exit poimt */
|
|
|
|
UWORD ps_size; /* 02 memory size in paragraphs */
|
|
|
|
BYTE ps_fill1; /* 04 single char fill */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* CP/M-like entry point */
|
2001-11-04 20:47:39 +01:00
|
|
|
UBYTE ps_farcall; /* 05 far call opcode */
|
2002-08-03 06:08:58 +02:00
|
|
|
VOID(FAR ASMCFUNC * ps_reentry) (void); /* 06 re-entry point */
|
2002-01-23 23:29:41 +01:00
|
|
|
intvec ps_isv22, /* 0a terminate address */
|
|
|
|
ps_isv23, /* 0e break address */
|
|
|
|
ps_isv24; /* 12 critical error address */
|
2001-11-04 20:47:39 +01:00
|
|
|
UWORD ps_parent; /* 16 parent psp segment */
|
|
|
|
UBYTE ps_files[20]; /* 18 file table - 0xff is unused */
|
|
|
|
UWORD ps_environ; /* 2c environment paragraph */
|
|
|
|
BYTE FAR *ps_stack; /* 2e user stack pointer - int 21 */
|
2002-08-03 06:08:58 +02:00
|
|
|
UWORD ps_maxfiles; /* 32 maximum open files */
|
2001-11-04 20:47:39 +01:00
|
|
|
UBYTE FAR *ps_filetab; /* 34 open file table pointer */
|
|
|
|
VOID FAR *ps_prevpsp; /* 38 previous psp pointer */
|
2002-10-22 04:40:19 +02:00
|
|
|
BYTE ps_fill2[20]; /* 3c */
|
2002-05-09 00:49:35 +02:00
|
|
|
UBYTE ps_unix[3]; /* 50 unix style call - 0xcd 0x21 0xcb */
|
|
|
|
BYTE ps_fill3[9]; /* 53 */
|
2001-11-18 15:01:12 +01:00
|
|
|
union {
|
|
|
|
struct {
|
2002-05-09 00:49:35 +02:00
|
|
|
fcb _ps_fcb1; /* 5c first command line argument */
|
2001-11-18 15:01:12 +01:00
|
|
|
} _u1;
|
|
|
|
struct {
|
|
|
|
BYTE fill4[16];
|
|
|
|
fcb _ps_fcb2; /* second command line argument */
|
|
|
|
} _u2;
|
|
|
|
struct {
|
2000-05-06 21:34:20 +02:00
|
|
|
BYTE fill5[36];
|
2002-10-22 04:40:19 +02:00
|
|
|
CommandTail _ps_cmd;
|
2001-11-18 15:01:12 +01:00
|
|
|
} _u3;
|
|
|
|
} _u;
|
|
|
|
} psp;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
#define ps_fcb1 _u._u1._ps_fcb1
|
|
|
|
#define ps_fcb2 _u._u2._ps_fcb2
|
2002-10-22 04:40:19 +02:00
|
|
|
#define ps_cmd _u._u3._ps_cmd
|
2001-11-18 00:26:45 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Log: process.h,v
|
|
|
|
*
|
|
|
|
* Revision 1.1.1.1 1999/03/29 15:39:34 jprice
|
|
|
|
* New version without IPL.SYS
|
|
|
|
*
|
|
|
|
* Revision 1.3 1999/02/01 01:40:06 jprice
|
|
|
|
* Clean up
|
|
|
|
*
|
|
|
|
* Revision 1.2 1999/01/22 04:17:40 jprice
|
|
|
|
* Formating
|
|
|
|
*
|
|
|
|
* Revision 1.1.1.1 1999/01/20 05:51:01 jprice
|
|
|
|
* Imported sources
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Rev 1.7 22 Jan 1998 22:13:00 patv
|
|
|
|
* Had to change ps_prevps to VOID FAR * due to BC++ error.
|
|
|
|
*
|
|
|
|
* Rev 1.6 22 Jan 1998 22:05:22 patv
|
|
|
|
* Corrected ps_prevpsp declaration.
|
|
|
|
*
|
|
|
|
* Rev 1.5 04 Jan 1998 23:14:16 patv
|
|
|
|
* Changed Log for strip utility
|
|
|
|
*
|
|
|
|
* Rev 1.4 29 May 1996 21:25:16 patv
|
|
|
|
* bug fixes for v0.91a
|
|
|
|
*
|
|
|
|
* Rev 1.3 19 Feb 1996 3:15:32 patv
|
|
|
|
* Added NLS, int2f and config.sys processing
|
|
|
|
*
|
|
|
|
* Rev 1.2 01 Sep 1995 17:35:44 patv
|
|
|
|
* First GPL release.
|
|
|
|
*
|
|
|
|
* Rev 1.1 30 Jul 1995 20:43:50 patv
|
|
|
|
* Eliminated version strings in ipl
|
|
|
|
*
|
|
|
|
* Rev 1.0 02 Jul 1995 10:39:52 patv
|
|
|
|
* Initial revision.
|
|
|
|
*/
|