OS_ReadSysInfo
The OS_ReadSysInfo SWI has been extended and modified since the calls documented in the PRMs. The full list of OS_ReadSysInfo reason codes currently supported is :
OS_ReadSysInfo 0 - Read configured screen size
OS_ReadSysInfo 1 - Read configured mode, monitor type and sync
OS_ReadSysInfo 2 - Read chip presence and unique machine ID
OS_ReadSysInfo 3 - Read features mask for 82C710-compatible chip family
OS_ReadSysInfo 4 - Read machine ethernet address
OS_ReadSysInfo 5 - Read raw unique ID
OS_ReadSysInfo 6 - Read kernel values
OS_ReadSysInfo 7 - Read last abort details
OS_ReadSysInfo 8 - Read platform class
OS_ReadSysInfo 9 - Read ROM information
OS_ReadSysInfo 10 - Read Operating System version
OS_ReadSysInfo 11 - Read debug information
SWIs
OS_ReadSysInfo 0
(Read configured screen size
On entry
R0 = 0
On exit
R0 = 0
This SWI no longer returns any configured screen size details. The screen size is managed entirely at the discretion of the video driver modules. Originally this SWI returned the size of the configured screen memory in bytes.
OS_ReadSysInfo 1
Read configured mode, monitor type and sync
On entry
R0 = 1
On exit
R0 = configured mode
R1 = configured monitor type
R2 = configured sync
This SWI reads the configured mode, monitor type and sync type as previously. Whilst the values are configurable, it is recommended that they be set to Auto except where this is a problem. The automatic detection of monitor type will be performed by the video hardware as necessary.
OS_ReadSysInfo 2
Read chip presence and unique machine ID
On entry
R0 = 2
On exit
R0 = hardware configuration word 0 :
bits 0-7 = special functions chip type:
0 = none
1 = IOEB
bits 8-15 = I/O controller chip type:
0 = IOC
1 = IOMD
255 = undefined
bits 16-23 = Memory controller chip type:
0 = MEMC1/MEMC1a
1 = IOMD
255 = undefined
bits 24-31 = video controller chip type:
0 = VIDC1a
1 = VIDC20
255 = undefined
R1 = hardware configuration word 1 :
bits 0-7 = I/O chip type:
0 = none
1 = 82C710/711, or SMC'665 or similar
bits 8-31 = reserved
R2 = hardware configuration word 2 :
bits 0-7 = LCD controller type:
0 = none
1 = A4 controller
2 = 'Stork' controller
bits 8-15 = IOMD type:
0 = IOMD
1 = IOMDL
255 = none
bits 16-23 = VIDC20 type:
0 = VIDC20
1 = VIDC2L
255 = none
bit 24 = IIC bus speed (unset = 100kHz, set = 400kHz)
bit 25 = IO clock state when idling (unset = running, set = stopped)
bits 26-31 = reserved
R3 = unique machine ID word 0
R4 = unique machine ID word 1
This SWI is used to read information on the hardware used within the system. In many cases this will be determined by the hardware drivers rather than the Kernel, and it is therefore prudent to interrogate the specific hardware driver modules rather than the Kernel. The Kernel restricts itself, in general, to those tasks which it is vital to perform for system start up and management. The operation of the hardware devices outside of this is the domain of the hardware drivers and correspondingly many of the fields may appear as 'undefined'.
OS_ReadSysInfo 3
Read features mask for 82C710-compatible chip family
On entry
R0 = 3
On exit
R0 = basic features mask :
bits 0-3 = IDE interface:
0 = absent
1 = present
bits 4-7 = floppy disc interface
0 = absent
1 = present
bits 8-11 = parallel port
0 = absent
1 = present, original device number assignment
2 = present, alternate device number assignment
bits 12-15 = 1st serial port
0 = absent
1 = present, original device number assignment
2 = present, alternate device number assignment
bits 16-19 = 2nd serial port
0 = absent
1 = present, original device number assignment
2 = present, alternate device number assignment
bits 20-23 = chip configuration type
0 = no chip present, or largely incompatible
1 = 82C710
2 = 82C711
3 = SMC'665
4 = SMC'669
5 = UMC'669
bits 24-31 = reserved
R1 = extra features mask :
bits 0-3 = IDE interface features (all reserved)
bits 4-7 = floppy interface features (all reserved)
bits 8-11 = parallel port features :
bit 8 = fast parallel present
bits 9-11 reserved
bits 12-15 = 1st serial port features :
bit 12 = FIFOs available
bits 13-15 reserved
bits 16-19 = 2nd serial port features :
bit 16 = FIFOs available
bits 17-19 reserved
bits 20-23 = chip configuration (all reserved)
bits 24-31 = reserved
R2-R4 = 0
This SWI has been updated to reflect the modern usage of the hardware IO chips used in RISC OS systems to date. It will return 0 in all fields for non-82710-compatible chipsets. See PRM 1-723 and PRM 5a-221 for more details.
OS_ReadSysInfo 4
Read machine ethernet address
On entry
R0 = 4
On exit
R0 = Ethernet MAC address word 0, or 0 if not known
R1 = Ethernet MAC address word 1, or 0 if not known
This SWI is used to read the machine's ethernet address. It should only be used within constrained environments where only a single ethernet network interface is available. This SWI was introduced to allow simpler expansion of systems with only a single network interface. It is recommended that network drivers should only use their own unique MAC address in preference to this value.
OS_ReadSysInfo 5
Read raw machine ID
On entry
R0 = 5
On exit
R0 = raw machine ID word 0
R1 = raw machine ID word 1
This SWI is used to read the raw machine ID as read from the system hardware. No interpretation should be placed upon the value by clients.
OS_ReadSysInfo 6
Read kernel values
On entry
R0 = 6
R1 = pointer to list of kernel values to read
R2 = pointer to block to fill in with values
On exit
block at R2 filled in
or
On entry
R0 = 6
R1 = 0
R2 = single kernel value to read
On exit
R2 = value of single item
This SWI can be used to obtain information about the Kernel's internal variables which it chooses to export. The variables are subject to change and may have caveats on their use. They are only expected to be used by components where the operation required is not supported by defined interfaces. In such cases, using the information provided by OS_ReadSysInfo 6 is preferred over using hard-coded values. Using information provided by more structured interfaces which the OS provides is preferred over using OS_ReadSysInfo 6.
The following values are defined. Strictly they are reserved for internal use, but are provided for completeness.
0 Address of OS page table
1 Pointer to number of highest OS page table entry
2 Value of page table PPL value for unavailable pages
3 Address of physical memory table
4 Address of cache cleaner flip-flop
5 Address of pointer to internal ticker chain
6 Address of pointer to ROM module chain
7 Address of pointer to internal dynamic area list
8 Address of application space dynamic area node
9 Address of pointer to module chain
10 Number of entries in SWI hash table
11 Address of SWI hash table
12 Address of I/O system type flags
13 Address of L1 page table (obsolete, see SystemDAs)
14 Address of L2 page table (obsolete, see SystemDAs)
15 Address of top of UND mode stack (obsolete, see SystemDAs)
16 Address of top of SVC mode stack (obsolete, see SystemDAs)
17 Address of start of system heap
18 Address of Kernel MessageTrans block
19 Address of error semaphore
20 Address of OS_PrettyPrint dictionary (obsolete, see OS_PrettyPrint)
21 Timer 0 latch value
22 FastTickerV counts per second
23 Address of vector claimants table
24 Number of vectors supported
25 Address of top of IRQ mode stack (obsolete, see SystemDAs)
26 Address of SWI dispatch table
27 Address of branch back to OS after SWIs
Any item may return an error, or the value 0 when being read to indicate that it is unavailable.
OS_ReadSysInfo 7
Read last abort details
On entry
R0 = 7
On exit
R0 preserved
R1 = 32-bit PC of last abort
R2 = 32-bit PSR of last abort
R3 = fault address of last abort
This SWI returns the details about the last failing abort. The fault address is the same as the 32bit PC for a pre-fetch abort. For a data abort, it contains the address whose access caused the abort. Aborts which are handled by other components may occur, and do not update these details. Such aborts are handled by the OS_AbortTrap interface, or the DynamicArea abort handlers. See documents OS_AbortTrap, OSDynamicArea, and AbortableDAs for more details.
OS_ReadSysInfo 8
Read platform class
On entry
R0 = 8
On exit
R0 = platform class :
0 = unknown
1 = RiscPC
2 = A7000
3 = A7000+ (including RiscStation)
4 = allocated to Phoebe
5 = allocated to Pace abstracted kernel based systems
6 = allocated to VirtualRPC
7 = A9
R1 = platform feature flags :
bit 0 = supports podule devices
bit 1 = supports PCI devices
bit 2 = supports additional processors
bit 3 = allocated for external use
bit 4 = operating system is RAM loaded
R2 = platform feature support. Bits set in line with values in R0 if feature defined
This SWI is used to read details about the platform upon which the OS is running.
OS_ReadSysInfo 9
Read ROM information
On entry
R0 = 9
R1 = item to return :
0 = OS name
1 = Release part number
2 = Build date
3 = Dealer name
4 = User name
5 = User address
6 = Printable OS description
other values reserved
On exit
R0 = pointer to requested string or 0 if item is not defined
This SWI is used to read details about the ROM build and details. It may be used to read additional information about the system in order to provide diagnostics. It is important that privacy concerns be addressed if such information is distributed, particularly if the user name and address fields are to be exported.
OS_ReadSysInfo 10
Read OS version
On entry
R0 = 10
On exit
R0 = OS version number * 100
R1 = Kernel version number * 100
R2 = SystemInit version number and system type:
bits 0-15 = version number
bits 16-31 = init type:
0 = RiscPC
other = reserved
R3 = Reserved (0)
This SWI is used to read the version number of the Operating System and Kernel. In order to differentiate between the OS as a whole and the Kernel itself, this SWI provides a mechanism for reading the version number of both.
The operating system version is contained within the help string for the UtilityModule. This describes the system as a whole. It should be used when checking for the general level of compatibility is required.
The Kernel version has, in the past, only been returned by the return from OS_Byte 0 as part of the error report. This interface defines a mechanism by which the version can be obtained without needing to parse a free-format string.
The SystemInit version number and system type are returned by the initialisation code and indicate the basic loader which is used to enter the Operating System.
The value returned in R3 will be defined in a future version of this call, and should not be interpreted by software.
This SWI call is available from Kernel 9.03.
OS_ReadSysInfo 11
Read debug information
On entry
R0 = 11
On exit
R0 = pointer to function for debug character output
R1 = pointer to function for debug character input
This SWI is used to read the diagnostic functions provided by the SystemInit code in order to debug the system. Usually this is a simple serial I/O stream which is managed by the SystemInit code, although other mechanisms may be employed dependant on hardware. The functions are expected to be called from a privileged mode, although operation in non-privileged modes is at that discretion of the SystemInit code. The functions have the following parameters:
Debug output function
On entry
R0 = character to write to debug stream
On exit
R0-R3, PSR corrupt
Debug input function
On entry
none
On exit
R0 = character read from debug stream, or -1 if no character available
R1-R3, PSR corrupt
Both routines expect a small amount of stack to be available.
|