No fork() in MSC5.0, help...

Robert C. White Jr. rwhite at nusdhub.UUCP
Sat Jul 23 05:11:49 AEST 1988


in article <3083 at emory.uucp>, platt at emory.uucp (Dan Platt) says:
> In article <9900005 at bradley> brian at bradley.UUCP writes:
>>  Of course, I could do a system() with my whole command line, but this
>>is not a solution because 1) there is no way to pass the environment
>>in this case, 2) I would have to somehow translate my shell's syntax
>>back to MS-DOS COMMAND.COM syntax, which may not be possible, and
>>3) the system() function probaly will load in another copy of COMMAND.COM,
>>and my shell will be cutting into avaible memory at it is.

> The only way I can see you doing it is using spawnv*() with a
> temporary file used to pass the information.  You may need to 
> tolerate loaded versions of COMMAND.COM.  If you are only loading
> one process at a time on top of your shell, this shouldn't be to
> much of a problem unless your shell is large. 

I think you are missing one small point here.  "COMMAND.COM" is the 
MS-DOS shell.  If you write something to replace it, you must
*include* a loader of you own in the text of your shell.  If you
look up the dos function call which loads programs, you will find
that it invokes the shell (e.g. command.com) to do the loading.
If you write your own true shell, it must contain a assembly
or such which will act as the loader from then on.  Once you
have doen this, you may simply decide that the loade will remain
in low memory all the time, and never worry about loading the
loader again.

All this is you own choice.  If you only wish to write a simple
command editor/environment that is your own get out, but it is
not a "MS-DOS shell"

Put simply: If you write a _true_ shell, you will have the procedures
to do whatever you want durring loading locally available to your shell.
At that point spawn() and exec() from the Microsoft C compiler become
irrevelant.

Rob.



More information about the Comp.lang.c mailing list