How to add NVME Driver to UEFI Bootloader

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

How to add NVME Driver to UEFI Bootloader

Post 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.
Octocontrabass
Member
Member
Posts: 5560
Joined: Mon Mar 25, 2013 7:01 pm

Re: How to add NVME Driver to UEFI Bootloader

Post 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.
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

Re: How to add NVME Driver to UEFI Bootloader

Post 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 ?
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

Re: How to add NVME Driver to UEFI Bootloader

Post 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.
User avatar
zaval
Member
Member
Posts: 656
Joined: Fri Feb 17, 2017 4:01 pm
Location: Ukraine, Bachmut
Contact:

Re: How to add NVME Driver to UEFI Bootloader

Post 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.
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

Re: How to add NVME Driver to UEFI Bootloader

Post 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.
Post Reply