NVMe: Difference between revisions

53 bytes added ,  2 months ago
m
Reverted edits by Xing1357 (talk) to last revision by Moltony112
[unchecked revision][unchecked revision]
No edit summary
m (Reverted edits by Xing1357 (talk) to last revision by Moltony112)
 
(6 intermediate revisions by 5 users not shown)
Line 1:
 
The [https://nvmexpress.org/resources/specifications/ NVMe Specifications] can be found here.
 
Forum thread about this page [https://forum.osdev.org/viewtopic.php?f=8&t=36366 here].
 
== Overview ==
 
* NVMe controllers can be found as [[PCI]] devices with class code 1 and subclass code 8.
* Its registers are accessible through BAR 0 (it should be 64-bit memory IO).
* The controller processes commands submitted to it from "submission queues". The driver prepares commands in the queue's circular buffer in memory, and then updates the tail pointer register for the queue.
Line 125 ⟶ 120:
=== PRP ===
 
A PRP (physical region page) is a 64-bit physical memory address. It must be DWORD aligned. A list of PRPs is used in a data transfer to specific, where data is transferred from/to in memory. A PRP list is subject to the follow rules:
 
* The size of the region specified by a given PRP is the minimum of: the amount of data that can be transferred without crossing a page boundary; and the amount of data remaining to be transferred.
Line 168 ⟶ 163:
=== Admin commands ===
 
==== Create IO completionsubmission queue ====
 
* Opcode is 0x050x01.
* The base address of the queue should be put in the DWORDs 6 and 7 of the commands.
* Command DWORD 10 contains the queue identifier in the low word, and the queue size in the high word. The queue size should be given as one less than the actual value.
* Command DWORD 11 contains flags in the low word, and the interruptcompletion vectorqueue identifier in the high word (where completion entries for this submission queue will be posted). Flag (1 << 0) indicates the queue is physically contiguous (recommended; non-contiguous are not supported by all controllers), and flag (1 << 1) enables interrupts.
 
==== Create IO submissioncompletion queue ====
 
* Opcode is 0x010x05.
* The base address of the queue should be put in the DWORDs 6 and 7 of the commands.
* Command DWORD 10 contains the queue identifier in the low word, and the queue size in the high word. The queue size should be given as one less than the actual value.
* Command DWORD 11 contains flags in the low word, and the completioninterrupt queue identifiervector in the high word (where completion entries for this submission queue will be posted). Flag (1 << 0) indicates the queue is physically contiguous (recommended; non-contiguous are not supported by all controllers), and flag (1 << 1) enables interrupts.
 
==== Identify ====
Line 245 ⟶ 240:
* Use the submission queue ID and command ID to work out which submitted command corresponds to this completion entry.
* Update the completion queue head doorbell register.
 
== See Also ==
 
=== External Links ===
 
The* [https://nvmexpress.org/resources/specifications/ NVMe Specifications] can be found here.
 
=== Forum Threads ===
 
Forum thread about this page* [https://forum.osdev.org/viewtopic.php?f=8&t=36366 here].
 
[[Category:Storage]]
[[Category:Standards]]
Anonymous user