home *** CD-ROM | disk | FTP | other *** search
- File : Module
- Date : 12-Jan-96
- Author : © A.Thoukydides, 1995, 1996
- Description : Description of the ARMEdit module.
-
-
- INTRODUCTION
-
- The ARMEdit module forms the core of the ARMEdit suite of software. It
- provides the communications between software running on the PC card and
- RISC OS.
-
- For any of the programs to work it is necessary to load the ARMEdit module
- before starting the PC front-end.
-
- The current version of this module will work with versions of the PC
- front-end software 1.87 and above. However, significantly better performace
- will be obtained if version 2.00 or above is used. Upgrades are available
- from both Acorn's (ftp.acorn.co.uk) and Aleph One's (ftp.ant.co.uk) ftp
- sites.
-
-
- SYSTEM VARIABLES
-
- The ARMEdit module sets and uses the following system variables:
-
- ARMEdit$Path
-
- Path used to access Messages file. This is normally set to point to
- the file contained within the module and placed in ResourceFS.
-
-
- ARMEdit$ScrapDir
-
- Directory used for temporary files. This is normally set to
- <Wimp$Scrap>.ARMEdit, but may be changed if required. If there is
- sufficient memory in the computer then better performance would
- result from placing this in a RAM disc.
-
- The module sets and uses this variable (if not already defined)
- during initialisation. Hence it is necessary for <Wimp$Scrap> to be
- defined before the module is loaded.
-
-
- *COMMANDS
-
- The following *commands are provided by the ARMEdit module:
-
-
- *ARMEdit_Clients
-
- This command displays details of the clients that have registered
- with the ARMEdit module for communication purposes.
-
- *ARMEdit_DOSMap
-
- This command updates the cached list of mappings between DOS
- extensions and RISC OS filetypes. These details are read initially
- from DOSFS, but may be re-read at any time using this command.
-
-
- *ARMEdit_Files
-
- This command displays details of the RISC OS files currently open for
- PC software. For each open file the file handle and filename is
- displayed. There is also a field that indicates whether the file will
- automatically be deleted when it is closed (either explicitly by the
- PC software, or when the PC is reset or quit).
-
-
- *ARMEdit_Memory
-
- This command displays details of the RISC OS memory currently being
- used by PC software. For each block of memory claimed the base
- address and size of the block is displayed.
-
- The memory is currently allocated from the RMA, but a header is
- attached to the start of each block. Hence the address displayed is
- not the start of a heap block. The information in the header is used
- to automatically release the memory when the PC is reset or quit if
- the PC software fails to do so.
-
-
- *ARMEdit_Version
-
- This command displays the version numbers of the data structures used
- by the most recently used PC front-end. It also displays the range of
- versions catered for by this version of the module.
-
-
- SWIs
-
- The following SWIs are provided by the ARMEdit module. For more details
- regarding the use of the communciations SWIs see the Code documentation.
-
-
- SWI "ARMEdit_ControlPC" (&4BC40)
-
- Control the PC front-end.
-
- On entry:
-
- R0 = Operation to perform:
-
- 0 Suspend full screen mode
- 1 Freeze running in a window
- 2 Reset the PC
- 3 Quit the front-end
-
- On exit:
-
- All registers preserved.
-
- Interrupts:
-
- Interrupt status is undefined.
- Fast interrupts are enabled.
-
- Processor mode:
-
- Processor is in SVC mode.
-
- Re-entrancy:
-
- SWI is not re-entrant.
-
- Use:
-
- This call allows the PC front-end to be controlled. Note that if the
- PC front-end is not the current application then this will only take
- effect the next time the front-end is paged in.
-
- Note that suspending full screen mode only starts execution in a
- window if enabled by the current configuration.
-
-
- SWI "ARMEdit_TalkStart" (&4BC41)
-
- Register a new client task.
-
- On entry:
-
- R0 = Pre-allocated ID for this task.
- R1 = Flags (see below).
- R2 = Pointer to a function to be called when a message is available,
- or 0 for none.
- R3 = Value for R12 to contain when function pointed to by R2 is
- called.
-
- On exit:
-
- R0 = A unique client handle.
- R1 = Pointer to a poll word for this task.
-
- Interrupts:
-
- Interrupt status is undefined.
- Fast interrupts are enabled.
-
- Processor mode:
-
- Processor is in SVC mode.
-
- Re-entrancy:
-
- SWI is not re-entrant.
-
- Use:
-
- An application that provides services to PC software should call this
- when it is starting. A message buffer is allocated and a unique
- handle for this task assigned. This handle should be stored and used
- in all other calls relating to this task.
-
- The currently defined flag bits are:
-
- Bit Meaning if set
-
- 0 Messages from the ARMEdit module are required.
-
- All other bits should be set to 0 to allow for future expansion.
-
- The poll word is initially set to zero. When there is potentially a
- message waiting for this task the poll word is set to a non-zero
- value. The poll word is cleared when either the message has been
- read, or no message is available for some other reason. Note that a
- non-zero poll word does not imply that a message will be available;
- another task might have read the message if it was not directed to
- a specific handle. The poll word must not be written to; it must only
- be modified by the ARMEdit module.
-
-
- SWI "ARMEdit_TalkEnd" (&4BC42)
-
- Deregister a client task.
-
- On entry:
-
- R0 = The previously assigned handle for this client task.
-
- On exit:
-
- All registers preserved.
-
- Interrupts:
-
- Interrupt status is undefined.
- Fast interrupts are enabled.
-
- Processor mode:
-
- Processor is in SVC mode.
-
- Re-entrancy:
-
- SWI is not re-entrant.
-
- Use:
-
- All applications that call ARMEdit_TalkStart must call this before
- they terminate. This releases the message buffer and allows other
- tasks to detect whether particular services are available.
-
-
- SWI "ARMEdit_TalkTX" (&4BC43)
-
- Send a message to another client task.
-
- On entry:
-
- R0 = Client handle for this task.
- R1 = Either the ID or client handle for the recipient.
- R2 = Pointer to block containing the message to send.
-
- On exit:
-
- All registers preserved.
-
- Interrupts:
-
- Interrupt status is undefined.
- Fast interrupts are enabled.
-
- Processor mode:
-
- Processor is in SVC mode.
-
- Re-entrancy:
-
- SWI is not re-entrant.
-
- Use:
-
- Send a message to another task. The destination task can be specified
- using either it's ID or client handle. If the ID is specified then it
- will be offered to each matching task that polls it until it is
- acknowledged. A particular message is only offered to each task once.
- When sending messages to PC software (ID = 0) the handle should
- always be specified.
-
- Note that the message buffer for each task can only contain a single
- message to send; if there is already a message waiting to be
- delivered then it is overwritten.
-
-
- SWI "ARMEdit_TalkRX" (&4BC44)
-
- Check for any waiting messages for this client task.
-
- On entry:
-
- R0 = Client handle for this task.
-
- On exit:
-
- R0 = Pointer to block containing waiting message, or 0 if no messages
- waiting.
- R1 = Source ID.
- R2 = Source client handle.
-
- Interrupts:
-
- Interrupt status is undefined.
- Fast interrupts are enabled.
-
- Processor mode:
-
- Processor is in SVC mode.
-
- Re-entrancy:
-
- SWI is not re-entrant.
-
- Use:
-
- Check for any waiting messages. If none are available R0 contains 0
- on exit, otherwise it contains a pointer to the first message. The
- message should be checked, and if it is claimed ARMEdit_TalkAck
- should be called to prevent it being passed to other clients. Any
- information required from the message must be read or copied
- immediately, since the message could be overwritten by a new message.
-
- The specified source client handle should be used for any reply;
- unlike the ID it uniquely identifies a particular instantiation of a
- client.
-
- If this call is successful then it should be called again; it is
- possible for multiple messages to be pending for a single client.
-
-
- SWI "ARMEdit_TalkAck" (&4BC45)
-
- Claim the most recently read message.
-
- On entry:
-
- R0 = Client handle for this task.
-
- On exit:
-
- All registers preserved.
-
- Interrupts:
-
- Interrupt status is undefined.
- Fast interrupts are enabled.
-
- Processor mode:
-
- Processor is in SVC mode.
-
- Re-entrancy:
-
- SWI is not re-entrant.
-
- Use:
-
- After reading a message with ARMEdit_TalkRX, this call should be
- used to claim the message, and to prevent it being offered to other
- clients. This should be used before calling any other SWIs from this
- module.
-
- If the message was sent by the ARMEdit module then calling this SWI
- has no effect; other clients still receive the message.
-
-
- THINGS TO DO
-
- The following are changes that may be made to the ARMEdit module sometime in
- the future.
-
- None at the moment!
-
-
- VERSION HISTORY
-
- 0.00 (12-Nov-95) Original development version.
-
- 0.01 (14-Nov-95) Fixed bugs in file handling. Removed stray debugging code.
- Sets variable for scrap directory and ensure it exists.
-
- 0.02 (15-Nov-95) Included extra command to display PC front-end version.
- Fixed workspace handling for *commands. (Oops!)
-
- 0.03 (17-Nov-95) Uses correct HPC service identifier.
- Includes development versions of device driver support.
-
- 0.04 (21-Nov-95) Implemented the *commands and real HPC support.
-
- 0.06 (22-Dec-95) Added SWI to control the PC front-end.
-
- 0.07 (28-Dec-95) Added message passing protocol.
-
- 1.00 (12-Jan-96) First official release version.
-