Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
15 crawler(s) on-line.
 164 guest(s) on-line.
 2 member(s) on-line.


 kolla,  OlafS25

You are an anonymous user.
Register Now!
 kolla:  18 secs ago
 OlafS25:  4 mins ago
 pixie:  17 mins ago
 BigD:  29 mins ago
 CosmosUnivers:  1 hr 43 mins ago
 Musashi5150:  2 hrs 12 mins ago
 AmigaPapst:  2 hrs 12 mins ago
 RobertB:  2 hrs 17 mins ago
 jPV:  2 hrs 31 mins ago
 ppcamiga1:  2 hrs 37 mins ago

/  Forum Index
   /  Amiga Development
      /  OS4 ARexx library host function
Register To Post

PosterThread
Drule 
OS4 ARexx library host function
Posted on 21-Nov-2018 13:53:48
#1 ]
Amiga Developer Team
Joined: 11-Jun-2004
Posts: 49
From: Harrogate, UK

I'm looking at writing a library which utilises a rexx host function under OS4 but am having a little difficulty with the invocation. I've based the initial implementation on the example in the 3.9 NDK tutorial. In its simplest form the script is just,

Quote:
/* an example rexx function call */
SAY "Working.."
ADDLIB( "ks.library", 0, -30, 0)
CALL MyFunc( 123 )

..with the function signature as..

Quote:
int32 _rexx_dispatch( struct Interface *, struct RexxMsg *, STRPTR *)

I've added the dispatch function entry point as the "first" function of the library to just write to debug and returns ERR10_001. Opening the library and invoking the function directly works but running the rexx script causes a grim reaper. It looks like the rexx libraries are still 68K and I don't know if I need to do something else before my PPC function can be called; is the offset still -30 for OS4 (I'm assuming so as ExamineDT works for datatypes)? Do I need some kind of shim?

The NDK example is a little vague as it has a precompiled "RexxDispatchGlue" function linked instead of the "RexxDispatch".

Does anyone have any idea or docs that might prove insightful?

_________________
Karma: Positive

 Status: Offline
Profile     Report this post  
thomas 
Re: OS4 ARexx library host function
Posted on 21-Nov-2018 15:16:50
#2 ]
Super Member
Joined: 28-May-2003
Posts: 1143
From: Germany

@Drule

In order to be called from 68k programs your library needs a 68k vector table.

Add the CLT_Vector68K tag to your libCreateTags array. The 68k vector table contains the usual Open/Close/Reserved/Expunge entries as well as your dispatch function.

The entries in the 68k vector table do not point directly to your PPC functions, there are two steps in between. The 68k vector points to a struct EmuTrap which in turn points to a PPC stub function. The PPC stub function gets one parameter: a pointer to a uint32 array containing the 68k register values. It has to pick the parameters from the respective registers in this array and can then finally call your real PPC library function.

I am not sure but I think that IDLTool can build a skeleton for you.

Last edited by thomas on 21-Nov-2018 at 03:21 PM.

_________________
Email: thomas-rapp@web.de
Home: thomas-rapp.homepage.t-online.de

 Status: Offline
Profile     Report this post  
Drule 
Re: OS4 ARexx library host function
Posted on 21-Nov-2018 15:23:26
#3 ]
Amiga Developer Team
Joined: 11-Jun-2004
Posts: 49
From: Harrogate, UK

@thomas

Thanks very much for the info - makes sense. I'll see what havoc I can cause with that :)

_________________
Karma: Positive

 Status: Offline
Profile     Report this post  
Drule 
Re: OS4 ARexx library host function
Posted on 21-Nov-2018 16:07:26
#4 ]
Amiga Developer Team
Joined: 11-Jun-2004
Posts: 49
From: Harrogate, UK

@thomas

I'm pleased to report you were spot on - with the stubs and 68K vector table in place, my function is now being called. Thanks very much for that.

_________________
Karma: Positive

 Status: Offline
Profile     Report this post  

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle