Engineering:Command descriptor block
In SCSI, the command descriptor block (CDB) is a structure used for sending commands between computers and peripheral devices. This is often particularly used as a standard for transferring data between computers and storage devices.[1][2]
Description
In the initial SCSI-1 specification, the CDB can be a total of 6, 10, 12, or 16 bytes.[3] Later versions of the SCSI standard such as iSCSI allow for variable-length CDBs.[4] The CDB consists of a one-byte operation code followed by some command-specific parameters.[3] The parameters need not be a full byte long, and the parameter length varies from one command to another.[1] The available commands, with links to articles describing the detailed structure of many of them, are listed in the article List of SCSI commands.
Typical CDB structures, for the 6- and 16-byte SCSI Request Sense Command, opcode 3, are:
Bit Byte [6]
|
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| 0 | Operation code = 03h | |||||||
| 1 | LUN | Reserved | ||||||
| 2 | Reserved | |||||||
| 3 | Reserved | |||||||
| 4 | Allocation length | |||||||
| 5 | Control | |||||||
Bit Byte
|
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| 0 | Operation code = 03h | |||||||
| 1 | LUN | Service Action | ||||||
| 2 | Logical Block (MSB) | |||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | Logical Block (LSB) | |||||||
| 6 | Addition CBP information | |||||||
| 7 | Addition CBP information | |||||||
| 8 | Addition CBP information | |||||||
| 9 | Addition CBP information | |||||||
| 10 | Allocation length (MSB) | |||||||
| 11 | ||||||||
| 12 | ||||||||
| 13 | Allocation length (LSB) | |||||||
| 14 | Misc. CDB data | |||||||
| 15 | Control | |||||||
An example with different allocation of bits to parameters is the 6-byte SCSI Mode Sense Command:[7]
Bit Byte
|
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| 0 | Operation code = 1Ah | |||||||
| 1 | LUN | Reserved | DBD | Reserved | ||||
| 2 | PC | Page code | ||||||
| 3 | Reserved | |||||||
| 4 | Allocation length | |||||||
| 5 | Control | |||||||
The generic form of the 12-byte CDB is:[3]
Bit Byte
|
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| 0 | Operation code | |||||||
| 1 | miscellaneous CDB information | SERVICE ACTION (if required) | ||||||
| 2 | Logical Block (MSB) | |||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 | TRANSFER LENGTH (if required) | |||||||
| 7 | PARAMETER LIST LENGTH (if required) | |||||||
| 8 | ALLOCATION LENGTH (if required) | |||||||
| 9 | ||||||||
| 10 | miscellaneous CDB information | |||||||
| 11 | CONTROL | |||||||
References
- ↑ 1.0 1.1 Buchanan, William (2000). Computer Busses: Design and Application. Elsevier Science. pp. 167–172. ISBN 9780340740767. https://www.google.com/books/edition/Computer_Busses/KhcEcNRkBHgC?hl=en&gbpv=1&dq=%22Command+Descriptor+Block%22&pg=PA167&printsec=frontcover.
- ↑ Warner, William C. (June 20, 1991). "Adapter and software simplify interface to SCSI peripherals". EDN (UBM Canon) 36 (13): 31–35. https://archive.org/details/bitsavers_EDNEDNV36N_46837082/page/31/.
- ↑ 3.0 3.1 3.2 3.3 3.4 Rahmel, Ron; Dan Rahmel (1995). Interfacing to the PowerPC Microprocessor. Sams Publications. pp. 297–298. ISBN 9780672305481. https://www.google.com/books/edition/Interfacing_to_the_PowerPC_Microprocesso/X45QAAAAMAAJ?hl=en&gbpv=1&bsq=%22Command+Descriptor+Block%22+%226%22+%2212%22+%2216%22&dq=%22Command+Descriptor+Block%22+%226%22+%2212%22+%2216%22&printsec=frontcover.
- ↑ Hufferd, John L. (2003). iSCSI: The Universal Storage Connection. Addison-Wesley. pp. 259–261. ISBN 9780201784190. https://www.google.com/books/edition/ISCSI/clx9Zrhr56sC?hl=en&gbpv=1&dq=%22+length%22+%22cdb%22+%22iSCSI%22&pg=PA260&printsec=frontcover.
- ↑ Black, John, ed (1992). The System Engineers Handbook. Morgan Kaufmann Publishers. pp. 333–334. ISBN 9780080519029. https://www.google.com/books/edition/The_System_Engineers_Handbook/82ylrSRpdbcC?hl=en&gbpv=1&dq=%22command+descriptor+block%22+%2216-bit%22&pg=PA333&printsec=frontcover.
- ↑ Glass, L. Brett (March 1990). "The SCSI Bus". Byte (McGraw-Hill) 15 (3): 291–298. https://archive.org/details/eu_BYTE-1990-03_OCR/page/n317/.
- ↑ SCSI Commands Reference Manual. Seagate Corporation. October 2016. pp. 97–100. https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf#page=97.
