I'm using a computer, a Dell OptiPlex 9010, which comes with UEFI firmware, but does not support booting from PCI-Express NVMe devices.
I've worked around this by using DUET to create an EFI boot partition on a USB stick, which has an NVMe driver which it loads, and then executes my OS's EFI boot program.
The commands to do this are currently entered manually. Here is the process:
- Computer is turned off.
- Insert my DUET USB stick into a USB port (I just always leave it plugged in)
- Turn on the computer
- (The UEFI is configured to always boot from that USB stick first, and ignore the boot loaders in the other drives I have plugged in)
- The DUET USB stick loads an EFI shell (
EFI Shell version 2.31 [4.653])
mapcommand shows the DUET USB stick is automatically mounted at
- I load the NVMe driver:
- I trigger a refresh of volume mappings with
map -r, this command completes successfully without any issues.
- (My NVMe volume is now listed, sometimes as
fs1:but also sometimes as
- I boot into Windows by running:
- Windows' startup screen appears and the computer resumes to boot Windows
I tried to automate this by putting the commands inside a
startup.nsh script (the EFI equivalent of DOS'
My script is this:
echo Step 1 load fs0:\EFI\Drivers\NvmExpressDxe-64.efi echo Step 2 map -r echo Step 3 fs0: echo Step 4 fs0:\EFI\Boot\Bootx64.efi echo Step 5
(This script uses
fs0: instead of
fs1: because when
startup.nsh runs, my NVMe drive is remapped to
fs0:, but when I run the commands interactively instead it's mapped to
fs1:. I don't know why or how this happens).
When I boot up and let the shell execute
startup.nsh I get this output:
startup.nsh> Step 1 startup.nsh> load fs0:\EFI\Drivers\NvmExpressDxe-64.efi load: Image fs0:\EFI\Drivers\NvmExpressDxe-64.efi loaded at D7C3F000 - Success startup.nsh> Step 2 startup.nsh> map -r Device mapping table fs0 :PciRoot(0x0)/Pci(0x1c,0x4)/... fs1 :PciRoot(0x0)/Pci(0x1c,0x4)/... blk0 :PciRoot(0x0)/Pci(0x1c,0x4)/... ... Shell: Cannot read from file - No Media Shell> _
map -r is executed from within
startup.nsh it runs, but then fails with the "Cannot read from file - No Media" error, and it then aborts executing the rest of the script (as there is no
echo Step 3 output), however if I manually type in the
fs0:\EFI\Boot\Bootx64.efi command then Windows loads fine.
I looked at the EFI Shell Commands documentation and I don't see any command like
on error resume next or
on error goto :label - so the script is doomed to fail.