diff --git a/drivers/nvme/nvme.asm b/drivers/nvme/nvme.asm index 13daa8e..bd5c970 100644 --- a/drivers/nvme/nvme.asm +++ b/drivers/nvme/nvme.asm @@ -178,6 +178,8 @@ proc determine_active_nsids stdcall, pci:dword invoke GetPhysAddr stdcall nvme_identify, [pci], 0, eax, CNS_IDCS mov eax, dword [esi + IDENTC.nn] + mov edx, [pci] + mov dword [edx + pcidev.nn], eax test eax, eax jz .fail invoke KernelAlloc, 0x1000 @@ -191,10 +193,12 @@ proc determine_active_nsids stdcall, pci:dword .loop: cmp ecx, dword [esi + IDENTC.nn] jg .success - stdcall nvme_identify, [pci], ecx, ebx, CNS_IDNS + stdcall nvme_identify, [pci], ecx, ebx, CNS_IDNS ; identify N'th namespace push ecx xor ecx, ecx +; We want to check if entire struct is zeroed out, if so, it is not an active NSID, +; otherwise it is .inner_loop: mov eax, dword [edi + ecx * 4] test eax, eax