[comp.sys.amiga.tech] AmigaDos Process structure questions

a275@mindlink.UUCP (Travers Naran) (06/04/90)

I was trying to write a replacement for the system() command so I can write
front ends that don't require using 'run'. Anyways, the program works except
for one thing: The Exit() command. Now, I noticed that in the Process structure
there is a pr_ReturnAddr varialbe. So I looked it up  in the AmigaDos Technical
Ref. Manual (1.2) and found this:
"The Exit function uses the value of ReturnAddr which points to just above the
return address on the currently active stack. If a program exits by performing
an RTS on an empty stack, then control passes to the code address pushed on the
stack by CreateProc or by the CLI. If a program terminates with a call to Exit,
then AmigaDOS uses this pointer to extract the same return address."

        Well, my question is this: What the hell does that mean!? I assumed it
meant that pr_ReturnAddr is pointing to the same location the stack pointer
would point to when the code is entered. But I keep guru'ing (CPU Trap #4 -
Illegal instruction so I guess that means it is going to the wrong address). So
to put the question mildly:
        What value should pr_ReturnAddr be set to if I want all Exits to return
back to my calling program?
--
-------------------------------------------------------------------
Travers "T'aran" Naran (I am male)
Simon Fraser University, Computing Science
Whovian, Prober, Treker, Quantum Leaper....
Mailing addresses:
   Usenet  Travers_Naran@mindlink.UUCP
or      uunet!van-bc!rsoft!mindlink!Travers_Naran
------------------------------------------------------------------

jesup@cbmvax.commodore.com (Randell Jesup) (06/06/90)

In article <2006@mindlink.UUCP> a275@mindlink.UUCP (Travers Naran) writes:
>I was trying to write a replacement for the system() command so I can write
>front ends that don't require using 'run'. Anyways, the program works except
>for one thing: The Exit() command.

	I advise not doing this if you don't have to.  The main reason is that
you're HIGHLY likely to break in 2.0.  Even Bill Hawes has had a few problems
with this, and he knows dos really well.  If you must do this, use the
arp.library, which will work much better, and when the 2.0 update comes out
arp will probably call the new System() call directly.

>        What value should pr_ReturnAddr be set to if I want all Exits to return
>back to my calling program?

	It's not real simple, and anything I tell you is likely to trip you
up in the future.  Manx fexec makes it even more complicated.  The real
solution is in 2.0 (System()).

-- 
Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com  BIX: rjesup  
Common phrase heard at Amiga Devcon '89: "It's in there!"

a275@mindlink.UUCP (Travers Naran) (06/07/90)

> jesup@cbmvax.commodore.com writes:
> 
>         I advise not doing this if you don't have to.  The main reason is
> that
> you're HIGHLY likely to break in 2.0.  Even Bill Hawes has had a few problems
> with this, and he knows dos really well.  If you must do this, use the
> arp.library, which will work much better, and when the 2.0 update comes out
> arp will probably call the new System() call directly.
> 
> >        What value should pr_ReturnAddr be set to if I want all Exits to
> return
> >back to my calling program?
> 
>         It's not real simple, and anything I tell you is likely to trip you
> up in the future.  Manx fexec makes it even more complicated.  The real
> solution is in 2.0 (System()).
> 
> --
> Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
> {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com  BIX: rjesup
> Common phrase heard at Amiga Devcon '89: "It's in there!"

Well, Jesup, one thing: When the heck am I going to get 2.0 for my Amiga 500!
Until then, I will abstain from ARP because I have a personal bias against it.
Until ARP is distributed WITH Workbench's I will not use Arp.library. :-)
Anyways, when will 2.0 come out for my poor 500? And if I don't have the new
ECS will the screen be in constant interlace? :-)
--
-------------------------------------------------------------------
Travers "T'aran" Naran (I am male)
Simon Fraser University, Computing Science
Whovian, Prober, Treker, Quantum Leaper....
Mailing addresses:
   Usenet  Travers_Naran@mindlink.UUCP
or      uunet!van-bc!rsoft!mindlink!Travers_Naran
------------------------------------------------------------------

peter@sugar.hackercorp.com (Peter da Silva) (06/08/90)

In article <2027@mindlink.UUCP> a275@mindlink.UUCP (Travers Naran) writes:
> And if I don't have the new
> ECS will the screen be in constant interlace? :-)

Not unless you make it so. 2.0 works fine with a non-interlace workbench.
-- 
 _--_|\  Peter da Silva <peter@sugar.hackercorp.com>.
/      \
\_.--._/ My other car is a hot-air balloon.
      v  "Have you hugged your wolf today?" `-_-'

a275@mindlink.UUCP (Travers Naran) (06/08/90)

> dillon@overload.UUCP writes:
> 
>     2.0, when it comes out, provides several new calls relating to running
>     another program, including calls able to run a seglist in the current
>     context.  I suggest the best thing to do is wait for 2.0 to come out,
>     it will save you a lot of grief!
> 
>                                             -Matt

        Yes, but when can I get 2.0 for my Amiga 500? :-)
--
-------------------------------------------------------------------
Travers "T'aran" Naran (I am male)
Simon Fraser University, Computing Science
Whovian, Prober, Treker, Quantum Leaper....
Mailing addresses:
   Usenet  Travers_Naran@mindlink.UUCP
or      uunet!van-bc!rsoft!mindlink!Travers_Naran
------------------------------------------------------------------

dillon@overload.UUCP (Matthew Dillon) (06/08/90)

>In article <2006@mindlink.UUCP> a275@mindlink.UUCP (Travers Naran) writes:
>I was trying to write a replacement for the system() command so I can write
>front ends that don't require using 'run'. Anyways, the program works except
>for one thing: The Exit() command. Now, I noticed that in the Process structure

    2.0, when it comes out, provides several new calls relating to running
    another program, including calls able to run a seglist in the current
    context.  I suggest the best thing to do is wait for 2.0 to come out,
    it will save you a lot of grief!

					    -Matt

--


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

jesup@cbmvax.commodore.com (Randell Jesup) (06/09/90)

In article <2027@mindlink.UUCP> a275@mindlink.UUCP (Travers Naran) writes:
>Well, Jesup, one thing: When the heck am I going to get 2.0 for my Amiga 500!
>Until then, I will abstain from ARP because I have a personal bias against it.
>Until ARP is distributed WITH Workbench's I will not use Arp.library. :-)

	I don't know the exact answer (we haven't even shipped the A3000
yet).  The answer will partially when we think it's ready for ROM, and
partly when marketing wants to ship it.

>Anyways, when will 2.0 come out for my poor 500? And if I don't have the new
>ECS will the screen be in constant interlace? :-)

	Not unless you like interlace.  :-)

-- 
Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com  BIX: rjesup  
Common phrase heard at Amiga Devcon '89: "It's in there!"

peter@sugar.hackercorp.com (Peter da Silva) (06/09/90)

In article <dillon.4248@overload.UUCP> dillon@overload.UUCP (Matthew Dillon) writes:
>     I suggest the best thing to do is wait for 2.0 to come out,
>     it will save you a lot of grief!

That's like waiting for UNIX System V.4. Fine for the long term, but for the
next year at least 1.3 is going to be there.
-- 
 _--_|\  Peter da Silva <peter@sugar.hackercorp.com>.
/      \
\_.--._/ My other car is a hot-air balloon.
      v  "Have you hugged your wolf today?" `-_-'

jesup@cbmvax.commodore.com (Randell Jesup) (07/04/90)

In article <775@teslab.lab.OZ> andrew@teslab.lab.oz.au (Andrew Phillips  289 8712) writes:
>In article <dillon.4248@overload.UUCP> dillon@overload.UUCP (Matthew Dillon) writes:
>>    ....  I suggest the best thing to do is wait for 2.0 to come out,
>>    it will save you a lot of grief!
>
>What if you have an A1000 and never intend to run 2.0 as it will
>apparently never be supported?

	While I don't want to get into specifics, you're making too big an
assumption.  There are several routes the A1000 owner who didn't upgrade can
take.  Two of them are the A1000 rejuvenator and the little rom-board,
like the one that's already available for the A1000 (I forget the name at
the moment, I should be at home relaxing).  There are other possible solutions
that we may offer, but I can't say whether we will or not at the moment.  To
a large extent, other solutions are marketing issues.  Hey, we haven't even
released A2000 roms yet, wait a bit.

	There's certainly no technical reason 2.0 can't run on A1000's.  In
fact, there are a numnber of developers who do right now (though using
methods we wouldn't use for actually releasing it to users, but other methods
are available).

	In any case, solutions for using A500/A2000 2.0 roms exist now, so
I wouldn't worry too much.

-- 
Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com  BIX: rjesup  
Common phrase heard at Amiga Devcon '89: "It's in there!"