Recompiling from OS4 to MOS
  • Caterpillar
    Caterpillar
    Flash
    Posts: 23 from 2019/11/1
    Hi friends, is there a guide about recompiling programs from OS4 to MOS?
  • »21.08.20 - 08:17
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 2098 from 2003/3/5
    From: Canada
    Don't think one was ever made. I guess the biggest obstacle would be the OS4 library interfaces.
  • »21.08.20 - 13:49
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 517 from 2007/10/23
    From: Gelsenkirchen,...
    This may help a little bit
    Code:
    egrep "I[a-zA-Z_]+->" *.c
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.13
  • »21.08.20 - 14:41
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    amigadave
    Posts: 2737 from 2006/3/21
    From: Lake Arrowhead...
    Quote:

    Flash wrote:
    Hi friends, is there a guide about recompiling programs from OS4 to MOS?


    I don't think that most users realize how different OS4 and MorphOS have become "under the hood" so to speak. From what tiny understanding I have of each of them, they grow further apart from how they work every update. I think OS4 has incorporated some methods from Windows, or Linux/Unix, with shared libraries is it? Even though OS4 has the Amiga name attached to it, I actually think that in some ways, MorphOS has remained more closely related to AmigaOS3.1 and earlier versions, but I could easily be wrong about that. OS4 certainly has more of the "Look and Feel" of the older versions of AmigaOS, which seems to be more important to some users, than how things work behind the scenes, in the hidden parts of the OS.

    A guide on how to recompile software from OS4 to MorphOS, and MorphOS to OS4 would be useful for programmers wishing to serve both communities, and since there are several programmers who appear to have that interest, I'm sure one of them could complete such a task, but who will invest the time to actually do it, since it will not profit them, except by increasing their good will from other beginning programmers, who need the help. It would be useful to me in the future.

    [ Edited by amigadave 21.08.2020 - 09:02 ]
    MorphOS - The best Next Gen Amiga choice.
  • »21.08.20 - 17:00
    Profile
  • Moderator
    Kronos
    Posts: 1985 from 2003/2/24
    It can be as easy as hitting "make" or it can be as hard as doing a rewrite from scratch *doh*

    It really depends on the quality of the code, what was used on the OS4 side and what constitutes a "MorphOS-port".

    Some people are o.k. with having to hunt down some crappy 68k ClassAct/ReAction to call it working, others expect it do be done in the right way.
    --------------------- May the 4th be with you ------------------
    Mother Russia dance of the Zar, don't you know how lucky you are
  • »21.08.20 - 18:26
    Profile
  • MorphOS Developer
    Piru
    Posts: 432 from 2003/2/24
    From: finland, the l...
    Quote:

    polluks wrote:
    This may help a little bit
    Code:
    egrep "I[a-zA-Z_]+->" *.c



    :D
  • »21.08.20 - 20:30
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Minuous
    Posts: 155 from 2010/2/13
    @Kronos:

    If a supposedly AmigaOS-compatible OS is missing the official Amiga GUI, it's hardly the application programmers' fault.
  • »21.08.20 - 23:35
    Profile Visit Website
  • Moderator
    Kronos
    Posts: 1985 from 2003/2/24
    Official crap is still crap.....
    --------------------- May the 4th be with you ------------------
    Mother Russia dance of the Zar, don't you know how lucky you are
  • »22.08.20 - 02:46
    Profile
  • Butterfly
    Butterfly
    kas1e
    Posts: 68 from 2005/10/31
    @Flash
    If reaction is used, then probably bad luck, you will need to ditch it in favor of mui. If mui is used, or no gui at all, then it's better and then:

    If aos4 code writen without __USE_INLINE__ , then it means you need to remove all those I* prefixes before amigaos functions (like those IIuntion->, IDOS->, IGraphics->,etc). If __USE_INLINE__ were used, it means code didn't have all those I*-> stuff, and you have no worry about.

    Then, next, you will need to replace functions which is present on os4, but not on morphos (to os4 haters: it didn't mean that they are better, just, of course, some new functions added to os4 the same as to morphos).

    After that, if code is heavy enough you will be in needs to deal with HOOKs. On Morphos they more or less like on os3 was, so you will need a bit spend time to make them works. Like this:

    Code:

    #ifdef __amigaos4__
    #define REXXHOOK(name, param) static const struct Hook name = { { NULL, NULL }, (HOOKFUNC)&Rexx, NULL, (APTR)(param) }
    static LONG Rexx(struct Hook *h,Object * obj, IPTR *params);
    #else
    #define REXXHOOK(name, param) static const struct Hook name = { { NULL, NULL }, (HOOKFUNC)&RexxEmul, NULL, (APTR)(param) }
    static LONG Rexx(void);
    static const struct EmulLibEntry RexxEmul = { TRAP_LIB, 0, (void (*)())&Rexx };
    #endif


    If graphics.library is used, there are some differences with functions name and tags will be as well.


    But in general, all you need probably is to grab "OS3 to OS4 migration guide", and made code be back "like os3 one", which then will be much closer to morphos's code then.


    [ Edited by kas1e 22.08.2020 - 10:19 ]
  • »22.08.20 - 10:18
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 517 from 2007/10/23
    From: Gelsenkirchen,...
    Quote:

    Andreas_Wolf schrieb:
    > If reaction is used, then probably bad luck, you will need to ditch it in favor of mui.

    Executables (re)compiled for MorphOS can use (m68k) ClassAct/ReAction:

    http://aminet.net/search?readme=reaction&arch=ppc-morphos

    Or simply most Minuous's stuff :-)
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.13
  • »22.08.20 - 23:21
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 11055 from 2003/5/22
    From: Germany
    >>> If reaction is used, then probably bad luck, you will need to ditch it in favor of mui.

    >> Executables (re)compiled for MorphOS can use (m68k) ClassAct/ReAction:
    >> http://aminet.net/search?readme=reaction&arch=ppc-morphos

    > Or simply most Minuous's stuff :-)

    While 4 of the 7 software titles are indeed by him, I don't see the relevance of this when the statement I replied to as well as my reply are about the mere technical possibility to compile such executables, which would be proven even with just one single existing program of this sort, no matter the author.
  • »23.08.20 - 01:37
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    takemehomegrandma
    Posts: 2648 from 2003/2/24
    ReAction is not, *and should never be*, relevant in a MorphOS context. An OS4 application migrating to MorphOS should not use anything like it when released to the public, even if made possible by a stretch through support from 68k stuff. That’s my opinion at oeast. ;-)
    MorphOS is Amiga done right! :-)
    MorphOS NG will be AROS done right! :-)
  • »23.08.20 - 02:30
    Profile
  • Butterfly
    Butterfly
    kas1e
    Posts: 68 from 2005/10/31
    @Andreas
    Quote:


    Executables (re)compiled for MorphOS can use (m68k) ClassAct/ReAction:

    http://aminet.net/search?readme=reaction&arch=ppc-morphos



    It's not a usual reaction-based apps as people do for OS4, it's just an example of "special apps working on MorphOS too when using old reaction libs". All semi-modern apps on OS4, which written for the latest public version of reaction classes, need to be rewritten for MorphOS and can't be recompiled as it. Even for OS4 things change and evolve with Reaction classes since OS3 days. And if one wrote an app for OS4+Reaction without having in mind MorphOS, then there can't be pure recompilation.

    If anyone wants cross-platform Amiga-native apps with GUI, then MUI should be used.

    [ Edited by kas1e 23.08.2020 - 06:19 ]
  • »23.08.20 - 06:12
    Profile
  • MorphOS Developer
    geit
    Posts: 945 from 2004/9/23
    Quote:

    kas1e wrote:

    If anyone wants cross-platform Amiga-native apps with GUI, then MUI should be used.


    Ähm, no. It may work, but I found so many issues during my journey of creating software for 68k, os4 and MorphOS.

    Issues I couldn’t figure out without having OS4. For me personally it wasn’t worth the time. Like there is a crash in one specific MUI class and while it worked on 68K, MorphOS and OS4 using the 68k binary, the native one did crash in the very same spot.

    As said, I gave up a long time ago. Today it is even worse, when you need to deal with a MUI remake, that’s not compatible or lacks features. Also the system functions you want to use are limited. One function is there on one system and the other needs to be worked around on the other OS. That’s no fun at all and that is for developing stuff from scratch.

    Porting and digging from one error to the next one, may be fun, but when each error makes you code a system function or a mui class to fix a port, then it’s not something I would enjoy..
  • »23.08.20 - 12:49
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 11055 from 2003/5/22
    From: Germany
    >>> If reaction is used, then probably bad luck, you will need to ditch it in favor of mui.

    >> Executables (re)compiled for MorphOS can use (m68k) ClassAct/ReAction:
    >> http://aminet.net/search?readme=reaction&arch=ppc-morphos

    > it's just an example of "special apps working on MorphOS too when using old reaction
    > libs". All semi-modern apps on OS4, which written for the latest public version of reaction
    > classes, need to be rewritten for MorphOS and can't be recompiled as it.

    Yes, this is true, thanks for the remark. I was just opposing the notion that ReAction necessarily has to be ditched when trying to make a program from OS4 run on MorphOS. I may be wrong, but I assume it's less effort to port from new ReAction to old ReAction than to something completely different like MUI (which of course is to be preferred for a proper MorphOS-native port).
  • »23.08.20 - 14:02
    Profile
  • Butterfly
    Butterfly
    Posts: 62 from 2017/8/7
    Just to be clear:

    MorphOS does not have any 'legacy' GUI, like GadTools?
  • »23.08.20 - 15:32
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 2098 from 2003/3/5
    From: Canada
    Quote:

    MorphOS does not have any 'legacy' GUI, like GadTools?


    Of course it does have gadtools.
  • »23.08.20 - 15:58
    Profile Visit Website
  • Butterfly
    Butterfly
    Posts: 62 from 2017/8/7
    Thanks. But it is advised to use it or should one go for MUI preferably?
  • »23.08.20 - 17:38
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 11055 from 2003/5/22
    From: Germany
    > it is advised to use it or should one go for MUI preferably?

    GadTools has been called "basically already quite obsolete" by a MorphOS team member.
  • »23.08.20 - 18:42
    Profile
  • Caterpillar
    Caterpillar
    Flash
    Posts: 23 from 2019/11/1
    Gas tools is obsolete on OS4 too.
    Maybe it’s time to learns MUI, sadly I hate C++ and all object programming related things.
  • »23.08.20 - 18:58
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 517 from 2007/10/23
    From: Gelsenkirchen,...
    GUI's can coexist: See Qt and GTK
    BTW there will be some unification in OS 3.2
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.13
  • »23.08.20 - 20:05
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 11055 from 2003/5/22
    From: Germany
    > BTW there will be some unification in OS 3.2

    Do you mean the integration of ReAction? Or something else?
  • »23.08.20 - 20:34
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 517 from 2007/10/23
    From: Gelsenkirchen,...
    Quote:

    Andreas_Wolf schrieb:
    > BTW there will be some unification in OS 3.2

    Do you mean the integration of ReAction? Or something else?

    yep
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.13
  • »23.08.20 - 21:05
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 2098 from 2003/3/5
    From: Canada
    Quote:

    Flash wrote:
    Gas tools is obsolete on OS4 too.
    Maybe it’s time to learns MUI, sadly I hate C++ and all object programming related things.


    Noone forces you to use C++ to use MUI. Then again if you hate OOP, you're probably better off purchasing Hollywood.
  • »23.08.20 - 21:20
    Profile Visit Website