From 1b88a4ff17f546a7e05c65448827f34f82b8b8b8 Mon Sep 17 00:00:00 2001 From: Abdur-Rahman Mansoor Date: Tue, 23 Jul 2024 13:04:52 -0400 Subject: [PATCH] feat: add in write to disk functions and remove unnecessary div in nvme_init --- drivers/nvme/nvme.asm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/nvme/nvme.asm b/drivers/nvme/nvme.asm index c61842f..6f3d8e9 100644 --- a/drivers/nvme/nvme.asm +++ b/drivers/nvme/nvme.asm @@ -1108,6 +1108,7 @@ proc nvme_init stdcall, pci:dword mov ecx, dword [edi + IDENTN.lbaf0] shr ecx, 16 ; Get LBADS and ecx, 0xff + movzx edx, cl dec ecx mov eax, 2 shl eax, cl @@ -1119,10 +1120,9 @@ proc nvme_init stdcall, pci:dword jne .exit_fail mov dword [ebx + NSINFO.lbads], eax - mov ecx, PAGE_SIZE - xchg eax, ecx - xor edx, edx - div ecx + mov eax, PAGE_SIZE + mov cl, dl + shr eax, cl mov dword [ebx + NSINFO.pg_sectors], eax invoke KernelFree, edi if 0 @@ -1468,7 +1468,7 @@ align 4 dd 0 ; no closemedia function dd nvme_query_media dd nvme_read - dd 0 ; no write function (for now) + dd nvme_write dd 0 ; no flush function dd 0 ; use default cache size .end: