[comp.sys.amiga.tech] Need something like exec

oliphant@telepro.UUCP (Mike Oliphant) (08/29/90)

Does anyone know of a way to get behavior identical to Manx's exec family of
routines in Lattice?  I need to chain one program to another, loading the
second program over top of the first.  Manx does this beautifully, but Lattice
doens't seem to be able to do it at all.  system() and the fork routines all
start up new processes, and that's no good for what I want to do.

Any help would be greatly appreciated.  This is the only problem holding me
back from switching to Lattice.

--
Mike Oliphant		    UUCP: alberta!herald!telepro!oliphant
			Internet: oliphant@telepro.uucp
			 FidoNet: (1:140/91) - ZMH only
*
* Call TelePro, the development system for DIALOG Professional
*
*   Phone: +1 306 249 2352	300/1200/2400/9600/14400 baud HST
* FidoNet: (1:140/90)
*

peterk@cbmger.UUCP (Peter Kittel GERMANY) (08/30/90)

In article <oliphant.3972@telepro.UUCP> oliphant@telepro.UUCP (Mike Oliphant) writes:
>Does anyone know of a way to get behavior identical to Manx's exec family of
>routines in Lattice?  I need to chain one program to another, loading the
>second program over top of the first.

Why not use the function Execute() of the Amiga exec library? You can
pass it a complete CLI command line. If you want to let your old program
leave the system then precede this command line with a "run" and then 
close down the first program. If you problems with input channels
then use "newcli ... from batchfile". If you are more expert with
Amiga topics then use LoadSeg().

>  Manx does this beautifully, but Lattice
>doens't seem to be able to do it at all.

I can't believe that Manx is able to load a new program on top of it,
into the same memory area, as I understand it from your posting.
Also I think it cannot use the same task structure, so it just MUST
open a new process. If Manx does all this, tell me, that would sound
interesting.


-- 
Best regards, Dr. Peter Kittel      //     E-Mail to 
Commodore Frankfurt, Germany      \X/      rutgers!cbmvax!cbmger!peterk

p554mve@mpirbn.mpifr-bonn.mpg.de (Michael van Elst) (09/01/90)

In article <350@cbmger.UUCP> peterk@cbmger.UUCP (Peter Kittel GERMANY) writes:
>In article <oliphant.3972@telepro.UUCP> oliphant@telepro.UUCP (Mike Oliphant) writes:
>I can't believe that Manx is able to load a new program on top of it,
>into the same memory area, as I understand it from your posting.
>Also I think it cannot use the same task structure, so it just MUST
>open a new process. If Manx does all this, tell me, that would sound
>interesting.

As far as I know, Manx uses several - say undocumented - techniques
to load a program and pass control to it. Now, how does the CLI start
a command ? The same is done by the Manx routines, LoadSeg()ing the
new module, creating certain system structures, patching others and
then roll up the old segment list to free the memory of the old module.
Who needs system conformance ? Let's force OS revisions to make Manx
executables work :-)

Regards,
-- 
Michael van Elst
UUCP:     universe!local-cluster!milky-way!sol!earth!uunet!unido!mpirbn!p554mve
Internet: p554mve@mpirbn.mpifr-bonn.mpg.de
                                "A potential Snark may lurk in every tree."

dillon@overload.Berkeley.CA.US (Matthew Dillon) (09/05/90)

    Neither Manx nor Lattice handles exec or fork/exec properly (nor DICE
    for that matter).  It is not their fault however.  The problems are due
    to deficiencies in 1.3 .  As far as I know, 2.0 solves all the problems
    with new capabilities and calls.

    Here are the problems:
	(1) ^C propogation
	(2) Starting a task asynchronously
	(3) Starting a task asynchronously plus getting an exit code on completion
	(4) Starting a task synchronously
	(5) Starting a task synchronously plus getting an exit code on completion

    Execute() handles (2) and (4) with some amount of overhead but there is
    no way to propogate ^C (that I know of) so that it is able to interrupt
    the Execute()d program in case (4).  The latest SetPatch for 1.3 allows
    Execute() to use a resident RUN instead of loading it from disk.  Without
    the patch Execute() takes a huge amount of overhead.

    Aztec's fork/exec handles (1) and (5) but only through major hacks (which
    I have never and will never trust).

    Lattice's fork/exec stuff handles (3) and (5) but only works with non-BCPL
    programs (not a problem under 2.0).  However, I've other problems with
    Lattice's calls and do not trust them either.

    WShell has a patch to get the exit code from an Execute()d program, I
    believe, but this is non-standard and you cannot count on it in any
    third-party developement you do, and you still have the ^C propogation
    problem.

    2.0 has solutions to all of these problems but you must be running 2.0
    to take advantage of them.

					    -Matt

In article <350@cbmger.UUCP> peterk@cbmger.UUCP (Peter Kittel GERMANY) writes:
>In article <oliphant.3972@telepro.UUCP> oliphant@telepro.UUCP (Mike Oliphant) writes:
>>Does anyone know of a way to get behavior identical to Manx's exec family of
>>routines in Lattice?	I need to chain one program to another, loading the
>>second program over top of the first.
>
>Why not use the function Execute() of the Amiga exec library? You can
>pass it a complete CLI command line. If you want to let your old program
>leave the system then precede this command line with a "run" and then
>close down the first program. If you problems with input channels
>then use "newcli ... from batchfile". If you are more expert with
>Amiga topics then use LoadSeg().
>
>>  Manx does this beautifully, but Lattice
>>doens't seem to be able to do it at all.
>
>I can't believe that Manx is able to load a new program on top of it,
>into the same memory area, as I understand it from your posting.
>Also I think it cannot use the same task structure, so it just MUST
>open a new process. If Manx does all this, tell me, that would sound
>interesting.
>--
>Best regards, Dr. Peter Kittel      //     E-Mail to
>Commodore Frankfurt, Germany	   \X/	    rutgers!cbmvax!cbmger!peterk

--


    Matthew Dillon	    dillon@Overload.Berkeley.CA.US
    891 Regal Rd.	    uunet.uu.net!overload!dillon
    Berkeley, Ca. 94708
    USA