WB Startup

Posted by ALB42 on 6. Mai 2015One Comment

A discussion I currently read reminds me of some special things about WBStartup message in AmigaOS. If a program is started by Icon/Workbench the program recieves a WBStartup Message which must be replied at end of program (Most C compilers care about it already). There is a tiny additional thing. If workbench get the reply message it will unload the code from the memory, so every code executed after can fail if the memory is reused by other programs. By RKM its suggested to Forbid() task change, reply message and end program without Permit() task change again, but of course only when started by Workbench, if started by CLI it should not end with . I didn’t remember to see this in the fpc AROS implementation. So I implemented it for AROS and test it a while, then later also fix for Amiga/MorphOS?

One comment to "WB Startup"

  1. magorium sagt:

    To answer your question: yes.

    Autoinit code for AROS shows the behavior you described here: http://repo.or.cz/w/AROS.git/blob/HEAD:/compiler/autoinit/fromwb.c

    An example for Amiga is available here: http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node060F.html

    I’m unsure about MorphOS, but i have no reason to think it differs. When in doubt, please ask Chain 🙂

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.