CD(9)
πΏ CD(9) β the CDROM driver page, but make it make sense β¨
okay so bestie, welcome to CD(9), straight out of the Kernel Developer's Manual π this is the page all about the cd driver and honestly it's giving "niche but iconic" β let's get into it π
πΈ NAME πΈ
cd β the CDROM driver for the CAM SCSI subsystem π¦
β¨ DESCRIPTION β¨
So the cd device driver is a read-only interface for CDROM drives (that's SCSI type 5, iykyk) and WORM drives (SCSI type 4) that support CDROM type commands π
β οΈ real talk: some drives just do not behave the way the driver expects π don't panic though β check out the βQUIRKSβ section below for the flags that might save you π«Ά
π QUIRKS π
ngl this is the messy part. every single CD-ROM device can have a totally different interpretation of the SCSI spec, which means some drives need special handling in the driver π here's the full list of quirks the driver recognizes, no skips, no cuts:
CD_Q_NO_TOUCHβ this flag tells the driver not to probe the drive at attach time to see if there's a disk in the drive and to find out what size it is. β heads up tho: this flag is currently unimplemented in the CAMcddriver. so like... it's in the list, it's just not doing anything yet πCD_Q_BCD_TRACKSβ this one's for the broken drives that return track numbers in packed BCD instead of straight decimal π if your drive seems to skip tracks (like, tracks 10-15 are just... gone), congrats, you've found a drive that needs this flag π―CD_Q_NO_CHANGERβ this flag tells the driver that the device in question is not a changer. the only time you actually need this is for a CDROM device with multiple LUNs that are not part of a changer π§CD_Q_CHANGERβ this flag tells the driver that the given device is a multi-lun changer. generally the driver figures this out automatically when it sees a LUN greater than 0, so setting this flag only really does one thing: it tells the driver to run the initial read capacity command for LUN 0 of the changer through the changer scheduling code πCD_Q_10_BYTE_ONLYβ this flag tells the driver that the given device only accepts 10 byteMODE SENSE/MODE SELECTcommands. but bestie, hear me out β in general these types of quirks should not be added to thecd(4)driver, and here's why: the driver already does a whole bunch of stuff to work out whether the drive in question needs 10 byte commands π- first, it issues a CAM Path Inquiry command to determine whether the protocol that the drive speaks typically only allows 10 byte commands. (
ATAPIandUSBare two prominent examples of protocols where you generally only want to send 10 byte commands.) π₯ - then, if it gets an
ILLEGAL REQUESTerror back from a 6 byteMODE SENSEorMODE SELECTcommand, it attempts to send the 10 byte version of the command instead β¨
- first, it issues a CAM Path Inquiry command to determine whether the protocol that the drive speaks typically only allows 10 byte commands. (
so the only reason you'd ever need this quirk is if your drive uses a protocol (e.g., SCSI) that typically does not have a problem with 6 byte commands. that's it, that's the tea π
π FILES π
/sys/cam/scsi/scsi_cd.cβ literally the driver source file, that's the whole vibe π
π SEE ALSO π
π¦ HISTORY π¦
the cd manual page first appeared in FreeBSD 2.2 β a true elder icon, we respect her π
π AUTHORS π
this manual page was written by John-Mark Gurney <jmg@FreeBSD.org> π«Ά and it was updated for CAM and FreeBSD 3.0 by Kenneth Merry <ken@FreeBSD.org> πΈ
and that's the whole page, bestie β no cap, every quirk accounted for π
this lil gem came to you from the Debian edition of the page, dated March 25, 2014 β mwah, go read cd(4) next πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1997 John-Mark Gurney. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms