The PokeMachineID module replaces part of the OS_ReadSysInfo (SWI &58) call to allow the information returned by reason code 2 to be dynamically altered. This allows software containing hardware dependent code which uses this call to be tested.
Requirements
============
PokeMachineID has been tested on a RiscPC with RISC OS 3.50 running on an ARM610. It may not work on earlier or later machines, as it patches the kernel SWI dispatch table in RAM (and this practice was introduced in the RiscPC due to the SVC32 SWI vector under ARM6, ARM7 and StrongARM). Should this table not exist at the desired location, PokeMachineID will alter the wrong addresses, with potentially disasterous results.
PokeMachineID requires the KaData utility module, a freeware version of which is provided. PokeMachineID also requires OS_SynchroniseCodeAreas (SWI &6E) as it uses dynamic code. For users of non-StrongARM RISC OS versions, a CallASWI module will therefore be required. There are a number of versions of this about:
0.00 CallASWI (18 Sep 1996) [SVC26] ⌐ Kasoft
(Do not use- unreliable. Used for in-house tests only.)
0.00 CallASWI (18 Sep 1996) [SVC32] ⌐ Kasoft
(Do not use- unreliable. Used for in-house tests only.)
0.00 CallASWI (25 Oct 1996) Written by Darren Salt
(Implements new SWI names)
0.01 CallASWI (17 Jul 1996) Acorn official version
(SWI numbers only)
SWI interface
=============
OS_ReadSysInfo 2 (SWI &58)
Returns the current dynamically set ASIC presence flags and machine
identification.
On entry R0 = 2
On exit R0 = current IOEB ASIC presence flag
R1 = current 82C710 presence flag
R2 = current LCD ASIC presence flag
R3 = low word of current 64-bit machine ID
R4 = high word of current 64-bit machine ID
Processor Mode Processor is in SVC26 mode
Interrupts Interrupt status is not altered
Fast interrupts are enabled
Re-entrancy SWI is re-entrant
OS_ReadSysInfo -1 (SWI &58)
Restores the correct ASIC presence flags and machine identification
for this hardware.
On entry R0 = -1
On exit R0 preserved
R1 = actual IOEB ASIC presence flag
R2 = actual 82C710 presence flag
R3 = actual LCD ASIC presence flag
R4 = low word of actual 64-bit machine ID
R5 = high word of actual 64-bit machine ID
Processor Mode Processor is in SVC26 mode
Interrupts Interrupt status is not altered
Fast interrupts are enabled
Re-entrancy Re-entrancy is not defined
OS_ReadSysInfo -2 (SWI &58)
Changes the current ASIC presence flags and machine identification
as returned by OS_ReadSysInfo 2 (SWI &58).
On entry R0 = -2
R1 = new IOEB ASIC presence flag
R2 = new 82C710 presence flag
R3 = new LCD ASIC presence flag
R4 = low word of new 64-bit machine ID
R5 = high word of new 64-bit machine ID
On exit R0-R5 preserved
Processor Mode Processor is in SVC26 mode
Interrupts Interrupt status is not altered
Fast interrupts are enabled
Re-entrancy Re-entrancy is not defined
Command interface
=================
*PokeASICs
Alters the IOEB, 82C710 and LCD ASIC presence flags as returned by
OS_ReadSysInfo 2 (SWI &58) in registers R0, R1 and R2 respectively.
Syntax *PokeASICs <IOEB presence flag>
<82C710 presence flag> <LCD presence flag>
Parameters <IOEB presence flag> Hexadecimal number
<82C710 presence flag> Hexadecimal number
<LCD presence flag> Hexadecimal number
Use Use this command with caution, as it will
cause software to make assertions about
available hardware which may well be false.
Such assertions may lead to failure of the
software, and could foreseeably result in
harmful software or hardware malfunction.
Example *PokeASICs 1010100 1 0
*PokeID
Alters the 64-bit unique machine identification as returned by
OS_ReadSysInfo 2 (SWI &58) in registers R3 (low word) and R4 (high
word).
Syntax *PokeID <low word> <high word>
Parameters <low word> Hexadecimal number
<high word> Hexadecimal number
Use Note that this command may cause software
that relies on a particular machine
identification to fail.
Example *PokeID A4004400 50
History
=======
0.01 Initial version which worked occasionally. ID was hardwired.
0.10 Commands and negative SWIs introduced, and mechanisms generalized.
Acknowledgements
================
Thanks are due to Mark Wooding at Straylight for teaching me bad things like the location of the SWI kernel dispatch table, Iain Truskett for insisting that I fix version 0.01, as well as Justin Fletcher and Dave Thomas for the StrongHelp "Poor Man and Woman's PRM", which told me what the hell OS_ReadSysInfo is supposed to do.
Copyright and Disclaimer
========================
Kasoft Software maintains copyright in this software, but explicit permission is hereby given for this particular version to be freely distrubuted (as Freeware).
IMPORTANT (Disclaimer of Liability): The software described in these notes is subject to continuous development and improvement. Kasoft Software cannot be held liable for any loss or damage arising from the use of this software, or the information given in these notes, even if Kasoft Software is aware of the possibility of such loss or damage. The software is supplied without any promise or warranty of any kind with respect to its fitness for any purpose whatsoever. The use of this software is entirely the user's own responsibility.
Suggestions for future versions of the software and these notes are welcomed. All correspondence should be addressed to:
Kasoft Software
PO Box 104
Shearwater 7307
AUSTRALIA
Telephone (International): [61] 3 64287448
Telephone (Australia): (03) 64287448
e-mail: kade_fh@postoffice.utas.edu.au
The relocatable module 'PokeMachineID' was programmed by Kade Hansson. This module is thought to be suitable for use with all ARM-based computers running Acorn RISC OS version 3.50 or later. These notes document version 0.10 (29 Sep 1998). These notes or the software they document have no connection with the Acorn Computers Plc.
Kasoft is a registered trademark of Kasoft Software, and owned by Kade Hansson. Acorn and RiscPC are trademarks of Acorn Computers Plc. ARM is a trademark of Advanced RISC Machines Plc.