CD(9)
πΏ CD(9) β the cd driver, bestie edition β¨
okay so this is cd, section 9 of the Kernel Developer's Manual β yes, the kernel developer one, not the shell command, don't @ me π it's the CDROM driver for the CAM SCSI subsystem and she's iconic.
πΈ NAME πΈ
cd β the CDROM driver for the CAM SCSI subsystem. that's it. that's the girl. π
β¨ DESCRIPTION β¨
so the cd device driver hands you a read-only interface for CDROM drives (that's SCSI type 5 π) and WORM drives (SCSI type 4) that support CDROM type commands. slay.
but lowkey? some drives do NOT behave the way the driver expects. like, at all. π so if your drive is being extra, go read the βQUIRKSβ section below for info on possible flags. iykyk.
π¦ QUIRKS π¦
every single CD-ROM device can have its own little interpretation of the SCSI spec, which is so on brand for hardware honestly. and that can lead to drives needing special handling in the driver. here's the full list of quirks the driver recognizes β no skips, no cuts, we list them all:
CD_Q_NO_TOUCHβ tells the driver not to probe the drive at attach time to see if there's a disk in there and figure out what size it is. > heads up bestie: this flag is currently unimplemented in the CAM cd driver. so yeah. it's giving placeholder. πCD_Q_BCD_TRACKSβ this one's for broken drives that return track numbers in packed BCD instead of straight decimal. if your drive seems to be skipping tracks (like tracks 10-15 just vanish β¨), congrats, you have a drive that is in need of this flag. not me diagnosing your hardware through a manpage.CD_Q_NO_CHANGERβ tells the driver that the device in question is not a changer. you only need this for a CDROM device with multiple luns that are not part of a changer. niche but valid.CD_Q_CHANGERβ tells the driver that the given device is a multi-lun changer. in general the driver will figure this out all by itself when it sees a LUN greater than 0 (main character energy, honestly). setting this flag only 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β tells the driver that the given device only accepts 10 byteMODE SENSE/MODE SELECTcommands. now listen β in general these types of quirks should not be added to thecd(4)driver. why? because the driver already does several things to try to figure out whether the drive in question needs 10 byte commands:- first, it issues a CAM Path Inquiry command to determine whether the protocol the drive speaks typically only allows 10 byte commands. (ATAPI and USB are 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.
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. periodt.
π FILES π
/sys/cam/scsi/scsi_cd.cβ is the driver source file. that's where the magic lives, go read her π«Ά
π₯ SEE ALSO π₯
π HISTORY π
the cd manual page first appeared in FreeBSD 2.2. a true legend. a pioneer. we stan an OG. π
π AUTHORS π
this manual page was written by John-Mark Gurney <jmg@FreeBSD.org>. it was then updated for CAM and FreeBSD 3.0 by Kenneth Merry <ken@FreeBSD.org>. thank you for your service, kings π«‘
and that's the whole vibe check bestie π this page is from Debian, dated March 25, 2014, living in section 9 of the Kernel Developer's Manual. go forth and mount something. πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1997 John-Mark Gurney. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms