Drobe :: The archives
About Drobe | Contact | RSS | Twitter | Tech docs | Downloads | BBC Micro

Select hardware profiles uncovered

By Theo Markettos. Published: 2nd Jan 2005, 00:05:38 | Permalink | Printable

But it's elementary, my dear Watson

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.

RiscPC hardware motifAha! 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

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] 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:

Hardware profile boot menu
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


Viewing threaded comments | View comments unthreaded, listed by date | Skip to the end

A very interesting article.

 is a RISC OS Usersa110 on 2/1/05 10:30AM
[ Reply | Permalink | Report ]

I don't think I'll fiddle with this anymore. I tried the above and with profiles left in it blocked my broadband connection - net card not recognised?

 is a RISC OS Userjlavallin on 2/1/05 10:51AM
[ Reply | Permalink | Report ]

On the same vain I should point out another useful info regarding not hardware profiles but user profiles. !Boot.Choices.Default can be used to store the configuration files that should be common to all users (like Internet.Files.Mimemap).

 is a RISC OS Userandretim on 2/1/05 10:54AM
[ Reply | Permalink | Report ]

User profiles - sounds more usefull. I would like both !Dialup2 and !Netfetch2 to be able the same accounts for both mail and news. At the moment 'Dun' is blocked and only 'Dem' is available from Newshound. I don't want thousands of duplicate posts.

 is a RISC OS Userjlavallin on 2/1/05 11:18AM
[ Reply | Permalink | Report ]


One thing to be aware of is that the default profile for 'create a new clean profile' comes from !Boot.Choices.Hardware.Blank, whereas 'treat as a new profile based on ...' will in theory copy the profile you were using last time or the one with a configuration nearest to what you have now as use that (it only seems to use the blank profile in my experiments though). It won't use any settings made in Profiles Disabled mode - you start from a hardware unconfigured machine again - though the only part of the OS that uses profiles is the network settings. So if you have any settings you want to retain across all profiles it's best to either copy them from !Boot.Choices.Hardware.Disabled to !Boot.Choices.Hardware.Blank, or better create a first new profile, put them in there, and treat all new profiles as based on this.

 is a RISC OS Usercaliston2 on 2/1/05 5:59PM
[ Reply | Permalink | Report ]

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

  • An introduction to IP networks
    Part one of masking the 'net
     10 comments, latest by Umair on 9/9/04 10:11PM. Published: 4 Sep 2004

  • Random article

  • Select 2i3 stable release
    CDs of RISC OS 4.33 out ASAP, 32bit Shared C Library softloading now permitted
     6 comments, latest by takkaria on 21/11/02 4:17PM. Published: 20 Nov 2002

  • Useful links

    News and media:

    Top developers:
    RISCOS LtdRISC OS OpenMW SoftwareR-CompAdvantage SixVirtualAcorn

    CJE MicrosAPDLCastlea4X-AmpleLiquid SiliconWebmonster


    RISCOS.org.ukRISCOS.orgRISCOS.infoFilebaseChris Why's Acorn/RISC OS collectionNetSurf

    Non-RISC OS:
    The RegisterThe InquirerApple InsiderBBC NewsSky NewsGoogle Newsxkcddiodesign

    © 1999-2009 The Drobe Team. Some rights reserved, click here for more information
    Powered by MiniDrobeCMS, based on J4U | Statistics
    "No comment. No comment. I said, no comment!"
    Page generated in 0.0907 seconds.