[Select]

Desktop


Index

 

Task Manager

The TaskManager module has been updated to bring it up to date with the rest of RISC OS. The following changes have been made to the module :

  • The TaskManager will warn users when the system is powered off without being safely shut down. This should encourage users to correctly shut down the system, rather than to merely turn off the system. Failure to shut down correctly may result in data loss.
  • The 'System memory allocation' details in the main tasks display has had a number of the previously displayed regions removed :
    • Screen memory (no longer centrally allocated; see the 'Video' areas within the 'Dynamic areas' section)
    • Cursor/System/Sound (these are now separate areas, listed under the 'Dynamic areas' section)
    • System heap/Stack (now presented as just 'System heap', as the system stack is a separate area - not listed)
  • The 'System memory allocation' details still includes the 'Font cache', 'System sprites' and 'RAM disc' areas, despite these areas now being controlled by the relevant modules (FontManager, SpriteUtils and RamFS respectively).
  • Physical dynamic areas are indicated by blue bars rather than red. This indicates that the areas are not part of normal allocatable memory.
  • It should be noted that the list of memory regions is not complete. In particular, memory regions allocated to the page tables, to the system stacks and other system areas (for example the softloaded ROM) are not included.
  • The memory size allocations beside each region are now listed as megabyte when they exceed 16M (rounded down). This makes the memory allocations easier to read.
  • The information window no longer provides a hidden 'cookie' by clicking on the authors field.
  • An 'i' icon in the information window provides additional information on the components within the system.
  • The shutdown confirmation window will offer 'Restart' and 'Off' buttons. These can be triggered by the 'R' and 'O' keys respectively. The 'Off' option is only available on hardware with power control (see document Portable).
  • The 'Exit' option has been removed from the menu, as it leaves the desktop without an obvious means of returning. Equivalent behaviour can be triggered by using Shift-Ctrl-F12 from the reset banner.
  • The configuration applications can be accessed from the TaskManager menu by selecting the 'Choices...' option.
  • The menu has an option 'Stand by' which will place the machine into a power conserving state. The power will not be removed, but hardware will be shut down and the system placed into a dormant state. This option is only available on hardware with power control (see document Portable).

Shutdown

In order to make shutdown more reliable and allow applications to force a reboot, the Task Manager shutdown controls have been updated. In addition to the standard bits that may be passed to TaskManager_Shutdown, new bits have been defined to provide additional functions.

SWI TaskManager_Shutdown
On entry
   R0 = flags :
         0 =  Do not display restart dialogue
         1  = Do not broadcast Message_PreQuit to clients
         2  = Flag in NVRAM as a power down due to exceptional condition, eg. lack of power
         3  = Send Message_Shutdown to all tasks
         4  = Reject media requests (OS_UpCall 1 and 2)
         5  = After shutdown has completed, reboot machine
         6  = After shutdown has completed, power off machine 
         Other - Reserved

This SWI is used to request that the machine shuts down. The power off facilities will only function when present on supported hardware. See the Portable module description for more details on power control.

Acknowledgements service

Many components of the system are required to provide an acknowledgement of their licence to the user. The TaskManager provides a mechanism for this through the TaskManagerAcknowledgements service.

Service TaskManagerAcknowledgements (&42680)
On entry
   R1 = &42680
   R2 = pointer to code to call to add messages, or 0 to notify taskmanager that the acknowledgements have changed.
On exit
   All registers preserved

This service call notifies TaskManager of changes to a module's licence acknowledgements. It is used to allow modules to communicate information about their licences which they are required to state, but would otherwise have no other means of displaying. Primarily it is intended for commercial developers and software built into the OS itself, but may be used by anyone. You should not claim this service.

The code to add messages must be called as :

On entry
   R0 = Group identifier of form &GMMM, where G is :
         0 = system overview  (3QD Developments Ltd only) 
         1 = system required components  (3QD Developments Ltd only) 
         2 = subsidiary components  (3QD Developments Ltd only) 
         3 = commercial components
         4 = freeware components
         5 = user components - private use only
         The MMM field should be set to 0 and is for future developments.
   R1 = pointer to zero terminated component title
   R2 = pointer to zero terminated acknowledgement details (see Note 2 below)
On exit
   All registers preserved

Note 1 - return with MOV pc,link (ie do not preserve the flags)

Note 2 - Details should be formatted as 60 characters LF terminated strings. Try to include full stops at the ends of sentences. Thus, in BASIC, you might use

     "© Fred Bloggs, 1998."+CHR$10+"© Sue Bloggs, 1999."+CHR$0

You should only call the entry point when requested for information by the TaskManager. TaskManager 0.11 and later support this service. Data will be copied so you can build strings in a temporary area if necessary.

In assembler you might use code something like the following to register messages :

svc_acknowledgements
       TEQ     r2,#0
       MOVEQ   pc,r14
       STMFD   r13!,{r0-r3 , r14}
       MOV     r3,r2
       MOV     r0,#&5000            ; group id
       ADR     r1,Title             ; pointer to your module title string
       ADR     r2,CopyrightMessage  ; some copyright message
       MOV     r14,pc
       MOV     pc,r3
       MOV     r0,r0
       LDMFD   r13!,{r0-r3 , pc}
   CopyrightMessage
           = "This software is based in part on work by Diaxos Holdings", 10
           = "Incorporated.", 10
           = "Some sections have been provided by Wally Williams.",0

In C you might use code something like the following :

typedef void (*addmessages_func)(unsigned int group,char const *title, char const *message);
   #define Service_TaskManagerAcknowledgements 0x42680
   void main_service(int service_number, _kernel_swi_regs *r, void *pw)
   {(service_number==service_taskmanageracknowledgements) {
       addmessages_func func=(addmessages_func)r->r[2];
       if (func!=NULL)
       {func(0x5000 ,Module_Title,"This software is based in part on the work of the Independent\nJPEG Group.");
       }
     }
   }

On module initialisation and finalisation you should notify the TaskManager of the change to the acknowledgement messages by issuing the service with R2 = 0. In C you might do this as :

  /* Let TaskManager know it's changed */
     _swix(XOS_ServiceCall,_INR(1,2),Service_TaskManagerAcknowledgements,0);
   In assembler, this could be :
   ; Cause a re-cache of the acknowledgements window
       LDR     r1,=&42680
       MOV     r2,#0
       SWI     XOS_ServiceCall


This documentation is copyright 3QD Developments Ltd 2013 and may not be reproduced or published in any form without the copyright holders permission. RISC OS is subject to continuous development and improvement as such all information is reproduced by 3QD Developments Ltd in good faith and is believed to be correct at the time of publication E&OE. 3QD Developments Ltd cannot accept any liability for any loss or damage arising from the use of any information provided as part of the RISC OS Documentation.

HTML document version 1.03 3rd November 2015