WarpUp (70/277)

From:Frank Wille
Date:09 Aug 2000 at 11:11:26
Subject:Re: MorphOS ;-)

Oliver Roberts wrote:

> >> The problem is I am not sure if a Emulation of PowerOpen on top of
> >> System V is even possible (or efficient).
>
> > Sure it is possible. They would be nearly as fast as real MorphOS
> > programs, like programs running under ppclibemu are nearly as fast as
> > native WarpOS ones.
>
> Wouldn't gpr2 be a problem? i.e. WarpOS uses this as a toc register,
> whereas it's reserved for system use in System V.4, which is what
> MorphOS conforms to, of course.

The emulation could save r2 when making MorphOS-calls and restore
the original contents. But you're right, this could still be a
problem, as there might be situations apart from WarpOS-library
calls where the destroyed toc register could become important. I
don't know...

I didn't say I will write this emulation, BTW. :)

> IIRC, MorphOS uses gpr2 for something to do with 68k emulation

That's correct. r2 points to a structure which provides function
pointers for CallOS and CallM68k.

> At least, this was the case with the old distributed.net RC5 clients, as
> Ralph reported this problem. It didn't affect PowerUp, but messing with
> gpr2 apparently affects MorphOS. Unfortunately, I suspect if this is
> true, the latest PowerUp RC5 clients won't run under MorphOS, since the
> PPC RC5 core still uses gpr2 extensively, and would most likely require
> a complete rewrite (it's written in assembler) to get it working.

Yes, I would think so. r2 must not be touched.



_ Frank Wille (frank@phoenix.owl.de)
_ // http://home.owl.de/~frank/
\X/ Phx @ #AmigaGer