
Theo Markettos investigates the little known feature of RISC OS Select and Adjust: the hardware profile system, which allows users to associate system and application choices with particular hardware configurations.
The instigation of a new Linux-based network backup system for my RiscPC gave me the chance to keep the hard drives of my RiscPC and VirtualAcorn laptop, both running RISC OS Adjust, synchronised. Whilst I've not automated this yet, I ran into a problem when using the RiscPC's hard drive image on VirtualRiscPC, as the emulator would complain when trying to configure hardware only found on the RiscPC, and vice versa.
Aha! I thought. Just the ticket for Adjust's hardware profiles feature. Unfortunately these don't seem to be documented anywhere so I set out to find out how they worked. Apparently this functionality has been working since Select version 1, but currently has no front end. RISC OS Ltd don't like you messing about inside !Boot and this isn't officially supported - but for those who are interested, read on.
The idea behind hardware profiles is that the boot sequence checks the hardware of the machine and compares it to that it already knows about. It will either pick the configuration for the nearest hardware setup it has already seen, or ask whether to create a new configuration. Each can be configured independently - for example on a network of machines with different Ethernet cards, you can have one network boot sequence with different hardware profiles to configure each type of card. At home you might sometimes remove a SCSI card and want to ensure that the software for it isn't loaded when it isn't present.
All the work is done by !Boot.Utils.HWScan. This is run on boot, and usually says:
Profile: Hardware profiles disabled
To enable it, you must change the contents of !Boot.Choices.Hardware.Config from 'disabled' to 'automatic' or 'manual'. Let's set it to 'manual'. If we then run /Boot:Utils.HWScan in a Taskwindow, it says:
*/Boot:Utils.HWScan
Profile: No hardware profiles present
Adding new hardware profile
Profile name:
and then prompts for a profile name. I entered 'Bream'.
It then creates a new directory of !Boot.Choices.Hardware.ID_0 and puts a copy of the default hardware configuration files in there: Boot and Internet directories. It also creates a file !Boot.Choices.Hardware.Profiles that contains:
@Bream
[Bream] 0
ROM declaration: RISC OS Ally Adjust
ROM part number: 20040317-001
ROM build: Wed,17 Mar 2004.23:00:28
ROM dealer: RISCOS Ltd
ROM user: A Markettos
Memory DRAM: 32MB
Memory VRAM: 2MB
Memory ROM: 4MB
Memory I/O space: 136MB
Memory SoftROM: 0MB
Chips Special chip: none
Chips IO control: IOMD
Chips Video: VIDC20
Chips IO chip: 82C710/711/SMC665
Chips LCD: none
Chips IOMD variant: IOMD
Chips VIDC20 variant: VIDC20
Chips IO config: type 3
Machine Platform: RPC
and so on. The first line means that the last known profile was called 'Bream', whilst the following lines create a profile called 'Bream' with ID 0 and describe the hardware of the machine.
Now, if we reboot the machine we find it is using the hardware profile called 'Bream'. This means that hardware specific configuration like network settings will be stored in the !Boot.Choices.Hardware.ID_0 directory rather than the usual place for Choices. Unfortunately not many programs know about this feature, so you may have to move manually choices directories here from the place applications put them (probably !Boot.Choices.Users.Single). The directory for the current profile is pointed to by ChoicesHardware$Dir, whilst ChoicesHardware$ID gives the ID number and ChoicesHardware$Name the profile name.
So let's change the hardware - for the sake of demonstration configure another floppy drive with !Boot and restart. We find:
Related articles
RISC OS 6.10 available to Select subscribers
Select 4 upgrade pack released
Select nets 1,000th subscriber
This article has been linked to, or is available in the following formats:
| [Printable] | [Digg this] | [Blog search] |