Select hardware profiles uncoveredBy Theo Markettos. Published: 2nd Jan 2005, 00:05:38 | Permalink | Printable
But it's elementary, my dear WatsonTheo 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:
Profile: No hardware profiles present
Adding new hardware profile
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:
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:
Click for larger image
Here we have the options to create a new profile or use an existing one. 'HELP!' documents the profiles system and explains the different options. For demonstration we use 'N) treat this as a new clean profile' to create another profile called 'Dover Sole'. This creates a directory of !Boot.Choices.Hardware.ID_1 and a virgin copy of the default configuration in there. Any changes made to the previous settings of 'Bream' won't be reflected here. Similarly any reconfiguration we make here won't affect 'Bream'. What's more is that if we change the hardware back to the original, RISC OS will notice and automatically switch to the 'Bream' profile. So every time we change the hardware RISC OS will select the appropriate profile.
Putting 'automatic' in !Boot.Choices.Hardware.Config will select the default option every time the machine sees an unknown hardware setup. With changes to the number of drives present it opts for to create new profile each time and demands a name for it: so changes still require user input to boot. Changes to the amount of memory in the machine opt to use an existing profile - that the amount of RAM arguably doesn't affect the operation of the machine and so doesn't require a different profile.
So, that just about covers it. The hardware configuration directory is on Choices$Path, so if you move choices directories there applications should still be able to read them, even if they don't understand the hardware profiles system, and will still write their new configuration in the old place. One downside from this system is that it doesn't seem possible for one profile to depend on another - so if you want different profiles to deal independently with presence or absence of a SCSI card and a network card, you'll need to create profiles for all combinations of them. Similarly, any changes you make to profile-specific settings will only be reflected in the current profile: so if you change the network settings after inserting the SCSI card it won't affect the network settings in the profile where the SCSI card isn't present.
Despite this it's a useful system that should make dealing with multiple hardware configurations much easier.
RISC OS Adjust website
Previous: RISC OS show details for 2005
Next: Of C Libraries and RISC OS
DiscussionViewing threaded comments | View comments unthreaded, listed by date | Skip to the end
Please login before posting a comment. Use the form on the right to do so or create a free account.
Search the archives
Today's featured article
Review: A9home v. Koolu
Clash of the tiniest
31 comments, latest by polas on 18/10/07 6:03PM. Published: 15 Oct 2007
Blogging helped me code says developer
Author found keeping online diary helps meet deadlines
5 comments, latest by Gerph on 20/7/06 10:45PM. Published: 16 Jul 2006
News and media:
RISCOS Ltd •
RISC OS Open •
MW Software •
Advantage Six •
CJE Micros •
Liquid Silicon •
Chris Why's Acorn/RISC OS collection •
The Register •
The Inquirer •
Apple Insider •
BBC News •
Sky News •
Google News •