English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 03 April 2010, 20:25   #1
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
What is required of a resident application?

Obviously it has to be reentrant, but are there any other restrictions as far as hunk types, BSS space etc. go?

Also, do Kick 1.2 and 1.3 have the resident feature or is it for 2.0+ only? And how did Commodore intend for developers to mark their applications as pure? The pure-flag is not available when you show icon information in the Workbench, and I can't recall seeing any compiler or linker that can set the flag on its output.
Leffmann is offline  
Old 03 April 2010, 20:43   #2
meega
Registered User
 
meega's Avatar
 
Join Date: Dec 2007
Location: Oooh what a feeling yeaaah dancing on the ceiling
Posts: 314
Try the CLI (Protect +/- hsparwed).

Ed: oh, don't mark it Pure if it isn't, it won't help.

Ed2: Pure code is pure code - no data. You can make things resident even if they aren't pure by using the FORCE keyword (there may be alternatives) which will strip the executable from any data hunks, and allows some things to be resident when they ordinarily wouldn't be. Someone else who really knows about this stuff should correct or continue here.

Ed3: if you want to know if it's in wb1.3, look in the C: drawer. If Resident is present, then you should be able to use it.

Ed4: I think DICE could create Pure executables, with the bit set, but I'm a little hazy on that.

Last edited by meega; 03 April 2010 at 20:50.
meega is offline  
Old 03 April 2010, 20:51   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,518
BSS space in re-entrant application does not make sense because it can't be used for storing data if you want to keep it re-entrant
Toni Wilen is offline  
Old 03 April 2010, 21:17   #4
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Quote:
Ed2: Pure code is pure code - no data.
So separate hunks for constant data is not allowed, and thus reloc entries are not allowed as well? Even if they are within that same, single code hunk?

Quote:
BSS space in re-entrant application does not make sense because it can't be used for storing data if you want to keep it re-entrant
Technically you could make use it for one-time initialization of data.

Anyway, is there any exhausting document on this? Maybe I've been looking in the wrong place, but the reason I posted here is because I haven't been able to find anything about this anywhere.

Thanks
Leffmann is offline  
Old 03 April 2010, 21:30   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,518
Relocation is fine, program is loaded only once but program's hunk contents (whatever the type of hunk) must not be modified.

All data space must be allocated dynamically, usually single memory block is allocated with AllocMem() and stored to A4 or A5 and all data accesses are relative to A4/A5.

Quote:
Technically you could make use it for one-time initialization of data.
Remember to disable multitasking during initialization or bad things can happen if someone runs your program again while previous one is still running one-time initialization

Last edited by Toni Wilen; 03 April 2010 at 21:42.
Toni Wilen is offline  
Old 03 April 2010, 21:47   #6
meega
Registered User
 
meega's Avatar
 
Join Date: Dec 2007
Location: Oooh what a feeling yeaaah dancing on the ceiling
Posts: 314
Offtopic: There are other uses for the protection bits than just the recomended ones. I used to mark text files as pure (protect blah:file.whatever +p) to show that I'd printed them.
meega is offline  
Old 03 April 2010, 22:50   #7
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by meega View Post
Offtopic: There are other uses for the protection bits than just the recomended ones. I used to mark text files as pure (protect blah:file.whatever +p) to show that I'd printed them.
Some are not so well known. For example, the h bit doesn't stand for hidden but for hold. A pure program with the h bit set will stay resident in memory when executed. Set the hold bits and remove lines like this...

Resident >NIL: Assign PURE

This will speed up the startup-sequence and make scripts faster if you have the memory to spare.

One note on making resident programs. It is ok to have data sections or data in your code sections but it can only be read and not written. The stack is commonly used for temporary storage as well as functions that allocate storage. Each program instance gets a new stack.

Relocs are fine. All the relocations take place before any programs use the code. The relocs and the code locations do not change after loadseg.

Last edited by matthey; 03 April 2010 at 22:56.
matthey is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm looking for an application Narf the Mouse request.Apps 33 27 May 2011 20:05
TruePub application ami_junkie support.Apps 2 25 March 2010 04:53
An Hybrid application amiga request.UAE Wishlist 1 19 January 2009 15:42
How about application software ? HCF HOL suggestions and feedback 0 18 December 2004 16:25
WHDLoad and its application... MethodGit support.Apps 42 26 August 2001 04:50

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 15:13.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09326 seconds with 15 queries