Page 1 of 1
How to add NVME Driver to UEFI Bootloader
Posted: Mon Mar 20, 2023 3:14 pm
by devc1
Is there anyway to add NvmeDxe driver to my UEFI bootloader, if I enumerate through the block_io protocol I cannot find the NVME Drive.
I use EDK2.
Re: How to add NVME Driver to UEFI Bootloader
Posted: Mon Mar 20, 2023 3:54 pm
by Octocontrabass
It should be possible, but the only way I know how to do it is to add a driver entry to the boot manager and then reboot.
Re: How to add NVME Driver to UEFI Bootloader
Posted: Mon Mar 20, 2023 3:58 pm
by devc1
what do you mean boot manager ? Is it the thing that I read in the UEFI spec that windows creates in the System Partition and names "bootmgr.efi" or bootmgfw.efi ?
Re: How to add NVME Driver to UEFI Bootloader
Posted: Mon Mar 20, 2023 4:10 pm
by Octocontrabass
Re: How to add NVME Driver to UEFI Bootloader
Posted: Mon Mar 20, 2023 4:12 pm
by devc1
I added the NvmExpressDxe.efi driver to the boot maintenance manager in QEMU but it still doesn't detect the nvme drive.
It adds the driver to the driver order but after restart nothing appears there.
Re: How to add NVME Driver to UEFI Bootloader
Posted: Mon Mar 20, 2023 5:56 pm
by zaval
devc1 wrote:Is there anyway to add NvmeDxe driver to my UEFI bootloader, if I enumerate through the block_io protocol I cannot find the NVME Drive.
I use EDK2.
you confused things heavily. your loader is a UEFI application and it should not add any drivers, not to mention Dxe drivers. the latter are part of internal UEFI implementation, that follows the PI specification. BLOCK_IO is produced by the firmware and your loader consumes it. the platform already has NVMe drivers to handle NVMe controllers/storage devices. if you are about to provide your own driver for that, it still should not be part of the loader.
InstallProtocolInterface(), ConnectController() and friends are of your interest if you want to extend the firmware. but it's not about Dxe drivers, it's about UEFI driver model drivers. Dxe is internals, it should be of interest for only those, who participates to EDK2. even extending it implies using UEFI driver model drivers. but it's so far away from the loader... it doesn't need to do all this.
you say, you use EDK2. how? as a consumer/client? then just write your loader and don't get into depths, you don't need to get for this. if you are extending/writing your own firmware, then read above.
Re: How to add NVME Driver to UEFI Bootloader
Posted: Mon Mar 20, 2023 10:35 pm
by devc1
It's because I have an old pc and to use my nvme drive I have the clover bootloader on the hdd that automaticly runs windows on my nvme. And in order for clover to support nvme you just need to add NvmExpressDxe.efi in the driver directory and it can detect windows inside the nvme drive.