Computational physicist William Somsky has put together a tool designed to make the installation and use of multiple operating systems on a single computer easier — by providing a physical switch to boot into a given OS.
"I've long had my computers set to dual boot between Linux and Windows, but always had to push keys at just the right time during the boot sequence to make my OS selection," Somsky explains. "Get distracted and the system boots into its default OS, even if that wasn't what I wanted. The solution is to have a hardware toggle which can be flipped beforehand and that the computer will read during boot to determine which OS it will boot into."
It's a concept well-rooted in history. Those who grew up around computers like the Commodore Amiga or Atari ST will well-remember workarounds for incompatibilities in upgraded ROMs that typically involved the installation of a multi-chip carrier board and a physical switch on the Chip Select pin to choose between them at boot time.
In effect, that's what Somsky has built — only rather than working on physical ROM chips it uses a microcontroller to present a USB Mass Storage device to the host system, containing the configuration file to tell the GRUB bootloader, which operating system is desired based on the position of a three-way hardware switch to the front.
Here, Somsky is building on the work of others: Stephen Holdaway built a similar device based on an STMicroelectronics STM32 microcontroller, followed by a modification based on a switchable USB flash drive; Madrajib Lab, meanwhile, created a version built around the Raspberry Pi Pico — providing Somsky with the means to port it to the compact Pimoroni Tiny 2040, based on the same Raspberry Pi RP2040 microcontroller.
"Since the RP2040 can internally perform pull-up on GPIO pins used for input, no further components beyond the switch and microcontroller board are needed," Somsky explains. "Further, with the small size of the Tiny 2040, I was able to do a minor bit of 'circuit sculpting' (with the aid of a couple paperclips for wiring) and attach the microcontroller directly onto the back of the switch. The resulting assembly is compact and sturdy and could be installed through a cut-out sized for panel-mounting the toggle switch."
Somsky's full write-up is available on the project's Hackaday.io page, though source code has not yet been shared. "I'm currently in the process of setting up a GitHub code repository for this project," Somsky explains.