Selecting entries in boot manager without using keyboard

3

My goal is rather simple to put in words: I want to install Windows and Chrome OS in dual boot on my Surface Go 2 and be able to select entries in the boot manager without having to use a physical keyboard or mouse (since I often don't have them around).

Because the Surface Go 2 is a touch-enabled x86 tablet with three built-in buttons (two volume buttons and a power button), this means that the boot manager should let me select boot entries either via touch screen or the vol+/vol- hardware buttons.

It must be noted that Chrome OS (or, to be more specific, brunch) requires grub for being loaded (as per the brunch developer's recommendation), so this hypothetical boot manager needs to chainload grub (to load Chrome OS) and the Windows boot manager (to load Windows).

The following is a list of boot managers I tried and what I tried doing with them. Unfortunately, nothing really worked.

grub:

  • As far as I'm aware, there's no config option or module that brings touch support to grub.
  • grub ignores hardware buttons by default. I tried making a custom keyboard layout for grub with the vol+/vol- buttons mapped to the up/down keys (as explained here). Unfortunately, whenever I set GRUB_TERMINAL_INPUT to at_keyboard, my Surface indefinitely freezes at boot time.
  • Apparently, in some Surface devices there's a firmware setting that brings a touch-enabled virtual keyboard throughout the boot phase (relevant reddit thread). Sadly, this setting is missing from the Go 2's firmware.

rEFInd:

  • I tried uncommenting the enable_touch setting in the refind.conf file, but rEFInd seems to be unable to load the correct touch screen drivers. Relevant SourceForge discussion.
  • rEFInd ignores hardware buttons. In a discussion on SourceForge, the rEFInd developer suggests modifying a specific C function of the rEFInd source code. I tried adding a default section to the switch statement that handles the buttons pressed by the user, and made it so that the selected boot entry scrolls to the right whenever I press any key. However, rEFInd seems unable to pick up on hardware buttons, which led me to believe that this is caused by a missing driver.

Windows Metro boot manager (henceforth WBM):

  • This one looks the most promising, as it comes with touch support out of the box. I tried adding an empty boot entry using the bcdedit command and indeed I managed to select it by tapping it with my finger.
  • Because it is obviously already capable of loading Windows, I only need it to chainload grub in order to load Chrome OS.
  • Unfortunately, when UEFI mode is active, it appears that the WBM is unable to chainload non-Windows operating systems (source). If I add a boot entry using bcdedit and make it load the EFI grub file, when I select this entry the boot manager throws error 0xc000007b.
  • Instead of making the boot entry load the EFI grub file, I tried installing grub in legacy mode and making the entry load it as a boot sector (as explained here and here) . It still throws error 0xc000007b.
  • Digging the web, I came across this forum thread. It appears that the WBM is only capable of loading EFI images whose type is BOOT_APPLICATION, whereas most EFI files (including grub's) are EFI_APPLICATION. On the second page of the thread, a person posted a code example of a mock BOOT_APPLICATION EFI program which simply prints some lines to the serial console, and supposedly it can be chainloaded by the WBM. I thought about making a similar EFI program which in turn chainloads the EFI grub file, but unfortunately it is quickly exceeding my technical and coding knowledge and I'm not even sure this is technically feasible.
  • Finally, I noticed that I can access the Windows recovery image from the WBM. This would effectively enable me to boot from the EFI boot manager's (not WBM's) entries via touch screen. However, I find this method very awkward, and since the WBM appears only when there are at least two boot entries, I'd have to keep a broken WBM entry. I'd rather find a more elegant way.

Is there anything else I should try, or is what I'm trying to achieve impossible?

boot
multi-boot
grub
uefi
microsoft-surface
asked on Super User Jan 6, 2021 by Maury • edited Jan 6, 2021 by Maury

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0