mirror of
https://git.missingno.dev/kolibrios-nvme-driver/
synced 2024-12-23 06:18:47 +01:00
feat: add in write to disk functions and remove unnecessary div in nvme_init
This commit is contained in:
parent
e3241e35cc
commit
1b88a4ff17
@ -1108,6 +1108,7 @@ proc nvme_init stdcall, pci:dword
|
|||||||
mov ecx, dword [edi + IDENTN.lbaf0]
|
mov ecx, dword [edi + IDENTN.lbaf0]
|
||||||
shr ecx, 16 ; Get LBADS
|
shr ecx, 16 ; Get LBADS
|
||||||
and ecx, 0xff
|
and ecx, 0xff
|
||||||
|
movzx edx, cl
|
||||||
dec ecx
|
dec ecx
|
||||||
mov eax, 2
|
mov eax, 2
|
||||||
shl eax, cl
|
shl eax, cl
|
||||||
@ -1119,10 +1120,9 @@ proc nvme_init stdcall, pci:dword
|
|||||||
jne .exit_fail
|
jne .exit_fail
|
||||||
|
|
||||||
mov dword [ebx + NSINFO.lbads], eax
|
mov dword [ebx + NSINFO.lbads], eax
|
||||||
mov ecx, PAGE_SIZE
|
mov eax, PAGE_SIZE
|
||||||
xchg eax, ecx
|
mov cl, dl
|
||||||
xor edx, edx
|
shr eax, cl
|
||||||
div ecx
|
|
||||||
mov dword [ebx + NSINFO.pg_sectors], eax
|
mov dword [ebx + NSINFO.pg_sectors], eax
|
||||||
invoke KernelFree, edi
|
invoke KernelFree, edi
|
||||||
if 0
|
if 0
|
||||||
@ -1468,7 +1468,7 @@ align 4
|
|||||||
dd 0 ; no closemedia function
|
dd 0 ; no closemedia function
|
||||||
dd nvme_query_media
|
dd nvme_query_media
|
||||||
dd nvme_read
|
dd nvme_read
|
||||||
dd 0 ; no write function (for now)
|
dd nvme_write
|
||||||
dd 0 ; no flush function
|
dd 0 ; no flush function
|
||||||
dd 0 ; use default cache size
|
dd 0 ; use default cache size
|
||||||
.end:
|
.end:
|
||||||
|
Loading…
Reference in New Issue
Block a user