Welcome, Guest. Please login or register.

Author Topic: WarpOS powerpc.library developments?  (Read 1327 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline mousehouseTopic starter

WarpOS powerpc.library developments?
« on: September 21, 2011, 12:07:32 PM »
A few months ago I played a bit with my SAS/C compiler and the PowerPC support that is provided through the ppc.library and powerpc.library. I've tried to find some consistent resources on the internet but there seems to be a lot of have around these libs for a n00b like me.

If I understand correctly the powerpc.library is the WarpOS version, a competing standard to Phase5's ppc.library. There is a fake/wrapper library available that provides a ppc.library API to clients but interfaces to the powerpc.library instead.

Now this powerpc.library implements a kernel running on the PowerPC CPU and provides an AmigaOS API / interface for coexistence, correct? So then the library functions eg. need to make sure that memory used by PowerPC processes are not used at the same time by 68K apps.

Now how does this library interface with the different PPC cards available? Eg. if I wanted my little nifty program that runs on a CSPPC in my A4000 also to run on the BlizzardPPC under 3.9 does the library handle the difference in hardware?

And how does this library come into play when using AmigaOS4.x or MorphOS, etc. Does this library exist in these operating systems as well in a version that maps the API calls to native stuff?

Just trying to get some basic understanding of this very interesting aspect of the Amiga, dual-cpu of different architectures ;-)
A3000T
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: WarpOS powerpc.library developments?
« Reply #1 on: September 21, 2011, 03:07:33 PM »
Quote
Now this powerpc.library implements a kernel running on the PowerPC CPU and provides an AmigaOS API / interface for coexistence, correct?

You can call AmigaOS API but it is not recommended due to context switches. You can not call AmigaOS API calls directly but using PPC->68k wrapper. Before calling AmigaOS API you must make sure data in 68k and PPC caches are consistent.

I would not recommend using PowerUP or WarpUP API at all.

Quote
So then the library functions eg. need to make sure that memory used by PowerPC processes are not used at the same time by 68K apps.

There is no built-in support for PowerPC. The user application is responsible for cache consistency. Using AmigaOS system structures from PowerPC code is strictly forbidden.

Quote
Now how does this library interface with the different PPC cards available?

It is handled by underlying HW drivers. Applications dont have to take care of it.

Quote
And how does this library come into play when using AmigaOS4.x or MorphOS, etc. Does this library exist in these operating systems as well in a version that maps the API calls to native stuff?

MorphOS has full compatibility to PowerUP and WarpUP API.

AmigaOS 4 only provides not fully compatible WarpUP API.

On MorphOS and AmigaOS 4 you dont have to care about cache coherency because there is no real 68k. This means PowerUP and WarpUP applications run at full speed.
My Amigas: A500, Mac Mini and PowerBook
 

Offline mousehouseTopic starter

Re: WarpOS powerpc.library developments?
« Reply #2 on: September 21, 2011, 03:54:14 PM »
Ah OK... just did some more reading and MorphOS and AmigaOS4 just disable the 68K CPU completely and run a JIT for the remaining 68K binaries on the PPC.

Now, when I build an executable using SAS/C for the PPC I assume that it uses powerpc.library to interface, right? Or are the PowerPC registers present somewhere in the Amiga memory map and can you manipulate them directly from a 68K application? Something like,

reserve some memory in AmigaOS memory space
put PowerPC machine language in memory
set the PPC PC and stack pointers to you allocated memory and code
run ;-)

Or is there some voodoo in the firmware of the CSPPC card that I am unaware of?
A3000T