home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Corel 10 Texture (image/corel10Texture)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX 2e document text
| default
| |
99%
| file
| LaTeX document text
| default
| |
98%
| file
| LaTeX document, ASCII text
| default
| |
100%
| TrID
| LaTeX 2e document
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| detectItEasy
| Format: Plain text[LF]
| default
| |
100%
| xdgMime
| text/x-tex
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 64 6f 63 75 6d 65 6e | 74 63 6c 61 73 73 7b 61 |\documen|tclass{a|
|00000010| 72 74 69 63 6c 65 7d 0a | 5c 64 65 66 5c 76 65 72 |rticle}.|\def\ver|
|00000020| 73 69 6f 6e 7b 24 49 64 | 3a 20 63 64 72 6f 6d 2d |sion{$Id|: cdrom-|
|00000030| 73 74 61 6e 64 61 72 64 | 2e 74 65 78 2c 76 20 30 |standard|.tex,v 0|
|00000040| 2e 36 20 31 39 39 36 2f | 30 35 2f 31 34 20 31 35 |.6 1996/|05/14 15|
|00000050| 3a 34 32 3a 33 39 20 64 | 61 76 69 64 20 45 78 70 |:42:39 d|avid Exp|
|00000060| 20 64 61 76 69 64 20 24 | 7d 0a 0a 5c 65 76 65 6e | david $|}..\even|
|00000070| 73 69 64 65 6d 61 72 67 | 69 6e 3d 30 70 74 0a 5c |sidemarg|in=0pt.\|
|00000080| 6f 64 64 73 69 64 65 6d | 61 72 67 69 6e 3d 30 70 |oddsidem|argin=0p|
|00000090| 74 0a 5c 74 6f 70 6d 61 | 72 67 69 6e 3d 2d 5c 68 |t.\topma|rgin=-\h|
|000000a0| 65 61 64 68 65 69 67 68 | 74 20 5c 61 64 76 61 6e |eadheigh|t \advan|
|000000b0| 63 65 5c 74 6f 70 6d 61 | 72 67 69 6e 20 62 79 20 |ce\topma|rgin by |
|000000c0| 2d 5c 68 65 61 64 73 65 | 70 0a 5c 74 65 78 74 77 |-\headse|p.\textw|
|000000d0| 69 64 74 68 3d 31 35 2e | 39 39 63 6d 20 5c 74 65 |idth=15.|99cm \te|
|000000e0| 78 74 68 65 69 67 68 74 | 3d 32 34 2e 36 32 63 6d |xtheight|=24.62cm|
|000000f0| 20 25 20 6e 6f 72 6d 61 | 6c 20 41 34 2c 20 31 27 | % norma|l A4, 1'|
|00000100| 27 20 6d 61 72 67 69 6e | 0a 0a 5c 64 65 66 5c 6c |' margin|..\def\l|
|00000110| 69 6e 75 78 7b 7b 5c 73 | 63 20 4c 69 6e 75 78 7d |inux{{\s|c Linux}|
|00000120| 7d 0a 5c 64 65 66 5c 63 | 64 72 6f 6d 7b 7b 5c 73 |}.\def\c|drom{{\s|
|00000130| 63 20 43 44 72 6f 6d 7d | 7d 0a 5c 64 65 66 5c 63 |c CDrom}|}.\def\c|
|00000140| 64 72 6f 6d 63 7b 7b 5c | 74 74 20 63 64 72 6f 6d |dromc{{\|tt cdrom|
|00000150| 2e 63 7d 7d 0a 5c 64 65 | 66 5c 63 64 72 6f 6d 68 |.c}}.\de|f\cdromh|
|00000160| 7b 7b 5c 74 74 20 63 64 | 72 6f 6d 2e 68 7d 7d 0a |{{\tt cd|rom.h}}.|
|00000170| 5c 64 65 66 5c 75 63 64 | 72 6f 6d 7b 7b 5c 74 74 |\def\ucd|rom{{\tt|
|00000180| 20 75 63 64 72 6f 6d 2e | 68 7d 7d 0a 0a 5c 65 76 | ucdrom.|h}}..\ev|
|00000190| 65 72 79 6d 61 74 68 7b | 5c 69 74 7d 20 5c 65 76 |erymath{|\it} \ev|
|000001a0| 65 72 79 64 69 73 70 6c | 61 79 7b 5c 69 74 7d 0a |erydispl|ay{\it}.|
|000001b0| 5c 63 61 74 63 6f 64 65 | 20 60 5c 5f 3d 5c 61 63 |\catcode| `\_=\ac|
|000001c0| 74 69 76 65 20 5c 64 65 | 66 5f 7b 5c 5f 5c 70 65 |tive \de|f_{\_\pe|
|000001d0| 6e 61 6c 74 79 31 30 30 | 20 7d 0a 5c 63 61 74 63 |nalty100| }.\catc|
|000001e0| 6f 64 65 60 5c 3c 3d 5c | 61 63 74 69 76 65 20 5c |ode`\<=\|active \|
|000001f0| 64 65 66 3c 23 31 3e 7b | 7b 5c 6c 61 6e 67 6c 65 |def<#1>{|{\langle|
|00000200| 5c 68 62 6f 78 7b 5c 72 | 6d 23 31 7d 5c 72 61 6e |\hbox{\r|m#1}\ran|
|00000210| 67 6c 65 7d 7d 0a 0a 5c | 62 65 67 69 6e 7b 64 6f |gle}}..\|begin{do|
|00000220| 63 75 6d 65 6e 74 7d 0a | 5c 74 69 74 6c 65 7b 41 |cument}.|\title{A|
|00000230| 20 5c 6c 69 6e 75 78 5c | 20 5c 63 64 72 6f 6d 5c | \linux\| \cdrom\|
|00000240| 20 73 74 61 6e 64 61 72 | 64 7d 0a 5c 61 75 74 68 | standar|d}.\auth|
|00000250| 6f 72 7b 44 61 76 69 64 | 20 76 61 6e 20 4c 65 65 |or{David| van Lee|
|00000260| 75 77 65 6e 5c 5c 7b 5c | 6e 6f 72 6d 61 6c 73 69 |uwen\\{\|normalsi|
|00000270| 7a 65 5c 74 74 20 64 61 | 76 69 64 40 74 6d 2e 74 |ze\tt da|vid@tm.t|
|00000280| 6e 6f 2e 6e 6c 7d 7d 0a | 0a 5c 6d 61 6b 65 74 69 |no.nl}}.|.\maketi|
|00000290| 74 6c 65 0a 0a 5c 73 65 | 63 74 69 6f 6e 7b 49 6e |tle..\se|ction{In|
|000002a0| 74 72 6f 64 75 63 74 69 | 6f 6e 7d 0a 0a 5c 6c 69 |troducti|on}..\li|
|000002b0| 6e 75 78 5c 20 69 73 20 | 70 72 6f 62 61 62 6c 79 |nux\ is |probably|
|000002c0| 20 74 68 65 20 55 6e 69 | 78 2d 6c 69 6b 65 20 6f | the Uni|x-like o|
|000002d0| 70 65 72 61 74 69 6e 67 | 20 73 79 73 74 65 6d 20 |perating| system |
|000002e0| 74 68 61 74 20 73 75 70 | 70 6f 72 74 73 20 74 68 |that sup|ports th|
|000002f0| 65 20 77 69 64 65 73 74 | 0a 76 61 72 69 65 74 79 |e widest|.variety|
|00000300| 20 6f 66 20 68 61 72 64 | 77 61 72 65 20 64 65 76 | of hard|ware dev|
|00000310| 69 63 65 73 2e 20 54 68 | 65 20 72 65 61 73 6f 6e |ices. Th|e reason|
|00000320| 73 20 66 6f 72 20 74 68 | 69 73 20 61 72 65 20 70 |s for th|is are p|
|00000330| 72 65 73 75 6d 61 62 6c | 79 0a 5c 62 65 67 69 6e |resumabl|y.\begin|
|00000340| 7b 69 74 65 6d 69 7a 65 | 7d 0a 5c 69 74 65 6d 20 |{itemize|}.\item |
|00000350| 54 68 65 20 6c 61 72 67 | 65 20 6c 69 73 74 20 6f |The larg|e list o|
|00000360| 66 20 64 69 66 66 65 72 | 65 6e 74 20 68 61 72 64 |f differ|ent hard|
|00000370| 77 61 72 65 20 64 65 76 | 69 63 65 73 20 61 76 61 |ware dev|ices ava|
|00000380| 69 6c 61 62 6c 65 20 66 | 6f 72 20 74 68 65 20 70 |ilable f|or the p|
|00000390| 6f 70 75 6c 61 72 0a 49 | 42 4d 20 50 43 2d 61 72 |opular.I|BM PC-ar|
|000003a0| 63 68 69 74 65 63 74 75 | 72 65 2c 0a 5c 69 74 65 |chitectu|re,.\ite|
|000003b0| 6d 20 54 68 65 20 6f 70 | 65 6e 20 64 65 73 69 67 |m The op|en desig|
|000003c0| 6e 20 6f 66 20 74 68 65 | 20 6f 70 65 72 61 74 69 |n of the| operati|
|000003d0| 6e 67 20 73 79 73 74 65 | 6d 2c 20 73 75 63 68 20 |ng syste|m, such |
|000003e0| 74 68 61 74 20 65 76 65 | 72 79 62 6f 64 79 20 63 |that eve|rybody c|
|000003f0| 61 6e 0a 77 72 69 74 65 | 20 61 20 64 72 69 76 65 |an.write| a drive|
|00000400| 72 20 66 6f 72 20 4c 69 | 6e 75 78 20 28 73 6f 75 |r for Li|nux (sou|
|00000410| 72 63 65 20 63 6f 64 65 | 20 65 78 61 6d 70 6c 65 |rce code| example|
|00000420| 73 29 2e 0a 5c 65 6e 64 | 7b 69 74 65 6d 69 7a 65 |s)..\end|{itemize|
|00000430| 7d 0a 54 68 65 20 76 61 | 73 74 20 63 68 6f 69 63 |}.The va|st choic|
|00000440| 65 20 61 6e 64 20 6f 70 | 65 6e 6e 65 73 73 20 68 |e and op|enness h|
|00000450| 61 73 20 6c 65 61 64 20 | 6e 6f 74 20 6f 6e 6c 79 |as lead |not only|
|00000460| 20 74 6f 20 61 20 77 69 | 64 65 20 73 75 70 70 6f | to a wi|de suppo|
|00000470| 72 74 20 6f 66 0a 68 61 | 72 64 77 61 72 65 20 64 |rt of.ha|rdware d|
|00000480| 65 76 69 63 65 73 2c 20 | 62 75 74 20 61 6c 73 6f |evices, |but also|
|00000490| 20 74 6f 20 61 20 63 65 | 72 74 61 69 6e 20 64 69 | to a ce|rtain di|
|000004a0| 76 65 72 67 65 6e 63 65 | 20 69 6e 20 62 65 68 61 |vergence| in beha|
|000004b0| 76 69 6f 72 2e 20 45 73 | 70 65 63 69 61 6c 6c 79 |vior. Es|pecially|
|000004c0| 0a 66 6f 72 20 5c 63 64 | 72 6f 6d 5c 20 64 65 76 |.for \cd|rom\ dev|
|000004d0| 69 63 65 73 2c 20 74 68 | 65 20 77 61 79 20 61 20 |ices, th|e way a |
|000004e0| 70 61 72 74 69 63 75 6c | 61 72 20 64 72 69 76 65 |particul|ar drive|
|000004f0| 20 72 65 61 63 74 73 20 | 74 6f 20 61 20 60 73 74 | reacts |to a `st|
|00000500| 61 6e 64 61 72 64 27 0a | 24 69 6f 63 74 6c 28 29 |andard'.|$ioctl()|
|00000510| 24 20 63 61 6c 6c 20 76 | 61 72 69 65 73 20 61 20 |$ call v|aries a |
|00000520| 6c 6f 74 20 66 72 6f 6d | 20 6f 6e 65 20 62 72 61 |lot from| one bra|
|00000530| 6e 64 20 74 6f 20 61 6e | 6f 74 68 65 72 3b 20 75 |nd to an|other; u|
|00000540| 6e 74 69 6c 20 74 6f 64 | 61 79 2c 20 74 68 65 0a |ntil tod|ay, the.|
|00000550| 5c 6c 69 6e 75 78 5c 20 | 5c 63 64 72 6f 6d 5c 20 |\linux\ |\cdrom\ |
|00000560| 64 72 69 76 65 72 20 77 | 72 69 74 65 72 73 20 6b |driver w|riters k|
|00000570| 65 70 74 20 61 77 61 79 | 20 66 72 6f 6d 20 77 69 |ept away| from wi|
|00000580| 6c 64 65 72 6e 65 73 73 | 20 62 79 20 61 20 67 6f |lderness| by a go|
|00000590| 6f 64 20 70 72 61 63 74 | 69 63 65 3a 0a 74 6f 20 |od pract|ice:.to |
|000005a0| 65 76 6f 6c 76 65 20 61 | 20 6e 65 77 20 64 72 69 |evolve a| new dri|
|000005b0| 76 65 72 20 62 79 20 63 | 6f 70 79 69 6e 67 2c 20 |ver by c|opying, |
|000005c0| 75 6e 64 65 72 73 74 61 | 6e 64 69 6e 67 20 61 6e |understa|nding an|
|000005d0| 64 20 63 68 61 6e 67 69 | 6e 67 20 61 6e 20 65 78 |d changi|ng an ex|
|000005e0| 69 73 74 69 6e 67 0a 6f | 6e 65 2e 0a 0a 53 69 6e |isting.o|ne...Sin|
|000005f0| 63 65 20 74 68 65 20 62 | 65 67 69 6e 6e 69 6e 67 |ce the b|eginning|
|00000600| 20 6f 66 20 74 68 65 20 | 5c 63 64 72 6f 6d 2c 20 | of the |\cdrom, |
|00000610| 6d 61 6e 79 20 64 69 66 | 66 65 72 65 6e 74 20 69 |many dif|ferent i|
|00000620| 6e 74 65 72 66 61 63 65 | 73 20 64 65 76 65 6c 6f |nterface|s develo|
|00000630| 70 65 64 2e 0a 53 6f 6d | 65 20 6f 66 20 74 68 65 |ped..Som|e of the|
|00000640| 6d 20 68 61 64 20 74 68 | 65 69 72 20 6f 77 6e 20 |m had th|eir own |
|00000650| 70 72 6f 70 72 69 65 74 | 61 72 79 20 64 65 73 69 |propriet|ary desi|
|00000660| 67 6e 20 28 53 6f 6e 79 | 2c 20 4d 69 74 73 75 6d |gn (Sony|, Mitsum|
|00000670| 69 2c 20 50 61 6e 61 73 | 6f 6e 69 63 29 2c 0a 6f |i, Panas|onic),.o|
|00000680| 74 68 65 72 20 6d 61 6e | 75 66 61 63 74 75 72 65 |ther man|ufacture|
|00000690| 72 73 20 61 64 6f 70 74 | 65 64 20 61 6e 20 65 78 |rs adopt|ed an ex|
|000006a0| 69 73 74 69 6e 67 20 65 | 6c 65 63 74 72 69 63 61 |isting e|lectrica|
|000006b0| 6c 20 69 6e 74 65 72 66 | 61 63 65 20 61 6e 64 20 |l interf|ace and |
|000006c0| 63 68 61 6e 67 65 64 0a | 74 68 65 20 66 75 6e 63 |changed.|the func|
|000006d0| 74 69 6f 6e 61 6c 69 74 | 79 20 28 43 72 65 61 74 |tionalit|y (Creat|
|000006e0| 69 76 65 4c 61 62 73 2f | 53 6f 75 6e 64 42 6c 61 |iveLabs/|SoundBla|
|000006f0| 73 74 65 72 2c 20 54 65 | 61 63 2c 20 46 75 6e 61 |ster, Te|ac, Funa|
|00000700| 69 29 20 6f 72 20 73 69 | 6d 70 6c 79 20 61 64 61 |i) or si|mply ada|
|00000710| 70 74 65 64 0a 74 68 65 | 69 72 20 64 72 69 76 65 |pted.the|ir drive|
|00000720| 73 20 74 6f 20 6f 6e 65 | 20 6f 72 20 6d 6f 72 65 |s to one| or more|
|00000730| 20 6f 66 20 74 68 65 20 | 61 6c 72 65 61 64 79 20 | of the |already |
|00000740| 65 78 69 73 74 69 6e 67 | 20 65 6c 65 63 74 72 69 |existing| electri|
|00000750| 63 61 6c 20 69 6e 74 65 | 72 66 61 63 65 73 0a 28 |cal inte|rfaces.(|
|00000760| 41 7a 74 65 63 68 2c 20 | 53 61 6e 79 6f 2c 20 46 |Aztech, |Sanyo, F|
|00000770| 75 6e 61 69 2c 20 56 65 | 72 74 6f 73 2c 20 4c 6f |unai, Ve|rtos, Lo|
|00000780| 6e 67 73 68 69 6e 65 2c | 20 4f 70 74 69 63 73 20 |ngshine,| Optics |
|00000790| 53 74 6f 72 61 67 65 20 | 61 6e 64 20 6d 6f 73 74 |Storage |and most|
|000007a0| 20 6f 66 20 74 68 65 0a | 60 4e 6f 4e 61 6d 65 27 | of the.|`NoName'|
|000007b0| 20 6d 61 6e 75 66 61 63 | 74 75 72 65 72 73 29 2e | manufac|turers).|
|000007c0| 0a 49 6e 20 63 61 73 65 | 73 20 77 68 65 72 65 20 |.In case|s where |
|000007d0| 61 20 6e 65 77 20 64 72 | 69 76 65 20 72 65 61 6c |a new dr|ive real|
|000007e0| 6c 79 20 62 72 6f 75 67 | 68 74 20 68 69 73 20 6f |ly broug|ht his o|
|000007f0| 77 6e 20 69 6e 74 65 72 | 66 61 63 65 20 6f 72 20 |wn inter|face or |
|00000800| 75 73 65 64 20 68 69 73 | 0a 6f 77 6e 20 63 6f 6d |used his|.own com|
|00000810| 6d 61 6e 64 20 73 65 74 | 20 61 6e 64 20 66 6c 6f |mand set| and flo|
|00000820| 77 20 63 6f 6e 74 72 6f | 6c 20 73 63 68 65 6d 65 |w contro|l scheme|
|00000830| 2c 20 65 69 74 68 65 72 | 20 61 20 73 65 70 61 72 |, either| a separ|
|00000840| 61 74 65 20 64 72 69 76 | 65 72 20 68 61 64 20 74 |ate driv|er had t|
|00000850| 6f 0a 62 65 20 77 72 69 | 74 74 65 6e 2c 20 6f 72 |o.be wri|tten, or|
|00000860| 20 61 6e 20 65 78 69 73 | 74 69 6e 67 20 64 72 69 | an exis|ting dri|
|00000870| 76 65 72 20 68 61 64 20 | 74 6f 20 67 65 74 20 65 |ver had |to get e|
|00000880| 6e 68 61 6e 63 65 64 2e | 0a 0a 4e 6f 77 61 64 61 |nhanced.|..Nowada|
|00000890| 79 73 2c 20 61 6c 6d 6f | 73 74 20 61 6c 6c 20 6e |ys, almo|st all n|
|000008a0| 65 77 20 5c 63 64 72 6f | 6d 5c 20 74 79 70 65 73 |ew \cdro|m\ types|
|000008b0| 20 61 72 65 20 65 69 74 | 68 65 72 20 41 54 41 50 | are eit|her ATAP|
|000008c0| 49 2f 49 44 45 20 6f 72 | 20 53 43 53 49 3b 0a 69 |I/IDE or| SCSI;.i|
|000008d0| 74 20 69 73 20 76 65 72 | 79 20 75 6e 6c 69 6b 65 |t is ver|y unlike|
|000008e0| 6c 79 20 74 68 61 74 20 | 61 6e 79 20 6d 61 6e 75 |ly that |any manu|
|000008f0| 66 61 63 74 75 72 65 72 | 20 73 74 69 6c 6c 20 77 |facturer| still w|
|00000900| 69 6c 6c 20 63 72 65 61 | 74 65 20 61 20 6e 65 77 |ill crea|te a new|
|00000910| 0a 69 6e 74 65 72 66 61 | 63 65 2c 20 61 6e 64 20 |.interfa|ce, and |
|00000920| 6e 65 77 20 64 72 69 76 | 65 73 20 66 6f 72 20 74 |new driv|es for t|
|00000930| 68 65 20 65 78 69 73 74 | 69 6e 67 20 70 72 6f 70 |he exist|ing prop|
|00000940| 72 69 65 74 61 72 79 20 | 69 6e 74 65 72 66 61 63 |rietary |interfac|
|00000950| 65 73 20 61 72 65 0a 67 | 65 74 74 69 6e 67 20 72 |es are.g|etting r|
|00000960| 61 72 65 2e 0a 42 75 74 | 20 68 69 73 74 6f 72 79 |are..But| history|
|00000970| 20 68 61 73 20 64 65 6c | 69 76 65 72 65 64 20 75 | has del|ivered u|
|00000980| 73 20 5c 63 64 72 6f 6d | 5c 20 73 75 70 70 6f 72 |s \cdrom|\ suppor|
|00000990| 74 20 66 6f 72 20 6d 61 | 6e 79 20 64 69 66 66 65 |t for ma|ny diffe|
|000009a0| 72 65 6e 74 20 69 6e 74 | 65 72 66 61 63 65 73 2e |rent int|erfaces.|
|000009b0| 0a 0a 53 6f 6d 65 20 6f | 66 20 74 68 65 20 5c 6c |..Some o|f the \l|
|000009c0| 69 6e 75 78 5c 20 5c 63 | 64 72 6f 6d 5c 20 64 72 |inux\ \c|drom\ dr|
|000009d0| 69 76 65 72 20 77 72 69 | 74 65 72 73 20 6c 6f 6f |iver wri|ters loo|
|000009e0| 6b 20 61 74 20 74 68 65 | 20 65 78 69 73 74 69 6e |k at the| existin|
|000009f0| 67 20 73 74 61 6e 64 61 | 72 64 0a 77 68 69 63 68 |g standa|rd.which|
|00000a00| 20 69 73 20 65 78 70 72 | 65 73 73 65 64 20 74 68 | is expr|essed th|
|00000a10| 72 6f 75 67 68 20 5c 63 | 64 72 6f 6d 68 5c 20 61 |rough \c|dromh\ a|
|00000a20| 73 20 74 6f 20 61 20 72 | 61 74 68 65 72 20 77 69 |s to a r|ather wi|
|00000a30| 6c 64 20 73 65 74 20 6f | 66 0a 63 6f 6d 6d 61 6e |ld set o|f.comman|
|00000a40| 64 73 20 61 6e 64 20 64 | 61 74 61 20 66 6f 72 6d |ds and d|ata form|
|00000a50| 61 74 73 20 61 6e 64 20 | 66 65 65 6c 20 74 68 61 |ats and |feel tha|
|00000a60| 74 20 61 6e 79 20 73 74 | 72 75 63 74 75 72 65 20 |t any st|ructure |
|00000a70| 69 73 20 6c 6f 73 74 2c | 20 61 6e 64 20 66 72 6f |is lost,| and fro|
|00000a80| 6d 0a 74 68 69 73 20 70 | 6f 69 6e 74 20 6f 66 20 |m.this p|oint of |
|00000a90| 76 69 65 77 2c 20 74 68 | 69 73 20 64 6f 63 75 6d |view, th|is docum|
|00000aa0| 65 6e 74 61 74 69 6f 6e | 20 73 68 61 6c 6c 20 68 |entation| shall h|
|00000ab0| 65 6c 70 20 74 6f 20 61 | 63 68 69 65 76 65 20 61 |elp to a|chieve a|
|00000ac0| 20 63 6f 6d 6d 6f 6e 0a | 70 72 6f 67 72 61 6d 6d | common.|programm|
|00000ad0| 69 6e 67 20 69 6e 74 65 | 72 66 61 63 65 2e 0a 20 |ing inte|rface.. |
|00000ae0| 0a 4f 74 68 65 72 73 2d | 2d 2d 6d 61 69 6e 6c 79 |.Others-|--mainly|
|00000af0| 20 74 68 6f 73 65 20 77 | 68 6f 20 75 73 65 64 20 | those w|ho used |
|00000b00| 74 68 65 20 61 6c 72 65 | 61 64 79 20 65 78 69 73 |the alre|ady exis|
|00000b10| 74 69 6e 67 20 64 72 69 | 76 65 72 73 20 6e 6f 74 |ting dri|vers not|
|00000b20| 20 6f 6e 6c 79 0a 61 73 | 20 61 20 63 6f 64 69 6e | only.as| a codin|
|00000b30| 67 20 65 78 61 6d 70 6c | 65 2c 20 62 75 74 20 61 |g exampl|e, but a|
|00000b40| 6c 73 6f 20 61 73 20 61 | 20 60 75 73 65 72 20 69 |lso as a| `user i|
|00000b50| 6e 74 65 72 66 61 63 65 | 27 20 72 65 66 65 72 65 |nterface|' refere|
|00000b60| 6e 63 65 20 64 75 72 69 | 6e 67 0a 74 68 65 69 72 |nce duri|ng.their|
|00000b70| 20 6f 77 6e 20 64 65 76 | 65 6c 6f 70 6d 65 6e 74 | own dev|elopment|
|00000b80| 2d 2d 2d 68 61 76 65 20 | 74 61 6b 65 6e 20 63 61 |---have |taken ca|
|00000b90| 72 65 20 74 68 61 74 20 | 5c 63 64 72 6f 6d 68 5c |re that |\cdromh\|
|00000ba0| 20 72 65 66 6c 65 63 74 | 73 20 61 0a 73 6f 66 74 | reflect|s a.soft|
|00000bb0| 77 61 72 65 20 69 6e 74 | 65 72 66 61 63 65 20 74 |ware int|erface t|
|00000bc0| 6f 20 60 75 73 65 72 20 | 70 72 6f 67 72 61 6d 73 |o `user |programs|
|00000bd0| 27 20 77 68 69 63 68 20 | 69 73 20 75 6e 69 71 75 |' which |is uniqu|
|00000be0| 65 20 62 65 74 77 65 65 | 6e 20 61 6c 6c 0a 64 72 |e betwee|n all.dr|
|00000bf0| 69 76 65 72 73 20 61 73 | 20 6d 75 63 68 20 61 73 |ivers as| much as|
|00000c00| 20 70 6f 73 73 69 62 6c | 65 3b 20 74 68 65 73 65 | possibl|e; these|
|00000c10| 20 64 72 69 76 65 72 20 | 77 72 69 74 65 72 73 20 | driver |writers |
|00000c20| 77 69 6c 6c 20 63 6f 6e | 74 69 6e 75 65 20 74 6f |will con|tinue to|
|00000c30| 0a 72 65 66 69 6e 65 20 | 74 68 65 20 65 78 69 73 |.refine |the exis|
|00000c40| 74 69 6e 67 20 5c 63 64 | 72 6f 6d 68 5c 20 77 68 |ting \cd|romh\ wh|
|00000c50| 65 72 65 20 69 74 20 73 | 65 65 6d 73 20 6e 65 63 |ere it s|eems nec|
|00000c60| 65 73 73 61 72 79 2c 20 | 61 6e 64 20 74 68 65 79 |essary, |and they|
|00000c70| 20 74 65 6e 64 0a 74 6f | 20 6c 6f 6f 6b 20 69 66 | tend.to| look if|
|00000c80| 20 61 6e 79 20 6e 65 77 | 6c 79 20 72 65 71 75 65 | any new|ly reque|
|00000c90| 73 74 65 64 20 66 75 6e | 63 74 69 6f 6e 61 6c 69 |sted fun|ctionali|
|00000ca0| 74 79 20 69 73 6e 27 74 | 20 61 6c 72 65 61 64 79 |ty isn't| already|
|00000cb0| 20 74 68 65 72 65 0a 62 | 65 66 6f 72 65 20 74 68 | there.b|efore th|
|00000cc0| 65 79 20 61 72 65 20 72 | 65 61 64 79 20 74 6f 20 |ey are r|eady to |
|00000cd0| 64 65 66 69 6e 65 20 6e | 65 77 20 73 74 72 75 63 |define n|ew struc|
|00000ce0| 74 75 72 65 73 2e 20 54 | 68 65 20 73 62 70 63 64 |tures. T|he sbpcd|
|00000cf0| 20 64 72 69 76 65 72 20 | 67 69 76 65 73 0a 61 6e | driver |gives.an|
|00000d00| 20 65 78 61 6d 70 6c 65 | 20 74 68 61 74 20 69 74 | example| that it|
|00000d10| 20 69 73 20 70 6f 73 73 | 69 62 6c 65 20 74 6f 20 | is poss|ible to |
|00000d20| 6c 65 74 20 61 20 72 6f | 62 6f 74 20 61 72 6d 20 |let a ro|bot arm |
|00000d30| 70 6c 61 79 20 6a 75 6b | 65 0a 62 6f 78 2d 2d 2d |play juk|e.box---|
|00000d40| 65 69 74 68 65 72 20 77 | 69 74 68 20 61 75 64 69 |either w|ith audi|
|00000d50| 6f 20 6f 72 20 77 69 74 | 68 20 64 61 74 61 20 43 |o or wit|h data C|
|00000d60| 44 73 2d 2d 2d 61 6e 64 | 20 74 68 61 74 20 69 74 |Ds---and| that it|
|00000d70| 20 69 73 20 70 6f 73 73 | 69 62 6c 65 20 74 6f 0a | is poss|ible to.|
|00000d80| 6c 65 74 20 74 68 65 20 | 6a 75 6b 65 20 62 6f 78 |let the |juke box|
|00000d90| 20 77 6f 72 6b 20 6f 6e | 20 65 76 65 6e 20 69 66 | work on| even if|
|00000da0| 20 61 20 64 69 73 6b 20 | 68 61 73 20 66 61 6c 6c | a disk |has fall|
|00000db0| 65 6e 20 75 70 6f 6e 20 | 74 68 65 20 66 6c 6f 6f |en upon |the floo|
|00000dc0| 72 20 61 6e 64 0a 74 68 | 65 20 64 72 69 76 65 20 |r and.th|e drive |
|00000dd0| 64 6f 6f 72 20 68 61 73 | 20 63 6c 6f 73 65 64 20 |door has| closed |
|00000de0| 77 69 74 68 6f 75 74 20 | 68 61 76 69 6e 67 20 61 |without |having a|
|00000df0| 20 64 69 73 6b 20 69 6e | 73 69 64 65 3b 20 77 69 | disk in|side; wi|
|00000e00| 74 68 6f 75 74 20 61 6e | 79 0a 6e 65 77 20 73 6f |thout an|y.new so|
|00000e10| 66 74 77 61 72 65 20 6c | 61 79 65 72 20 6f 72 20 |ftware l|ayer or |
|00000e20| 61 6e 79 20 73 74 72 75 | 63 74 75 72 65 73 20 77 |any stru|ctures w|
|00000e30| 68 69 63 68 20 61 72 65 | 20 6e 6f 74 20 61 6c 72 |hich are| not alr|
|00000e40| 65 61 64 79 20 70 72 65 | 73 65 6e 74 20 69 6e 0a |eady pre|sent in.|
|00000e50| 5c 63 64 72 6f 6d 68 2e | 20 20 54 68 69 73 20 60 |\cdromh.| This `|
|00000e60| 6f 74 68 65 72 27 20 67 | 72 6f 75 70 20 6f 66 20 |other' g|roup of |
|00000e70| 5c 6c 69 6e 75 78 5c 20 | 5c 63 64 72 6f 6d 5c 20 |\linux\ |\cdrom\ |
|00000e80| 64 72 69 76 65 72 20 77 | 72 69 74 65 72 73 0a 65 |driver w|riters.e|
|00000e90| 78 70 6c 69 63 69 74 6c | 79 20 64 6f 65 73 20 7b |xplicitl|y does {|
|00000ea0| 5c 65 6d 20 6e 6f 74 5c | 2f 7d 20 73 75 70 70 6f |\em not\|/} suppo|
|00000eb0| 72 74 20 74 68 65 20 69 | 64 65 61 20 74 6f 20 64 |rt the i|dea to d|
|00000ec0| 65 66 69 6e 65 20 61 6e | 20 61 64 64 69 74 69 6f |efine an| additio|
|00000ed0| 6e 61 6c 0a 73 6f 66 74 | 77 61 72 65 20 6c 61 79 |nal.soft|ware lay|
|00000ee0| 65 72 20 62 65 74 77 65 | 65 6e 20 64 72 69 76 65 |er betwe|en drive|
|00000ef0| 72 20 61 6e 64 20 75 73 | 65 72 20 70 72 6f 67 72 |r and us|er progr|
|00000f00| 61 6d 2e 0a 0a 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |am...The| followi|
|00000f10| 6e 67 20 74 65 78 74 20 | 72 65 66 6c 65 63 74 73 |ng text |reflects|
|00000f20| 20 74 68 65 20 6f 70 69 | 6e 69 6f 6e 20 6f 66 20 | the opi|nion of |
|00000f30| 74 68 65 20 66 69 72 73 | 74 20 6d 65 6e 74 69 6f |the firs|t mentio|
|00000f40| 6e 65 64 20 5c 6c 69 6e | 75 78 5c 20 0a 5c 63 64 |ned \lin|ux\ .\cd|
|00000f50| 72 6f 6d 5c 20 64 72 69 | 76 65 72 20 77 72 69 74 |rom\ dri|ver writ|
|00000f60| 65 72 20 67 72 6f 75 70 | 20 6f 6e 6c 79 3b 20 74 |er group| only; t|
|00000f70| 68 65 20 6f 74 68 65 72 | 20 67 72 6f 75 70 20 28 |he other| group (|
|00000f80| 6e 6f 74 20 6f 6e 6c 79 | 20 74 68 65 20 60 73 69 |not only| the `si|
|00000f90| 6c 65 6e 74 0a 6d 61 6a | 6f 72 69 74 79 27 29 20 |lent.maj|ority') |
|00000fa0| 73 65 65 73 20 74 68 69 | 73 20 74 65 78 74 20 61 |sees thi|s text a|
|00000fb0| 73 20 61 20 67 6f 6f 64 | 20 62 61 73 65 20 66 6f |s a good| base fo|
|00000fc0| 72 20 61 20 66 75 74 75 | 72 65 20 64 6f 63 75 6d |r a futu|re docum|
|00000fd0| 65 6e 74 61 74 69 6f 6e | 20 6f 66 20 74 68 65 0a |entation| of the.|
|00000fe0| 65 78 69 73 74 69 6e 67 | 20 63 6f 6d 6d 6f 6e 20 |existing| common |
|00000ff0| 5c 6c 69 6e 75 78 5c 20 | 5c 63 64 72 6f 6d 5c 20 |\linux\ |\cdrom\ |
|00001000| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 69 6e 74 65 |programm|ing inte|
|00001010| 72 66 61 63 65 2c 20 61 | 73 20 69 74 20 69 73 20 |rface, a|s it is |
|00001020| 73 74 61 74 65 64 20 0a | 77 69 74 68 69 6e 20 5c |stated .|within \|
|00001030| 63 64 72 6f 6d 68 2e 20 | 57 68 65 72 65 20 5c 63 |cdromh. |Where \c|
|00001040| 64 72 6f 6d 68 5c 20 6e | 65 65 64 73 20 73 6f 6d |dromh\ n|eeds som|
|00001050| 65 20 65 78 74 65 72 6e | 61 6c 20 0a 65 78 70 6c |e extern|al .expl|
|00001060| 61 6e 61 74 69 6f 6e 2c | 20 74 68 69 73 20 74 65 |anation,| this te|
|00001070| 78 74 20 63 61 6e 20 67 | 69 76 65 20 69 74 20 69 |xt can g|ive it i|
|00001080| 66 20 74 68 65 20 72 65 | 61 64 65 72 20 69 73 20 |f the re|ader is |
|00001090| 61 77 61 72 65 20 74 68 | 61 74 2d 2d 2d 61 74 20 |aware th|at---at |
|000010a0| 6c 65 61 73 74 0a 61 74 | 20 74 68 65 20 6d 6f 6d |least.at| the mom|
|000010b0| 65 6e 74 2d 2d 2d 74 68 | 69 73 20 74 65 78 74 20 |ent---th|is text |
|000010c0| 63 6c 61 69 6d 73 20 74 | 6f 20 62 65 20 74 68 65 |claims t|o be the|
|000010d0| 20 70 72 6f 70 6f 73 61 | 6c 20 6f 66 20 73 6f 6d | proposa|l of som|
|000010e0| 65 74 68 69 6e 67 20 65 | 6c 73 65 20 74 68 61 6e |ething e|lse than|
|000010f0| 0a 5c 63 64 72 6f 6d 68 | 2e 0a 0a 0a 41 70 61 72 |.\cdromh|....Apar|
|00001100| 74 20 66 72 6f 6d 20 74 | 68 65 20 73 6f 6d 65 77 |t from t|he somew|
|00001110| 68 61 74 20 75 6e 73 74 | 72 75 63 74 75 72 65 64 |hat unst|ructured|
|00001120| 20 69 6e 74 65 72 66 61 | 63 69 6e 67 20 77 69 74 | interfa|cing wit|
|00001130| 68 20 73 6f 66 74 77 61 | 72 65 2c 20 74 68 65 0a |h softwa|re, the.|
|00001140| 61 63 74 75 61 6c 20 65 | 78 65 63 75 74 69 6f 6e |actual e|xecution|
|00001150| 20 6f 66 20 74 68 65 20 | 63 6f 6d 6d 61 6e 64 73 | of the |commands|
|00001160| 20 69 73 20 64 69 66 66 | 65 72 65 6e 74 20 66 6f | is diff|erent fo|
|00001170| 72 20 6d 6f 73 74 20 6f | 66 20 74 68 65 0a 64 69 |r most o|f the.di|
|00001180| 66 66 65 72 65 6e 74 20 | 64 72 69 76 65 72 73 3a |fferent |drivers:|
|00001190| 20 65 2e 67 2e 2c 20 73 | 6f 6d 65 20 64 72 69 76 | e.g., s|ome driv|
|000011a0| 65 72 73 20 63 6c 6f 73 | 65 20 74 68 65 20 74 72 |ers clos|e the tr|
|000011b0| 61 79 20 69 66 20 61 6e | 20 24 6f 70 65 6e 28 29 |ay if an| $open()|
|000011c0| 24 20 63 61 6c 6c 0a 6f | 63 63 75 72 73 20 77 68 |$ call.o|ccurs wh|
|000011d0| 69 6c 65 20 74 68 65 20 | 74 72 61 79 20 69 73 20 |ile the |tray is |
|000011e0| 75 6e 6c 6f 61 64 65 64 | 2c 20 77 68 69 6c 65 20 |unloaded|, while |
|000011f0| 6f 74 68 65 72 73 20 64 | 6f 20 6e 6f 74 2e 20 53 |others d|o not. S|
|00001200| 6f 6d 65 20 64 72 69 76 | 65 72 73 20 6c 6f 63 6b |ome driv|ers lock|
|00001210| 20 74 68 65 0a 64 6f 6f | 72 20 75 70 6f 6e 20 6f | the.doo|r upon o|
|00001220| 70 65 6e 69 6e 67 20 74 | 68 65 20 64 65 76 69 63 |pening t|he devic|
|00001230| 65 2c 20 74 6f 20 70 72 | 65 76 65 6e 74 20 61 6e |e, to pr|event an|
|00001240| 20 69 6e 63 6f 68 65 72 | 65 6e 74 20 66 69 6c 65 | incoher|ent file|
|00001250| 20 73 79 73 74 65 6d 2c | 0a 62 75 74 20 6f 74 68 | system,|.but oth|
|00001260| 65 72 73 20 64 6f 6e 27 | 74 2c 20 74 6f 20 61 6c |ers don'|t, to al|
|00001270| 6c 6f 77 20 73 6f 66 74 | 77 61 72 65 20 65 6a 65 |low soft|ware eje|
|00001280| 63 74 69 6f 6e 2e 20 55 | 6e 64 6f 75 62 74 65 64 |ction. U|ndoubted|
|00001290| 6c 79 2c 20 74 68 65 0a | 63 61 70 61 62 69 6c 69 |ly, the.|capabili|
|000012a0| 74 69 65 73 20 6f 66 20 | 74 68 65 20 64 69 66 66 |ties of |the diff|
|000012b0| 65 72 65 6e 74 20 64 72 | 69 76 65 73 20 76 61 72 |erent dr|ives var|
|000012c0| 79 2c 20 62 75 74 20 65 | 76 65 6e 20 77 68 65 6e |y, but e|ven when|
|000012d0| 20 74 77 6f 20 64 72 69 | 76 65 73 20 68 61 76 65 | two dri|ves have|
|000012e0| 0a 74 68 65 20 73 61 6d | 65 20 63 61 70 61 62 69 |.the sam|e capabi|
|000012f0| 6c 69 74 79 20 74 68 65 | 20 64 72 69 76 65 72 20 |lity the| driver |
|00001300| 62 65 68 61 76 69 6f 72 | 20 6d 61 79 20 62 65 20 |behavior| may be |
|00001310| 64 69 66 66 65 72 65 6e | 74 2e 20 0a 0a 50 65 72 |differen|t. ..Per|
|00001320| 73 6f 6e 61 6c 6c 79 2c | 20 49 20 74 68 69 6e 6b |sonally,| I think|
|00001330| 20 74 68 61 74 20 74 68 | 65 20 6d 6f 73 74 20 69 | that th|e most i|
|00001340| 6d 70 6f 72 74 61 6e 74 | 20 64 72 69 76 65 20 69 |mportant| drive i|
|00001350| 6e 74 65 72 66 61 63 65 | 73 20 77 69 6c 6c 20 62 |nterface|s will b|
|00001360| 65 0a 74 68 65 20 49 44 | 45 2f 41 54 41 50 49 20 |e.the ID|E/ATAPI |
|00001370| 64 72 69 76 65 73 20 61 | 6e 64 20 6f 66 20 63 6f |drives a|nd of co|
|00001380| 75 72 73 65 20 74 68 65 | 20 53 43 53 49 20 64 72 |urse the| SCSI dr|
|00001390| 69 76 65 73 2c 20 62 75 | 74 20 61 73 20 70 72 69 |ives, bu|t as pri|
|000013a0| 63 65 73 20 6f 66 0a 68 | 61 72 64 77 61 72 65 20 |ces of.h|ardware |
|000013b0| 64 72 6f 70 20 63 6f 6e | 74 69 6e 75 6f 75 73 6c |drop con|tinuousl|
|000013c0| 79 2c 20 69 74 20 69 73 | 20 6e 6f 74 20 75 6e 6c |y, it is| not unl|
|000013d0| 69 6b 65 6c 79 20 74 68 | 61 74 20 70 65 6f 70 6c |ikely th|at peopl|
|000013e0| 65 20 77 69 6c 6c 20 68 | 61 76 65 0a 6d 6f 72 65 |e will h|ave.more|
|000013f0| 20 74 68 61 6e 20 6f 6e | 65 20 5c 63 64 72 6f 6d | than on|e \cdrom|
|00001400| 5c 20 64 72 69 76 65 2c | 20 70 6f 73 73 69 62 6c |\ drive,| possibl|
|00001410| 79 20 6f 66 20 6d 69 78 | 65 64 20 74 79 70 65 73 |y of mix|ed types|
|00001420| 2e 20 20 28 49 6e 20 44 | 65 63 65 6d 62 65 72 0a |. (In D|ecember.|
|00001430| 31 39 39 34 2c 20 6f 6e | 65 20 6f 66 20 74 68 65 |1994, on|e of the|
|00001440| 20 63 68 65 61 70 65 73 | 74 20 5c 63 64 72 6f 6d | cheapes|t \cdrom|
|00001450| 5c 20 64 72 69 76 65 73 | 20 77 61 73 20 61 20 50 |\ drives| was a P|
|00001460| 68 69 6c 69 70 73 20 63 | 6d 32 30 36 2c 20 61 0a |hilips c|m206, a.|
|00001470| 64 6f 75 62 6c 65 2d 73 | 70 65 65 64 20 70 72 6f |double-s|peed pro|
|00001480| 70 72 69 65 74 61 72 79 | 20 64 72 69 76 65 2e 20 |prietary| drive. |
|00001490| 49 6e 20 74 68 65 20 6d | 6f 6e 74 68 73 20 74 68 |In the m|onths th|
|000014a0| 61 74 20 49 20 77 61 73 | 20 62 75 73 79 20 77 72 |at I was| busy wr|
|000014b0| 69 74 69 6e 67 0a 61 20 | 5c 6c 69 6e 75 78 5c 20 |iting.a |\linux\ |
|000014c0| 64 72 69 76 65 72 20 66 | 6f 72 20 69 74 2c 20 70 |driver f|or it, p|
|000014d0| 72 6f 70 72 69 65 74 61 | 72 79 20 64 72 69 76 65 |roprieta|ry drive|
|000014e0| 73 20 62 65 63 61 6d 65 | 20 6f 6c 64 2d 66 61 73 |s became| old-fas|
|000014f0| 68 69 6f 6e 65 64 20 61 | 6e 64 0a 49 44 45 2f 41 |hioned a|nd.IDE/A|
|00001500| 54 41 50 49 20 64 72 69 | 76 65 73 20 62 65 63 61 |TAPI dri|ves beca|
|00001510| 6d 65 20 73 74 61 6e 64 | 61 72 64 2e 20 41 74 20 |me stand|ard. At |
|00001520| 74 68 65 20 74 69 6d 65 | 20 6f 66 20 77 72 69 74 |the time| of writ|
|00001530| 69 6e 67 20 28 41 70 72 | 69 6c 20 31 39 39 36 29 |ing (Apr|il 1996)|
|00001540| 0a 74 68 65 20 63 68 65 | 61 70 65 73 74 20 64 6f |.the che|apest do|
|00001550| 75 62 6c 65 20 73 70 65 | 65 64 20 64 72 69 76 65 |uble spe|ed drive|
|00001560| 20 69 73 20 49 44 45 20 | 61 6e 64 20 61 74 20 6f | is IDE |and at o|
|00001570| 6e 65 20 66 69 66 74 68 | 20 6f 66 20 74 68 65 20 |ne fifth| of the |
|00001580| 70 72 69 63 65 0a 6f 66 | 20 69 74 73 20 70 72 65 |price.of| its pre|
|00001590| 64 65 63 65 73 73 6f 72 | 2e 20 45 69 67 68 74 20 |decessor|. Eight |
|000015a0| 73 70 65 65 64 20 64 72 | 69 76 65 73 20 61 72 65 |speed dr|ives are|
|000015b0| 20 61 76 61 69 6c 61 62 | 6c 65 20 6e 6f 77 2e 29 | availab|le now.)|
|000015c0| 0a 0a 54 68 69 73 20 64 | 6f 63 75 6d 65 6e 74 20 |..This d|ocument |
|000015d0| 64 65 66 69 6e 65 73 20 | 28 69 6e 20 70 72 65 2d |defines |(in pre-|
|000015e0| 72 65 6c 65 61 73 65 20 | 76 65 72 73 69 6f 6e 73 |release |versions|
|000015f0| 3a 20 70 72 6f 70 6f 73 | 65 73 29 20 74 68 65 20 |: propos|es) the |
|00001600| 76 61 72 69 6f 75 73 0a | 24 69 6f 63 74 6c 24 73 |various.|$ioctl$s|
|00001610| 2c 20 61 6e 64 20 74 68 | 65 20 77 61 79 20 74 68 |, and th|e way th|
|00001620| 65 20 64 72 69 76 65 72 | 73 20 73 68 6f 75 6c 64 |e driver|s should|
|00001630| 20 69 6d 70 6c 65 6d 65 | 6e 74 20 74 68 69 73 2e | impleme|nt this.|
|00001640| 0a 0a 5c 73 65 63 74 69 | 6f 6e 7b 53 74 61 6e 64 |..\secti|on{Stand|
|00001650| 61 72 64 69 7a 69 6e 67 | 20 74 68 72 6f 75 67 68 |ardizing| through|
|00001660| 20 61 6e 6f 74 68 65 72 | 20 73 6f 66 74 77 61 72 | another| softwar|
|00001670| 65 20 6c 65 76 65 6c 7d | 0a 5c 6c 61 62 65 6c 7b |e level}|.\label{|
|00001680| 63 64 72 6f 6d 2e 63 7d | 0a 0a 41 74 20 74 68 65 |cdrom.c}|..At the|
|00001690| 20 74 69 6d 65 20 74 68 | 69 73 20 64 6f 63 75 6d | time th|is docum|
|000016a0| 65 6e 74 20 69 73 20 77 | 72 69 74 74 65 6e 2c 20 |ent is w|ritten, |
|000016b0| 61 6c 6c 20 64 72 69 76 | 65 72 73 20 64 69 72 65 |all driv|ers dire|
|000016c0| 63 74 6c 79 20 69 6d 70 | 6c 65 6d 65 6e 74 0a 74 |ctly imp|lement.t|
|000016d0| 68 65 20 24 69 6f 63 74 | 6c 28 29 24 20 63 61 6c |he $ioct|l()$ cal|
|000016e0| 6c 73 20 74 68 72 6f 75 | 67 68 20 74 68 65 69 72 |ls throu|gh their|
|000016f0| 20 6f 77 6e 20 72 6f 75 | 74 69 6e 65 73 2c 20 77 | own rou|tines, w|
|00001700| 69 74 68 20 74 68 65 20 | 64 61 6e 67 65 72 20 6f |ith the |danger o|
|00001710| 66 0a 66 6f 72 67 65 74 | 74 69 6e 67 20 63 61 6c |f.forget|ting cal|
|00001720| 6c 73 20 74 6f 20 24 76 | 65 72 69 66 79 5f 61 72 |ls to $v|erify_ar|
|00001730| 65 61 28 29 24 20 61 6e | 64 20 74 68 65 20 72 69 |ea()$ an|d the ri|
|00001740| 73 6b 20 6f 66 20 64 69 | 76 65 72 67 65 6e 63 65 |sk of di|vergence|
|00001750| 20 69 6e 0a 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 | in.impl|ementati|
|00001760| 6f 6e 2e 20 0a 0a 46 6f | 72 20 74 68 69 73 20 72 |on. ..Fo|r this r|
|00001770| 65 61 73 6f 6e 2c 20 77 | 65 5c 66 6f 6f 74 6e 6f |eason, w|e\footno|
|00001780| 74 65 7b 54 68 65 20 77 | 72 69 74 69 6e 67 20 73 |te{The w|riting s|
|00001790| 74 79 6c 65 20 69 73 20 | 73 75 63 68 20 74 68 61 |tyle is |such tha|
|000017a0| 74 20 60 77 65 27 20 69 | 73 0a 75 73 65 64 20 77 |t `we' i|s.used w|
|000017b0| 68 65 6e 20 28 61 74 20 | 6c 65 61 73 74 20 70 61 |hen (at |least pa|
|000017c0| 72 74 20 6f 66 29 20 74 | 68 65 20 5c 63 64 72 6f |rt of) t|he \cdro|
|000017d0| 6d 2d 64 65 76 69 63 65 | 20 64 72 69 76 65 72 20 |m-device| driver |
|000017e0| 61 75 74 68 6f 72 73 20 | 73 75 70 70 6f 72 74 0a |authors |support.|
|000017f0| 74 68 65 20 69 64 65 61 | 2c 20 61 6e 20 60 49 27 |the idea|, an `I'|
|00001800| 20 69 73 20 75 73 65 64 | 20 66 6f 72 20 70 65 72 | is used| for per|
|00001810| 73 6f 6e 61 6c 20 6f 70 | 69 6e 69 6f 6e 73 7d 20 |sonal op|inions} |
|00001820| 70 72 6f 70 6f 73 65 20 | 74 6f 20 64 65 66 69 6e |propose |to defin|
|00001830| 65 0a 61 6e 6f 74 68 65 | 72 20 73 6f 66 74 77 61 |e.anothe|r softwa|
|00001840| 72 65 2d 6c 65 76 65 6c | 2c 20 74 68 61 74 20 73 |re-level|, that s|
|00001850| 65 70 61 72 61 74 65 73 | 20 74 68 65 20 24 69 6f |eparates| the $io|
|00001860| 63 74 6c 28 29 24 20 61 | 6e 64 20 24 6f 70 65 6e |ctl()$ a|nd $open|
|00001870| 28 29 24 0a 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |()$.impl|ementati|
|00001880| 6f 6e 20 66 72 6f 6d 20 | 74 68 65 20 61 63 74 75 |on from |the actu|
|00001890| 61 6c 20 68 61 72 64 77 | 61 72 65 20 69 6d 70 6c |al hardw|are impl|
|000018a0| 65 6d 65 6e 74 61 74 69 | 6f 6e 2e 20 57 65 20 62 |ementati|on. We b|
|000018b0| 65 6c 69 65 76 65 0a 74 | 68 61 74 20 5c 63 64 72 |elieve.t|hat \cdr|
|000018c0| 6f 6d 5c 20 64 72 69 76 | 65 73 20 61 72 65 20 73 |om\ driv|es are s|
|000018d0| 70 65 63 69 66 69 63 20 | 65 6e 6f 75 67 68 20 28 |pecific |enough (|
|000018e0| 69 2e 65 2e 2c 20 64 69 | 66 66 65 72 65 6e 74 20 |i.e., di|fferent |
|000018f0| 66 72 6f 6d 20 6f 74 68 | 65 72 0a 62 6c 6f 63 6b |from oth|er.block|
|00001900| 2d 64 65 76 69 63 65 73 | 20 73 75 63 68 20 61 73 |-devices| such as|
|00001910| 20 66 6c 6f 70 70 79 20 | 6f 72 20 68 61 72 64 20 | floppy |or hard |
|00001920| 64 69 73 63 20 64 72 69 | 76 65 73 29 2c 20 74 6f |disc dri|ves), to|
|00001930| 20 64 65 66 69 6e 65 20 | 61 20 73 65 74 20 6f 66 | define |a set of|
|00001940| 0a 7b 5c 65 6d 20 5c 63 | 64 72 6f 6d 5c 20 64 65 |.{\em \c|drom\ de|
|00001950| 76 69 63 65 20 6f 70 65 | 72 61 74 69 6f 6e 73 7d |vice ope|rations}|
|00001960| 2c 20 24 3c 63 64 72 6f | 6d 2d 64 65 76 69 63 65 |, $<cdro|m-device|
|00001970| 3e 5f 64 6f 70 73 24 2e | 20 54 68 65 73 65 20 61 |>_dops$.| These a|
|00001980| 72 65 20 6f 66 20 61 0a | 64 69 66 66 65 72 65 6e |re of a.|differen|
|00001990| 74 20 6e 61 74 75 72 65 | 20 74 68 61 6e 20 74 68 |t nature| than th|
|000019a0| 65 20 63 6c 61 73 73 69 | 63 61 6c 20 62 6c 6f 63 |e classi|cal bloc|
|000019b0| 6b 2d 64 65 76 69 63 65 | 20 66 69 6c 65 20 6f 70 |k-device| file op|
|000019c0| 65 72 61 74 69 6f 6e 73 | 0a 24 3c 62 6c 6f 63 6b |erations|.$<block|
|000019d0| 2d 64 65 76 69 63 65 3e | 5f 66 6f 70 73 24 2e 0a |-device>|_fops$..|
|000019e0| 0a 54 68 65 20 65 78 74 | 72 61 20 69 6e 74 65 72 |.The ext|ra inter|
|000019f0| 66 61 63 69 6e 67 20 6c | 65 76 65 6c 20 72 6f 75 |facing l|evel rou|
|00001a00| 74 69 6e 65 73 20 61 72 | 65 20 69 6d 70 6c 65 6d |tines ar|e implem|
|00001a10| 65 6e 74 65 64 20 69 6e | 20 61 20 66 69 6c 65 0a |ented in| a file.|
|00001a20| 5c 63 64 72 6f 6d 63 2c | 20 61 6e 64 20 61 20 6c |\cdromc,| and a l|
|00001a30| 6f 77 2d 6c 65 76 65 6c | 20 5c 63 64 72 6f 6d 5c |ow-level| \cdrom\|
|00001a40| 20 64 72 69 76 65 72 20 | 68 61 6e 64 73 20 6f 76 | driver |hands ov|
|00001a50| 65 72 20 74 68 65 20 69 | 6e 74 65 72 66 61 63 69 |er the i|nterfaci|
|00001a60| 6e 67 20 74 6f 0a 74 68 | 65 20 6b 65 72 6e 65 6c |ng to.th|e kernel|
|00001a70| 20 62 79 20 72 65 67 69 | 73 74 65 72 69 6e 67 20 | by regi|stering |
|00001a80| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 67 65 |the foll|owing ge|
|00001a90| 6e 65 72 61 6c 20 24 73 | 74 72 75 63 74 5c 20 66 |neral $s|truct\ f|
|00001aa0| 69 6c 65 5f 6f 70 65 72 | 61 74 69 6f 6e 73 24 3a |ile_oper|ations$:|
|00001ab0| 0a 24 24 0a 5c 68 61 6c | 69 67 6e 7b 24 23 24 5c |.$$.\hal|ign{$#$\|
|00001ac0| 20 5c 68 66 69 6c 26 24 | 23 24 5c 20 5c 68 66 69 | \hfil&$|#$\ \hfi|
|00001ad0| 6c 26 24 2f 2a 24 20 5c | 72 6d 23 20 24 2a 2f 24 |l&$/*$ \|rm# $*/$|
|00001ae0| 5c 68 66 69 6c 5c 63 72 | 0a 73 74 72 75 63 74 26 |\hfil\cr|.struct&|
|00001af0| 20 66 69 6c 65 5f 6f 70 | 65 72 61 74 69 6f 6e 73 | file_op|erations|
|00001b00| 5c 20 63 64 72 6f 6d 5f | 66 6f 70 73 20 3d 20 5c |\ cdrom_|fops = \|
|00001b10| 7b 5c 68 69 64 65 77 69 | 64 74 68 5c 63 72 0a 20 |{\hidewi|dth\cr. |
|00001b20| 20 20 20 20 20 20 20 26 | 4e 55 4c 4c 2c 20 20 20 | &|NULL, |
|00001b30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 26 | | &|
|00001b40| 20 6c 73 65 65 6b 20 5c | 63 72 0a 20 20 20 20 20 | lseek \|cr. |
|00001b50| 20 20 20 26 62 6c 6f 63 | 6b 5f 72 65 61 64 2c 20 | &bloc|k_read, |
|00001b60| 20 20 20 20 20 20 20 20 | 20 20 20 26 20 72 65 61 | | & rea|
|00001b70| 64 2d 2d 2d 67 65 6e 65 | 72 61 6c 5c 20 62 6c 6f |d---gene|ral\ blo|
|00001b80| 63 6b 2d 64 65 76 5c 20 | 72 65 61 64 20 5c 63 72 |ck-dev\ |read \cr|
|00001b90| 0a 20 20 20 20 20 20 20 | 20 26 62 6c 6f 63 6b 5f |. | &block_|
|00001ba0| 77 72 69 74 65 2c 20 20 | 20 20 20 20 20 20 20 20 |write, | |
|00001bb0| 20 26 20 77 72 69 74 65 | 2d 2d 2d 67 65 6e 65 72 | & write|---gener|
|00001bc0| 61 6c 20 62 6c 6f 63 6b | 2d 64 65 76 20 77 72 69 |al block|-dev wri|
|00001bd0| 74 65 20 5c 63 72 0a 20 | 20 20 20 20 20 20 20 26 |te \cr. | &|
|00001be0| 4e 55 4c 4c 2c 20 20 20 | 20 20 20 20 20 20 20 20 |NULL, | |
|00001bf0| 20 20 20 20 20 20 20 26 | 20 72 65 61 64 64 69 72 | &| readdir|
|00001c00| 20 5c 63 72 0a 20 20 20 | 20 20 20 20 20 26 4e 55 | \cr. | &NU|
|00001c10| 4c 4c 2c 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |LL, | |
|00001c20| 20 20 20 20 20 26 20 73 | 65 6c 65 63 74 20 5c 63 | & s|elect \c|
|00001c30| 72 0a 20 20 20 20 20 20 | 20 20 26 63 64 72 6f 6d |r. | &cdrom|
|00001c40| 5f 69 6f 63 74 6c 2c 20 | 20 20 20 20 20 20 20 20 |_ioctl, | |
|00001c50| 20 20 26 20 69 6f 63 74 | 6c 20 5c 63 72 0a 20 20 | & ioct|l \cr. |
|00001c60| 20 20 20 20 20 20 26 4e | 55 4c 4c 2c 20 20 20 20 | &N|ULL, |
|00001c70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 26 20 | | & |
|00001c80| 6d 6d 61 70 20 5c 63 72 | 0a 20 20 20 20 20 20 20 |mmap \cr|. |
|00001c90| 20 26 63 64 72 6f 6d 5f | 6f 70 65 6e 2c 20 20 20 | &cdrom_|open, |
|00001ca0| 20 20 20 20 20 20 20 20 | 20 26 20 6f 70 65 6e 20 | | & open |
|00001cb0| 5c 63 72 0a 20 20 20 20 | 20 20 20 20 26 63 64 72 |\cr. | &cdr|
|00001cc0| 6f 6d 5f 72 65 6c 65 61 | 73 65 2c 20 20 20 20 20 |om_relea|se, |
|00001cd0| 20 20 20 20 26 20 72 65 | 6c 65 61 73 65 20 5c 63 | & re|lease \c|
|00001ce0| 72 0a 20 20 20 20 20 20 | 20 20 26 4e 55 4c 4c 2c |r. | &NULL,|
|00001cf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001d00| 20 20 26 20 66 73 79 6e | 63 20 5c 63 72 0a 20 20 | & fsyn|c \cr. |
|00001d10| 20 20 20 20 20 20 26 4e | 55 4c 4c 2c 20 20 20 20 | &N|ULL, |
|00001d20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 26 20 | | & |
|00001d30| 66 61 73 79 6e 63 20 5c | 63 72 0a 20 20 20 20 20 |fasync \|cr. |
|00001d40| 20 20 20 26 63 64 72 6f | 6d 5f 6d 65 64 69 61 5f | &cdro|m_media_|
|00001d50| 63 68 61 6e 67 65 64 2c | 20 20 20 26 20 6d 65 64 |changed,| & med|
|00001d60| 69 61 5f 63 68 61 6e 67 | 65 20 5c 63 72 0a 20 20 |ia_chang|e \cr. |
|00001d70| 20 20 20 20 20 20 26 4e | 55 4c 4c 20 20 20 20 20 | &N|ULL |
|00001d80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 26 20 | | & |
|00001d90| 72 65 76 61 6c 69 64 61 | 74 65 20 5c 63 72 0a 5c |revalida|te \cr.\|
|00001da0| 7d 3b 5c 63 72 0a 7d 0a | 24 24 0a 45 76 65 72 79 |};\cr.}.|$$.Every|
|00001db0| 20 61 63 74 69 76 65 20 | 5c 63 64 72 6f 6d 5c 20 | active |\cdrom\ |
|00001dc0| 64 65 76 69 63 65 20 73 | 68 61 72 65 73 20 74 68 |device s|hares th|
|00001dd0| 69 73 20 24 73 74 72 75 | 63 74 24 2e 20 54 68 65 |is $stru|ct$. The|
|00001de0| 20 72 6f 75 74 69 6e 65 | 73 20 64 65 63 6c 61 72 | routine|s declar|
|00001df0| 65 64 0a 61 62 6f 76 65 | 20 61 72 65 20 61 6c 6c |ed.above| are all|
|00001e00| 20 69 6d 70 6c 65 6d 65 | 6e 74 65 64 20 69 6e 20 | impleme|nted in |
|00001e10| 5c 63 64 72 6f 6d 63 2c | 20 61 6e 64 20 74 68 69 |\cdromc,| and thi|
|00001e20| 73 20 69 73 20 74 68 65 | 20 70 6c 61 63 65 20 77 |s is the| place w|
|00001e30| 68 65 72 65 20 74 68 65 | 0a 7b 5c 65 6d 20 62 65 |here the|.{\em be|
|00001e40| 68 61 76 69 6f 72 5c 2f | 7d 20 6f 66 20 61 6c 6c |havior\/|} of all|
|00001e50| 20 5c 63 64 72 6f 6d 2d | 64 65 76 69 63 65 73 20 | \cdrom-|devices |
|00001e60| 69 73 20 64 65 66 69 6e | 65 64 2c 20 61 6e 64 20 |is defin|ed, and |
|00001e70| 68 65 6e 63 65 0a 73 74 | 61 6e 64 61 72 64 69 7a |hence.st|andardiz|
|00001e80| 65 64 2e 20 54 68 65 20 | 69 6d 70 6c 65 6d 65 6e |ed. The |implemen|
|00001e90| 74 61 74 69 6f 6e 20 6f | 66 20 74 68 65 20 69 6e |tation o|f the in|
|00001ea0| 74 65 72 66 61 63 69 6e | 67 20 74 6f 20 74 68 65 |terfacin|g to the|
|00001eb0| 20 76 61 72 69 6f 75 73 | 0a 74 79 70 65 73 20 6f | various|.types o|
|00001ec0| 66 20 68 61 72 64 77 61 | 72 65 20 73 74 69 6c 6c |f hardwa|re still|
|00001ed0| 20 69 73 20 64 6f 6e 65 | 20 62 79 20 74 68 65 20 | is done| by the |
|00001ee0| 76 61 72 69 6f 75 73 20 | 5c 63 64 72 6f 6d 2d 64 |various |\cdrom-d|
|00001ef0| 65 76 69 63 65 20 64 72 | 69 76 65 72 73 2c 0a 62 |evice dr|ivers,.b|
|00001f00| 75 74 20 74 68 65 73 65 | 20 72 6f 75 74 69 6e 65 |ut these| routine|
|00001f10| 73 20 6f 6e 6c 79 20 69 | 6d 70 6c 65 6d 65 6e 74 |s only i|mplement|
|00001f20| 20 63 65 72 74 61 69 6e | 20 7b 5c 65 6d 20 63 61 | certain| {\em ca|
|00001f30| 70 61 62 69 6c 69 74 69 | 65 73 5c 2f 7d 20 74 68 |pabiliti|es\/} th|
|00001f40| 61 74 0a 61 72 65 20 74 | 79 70 69 63 61 6c 20 74 |at.are t|ypical t|
|00001f50| 6f 20 5c 63 64 72 6f 6d | 5c 20 28 72 65 6d 6f 76 |o \cdrom|\ (remov|
|00001f60| 61 62 6c 65 2d 6d 65 64 | 69 61 29 20 64 65 76 69 |able-med|ia) devi|
|00001f70| 63 65 73 2e 0a 0a 52 65 | 67 69 73 74 72 61 74 69 |ces...Re|gistrati|
|00001f80| 6f 6e 20 6f 66 20 74 68 | 65 20 5c 63 64 72 6f 6d |on of th|e \cdrom|
|00001f90| 5c 20 64 65 76 69 63 65 | 20 64 72 69 76 65 72 20 |\ device| driver |
|00001fa0| 73 68 6f 75 6c 64 20 6e | 6f 77 20 62 65 20 74 6f |should n|ow be to|
|00001fb0| 20 74 68 65 20 67 65 6e | 65 72 61 6c 0a 72 6f 75 | the gen|eral.rou|
|00001fc0| 74 69 6e 65 73 20 69 6e | 20 5c 63 64 72 6f 6d 63 |tines in| \cdromc|
|00001fd0| 2c 20 6e 6f 74 20 74 6f | 20 74 68 65 20 56 46 53 |, not to| the VFS|
|00001fe0| 20 61 6e 79 20 6d 6f 72 | 65 2e 20 54 68 69 73 20 | any mor|e. This |
|00001ff0| 69 73 20 64 6f 6e 65 20 | 74 68 6f 75 67 68 20 74 |is done |though t|
|00002000| 68 65 0a 63 61 6c 6c 0a | 24 24 72 65 67 69 73 74 |he.call.|$$regist|
|00002010| 65 72 5f 63 64 72 6f 6d | 28 69 6e 74 5c 20 6d 61 |er_cdrom|(int\ ma|
|00002020| 6a 6f 72 2c 20 63 68 61 | 72 20 2a 20 6e 61 6d 65 |jor, cha|r * name|
|00002030| 2c 20 0a 20 20 73 74 72 | 75 63 74 5c 20 63 64 72 |, . str|uct\ cdr|
|00002040| 6f 6d 5f 64 65 76 69 63 | 65 5f 6f 70 73 5c 20 64 |om_devic|e_ops\ d|
|00002050| 65 76 69 63 65 5f 6f 70 | 74 69 6f 6e 73 29 0a 24 |evice_op|tions).$|
|00002060| 24 0a 0a 54 68 65 20 64 | 65 76 69 63 65 20 6f 70 |$..The d|evice op|
|00002070| 65 72 61 74 69 6f 6e 73 | 20 73 74 72 75 63 74 75 |erations| structu|
|00002080| 72 65 20 6c 69 73 74 73 | 20 74 68 65 20 69 6d 70 |re lists| the imp|
|00002090| 6c 65 6d 65 6e 74 65 64 | 20 72 6f 75 74 69 6e 65 |lemented| routine|
|000020a0| 73 20 66 6f 72 0a 69 6e | 74 65 72 66 61 63 69 6e |s for.in|terfacin|
|000020b0| 67 20 74 6f 20 74 68 65 | 20 68 61 72 64 77 61 72 |g to the| hardwar|
|000020c0| 65 2c 20 61 6e 64 20 73 | 6f 6d 65 20 73 70 65 63 |e, and s|ome spec|
|000020d0| 69 66 69 63 61 74 69 6f | 6e 73 20 6f 66 20 63 61 |ificatio|ns of ca|
|000020e0| 70 61 62 69 6c 69 74 69 | 65 73 0a 6f 66 20 74 68 |pabiliti|es.of th|
|000020f0| 65 20 64 65 76 69 63 65 | 2c 20 73 75 63 68 20 61 |e device|, such a|
|00002100| 73 20 74 68 65 20 6d 61 | 78 69 6d 75 6d 20 68 65 |s the ma|ximum he|
|00002110| 61 64 2d 74 72 61 6e 73 | 66 65 72 20 72 61 74 65 |ad-trans|fer rate|
|00002120| 2e 20 20 5b 49 74 20 69 | 73 0a 69 6d 70 6f 73 73 |. [It i|s.imposs|
|00002130| 69 62 6c 65 20 74 6f 20 | 63 6f 6d 65 20 75 70 20 |ible to |come up |
|00002140| 77 69 74 68 20 61 20 63 | 6f 6d 70 6c 65 74 65 20 |with a c|omplete |
|00002150| 6c 69 73 74 20 6f 66 20 | 61 6c 6c 20 63 61 70 61 |list of |all capa|
|00002160| 62 69 6c 69 74 69 65 73 | 20 6f 66 0a 28 66 75 74 |bilities| of.(fut|
|00002170| 75 72 65 29 20 5c 63 64 | 72 6f 6d 5c 20 64 72 69 |ure) \cd|rom\ dri|
|00002180| 76 65 73 2c 20 61 73 20 | 74 68 65 20 64 65 76 65 |ves, as |the deve|
|00002190| 6c 6f 70 6d 65 6e 74 73 | 20 69 6e 20 74 65 63 68 |lopments| in tech|
|000021a0| 6e 6f 6c 6f 67 79 20 66 | 6f 6c 6c 6f 77 2d 75 70 |nology f|ollow-up|
|000021b0| 0a 61 74 20 61 6e 20 69 | 6e 63 72 65 64 69 62 6c |.at an i|ncredibl|
|000021c0| 65 20 72 61 74 65 2e 20 | 4d 61 79 62 65 20 77 72 |e rate. |Maybe wr|
|000021d0| 69 74 65 2d 6f 70 65 72 | 61 74 69 6f 6e 20 28 57 |ite-oper|ation (W|
|000021e0| 4f 52 4d 20 64 65 76 69 | 63 65 73 29 20 77 69 6c |ORM devi|ces) wil|
|000021f0| 6c 0a 62 65 63 6f 6d 65 | 20 76 65 72 79 20 70 6f |l.become| very po|
|00002200| 70 75 6c 61 72 20 69 6e | 20 74 68 65 20 66 75 74 |pular in| the fut|
|00002210| 75 72 65 2e 5d 20 20 54 | 68 65 20 6c 69 73 74 20 |ure.] T|he list |
|00002220| 6e 6f 77 20 69 73 3a 0a | 24 24 0a 5c 68 61 6c 69 |now is:.|$$.\hali|
|00002230| 67 6e 7b 24 23 24 5c 20 | 5c 68 66 69 6c 26 24 23 |gn{$#$\ |\hfil&$#|
|00002240| 24 5c 20 5c 68 66 69 6c | 26 5c 68 62 6f 78 20 74 |$\ \hfil|&\hbox t|
|00002250| 6f 20 31 30 65 6d 7b 24 | 23 24 5c 68 73 73 7d 26 |o 10em{$|#$\hss}&|
|00002260| 0a 20 20 24 2f 2a 24 20 | 5c 72 6d 23 20 24 2a 2f |. $/*$ |\rm# $*/|
|00002270| 24 5c 68 66 69 6c 5c 63 | 72 0a 73 74 72 75 63 74 |$\hfil\c|r.struct|
|00002280| 26 20 63 64 72 6f 6d 5f | 64 65 76 69 63 65 5f 6f |& cdrom_|device_o|
|00002290| 70 73 5c 20 5c 7b 20 5c | 68 69 64 65 77 69 64 74 |ps\ \{ \|hidewidt|
|000022a0| 68 5c 63 72 0a 20 20 26 | 69 6e 74 26 20 28 2a 20 |h\cr. &|int& (* |
|000022b0| 6f 70 65 6e 29 28 6b 64 | 65 76 5f 74 2c 20 69 6e |open)(kd|ev_t, in|
|000022c0| 74 29 5c 63 72 0a 20 20 | 26 76 6f 69 64 26 20 28 |t)\cr. |&void& (|
|000022d0| 2a 20 72 65 6c 65 61 73 | 65 29 28 6b 64 65 76 5f |* releas|e)(kdev_|
|000022e0| 74 29 3b 5c 63 72 20 0a | 20 20 26 69 6e 74 26 20 |t);\cr .| &int& |
|000022f0| 28 2a 20 6f 70 65 6e 5f | 66 69 6c 65 73 29 28 6b |(* open_|files)(k|
|00002300| 64 65 76 5f 74 29 3b 20 | 20 5c 63 72 0a 20 20 26 |dev_t); | \cr. &|
|00002310| 69 6e 74 26 20 28 2a 20 | 64 72 69 76 65 5f 73 74 |int& (* |drive_st|
|00002320| 61 74 75 73 29 28 6b 64 | 65 76 5f 74 29 3b 5c 63 |atus)(kd|ev_t);\c|
|00002330| 72 20 20 20 20 20 0a 20 | 20 26 69 6e 74 26 20 28 |r . | &int& (|
|00002340| 2a 20 64 69 73 63 5f 73 | 74 61 74 75 73 29 28 6b |* disc_s|tatus)(k|
|00002350| 64 65 76 5f 74 29 3b 5c | 63 72 20 20 20 20 20 20 |dev_t);\|cr |
|00002360| 0a 20 20 26 69 6e 74 26 | 20 28 2a 20 6d 65 64 69 |. &int&| (* medi|
|00002370| 61 5f 63 68 61 6e 67 65 | 64 29 28 6b 64 65 76 5f |a_change|d)(kdev_|
|00002380| 74 29 3b 5c 63 72 20 0a | 20 20 26 69 6e 74 26 20 |t);\cr .| &int& |
|00002390| 28 2a 20 74 72 61 79 5f | 6d 6f 76 65 29 28 6b 64 |(* tray_|move)(kd|
|000023a0| 65 76 5f 74 2c 20 69 6e | 74 29 3b 5c 63 72 0a 20 |ev_t, in|t);\cr. |
|000023b0| 20 26 69 6e 74 26 20 28 | 2a 20 6c 6f 63 6b 5f 64 | &int& (|* lock_d|
|000023c0| 6f 6f 72 29 28 6b 64 65 | 76 5f 74 2c 20 69 6e 74 |oor)(kde|v_t, int|
|000023d0| 29 3b 5c 63 72 0a 20 20 | 26 69 6e 74 26 20 28 2a |);\cr. |&int& (*|
|000023e0| 20 73 65 6c 65 63 74 5f | 73 70 65 65 64 29 28 6b | select_|speed)(k|
|000023f0| 64 65 76 5f 74 2c 20 69 | 6e 74 29 3b 5c 63 72 0a |dev_t, i|nt);\cr.|
|00002400| 20 20 26 69 6e 74 26 20 | 28 2a 20 73 65 6c 65 63 | &int& |(* selec|
|00002410| 74 5f 64 69 73 63 29 28 | 6b 64 65 76 5f 74 2c 20 |t_disc)(|kdev_t, |
|00002420| 69 6e 74 29 3b 5c 63 72 | 0a 20 20 26 69 6e 74 26 |int);\cr|. &int&|
|00002430| 20 28 2a 20 67 65 74 5f | 6c 61 73 74 5f 73 65 73 | (* get_|last_ses|
|00002440| 73 69 6f 6e 29 20 28 6b | 64 65 76 5f 74 2c 20 73 |sion) (k|dev_t, s|
|00002450| 74 72 75 63 74 5c 20 63 | 64 72 6f 6d 5f 6d 75 6c |truct\ c|drom_mul|
|00002460| 74 69 73 65 73 73 69 6f | 6e 20 2a 7b 7d 29 3b 5c |tisessio|n *{});\|
|00002470| 63 72 0a 20 20 26 69 6e | 74 26 20 28 2a 20 67 65 |cr. &in|t& (* ge|
|00002480| 74 5f 6d 63 6e 29 28 6b | 64 65 76 5f 74 2c 20 73 |t_mcn)(k|dev_t, s|
|00002490| 74 72 75 63 74 5c 20 63 | 64 72 6f 6d 5f 6d 63 6e |truct\ c|drom_mcn|
|000024a0| 20 2a 7b 7d 29 3b 5c 63 | 72 0a 20 20 26 69 6e 74 | *{});\c|r. &int|
|000024b0| 26 20 28 2a 20 72 65 73 | 65 74 29 28 6b 64 65 76 |& (* res|et)(kdev|
|000024c0| 5f 74 29 3b 5c 63 72 0a | 20 20 26 69 6e 74 26 20 |_t);\cr.| &int& |
|000024d0| 28 2a 20 61 75 64 69 6f | 5f 69 6f 63 74 6c 29 28 |(* audio|_ioctl)(|
|000024e0| 6b 64 65 76 5f 74 2c 20 | 75 6e 73 69 67 6e 65 64 |kdev_t, |unsigned|
|000024f0| 5c 20 69 6e 74 2c 20 76 | 6f 69 64 20 2a 7b 7d 29 |\ int, v|oid *{})|
|00002500| 3b 5c 63 72 20 0a 20 20 | 26 69 6e 74 26 20 28 2a |;\cr . |&int& (*|
|00002510| 20 64 65 76 5f 69 6f 63 | 74 6c 29 28 6b 64 65 76 | dev_ioc|tl)(kdev|
|00002520| 5f 74 2c 20 75 6e 73 69 | 67 6e 65 64 5c 20 69 6e |_t, unsi|gned\ in|
|00002530| 74 2c 20 75 6e 73 69 67 | 6e 65 64 5c 20 6c 6f 6e |t, unsig|ned\ lon|
|00002540| 67 29 3b 5c 63 72 0a 5c | 6e 6f 61 6c 69 67 6e 7b |g);\cr.\|noalign{|
|00002550| 5c 6d 65 64 73 6b 69 70 | 7d 0a 20 20 26 5c 6c 6c |\medskip|}. &\ll|
|00002560| 61 70 7b 63 6f 6e 73 74 | 5c 20 7d 69 6e 74 26 20 |ap{const|\ }int& |
|00002570| 63 61 70 61 62 69 6c 69 | 74 79 3b 26 20 20 63 61 |capabili|ty;& ca|
|00002580| 70 61 62 69 6c 69 74 79 | 20 66 6c 61 67 73 20 5c |pability| flags \|
|00002590| 63 72 0a 20 20 26 69 6e | 74 26 20 6d 61 73 6b 3b |cr. &in|t& mask;|
|000025a0| 26 20 6d 61 73 6b 20 6f | 66 20 63 61 70 61 62 69 |& mask o|f capabi|
|000025b0| 6c 69 74 79 3a 20 64 69 | 73 61 62 6c 65 73 20 74 |lity: di|sables t|
|000025c0| 68 65 6d 20 5c 63 72 0a | 20 20 26 5c 6c 6c 61 70 |hem \cr.| &\llap|
|000025d0| 7b 24 63 6f 6e 73 74 5c | 20 24 7d 66 6c 6f 61 74 |{$const\| $}float|
|000025e0| 26 20 73 70 65 65 64 3b | 26 20 20 6d 61 78 69 6d |& speed;|& maxim|
|000025f0| 75 6d 20 73 70 65 65 64 | 20 66 6f 72 20 72 65 61 |um speed| for rea|
|00002600| 64 69 6e 67 20 64 61 74 | 61 20 5c 63 72 0a 20 20 |ding dat|a \cr. |
|00002610| 26 5c 6c 6c 61 70 7b 24 | 63 6f 6e 73 74 5c 20 24 |&\llap{$|const\ $|
|00002620| 7d 69 6e 74 26 20 6d 69 | 6e 6f 72 73 3b 26 20 6e |}int& mi|nors;& n|
|00002630| 75 6d 62 65 72 20 6f 66 | 20 73 75 70 70 6f 72 74 |umber of| support|
|00002640| 65 64 20 6d 69 6e 6f 72 | 20 64 65 76 69 63 65 73 |ed minor| devices|
|00002650| 20 5c 63 72 0a 20 20 26 | 5c 6c 6c 61 70 7b 24 63 | \cr. &|\llap{$c|
|00002660| 6f 6e 73 74 5c 20 24 7d | 69 6e 74 26 20 63 61 70 |onst\ $}|int& cap|
|00002670| 61 63 69 74 79 3b 26 20 | 6e 75 6d 62 65 72 20 6f |acity;& |number o|
|00002680| 66 20 64 69 73 63 73 20 | 69 6e 20 6a 75 6b 65 62 |f discs |in jukeb|
|00002690| 6f 78 20 5c 63 72 0a 5c | 6e 6f 61 6c 69 67 6e 7b |ox \cr.\|noalign{|
|000026a0| 5c 6d 65 64 73 6b 69 70 | 7d 0a 20 20 26 69 6e 74 |\medskip|}. &int|
|000026b0| 26 20 6f 70 74 69 6f 6e | 73 3b 26 20 6f 70 74 69 |& option|s;& opti|
|000026c0| 6f 6e 73 20 66 6c 61 67 | 73 20 5c 63 72 0a 20 20 |ons flag|s \cr. |
|000026d0| 26 6c 6f 6e 67 26 20 6d | 63 5f 66 6c 61 67 73 3b |&long& m|c_flags;|
|000026e0| 26 20 6d 65 64 69 61 2d | 63 68 61 6e 67 65 20 62 |& media-|change b|
|000026f0| 75 66 66 65 72 20 66 6c | 61 67 73 20 28 24 32 5c |uffer fl|ags ($2\|
|00002700| 74 69 6d 65 73 31 36 24 | 29 20 5c 63 72 0a 5c 7d |times16$|) \cr.\}|
|00002710| 5c 63 72 0a 7d 0a 24 24 | 20 54 68 65 20 5c 63 64 |\cr.}.$$| The \cd|
|00002720| 72 6f 6d 2d 64 72 69 76 | 65 72 20 73 68 6f 75 6c |rom-driv|er shoul|
|00002730| 64 20 73 69 6d 70 6c 79 | 20 69 6d 70 6c 65 6d 65 |d simply| impleme|
|00002740| 6e 74 20 28 73 6f 6d 65 | 20 6f 66 29 20 74 68 65 |nt (some| of) the|
|00002750| 73 65 0a 66 75 6e 63 74 | 69 6f 6e 73 2c 20 61 6e |se.funct|ions, an|
|00002760| 64 20 72 65 67 69 73 74 | 65 72 20 74 68 65 20 66 |d regist|er the f|
|00002770| 75 6e 63 74 69 6f 6e 73 | 20 74 6f 20 74 68 65 20 |unctions| to the |
|00002780| 67 6c 6f 62 61 6c 20 5c | 63 64 72 6f 6d 5c 20 64 |global \|cdrom\ d|
|00002790| 72 69 76 65 72 2c 0a 77 | 68 69 63 68 20 70 65 72 |river,.w|hich per|
|000027a0| 66 6f 72 6d 73 20 69 6e | 74 65 72 66 61 63 69 6e |forms in|terfacin|
|000027b0| 67 20 77 69 74 68 20 74 | 68 65 20 56 69 72 74 75 |g with t|he Virtu|
|000027c0| 61 6c 20 46 69 6c 65 20 | 53 79 73 74 65 6d 20 61 |al File |System a|
|000027d0| 6e 64 20 73 79 73 74 65 | 6d 0a 24 69 6f 63 74 6c |nd syste|m.$ioctl|
|000027e0| 24 73 2e 20 54 68 65 20 | 66 6c 61 67 73 20 24 63 |$s. The |flags $c|
|000027f0| 61 70 61 62 69 6c 69 74 | 79 24 20 73 70 65 63 69 |apabilit|y$ speci|
|00002800| 66 79 20 74 68 65 20 68 | 61 72 64 77 61 72 65 2d |fy the h|ardware-|
|00002810| 63 61 70 61 62 69 6c 69 | 74 69 65 73 20 6f 6e 0a |capabili|ties on.|
|00002820| 72 65 67 69 73 74 72 61 | 74 69 6f 6e 20 6f 66 20 |registra|tion of |
|00002830| 74 68 65 20 64 65 76 69 | 63 65 2c 20 74 68 65 20 |the devi|ce, the |
|00002840| 66 6c 61 67 73 20 24 6d | 61 73 6b 24 20 63 61 6e |flags $m|ask$ can|
|00002850| 20 62 65 20 75 73 65 64 | 20 74 6f 20 6d 61 73 6b | be used| to mask|
|00002860| 20 73 6f 6d 65 0a 6f 66 | 20 74 68 6f 73 65 20 63 | some.of| those c|
|00002870| 61 70 61 62 69 6c 69 74 | 69 65 73 20 28 66 6f 72 |apabilit|ies (for|
|00002880| 20 6f 6e 65 20 72 65 61 | 73 6f 6e 20 6f 72 20 61 | one rea|son or a|
|00002890| 6e 6f 74 68 65 72 29 2e | 20 54 68 65 20 76 61 6c |nother).| The val|
|000028a0| 75 65 20 24 6d 69 6e 6f | 72 73 24 0a 73 68 6f 75 |ue $mino|rs$.shou|
|000028b0| 6c 64 20 62 65 20 61 20 | 70 6f 73 69 74 69 76 65 |ld be a |positive|
|000028c0| 20 76 61 6c 75 65 20 69 | 6e 64 69 63 61 74 69 6e | value i|ndicatin|
|000028d0| 67 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |g the nu|mber of |
|000028e0| 6d 69 6e 6f 72 20 64 65 | 76 69 63 65 73 20 74 68 |minor de|vices th|
|000028f0| 61 74 0a 61 72 65 20 73 | 75 70 70 6f 72 74 65 64 |at.are s|upported|
|00002900| 20 62 79 20 74 68 65 20 | 64 72 69 76 65 72 2c 20 | by the |driver, |
|00002910| 6e 6f 72 6d 61 6c 6c 79 | 7e 31 2e 20 20 28 54 68 |normally|~1. (Th|
|00002920| 65 79 20 61 72 65 20 73 | 75 70 70 6f 73 65 64 20 |ey are s|upposed |
|00002930| 74 6f 20 62 65 0a 6e 75 | 6d 62 65 72 65 64 20 66 |to be.nu|mbered f|
|00002940| 72 6f 6d 20 30 20 75 70 | 77 61 72 64 73 29 2e 20 |rom 0 up|wards). |
|00002950| 54 68 65 20 76 61 6c 75 | 65 20 24 63 61 70 61 63 |The valu|e $capac|
|00002960| 69 74 79 24 20 73 68 6f | 75 6c 64 20 62 65 20 74 |ity$ sho|uld be t|
|00002970| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 0a 64 69 73 |he numbe|r of.dis|
|00002980| 63 73 20 74 68 65 20 64 | 72 69 76 65 20 63 61 6e |cs the d|rive can|
|00002990| 20 68 6f 6c 64 20 73 69 | 6d 75 6c 74 61 6e 65 6f | hold si|multaneo|
|000029a0| 75 73 6c 79 2c 20 69 66 | 20 69 74 20 69 73 20 64 |usly, if| it is d|
|000029b0| 65 73 69 67 6e 65 64 20 | 61 73 20 61 0a 6a 75 6b |esigned |as a.juk|
|000029c0| 65 2d 62 6f 78 2c 20 6f | 72 20 6f 74 68 65 72 77 |e-box, o|r otherw|
|000029d0| 69 73 65 7e 31 2e 0a 0a | 54 77 6f 20 72 65 67 69 |ise~1...|Two regi|
|000029e0| 73 74 65 72 73 20 63 6f | 6e 74 61 69 6e 20 76 61 |sters co|ntain va|
|000029f0| 72 69 61 62 6c 65 73 20 | 6c 6f 63 61 6c 20 74 6f |riables |local to|
|00002a00| 20 74 68 65 20 5c 63 64 | 72 6f 6d 5c 20 64 65 76 | the \cd|rom\ dev|
|00002a10| 69 63 65 2e 20 54 68 65 | 20 66 6c 61 67 73 0a 24 |ice. The| flags.$|
|00002a20| 6f 70 74 69 6f 6e 73 24 | 20 61 72 65 20 75 73 65 |options$| are use|
|00002a30| 64 20 74 6f 20 73 70 65 | 63 69 66 79 20 68 6f 77 |d to spe|cify how|
|00002a40| 20 74 68 65 20 67 65 6e | 65 72 61 6c 20 5c 63 64 | the gen|eral \cd|
|00002a50| 72 6f 6d 5c 20 72 6f 75 | 74 69 6e 65 73 0a 73 68 |rom\ rou|tines.sh|
|00002a60| 6f 75 6c 64 20 62 65 68 | 61 76 65 2e 20 54 68 65 |ould beh|ave. The|
|00002a70| 73 65 20 76 61 72 69 6f | 75 73 20 66 6c 61 67 73 |se vario|us flags|
|00002a80| 20 72 65 67 69 73 74 65 | 72 73 20 73 68 6f 75 6c | registe|rs shoul|
|00002a90| 64 20 70 72 6f 76 69 64 | 65 20 65 6e 6f 75 67 68 |d provid|e enough|
|00002aa0| 0a 66 6c 65 78 69 62 69 | 6c 69 74 79 20 74 6f 20 |.flexibi|lity to |
|00002ab0| 61 64 61 70 74 20 74 6f | 20 74 68 65 20 64 69 66 |adapt to| the dif|
|00002ac0| 66 65 72 65 6e 74 20 75 | 73 65 72 27 73 20 77 69 |ferent u|ser's wi|
|00002ad0| 73 68 65 73 20 28 61 6e | 64 20 7b 5c 65 6d 20 6e |shes (an|d {\em n|
|00002ae0| 6f 74 5c 2f 7d 0a 74 68 | 65 20 60 61 72 62 69 74 |ot\/}.th|e `arbit|
|00002af0| 72 61 72 79 27 20 77 69 | 73 68 65 73 20 6f 66 20 |rary' wi|shes of |
|00002b00| 74 68 65 20 61 75 74 68 | 6f 72 20 6f 66 20 74 68 |the auth|or of th|
|00002b10| 65 20 6c 6f 77 2d 6c 65 | 76 65 6c 20 64 65 76 69 |e low-le|vel devi|
|00002b20| 63 65 20 64 72 69 76 65 | 72 2c 0a 61 73 20 69 73 |ce drive|r,.as is|
|00002b30| 20 74 68 65 20 63 61 73 | 65 20 69 6e 20 74 68 65 | the cas|e in the|
|00002b40| 20 6f 6c 64 20 73 63 68 | 65 6d 65 29 2e 20 54 68 | old sch|eme). Th|
|00002b50| 65 20 72 65 67 69 73 74 | 65 72 20 24 6d 63 5f 66 |e regist|er $mc_f|
|00002b60| 6c 61 67 73 24 20 69 73 | 20 75 73 65 64 20 74 6f |lags$ is| used to|
|00002b70| 0a 62 75 66 66 65 72 20 | 74 68 65 20 69 6e 66 6f |.buffer |the info|
|00002b80| 72 6d 61 74 69 6f 6e 20 | 66 72 6f 6d 20 24 6d 65 |rmation |from $me|
|00002b90| 64 69 61 5f 63 68 61 6e | 67 65 64 28 29 24 20 74 |dia_chan|ged()$ t|
|00002ba0| 6f 20 74 77 6f 20 73 65 | 70 61 72 61 74 65 20 71 |o two se|parate q|
|00002bb0| 75 65 75 65 73 2e 20 0a | 0a 4e 6f 74 65 20 74 68 |ueues. .|.Note th|
|00002bc0| 61 74 20 6d 6f 73 74 20 | 66 75 6e 63 74 69 6f 6e |at most |function|
|00002bd0| 73 20 68 61 76 65 20 66 | 65 77 65 72 20 70 61 72 |s have f|ewer par|
|00002be0| 61 6d 65 74 65 72 73 20 | 74 68 61 6e 20 74 68 65 |ameters |than the|
|00002bf0| 69 72 0a 24 62 6c 6b 64 | 65 76 5f 66 6f 70 73 24 |ir.$blkd|ev_fops$|
|00002c00| 20 63 6f 75 6e 74 65 72 | 70 61 72 74 73 2e 20 54 | counter|parts. T|
|00002c10| 68 69 73 20 69 73 20 62 | 65 63 61 75 73 65 20 76 |his is b|ecause v|
|00002c20| 65 72 79 20 6c 69 74 74 | 6c 65 20 6f 66 20 74 68 |ery litt|le of th|
|00002c30| 65 0a 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 69 6e |e.inform|ation in|
|00002c40| 20 74 68 65 20 73 74 72 | 75 63 74 75 72 65 73 20 | the str|uctures |
|00002c50| 24 69 6e 6f 64 65 24 20 | 61 6e 64 20 24 66 69 6c |$inode$ |and $fil|
|00002c60| 65 24 20 61 72 65 20 75 | 73 65 64 2c 20 74 68 65 |e$ are u|sed, the|
|00002c70| 20 6d 61 69 6e 0a 70 61 | 72 61 6d 65 74 65 72 20 | main.pa|rameter |
|00002c80| 69 73 20 74 68 65 20 64 | 65 76 69 63 65 20 24 64 |is the d|evice $d|
|00002c90| 65 76 24 2c 20 66 72 6f | 6d 20 77 68 69 63 68 20 |ev$, fro|m which |
|00002ca0| 74 68 65 20 6d 69 6e 6f | 72 2d 6e 75 6d 62 65 72 |the mino|r-number|
|00002cb0| 20 63 61 6e 20 62 65 0a | 65 78 74 72 61 63 74 65 | can be.|extracte|
|00002cc0| 64 2e 20 28 4d 6f 73 74 | 20 6c 6f 77 2d 6c 65 76 |d. (Most| low-lev|
|00002cd0| 65 6c 20 5c 63 64 72 6f | 6d 5c 20 64 72 69 76 65 |el \cdro|m\ drive|
|00002ce0| 72 73 20 64 6f 6e 27 74 | 20 65 76 65 6e 20 6c 6f |rs don't| even lo|
|00002cf0| 6f 6b 20 61 74 20 74 68 | 61 74 20 76 61 6c 75 65 |ok at th|at value|
|00002d00| 0a 61 73 20 6f 6e 6c 79 | 20 6f 6e 65 20 64 65 76 |.as only| one dev|
|00002d10| 69 63 65 20 69 73 20 73 | 75 70 70 6f 72 74 65 64 |ice is s|upported|
|00002d20| 2e 29 0a 0a 54 68 65 20 | 69 6e 74 65 72 6d 65 64 |.)..The |intermed|
|00002d30| 69 61 74 65 20 73 6f 66 | 74 77 61 72 65 20 6c 61 |iate sof|tware la|
|00002d40| 79 65 72 20 74 68 61 74 | 20 5c 63 64 72 6f 6d 63 |yer that| \cdromc|
|00002d50| 5c 20 66 6f 72 6d 73 20 | 77 69 6c 6c 20 70 65 72 |\ forms |will per|
|00002d60| 66 6f 72 6d 73 20 73 6f | 6d 65 0a 61 64 64 69 74 |forms so|me.addit|
|00002d70| 69 6f 6e 61 6c 20 62 6f | 6f 6b 6b 65 65 70 69 6e |ional bo|okkeepin|
|00002d80| 67 2e 20 54 68 65 20 6d | 69 6e 6f 72 20 6e 75 6d |g. The m|inor num|
|00002d90| 62 65 72 20 6f 66 20 74 | 68 65 20 64 65 76 69 63 |ber of t|he devic|
|00002da0| 65 20 69 73 20 63 68 65 | 63 6b 65 64 0a 61 67 61 |e is che|cked.aga|
|00002db0| 69 6e 73 74 20 74 68 65 | 20 6d 61 78 69 6d 75 6d |inst the| maximum|
|00002dc0| 20 72 65 67 69 73 74 65 | 72 65 64 20 69 6e 20 24 | registe|red in $|
|00002dd0| 3c 64 65 76 69 63 65 3e | 5f 64 6f 70 73 24 2e 20 |<device>|_dops$. |
|00002de0| 54 68 65 20 66 75 6e 63 | 74 69 6f 6e 0a 24 63 64 |The func|tion.$cd|
|00002df0| 72 6f 6d 5f 69 6f 63 74 | 6c 28 29 24 20 77 69 6c |rom_ioct|l()$ wil|
|00002e00| 6c 20 76 65 72 69 66 79 | 20 74 68 65 20 61 70 70 |l verify| the app|
|00002e10| 72 6f 70 72 69 61 74 65 | 20 75 73 65 72 2d 6d 65 |ropriate| user-me|
|00002e20| 6d 6f 72 79 20 72 65 67 | 69 6f 6e 73 20 66 6f 72 |mory reg|ions for|
|00002e30| 0a 72 65 61 64 20 61 6e | 64 20 77 72 69 74 65 2c |.read an|d write,|
|00002e40| 20 61 6e 64 20 69 6e 20 | 63 61 73 65 20 61 20 6c | and in |case a l|
|00002e50| 6f 63 61 74 69 6f 6e 20 | 6f 6e 20 74 68 65 20 43 |ocation |on the C|
|00002e60| 44 20 69 73 20 74 72 61 | 6e 73 66 65 72 72 65 64 |D is tra|nsferred|
|00002e70| 2c 20 69 74 0a 77 69 6c | 6c 20 60 73 61 6e 69 74 |, it.wil|l `sanit|
|00002e80| 69 7a 65 27 20 74 68 65 | 20 66 6f 72 6d 61 74 20 |ize' the| format |
|00002e90| 62 79 20 6d 61 6b 69 6e | 67 20 72 65 71 75 65 73 |by makin|g reques|
|00002ea0| 74 73 20 74 6f 20 74 68 | 65 20 6c 6f 77 2d 6c 65 |ts to th|e low-le|
|00002eb0| 76 65 6c 20 64 72 69 76 | 65 72 73 0a 69 6e 20 61 |vel driv|ers.in a|
|00002ec0| 20 73 74 61 6e 64 61 72 | 64 20 66 6f 72 6d 61 74 | standar|d format|
|00002ed0| 2c 20 61 6e 64 20 74 72 | 61 6e 73 6c 61 74 69 6e |, and tr|anslatin|
|00002ee0| 67 20 61 6c 6c 20 66 6f | 72 6d 61 74 73 20 62 65 |g all fo|rmats be|
|00002ef0| 74 77 65 65 6e 20 74 68 | 65 0a 75 73 65 72 2d 73 |tween th|e.user-s|
|00002f00| 6f 66 74 77 61 72 65 20 | 61 6e 64 20 6c 6f 77 20 |oftware |and low |
|00002f10| 6c 65 76 65 6c 20 64 72 | 69 76 65 72 73 2e 20 54 |level dr|ivers. T|
|00002f20| 68 69 73 20 72 65 6c 69 | 65 76 65 73 20 6d 75 63 |his reli|eves muc|
|00002f30| 68 20 6f 66 20 74 68 65 | 20 64 72 69 76 65 72 73 |h of the| drivers|
|00002f40| 0a 6d 65 6d 6f 72 79 20 | 63 68 65 63 6b 69 6e 67 |.memory |checking|
|00002f50| 20 61 6e 64 20 66 6f 72 | 6d 61 74 20 63 68 65 63 | and for|mat chec|
|00002f60| 6b 69 6e 67 20 61 6e 64 | 20 74 72 61 6e 73 6c 61 |king and| transla|
|00002f70| 74 69 6f 6e 2e 20 41 6c | 73 6f 2c 20 74 68 65 0a |tion. Al|so, the.|
|00002f80| 6e 65 63 65 73 73 61 72 | 79 20 73 74 72 75 63 74 |necessar|y struct|
|00002f90| 75 72 65 73 20 77 69 6c | 6c 20 62 65 20 64 65 63 |ures wil|l be dec|
|00002fa0| 6c 61 72 65 64 20 6f 6e | 20 74 68 65 20 70 72 6f |lared on| the pro|
|00002fb0| 67 72 61 6d 20 73 74 61 | 63 6b 2e 0a 0a 54 68 65 |gram sta|ck...The|
|00002fc0| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 20 | impleme|ntation |
|00002fd0| 6f 66 20 74 68 65 20 66 | 75 6e 63 74 69 6f 6e 73 |of the f|unctions|
|00002fe0| 20 73 68 6f 75 6c 64 20 | 62 65 20 61 73 20 64 65 | should |be as de|
|00002ff0| 66 69 6e 65 64 20 69 6e | 20 74 68 65 0a 66 6f 6c |fined in| the.fol|
|00003000| 6c 6f 77 69 6e 67 20 73 | 65 63 74 69 6f 6e 73 2e |lowing s|ections.|
|00003010| 20 54 68 72 65 65 20 66 | 75 6e 63 74 69 6f 6e 73 | Three f|unctions|
|00003020| 20 7b 5c 65 6d 20 6d 75 | 73 74 5c 2f 7d 20 62 65 | {\em mu|st\/} be|
|00003030| 20 69 6d 70 6c 65 6d 65 | 6e 74 65 64 2c 0a 6e 61 | impleme|nted,.na|
|00003040| 6d 65 6c 79 20 24 6f 70 | 65 6e 28 29 24 2c 20 24 |mely $op|en()$, $|
|00003050| 72 65 6c 65 61 73 65 28 | 29 24 20 61 6e 64 20 24 |release(|)$ and $|
|00003060| 6f 70 65 6e 5f 66 69 6c | 65 73 28 29 24 2e 20 4f |open_fil|es()$. O|
|00003070| 74 68 65 72 20 66 75 6e | 63 74 69 6f 6e 73 20 6d |ther fun|ctions m|
|00003080| 61 79 0a 62 65 20 6f 6d | 69 74 74 65 64 2c 20 74 |ay.be om|itted, t|
|00003090| 68 65 69 72 20 63 6f 72 | 72 65 73 70 6f 6e 64 69 |heir cor|respondi|
|000030a0| 6e 67 20 63 61 70 61 62 | 69 6c 69 74 79 20 66 6c |ng capab|ility fl|
|000030b0| 61 67 73 20 77 69 6c 6c | 20 62 65 20 63 6c 65 61 |ags will| be clea|
|000030c0| 72 65 64 20 75 70 6f 6e | 0a 72 65 67 69 73 74 72 |red upon|.registr|
|000030d0| 61 74 69 6f 6e 2e 20 47 | 65 6e 65 72 61 6c 6c 79 |ation. G|enerally|
|000030e0| 2c 20 61 20 66 75 6e 63 | 74 69 6f 6e 20 72 65 74 |, a func|tion ret|
|000030f0| 75 72 6e 73 20 7a 65 72 | 6f 20 6f 6e 20 73 75 63 |urns zer|o on suc|
|00003100| 63 65 73 73 20 61 6e 64 | 0a 6e 65 67 61 74 69 76 |cess and|.negativ|
|00003110| 65 20 6f 6e 20 65 72 72 | 6f 72 2e 20 41 20 66 75 |e on err|or. A fu|
|00003120| 6e 63 74 69 6f 6e 20 63 | 61 6c 6c 20 73 68 6f 75 |nction c|all shou|
|00003130| 6c 64 20 72 65 74 75 72 | 6e 20 6f 6e 6c 79 20 61 |ld retur|n only a|
|00003140| 66 74 65 72 20 74 68 65 | 0a 63 6f 6d 6d 61 6e 64 |fter the|.command|
|00003150| 20 68 61 73 20 63 6f 6d | 70 6c 65 74 65 64 2c 20 | has com|pleted, |
|00003160| 62 75 74 20 6f 66 20 63 | 6f 75 72 73 65 20 77 61 |but of c|ourse wa|
|00003170| 69 74 69 6e 67 20 66 6f | 72 20 74 68 65 20 64 65 |iting fo|r the de|
|00003180| 76 69 63 65 20 73 68 6f | 75 6c 64 20 6e 6f 74 0a |vice sho|uld not.|
|00003190| 75 73 65 20 70 72 6f 63 | 65 73 73 6f 72 20 74 69 |use proc|essor ti|
|000031a0| 6d 65 2e 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |me...\su|bsection|
|000031b0| 7b 24 4f 70 65 6e 28 6b | 64 65 76 5f 74 5c 20 64 |{$Open(k|dev_t\ d|
|000031c0| 65 76 2c 20 69 6e 74 5c | 20 70 75 72 70 6f 73 65 |ev, int\| purpose|
|000031d0| 29 24 7d 0a 0a 24 4f 70 | 65 6e 28 29 24 20 73 68 |)$}..$Op|en()$ sh|
|000031e0| 6f 75 6c 64 20 74 72 79 | 20 74 6f 20 6f 70 65 6e |ould try| to open|
|000031f0| 20 74 68 65 20 64 65 76 | 69 63 65 20 66 6f 72 20 | the dev|ice for |
|00003200| 61 20 73 70 65 63 69 66 | 69 63 20 24 70 75 72 70 |a specif|ic $purp|
|00003210| 6f 73 65 24 2c 20 77 68 | 69 63 68 0a 63 61 6e 20 |ose$, wh|ich.can |
|00003220| 62 65 20 65 69 74 68 65 | 72 3a 0a 5c 62 65 67 69 |be eithe|r:.\begi|
|00003230| 6e 7b 69 74 65 6d 69 7a | 65 7d 0a 5c 69 74 65 6d |n{itemiz|e}.\item|
|00003240| 5b 30 5d 20 4f 70 65 6e | 20 66 6f 72 20 64 61 74 |[0] Open| for dat|
|00003250| 61 20 72 65 61 64 2c 20 | 61 73 20 69 73 20 75 73 |a read, |as is us|
|00003260| 65 64 20 62 79 20 7b 5c | 74 74 20 6d 6f 75 6e 74 |ed by {\|tt mount|
|00003270| 28 29 7d 20 28 32 29 2c | 20 6f 72 20 74 68 65 0a |()} (2),| or the.|
|00003280| 75 73 65 72 20 63 6f 6d | 6d 61 6e 64 73 20 7b 5c |user com|mands {\|
|00003290| 74 74 20 64 64 7d 20 6f | 72 20 7b 5c 74 74 20 63 |tt dd} o|r {\tt c|
|000032a0| 61 74 7d 2e 20 20 0a 5c | 69 74 65 6d 5b 31 5d 20 |at}. .\|item[1] |
|000032b0| 4f 70 65 6e 20 66 6f 72 | 20 24 69 6f 63 74 6c 24 |Open for| $ioctl$|
|000032c0| 20 63 6f 6d 6d 61 6e 64 | 69 6e 67 2c 20 61 73 20 | command|ing, as |
|000032d0| 69 73 20 75 73 65 64 20 | 66 6f 72 20 61 75 64 69 |is used |for audi|
|000032e0| 6f 2d 43 44 20 70 6c 61 | 79 69 6e 67 0a 70 72 6f |o-CD pla|ying.pro|
|000032f0| 67 72 61 6d 73 20 6d 6f | 73 74 6c 79 2e 20 0a 5c |grams mo|stly. .\|
|00003300| 65 6e 64 7b 69 74 65 6d | 69 7a 65 7d 0a 49 6e 20 |end{item|ize}.In |
|00003310| 74 68 69 73 20 72 6f 75 | 74 69 6e 65 2c 20 61 20 |this rou|tine, a |
|00003320| 73 74 61 74 69 63 20 63 | 6f 75 6e 74 65 72 20 73 |static c|ounter s|
|00003330| 68 6f 75 6c 64 20 62 65 | 20 75 70 64 61 74 65 64 |hould be| updated|
|00003340| 2c 20 72 65 66 6c 65 63 | 74 69 6e 67 20 74 68 65 |, reflec|ting the|
|00003350| 0a 6e 75 6d 62 65 72 20 | 6f 66 20 74 69 6d 65 73 |.number |of times|
|00003360| 20 74 68 65 20 73 70 65 | 63 69 66 69 63 20 64 65 | the spe|cific de|
|00003370| 76 69 63 65 20 69 73 20 | 73 75 63 63 65 73 73 66 |vice is |successf|
|00003380| 75 6c 6c 79 20 6f 70 65 | 6e 65 64 20 28 61 6e 64 |ully ope|ned (and|
|00003390| 20 69 6e 0a 63 61 73 65 | 20 74 68 65 20 64 72 69 | in.case| the dri|
|000033a0| 76 65 72 20 73 75 70 70 | 6f 72 74 73 20 6d 6f 64 |ver supp|orts mod|
|000033b0| 75 6c 65 73 2c 20 74 68 | 65 20 63 61 6c 6c 20 24 |ules, th|e call $|
|000033c0| 4d 4f 44 5f 49 4e 43 5f | 55 53 45 5f 43 4f 55 4e |MOD_INC_|USE_COUN|
|000033d0| 54 24 0a 73 68 6f 75 6c | 64 20 62 65 20 70 65 72 |T$.shoul|d be per|
|000033e0| 66 6f 72 6d 65 64 20 65 | 78 61 63 74 6c 79 20 6f |formed e|xactly o|
|000033f0| 6e 63 65 2c 20 69 66 20 | 73 75 63 63 65 73 73 66 |nce, if |successf|
|00003400| 75 6c 29 2e 20 54 68 65 | 20 72 65 74 75 72 6e 20 |ul). The| return |
|00003410| 76 61 6c 75 65 20 69 73 | 0a 6e 65 67 61 74 69 76 |value is|.negativ|
|00003420| 65 20 6f 6e 20 65 72 72 | 6f 72 2c 20 61 6e 64 20 |e on err|or, and |
|00003430| 7a 65 72 6f 20 6f 6e 20 | 73 75 63 63 65 73 73 2e |zero on |success.|
|00003440| 20 54 68 65 20 6f 70 65 | 6e 2d 66 6f 72 2d 69 6f | The ope|n-for-io|
|00003450| 63 74 6c 20 63 61 6c 6c | 20 63 61 6e 0a 6f 6e 6c |ctl call| can.onl|
|00003460| 79 20 66 61 69 6c 20 69 | 66 20 74 68 65 72 65 20 |y fail i|f there |
|00003470| 69 73 20 6e 6f 20 68 61 | 72 64 77 61 72 65 2e 0a |is no ha|rdware..|
|00003480| 0a 4e 6f 74 69 63 65 20 | 74 68 61 74 20 61 6e 79 |.Notice |that any|
|00003490| 20 73 74 72 61 74 65 67 | 69 63 20 63 6f 64 65 20 | strateg|ic code |
|000034a0| 28 63 6c 6f 73 69 6e 67 | 20 74 72 61 79 20 75 70 |(closing| tray up|
|000034b0| 6f 6e 20 24 6f 70 65 6e | 28 29 24 2c 20 65 74 63 |on $open|()$, etc|
|000034c0| 2e 29 5c 20 69 73 0a 64 | 6f 6e 65 20 62 79 20 74 |.)\ is.d|one by t|
|000034d0| 68 65 20 63 61 6c 6c 69 | 6e 67 20 72 6f 75 74 69 |he calli|ng routi|
|000034e0| 6e 65 20 69 6e 20 5c 63 | 64 72 6f 6d 63 2c 20 73 |ne in \c|dromc, s|
|000034f0| 6f 20 74 68 65 20 6c 6f | 77 2d 6c 65 76 65 6c 20 |o the lo|w-level |
|00003500| 72 6f 75 74 69 6e 65 0a | 73 68 6f 75 6c 64 20 6f |routine.|should o|
|00003510| 6e 6c 79 20 62 65 20 63 | 6f 6e 63 65 72 6e 65 64 |nly be c|oncerned|
|00003520| 20 77 69 74 68 20 70 72 | 6f 70 65 72 20 69 6e 69 | with pr|oper ini|
|00003530| 74 69 61 6c 69 7a 61 74 | 69 6f 6e 20 61 6e 64 20 |tializat|ion and |
|00003540| 64 65 76 69 63 65 2d 75 | 73 65 0a 63 6f 75 6e 74 |device-u|se.count|
|00003550| 2e 0a 0a 5c 73 75 62 73 | 65 63 74 69 6f 6e 7b 24 |...\subs|ection{$|
|00003560| 52 65 6c 65 61 73 65 28 | 6b 64 65 76 5f 74 5c 20 |Release(|kdev_t\ |
|00003570| 64 65 76 29 24 7d 0a 0a | 54 68 65 20 75 73 65 2d |dev)$}..|The use-|
|00003580| 63 6f 75 6e 74 20 6f 66 | 20 74 68 65 20 64 65 76 |count of| the dev|
|00003590| 69 63 65 20 24 64 65 76 | 24 20 73 68 6f 75 6c 64 |ice $dev|$ should|
|000035a0| 20 62 65 20 64 65 63 72 | 65 61 73 65 64 20 62 79 | be decr|eased by|
|000035b0| 20 31 2c 20 61 6e 64 20 | 61 0a 73 69 6e 67 6c 65 | 1, and |a.single|
|000035c0| 20 63 61 6c 6c 20 24 4d | 4f 44 5f 44 45 43 5f 55 | call $M|OD_DEC_U|
|000035d0| 53 45 5f 43 4f 55 4e 54 | 24 20 73 68 6f 75 6c 64 |SE_COUNT|$ should|
|000035e0| 20 62 65 20 63 6f 64 65 | 64 20 68 65 72 65 2e 20 | be code|d here. |
|000035f0| 20 50 6f 73 73 69 62 6c | 79 20 6f 74 68 65 72 0a | Possibl|y other.|
|00003600| 64 65 76 69 63 65 2d 73 | 70 65 63 69 66 69 63 20 |device-s|pecific |
|00003610| 61 63 74 69 6f 6e 73 20 | 73 68 6f 75 6c 64 20 62 |actions |should b|
|00003620| 65 20 74 61 6b 65 6e 20 | 73 75 63 68 20 61 73 20 |e taken |such as |
|00003630| 73 70 69 6e 6e 69 6e 67 | 20 64 6f 77 6e 20 74 68 |spinning| down th|
|00003640| 65 0a 64 65 76 69 63 65 | 2e 20 48 6f 77 65 76 65 |e.device|. Howeve|
|00003650| 72 2c 20 73 74 72 61 74 | 65 67 69 63 20 61 63 74 |r, strat|egic act|
|00003660| 69 6f 6e 73 20 73 75 63 | 68 20 61 73 20 65 6a 65 |ions suc|h as eje|
|00003670| 63 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 74 72 61 |ction of| the tra|
|00003680| 79 2c 20 6f 72 0a 75 6e | 6c 6f 63 6b 69 6e 67 20 |y, or.un|locking |
|00003690| 74 68 65 20 64 6f 6f 72 | 2c 20 73 68 6f 75 6c 64 |the door|, should|
|000036a0| 20 62 65 20 6c 65 66 74 | 20 6f 76 65 72 20 74 6f | be left| over to|
|000036b0| 20 74 68 65 20 67 65 6e | 65 72 61 6c 20 72 6f 75 | the gen|eral rou|
|000036c0| 74 69 6e 65 0a 24 63 64 | 72 6f 6d 5f 72 65 6c 65 |tine.$cd|rom_rele|
|000036d0| 61 73 65 28 29 24 2e 20 | 41 6c 73 6f 2c 20 74 68 |ase()$. |Also, th|
|000036e0| 65 20 69 6e 76 61 6c 69 | 64 61 74 69 6f 6e 20 6f |e invali|dation o|
|000036f0| 66 20 74 68 65 20 61 6c | 6c 6f 63 61 74 65 64 20 |f the al|located |
|00003700| 62 75 66 66 65 72 73 20 | 69 6e 0a 74 68 65 20 56 |buffers |in.the V|
|00003710| 46 53 20 69 73 20 74 61 | 6b 65 6e 20 63 61 72 65 |FS is ta|ken care|
|00003720| 20 6f 66 20 62 79 20 74 | 68 65 20 72 6f 75 74 69 | of by t|he routi|
|00003730| 6e 65 20 69 6e 20 5c 63 | 64 72 6f 6d 63 2e 0a 0a |ne in \c|dromc...|
|00003740| 5c 73 75 62 73 65 63 74 | 69 6f 6e 7b 24 4f 70 65 |\subsect|ion{$Ope|
|00003750| 6e 5f 66 69 6c 65 73 28 | 6b 64 65 76 5f 74 5c 20 |n_files(|kdev_t\ |
|00003760| 64 65 76 29 24 7d 0a 0a | 54 68 69 73 20 66 75 6e |dev)$}..|This fun|
|00003770| 63 74 69 6f 6e 20 73 68 | 6f 75 6c 64 20 72 65 74 |ction sh|ould ret|
|00003780| 75 72 6e 20 74 68 65 20 | 69 6e 74 65 72 6e 61 6c |urn the |internal|
|00003790| 20 76 61 72 69 61 62 6c | 65 20 75 73 65 2d 63 6f | variabl|e use-co|
|000037a0| 75 6e 74 20 6f 66 20 74 | 68 65 0a 64 65 76 69 63 |unt of t|he.devic|
|000037b0| 65 20 24 64 65 76 24 2e | 20 54 68 65 20 75 73 65 |e $dev$.| The use|
|000037c0| 2d 63 6f 75 6e 74 20 69 | 73 20 6e 6f 74 20 69 6d |-count i|s not im|
|000037d0| 70 6c 65 6d 65 6e 74 65 | 64 20 69 6e 20 74 68 65 |plemente|d in the|
|000037e0| 20 72 6f 75 74 69 6e 65 | 73 20 69 6e 0a 5c 63 64 | routine|s in.\cd|
|000037f0| 72 6f 6d 63 5c 20 69 74 | 73 65 6c 66 2c 20 62 65 |romc\ it|self, be|
|00003800| 63 61 75 73 65 20 74 68 | 65 72 65 20 6d 61 79 20 |cause th|ere may |
|00003810| 62 65 20 6d 61 6e 79 20 | 6d 69 6e 6f 72 20 64 65 |be many |minor de|
|00003820| 76 69 63 65 73 20 63 6f | 6e 6e 65 63 74 65 64 20 |vices co|nnected |
|00003830| 74 6f 0a 61 20 73 69 6e | 67 6c 65 20 6c 6f 77 2d |to.a sin|gle low-|
|00003840| 6c 65 76 65 6c 20 64 72 | 69 76 65 72 2e 0a 0a 5c |level dr|iver...\|
|00003850| 73 75 62 73 65 63 74 69 | 6f 6e 7b 24 44 72 69 76 |subsecti|on{$Driv|
|00003860| 65 5f 73 74 61 74 75 73 | 28 6b 64 65 76 5f 74 5c |e_status|(kdev_t\|
|00003870| 20 64 65 76 29 24 7d 0a | 5c 6c 61 62 65 6c 7b 64 | dev)$}.|\label{d|
|00003880| 72 69 76 65 20 73 74 61 | 74 75 73 7d 0a 0a 54 68 |rive sta|tus}..Th|
|00003890| 65 20 66 75 6e 63 74 69 | 6f 6e 20 24 64 72 69 76 |e functi|on $driv|
|000038a0| 65 5f 73 74 61 74 75 73 | 24 2c 20 69 66 20 69 6d |e_status|$, if im|
|000038b0| 70 6c 65 6d 65 6e 74 65 | 64 2c 20 73 68 6f 75 6c |plemente|d, shoul|
|000038c0| 64 20 70 72 6f 76 69 64 | 65 0a 69 6e 66 6f 72 6d |d provid|e.inform|
|000038d0| 61 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 73 74 61 |ation of| the sta|
|000038e0| 74 75 73 20 6f 66 20 74 | 68 65 20 64 72 69 76 65 |tus of t|he drive|
|000038f0| 20 28 6e 6f 74 20 74 68 | 65 20 73 74 61 74 75 73 | (not th|e status|
|00003900| 20 6f 66 20 74 68 65 20 | 64 69 73 63 2c 0a 77 68 | of the |disc,.wh|
|00003910| 69 63 68 20 6d 61 79 20 | 6f 72 20 6d 61 79 20 6e |ich may |or may n|
|00003920| 6f 74 20 62 65 20 69 6e | 20 74 68 65 20 64 72 69 |ot be in| the dri|
|00003930| 76 65 29 2e 20 49 6e 20 | 5c 75 63 64 72 6f 6d 5c |ve). In |\ucdrom\|
|00003940| 20 74 68 65 20 70 6f 73 | 73 69 62 69 6c 69 74 69 | the pos|sibiliti|
|00003950| 65 73 0a 61 72 65 20 6c | 69 73 74 65 64 3a 20 0a |es.are l|isted: .|
|00003960| 24 24 0a 5c 68 61 6c 69 | 67 6e 7b 24 23 24 5c 20 |$$.\hali|gn{$#$\ |
|00003970| 5c 68 66 69 6c 26 24 2f | 2a 24 20 5c 72 6d 23 20 |\hfil&$/|*$ \rm# |
|00003980| 24 2a 2f 24 5c 68 66 69 | 6c 5c 63 72 0a 43 44 53 |$*/$\hfi|l\cr.CDS|
|00003990| 5f 4e 4f 5f 49 4e 46 4f | 26 20 6e 6f 20 69 6e 66 |_NO_INFO|& no inf|
|000039a0| 6f 72 6d 61 74 69 6f 6e | 20 61 76 61 69 6c 61 62 |ormation| availab|
|000039b0| 6c 65 5c 63 72 0a 43 44 | 53 5f 4e 4f 5f 44 49 53 |le\cr.CD|S_NO_DIS|
|000039c0| 43 26 20 6e 6f 20 64 69 | 73 63 20 69 73 20 69 6e |C& no di|sc is in|
|000039d0| 73 65 72 74 65 64 2c 20 | 74 72 61 79 20 69 73 20 |serted, |tray is |
|000039e0| 63 6c 6f 73 65 64 5c 63 | 72 0a 43 44 53 5f 54 52 |closed\c|r.CDS_TR|
|000039f0| 41 59 5f 4f 50 45 4e 26 | 20 74 72 61 79 20 69 73 |AY_OPEN&| tray is|
|00003a00| 20 6f 70 65 6e 65 64 5c | 63 72 0a 43 44 53 5f 44 | opened\|cr.CDS_D|
|00003a10| 52 49 56 45 5f 4e 4f 54 | 5f 52 45 41 44 59 26 20 |RIVE_NOT|_READY& |
|00003a20| 73 6f 6d 65 74 68 69 6e | 67 20 69 73 20 77 72 6f |somethin|g is wro|
|00003a30| 6e 67 2c 20 74 72 61 79 | 20 69 73 20 6d 6f 76 69 |ng, tray| is movi|
|00003a40| 6e 67 3f 5c 63 72 0a 43 | 44 53 5f 44 49 53 43 5f |ng?\cr.C|DS_DISC_|
|00003a50| 4f 4b 26 20 61 20 64 69 | 73 63 20 69 73 20 6c 6f |OK& a di|sc is lo|
|00003a60| 61 64 65 64 20 61 6e 64 | 20 65 76 65 72 79 74 68 |aded and| everyth|
|00003a70| 69 6e 67 20 69 73 20 66 | 69 6e 65 5c 63 72 0a 7d |ing is f|ine\cr.}|
|00003a80| 0a 24 24 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |.$$..\su|bsection|
|00003a90| 7b 24 44 69 73 63 5f 73 | 74 61 74 75 73 28 6b 64 |{$Disc_s|tatus(kd|
|00003aa0| 65 76 5f 74 5c 20 64 65 | 76 29 24 7d 0a 5c 6c 61 |ev_t\ de|v)$}.\la|
|00003ab0| 62 65 6c 7b 64 69 73 63 | 20 73 74 61 74 75 73 7d |bel{disc| status}|
|00003ac0| 0a 0a 41 73 20 61 20 63 | 6f 6d 70 6c 65 6d 65 6e |..As a c|omplemen|
|00003ad0| 74 20 74 6f 20 24 64 72 | 69 76 65 5f 73 74 61 74 |t to $dr|ive_stat|
|00003ae0| 75 73 28 29 24 2c 20 74 | 68 69 73 20 66 75 6e 63 |us()$, t|his func|
|00003af0| 74 69 6f 6e 20 63 61 6e | 20 70 72 6f 76 69 64 65 |tion can| provide|
|00003b00| 20 74 68 65 0a 67 65 6e | 65 72 61 6c 20 5c 63 64 | the.gen|eral \cd|
|00003b10| 72 6f 6d 2d 72 6f 75 74 | 69 6e 65 73 20 77 69 74 |rom-rout|ines wit|
|00003b20| 68 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 61 62 |h inform|ation ab|
|00003b30| 6f 75 74 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |out the |current |
|00003b40| 64 69 73 63 20 74 68 61 | 74 20 69 73 0a 69 6e 73 |disc tha|t is.ins|
|00003b50| 65 72 74 65 64 20 69 6e | 20 74 68 65 20 64 72 69 |erted in| the dri|
|00003b60| 76 65 20 72 65 70 72 65 | 73 65 6e 74 65 64 20 62 |ve repre|sented b|
|00003b70| 79 20 24 64 65 76 24 2e | 20 54 68 65 20 68 69 73 |y $dev$.| The his|
|00003b80| 74 6f 72 79 20 6f 66 20 | 64 65 76 65 6c 6f 70 6d |tory of |developm|
|00003b90| 65 6e 74 0a 6f 66 20 74 | 68 65 20 43 44 27 73 20 |ent.of t|he CD's |
|00003ba0| 75 73 65 20 61 73 20 61 | 20 63 61 72 72 69 65 72 |use as a| carrier|
|00003bb0| 20 6d 65 64 69 75 6d 20 | 66 6f 72 20 76 61 72 69 | medium |for vari|
|00003bc0| 6f 75 73 20 64 69 67 69 | 74 61 6c 20 69 6e 66 6f |ous digi|tal info|
|00003bd0| 72 6d 61 74 69 6f 6e 0a | 68 61 73 20 6c 65 61 64 |rmation.|has lead|
|00003be0| 20 74 6f 20 6d 61 6e 79 | 20 64 69 66 66 65 72 65 | to many| differe|
|00003bf0| 6e 74 20 64 69 73 63 20 | 74 79 70 65 73 2c 20 68 |nt disc |types, h|
|00003c00| 65 6e 63 65 20 74 68 69 | 73 20 66 75 6e 63 74 69 |ence thi|s functi|
|00003c10| 6f 6e 20 63 61 6e 20 72 | 65 74 75 72 6e 3a 0a 24 |on can r|eturn:.$|
|00003c20| 24 0a 5c 68 61 6c 69 67 | 6e 7b 24 23 24 5c 20 5c |$.\halig|n{$#$\ \|
|00003c30| 68 66 69 6c 26 24 2f 2a | 24 20 5c 72 6d 23 20 24 |hfil&$/*|$ \rm# $|
|00003c40| 2a 2f 24 5c 68 66 69 6c | 5c 63 72 0a 43 44 53 5f |*/$\hfil|\cr.CDS_|
|00003c50| 4e 4f 5f 49 4e 46 4f 26 | 20 6e 6f 20 69 6e 66 6f |NO_INFO&| no info|
|00003c60| 72 6d 61 74 69 6f 6e 20 | 61 76 61 69 6c 61 62 6c |rmation |availabl|
|00003c70| 65 5c 63 72 0a 43 44 53 | 5f 4e 4f 5f 44 49 53 43 |e\cr.CDS|_NO_DISC|
|00003c80| 26 20 6e 6f 20 64 69 73 | 63 20 69 73 20 69 6e 73 |& no dis|c is ins|
|00003c90| 65 72 74 65 64 2c 20 6f | 72 20 74 72 61 79 20 69 |erted, o|r tray i|
|00003ca0| 73 20 6f 70 65 6e 65 64 | 5c 63 72 0a 43 44 53 5f |s opened|\cr.CDS_|
|00003cb0| 41 55 44 49 4f 26 20 41 | 75 64 69 6f 20 64 69 73 |AUDIO& A|udio dis|
|00003cc0| 63 20 28 32 33 35 32 20 | 61 75 64 69 6f 20 62 79 |c (2352 |audio by|
|00003cd0| 74 65 73 2f 66 72 61 6d | 65 29 5c 63 72 0a 43 44 |tes/fram|e)\cr.CD|
|00003ce0| 53 5f 44 41 54 41 5f 31 | 26 20 64 61 74 61 20 64 |S_DATA_1|& data d|
|00003cf0| 69 73 63 2c 20 6d 6f 64 | 65 20 31 20 28 32 30 34 |isc, mod|e 1 (204|
|00003d00| 38 20 75 73 65 72 20 62 | 79 74 65 73 2f 66 72 61 |8 user b|ytes/fra|
|00003d10| 6d 65 29 5c 63 72 0a 43 | 44 53 5f 44 41 54 41 5f |me)\cr.C|DS_DATA_|
|00003d20| 32 26 20 64 61 74 61 20 | 64 69 73 63 2c 20 6d 6f |2& data |disc, mo|
|00003d30| 64 65 20 32 20 28 32 33 | 33 36 20 75 73 65 72 20 |de 2 (23|36 user |
|00003d40| 62 79 74 65 73 2f 66 72 | 61 6d 65 29 5c 63 72 0a |bytes/fr|ame)\cr.|
|00003d50| 43 44 53 5f 58 41 5f 32 | 5f 31 26 20 6d 69 78 65 |CDS_XA_2|_1& mixe|
|00003d60| 64 20 64 61 74 61 20 28 | 58 41 29 2c 20 6d 6f 64 |d data (|XA), mod|
|00003d70| 65 20 32 2c 20 66 6f 72 | 6d 20 31 20 28 32 30 34 |e 2, for|m 1 (204|
|00003d80| 38 20 75 73 65 72 20 62 | 79 74 65 73 29 5c 63 72 |8 user b|ytes)\cr|
|00003d90| 0a 43 44 53 5f 58 41 5f | 32 5f 32 26 20 6d 69 78 |.CDS_XA_|2_2& mix|
|00003da0| 65 64 20 64 61 74 61 20 | 28 58 41 29 2c 20 6d 6f |ed data |(XA), mo|
|00003db0| 64 65 20 32 2c 20 66 6f | 72 6d 20 31 20 28 32 33 |de 2, fo|rm 1 (23|
|00003dc0| 32 34 20 20 75 73 65 72 | 20 62 79 74 65 73 29 5c |24 user| bytes)\|
|00003dd0| 63 72 0a 7d 0a 24 24 0a | 41 73 20 66 61 72 20 61 |cr.}.$$.|As far a|
|00003de0| 73 20 49 20 6b 6e 6f 77 | 2c 20 5c 63 64 72 6f 6d |s I know|, \cdrom|
|00003df0| 20 73 20 61 72 65 20 61 | 6c 77 61 79 73 20 6f 66 | s are a|lways of|
|00003e00| 20 74 79 70 65 20 24 43 | 44 53 5f 44 41 54 41 5f | type $C|DS_DATA_|
|00003e10| 31 24 2e 20 46 6f 72 0a | 73 6f 6d 65 20 69 6e 66 |1$. For.|some inf|
|00003e20| 6f 72 6d 61 74 69 6f 6e | 20 63 6f 6e 63 65 72 6e |ormation| concern|
|00003e30| 69 6e 67 20 66 72 61 6d | 65 20 6c 61 79 6f 75 74 |ing fram|e layout|
|00003e40| 20 6f 66 20 74 68 65 20 | 76 61 72 69 6f 75 73 20 | of the |various |
|00003e50| 64 69 73 63 20 74 79 70 | 65 73 2c 20 73 65 65 0a |disc typ|es, see.|
|00003e60| 61 20 72 65 63 65 6e 74 | 20 76 65 72 73 69 6f 6e |a recent| version|
|00003e70| 20 6f 66 20 7b 5c 74 74 | 20 63 64 72 6f 6d 2e 68 | of {\tt| cdrom.h|
|00003e80| 7d 2e 20 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |}. ..\su|bsection|
|00003e90| 7b 24 4d 65 64 69 61 5f | 63 68 61 6e 67 65 64 28 |{$Media_|changed(|
|00003ea0| 64 65 76 5c 5f 74 5c 20 | 64 65 76 29 24 7d 0a 0a |dev\_t\ |dev)$}..|
|00003eb0| 54 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 69 73 |This fun|ction is|
|00003ec0| 20 76 65 72 79 20 73 69 | 6d 69 6c 61 72 20 74 6f | very si|milar to|
|00003ed0| 20 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 66 75 | the ori|ginal fu|
|00003ee0| 6e 63 74 69 6f 6e 20 69 | 6e 20 24 73 74 72 75 63 |nction i|n $struc|
|00003ef0| 74 5c 0a 66 69 6c 65 5f | 6f 70 65 72 61 74 69 6f |t\.file_|operatio|
|00003f00| 6e 73 24 2e 20 49 74 20 | 72 65 74 75 72 6e 73 20 |ns$. It |returns |
|00003f10| 31 20 69 66 20 74 68 65 | 20 6d 65 64 69 75 6d 20 |1 if the| medium |
|00003f20| 6f 66 20 74 68 65 20 64 | 65 76 69 63 65 20 24 64 |of the d|evice $d|
|00003f30| 65 76 24 20 68 61 73 0a | 63 68 61 6e 67 65 64 20 |ev$ has.|changed |
|00003f40| 73 69 6e 63 65 20 74 68 | 65 20 6c 61 73 74 20 63 |since th|e last c|
|00003f50| 61 6c 6c 2c 20 61 6e 64 | 20 30 20 6f 74 68 65 72 |all, and| 0 other|
|00003f60| 77 69 73 65 2e 20 4e 6f | 74 65 20 74 68 61 74 20 |wise. No|te that |
|00003f70| 62 79 20 60 72 65 2d 72 | 6f 75 74 69 6e 67 27 0a |by `re-r|outing'.|
|00003f80| 74 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 74 68 |this fun|ction th|
|00003f90| 72 6f 75 67 68 20 24 63 | 64 72 6f 6d 5f 6d 65 64 |rough $c|drom_med|
|00003fa0| 69 61 5f 63 68 61 6e 67 | 65 64 28 29 24 2c 20 77 |ia_chang|ed()$, w|
|00003fb0| 65 20 63 61 6e 20 69 6d | 70 6c 65 6d 65 6e 74 0a |e can im|plement.|
|00003fc0| 73 65 70 61 72 61 74 65 | 20 71 75 65 75 65 73 20 |separate| queues |
|00003fd0| 66 6f 72 20 74 68 65 20 | 56 46 53 20 61 6e 64 20 |for the |VFS and |
|00003fe0| 61 20 6e 65 77 20 24 69 | 6f 63 74 6c 28 29 24 20 |a new $i|octl()$ |
|00003ff0| 66 75 6e 63 74 69 6f 6e | 20 74 68 61 74 20 63 61 |function| that ca|
|00004000| 6e 0a 72 65 70 6f 72 74 | 20 64 65 76 69 63 65 20 |n.report| device |
|00004010| 63 68 61 6e 67 65 73 20 | 74 6f 20 73 6f 66 74 77 |changes |to softw|
|00004020| 61 72 65 20 28 65 2e 67 | 2e 2c 20 61 6e 20 61 75 |are (e.g|., an au|
|00004030| 74 6f 2d 6d 6f 75 6e 74 | 69 6e 67 20 64 61 65 6d |to-mount|ing daem|
|00004040| 6f 6e 29 2e 20 0a 0a 5c | 73 75 62 73 65 63 74 69 |on). ..\|subsecti|
|00004050| 6f 6e 7b 24 54 72 61 79 | 5f 6d 6f 76 65 28 6b 64 |on{$Tray|_move(kd|
|00004060| 65 76 5f 74 5c 20 64 65 | 76 2c 20 69 6e 74 5c 20 |ev_t\ de|v, int\ |
|00004070| 70 6f 73 69 74 69 6f 6e | 29 24 7d 0a 0a 54 68 69 |position|)$}..Thi|
|00004080| 73 20 66 75 6e 63 74 69 | 6f 6e 2c 20 69 66 20 69 |s functi|on, if i|
|00004090| 6d 70 6c 65 6d 65 6e 74 | 65 64 2c 20 73 68 6f 75 |mplement|ed, shou|
|000040a0| 6c 64 20 63 6f 6e 74 72 | 6f 6c 20 74 68 65 20 74 |ld contr|ol the t|
|000040b0| 72 61 79 20 6d 6f 76 65 | 6d 65 6e 74 2e 20 28 4e |ray move|ment. (N|
|000040c0| 6f 0a 6f 74 68 65 72 20 | 66 75 6e 63 74 69 6f 6e |o.other |function|
|000040d0| 20 73 68 6f 75 6c 64 20 | 63 6f 6e 74 72 6f 6c 20 | should |control |
|000040e0| 74 68 69 73 2e 29 20 54 | 68 65 20 70 61 72 61 6d |this.) T|he param|
|000040f0| 65 74 65 72 20 24 70 6f | 73 69 74 69 6f 6e 24 20 |eter $po|sition$ |
|00004100| 63 6f 6e 74 72 6f 6c 73 | 0a 74 68 65 20 64 65 73 |controls|.the des|
|00004110| 69 72 65 64 20 64 69 72 | 65 63 74 69 6f 6e 20 6f |ired dir|ection o|
|00004120| 66 20 6d 6f 76 65 6d 65 | 6e 74 3a 0a 5c 62 65 67 |f moveme|nt:.\beg|
|00004130| 69 6e 7b 69 74 65 6d 69 | 7a 65 7d 0a 5c 69 74 65 |in{itemi|ze}.\ite|
|00004140| 6d 5b 30 5d 20 43 6c 6f | 73 65 20 74 72 61 79 0a |m[0] Clo|se tray.|
|00004150| 5c 69 74 65 6d 5b 31 5d | 20 4f 70 65 6e 20 74 72 |\item[1]| Open tr|
|00004160| 61 79 0a 5c 65 6e 64 7b | 69 74 65 6d 69 7a 65 7d |ay.\end{|itemize}|
|00004170| 0a 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 72 |.This fu|nction r|
|00004180| 65 74 75 72 6e 73 20 30 | 20 75 70 6f 6e 20 73 75 |eturns 0| upon su|
|00004190| 63 63 65 73 73 2c 20 61 | 6e 64 20 61 20 6e 6f 6e |ccess, a|nd a non|
|000041a0| 2d 7a 65 72 6f 20 76 61 | 6c 75 65 20 75 70 6f 6e |-zero va|lue upon|
|000041b0| 0a 65 72 72 6f 72 2e 20 | 4e 6f 74 65 20 74 68 61 |.error. |Note tha|
|000041c0| 74 20 69 66 20 74 68 65 | 20 74 72 61 79 20 69 73 |t if the| tray is|
|000041d0| 20 61 6c 72 65 61 64 79 | 20 69 6e 20 74 68 65 20 | already| in the |
|000041e0| 64 65 73 69 72 65 64 20 | 70 6f 73 69 74 69 6f 6e |desired |position|
|000041f0| 2c 20 6e 6f 0a 61 63 74 | 69 6f 6e 20 6e 65 65 64 |, no.act|ion need|
|00004200| 20 62 65 20 74 61 6b 65 | 6e 2c 20 61 6e 64 20 74 | be take|n, and t|
|00004210| 68 65 20 72 65 74 75 72 | 6e 20 76 61 6c 75 65 20 |he retur|n value |
|00004220| 73 68 6f 75 6c 64 20 62 | 65 20 30 2e 20 0a 0a 5c |should b|e 0. ..\|
|00004230| 73 75 62 73 65 63 74 69 | 6f 6e 7b 24 4c 6f 63 6b |subsecti|on{$Lock|
|00004240| 5f 64 6f 6f 72 28 6b 64 | 65 76 5f 74 5c 20 64 65 |_door(kd|ev_t\ de|
|00004250| 76 2c 20 69 6e 74 5c 20 | 6c 6f 63 6b 29 24 7d 0a |v, int\ |lock)$}.|
|00004260| 0a 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 28 |.This fu|nction (|
|00004270| 61 6e 64 20 6e 6f 20 6f | 74 68 65 72 20 63 6f 64 |and no o|ther cod|
|00004280| 65 29 20 63 6f 6e 74 72 | 6f 6c 73 20 6c 6f 63 6b |e) contr|ols lock|
|00004290| 69 6e 67 20 6f 66 20 74 | 68 65 20 64 6f 6f 72 2c |ing of t|he door,|
|000042a0| 20 69 66 20 74 68 65 0a | 64 72 69 76 65 20 61 6c | if the.|drive al|
|000042b0| 6c 6f 77 73 20 74 68 69 | 73 2e 20 54 68 65 20 76 |lows thi|s. The v|
|000042c0| 61 6c 75 65 20 6f 66 20 | 24 6c 6f 63 6b 24 20 63 |alue of |$lock$ c|
|000042d0| 6f 6e 74 72 6f 6c 73 20 | 74 68 65 20 64 65 73 69 |ontrols |the desi|
|000042e0| 72 65 64 20 6c 6f 63 6b | 69 6e 67 0a 73 74 61 74 |red lock|ing.stat|
|000042f0| 65 3a 0a 5c 62 65 67 69 | 6e 7b 69 74 65 6d 69 7a |e:.\begi|n{itemiz|
|00004300| 65 7d 0a 5c 69 74 65 6d | 5b 30 5d 20 55 6e 6c 6f |e}.\item|[0] Unlo|
|00004310| 63 6b 20 64 6f 6f 72 2c | 20 6d 61 6e 75 61 6c 20 |ck door,| manual |
|00004320| 6f 70 65 6e 69 6e 67 20 | 69 73 20 61 6c 6c 6f 77 |opening |is allow|
|00004330| 65 64 0a 5c 69 74 65 6d | 5b 31 5d 20 4c 6f 63 6b |ed.\item|[1] Lock|
|00004340| 20 64 6f 6f 72 2c 20 74 | 72 61 79 20 63 61 6e 6e | door, t|ray cann|
|00004350| 6f 74 20 62 65 20 65 6a | 65 63 74 65 64 20 6d 61 |ot be ej|ected ma|
|00004360| 6e 75 61 6c 6c 79 0a 5c | 65 6e 64 7b 69 74 65 6d |nually.\|end{item|
|00004370| 69 7a 65 7d 0a 52 65 74 | 75 72 6e 20 76 61 6c 75 |ize}.Ret|urn valu|
|00004380| 65 73 20 61 72 65 20 61 | 73 20 66 6f 72 20 24 74 |es are a|s for $t|
|00004390| 72 61 79 5f 6d 6f 76 65 | 28 29 24 2e 0a 0a 5c 73 |ray_move|()$...\s|
|000043a0| 75 62 73 65 63 74 69 6f | 6e 7b 24 53 65 6c 65 63 |ubsectio|n{$Selec|
|000043b0| 74 5f 73 70 65 65 64 28 | 6b 64 65 76 5f 74 5c 20 |t_speed(|kdev_t\ |
|000043c0| 64 65 76 2c 20 69 6e 74 | 5c 20 73 70 65 65 64 29 |dev, int|\ speed)|
|000043d0| 24 7d 0a 0a 41 6c 74 68 | 6f 75 67 68 20 6e 6f 6e |$}..Alth|ough non|
|000043e0| 65 20 6f 66 20 74 68 65 | 20 64 72 69 76 65 72 73 |e of the| drivers|
|000043f0| 20 68 61 73 20 69 6d 70 | 6c 65 6d 65 6e 74 65 64 | has imp|lemented|
|00004400| 20 74 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 73 | this fu|nction s|
|00004410| 6f 20 66 61 72 2c 0a 73 | 6f 6d 65 20 64 72 69 76 |o far,.s|ome driv|
|00004420| 65 73 20 61 72 65 20 63 | 61 70 61 62 6c 65 20 6f |es are c|apable o|
|00004430| 66 20 68 65 61 64 2d 73 | 70 65 65 64 20 73 65 6c |f head-s|peed sel|
|00004440| 65 63 74 69 6f 6e 2c 20 | 61 6e 64 20 68 65 6e 63 |ection, |and henc|
|00004450| 65 20 74 68 69 73 20 69 | 73 20 61 0a 63 61 70 61 |e this i|s a.capa|
|00004460| 62 69 6c 69 74 79 20 74 | 68 61 74 20 73 68 6f 75 |bility t|hat shou|
|00004470| 6c 64 20 62 65 20 73 74 | 61 6e 64 61 72 64 69 7a |ld be st|andardiz|
|00004480| 65 64 20 74 68 72 6f 75 | 67 68 20 61 20 66 75 6e |ed throu|gh a fun|
|00004490| 63 74 69 6f 6e 20 69 6e | 20 74 68 65 0a 64 65 76 |ction in| the.dev|
|000044a0| 69 63 65 2d 6f 70 65 72 | 61 74 69 6f 6e 73 20 73 |ice-oper|ations s|
|000044b0| 74 72 75 63 74 75 72 65 | 2e 20 54 68 69 73 20 66 |tructure|. This f|
|000044c0| 75 6e 63 74 69 6f 6e 20 | 73 68 6f 75 6c 64 20 73 |unction |should s|
|000044d0| 65 6c 65 63 74 20 74 68 | 65 20 73 70 65 65 64 20 |elect th|e speed |
|000044e0| 61 74 0a 77 68 69 63 68 | 20 64 61 74 61 20 69 73 |at.which| data is|
|000044f0| 20 72 65 61 64 20 6f 72 | 20 61 75 64 69 6f 20 69 | read or| audio i|
|00004500| 73 20 70 6c 61 79 65 64 | 20 62 61 63 6b 2e 20 54 |s played| back. T|
|00004510| 68 65 20 73 70 65 63 69 | 61 6c 20 76 61 6c 75 65 |he speci|al value|
|00004520| 20 60 30 27 0a 6d 65 61 | 6e 73 20 60 61 75 74 6f | `0'.mea|ns `auto|
|00004530| 2d 73 65 6c 65 63 74 69 | 6f 6e 27 2c 20 69 2e 65 |-selecti|on', i.e|
|00004540| 2e 2c 20 6d 61 78 69 6d | 75 6d 20 64 61 74 61 2d |., maxim|um data-|
|00004550| 72 61 74 65 20 6f 72 20 | 72 65 61 6c 2d 74 69 6d |rate or |real-tim|
|00004560| 65 20 61 75 64 69 6f 0a | 72 61 74 65 2e 20 49 66 |e audio.|rate. If|
|00004570| 20 74 68 65 20 64 72 69 | 76 65 20 64 6f 65 73 6e | the dri|ve doesn|
|00004580| 27 74 20 68 61 76 65 20 | 74 68 69 73 20 60 61 75 |'t have |this `au|
|00004590| 74 6f 2d 73 65 6c 65 63 | 74 69 6f 6e 27 20 63 61 |to-selec|tion' ca|
|000045a0| 70 61 62 69 6c 69 74 79 | 2c 20 74 68 65 0a 64 65 |pability|, the.de|
|000045b0| 63 69 73 69 6f 6e 20 73 | 68 6f 75 6c 64 20 62 65 |cision s|hould be|
|000045c0| 20 6d 61 64 65 20 6f 6e | 20 74 68 65 20 63 75 72 | made on| the cur|
|000045d0| 72 65 6e 74 20 64 69 73 | 63 20 6c 6f 61 64 65 64 |rent dis|c loaded|
|000045e0| 20 61 6e 64 20 74 68 65 | 20 72 65 74 75 72 6e 0a | and the| return.|
|000045f0| 76 61 6c 75 65 20 73 68 | 6f 75 6c 64 20 62 65 20 |value sh|ould be |
|00004600| 70 6f 73 69 74 69 76 65 | 2e 20 41 20 6e 65 67 61 |positive|. A nega|
|00004610| 74 69 76 65 20 72 65 74 | 75 72 6e 20 76 61 6c 75 |tive ret|urn valu|
|00004620| 65 20 69 6e 64 69 63 61 | 74 65 73 20 61 6e 0a 65 |e indica|tes an.e|
|00004630| 72 72 6f 72 2e 20 28 41 | 6c 74 68 6f 75 67 68 20 |rror. (A|lthough |
|00004640| 74 68 65 20 61 75 64 69 | 6f 2d 6c 6f 77 2d 70 61 |the audi|o-low-pa|
|00004650| 73 73 20 66 69 6c 74 65 | 72 73 20 70 72 6f 62 61 |ss filte|rs proba|
|00004660| 62 6c 79 20 61 72 65 6e | 27 74 20 64 65 73 69 67 |bly aren|'t desig|
|00004670| 6e 65 64 0a 66 6f 72 20 | 69 74 2c 20 6d 6f 72 65 |ned.for |it, more|
|00004680| 20 74 68 61 6e 20 72 65 | 61 6c 2d 74 69 6d 65 20 | than re|al-time |
|00004690| 70 6c 61 79 62 61 63 6b | 20 6f 66 20 61 75 64 69 |playback| of audi|
|000046a0| 6f 20 6d 69 67 68 74 20 | 62 65 20 75 73 65 64 20 |o might |be used |
|000046b0| 66 6f 72 0a 68 69 67 68 | 2d 73 70 65 65 64 20 63 |for.high|-speed c|
|000046c0| 6f 70 79 69 6e 67 20 6f | 66 20 61 75 64 69 6f 20 |opying o|f audio |
|000046d0| 74 72 61 63 6b 73 29 2e | 20 42 61 64 6c 79 20 70 |tracks).| Badly p|
|000046e0| 72 65 73 73 65 64 20 5c | 63 64 72 6f 6d 20 73 20 |ressed \|cdrom s |
|000046f0| 6d 61 79 0a 62 65 6e 65 | 66 69 74 20 66 72 6f 6d |may.bene|fit from|
|00004700| 20 6c 65 73 73 2d 74 68 | 61 6e 2d 6d 61 78 69 6d | less-th|an-maxim|
|00004710| 75 6d 20 68 65 61 64 20 | 72 61 74 65 2e 0a 0a 5c |um head |rate...\|
|00004720| 73 75 62 73 65 63 74 69 | 6f 6e 7b 24 53 65 6c 65 |subsecti|on{$Sele|
|00004730| 63 74 5f 64 69 73 63 28 | 6b 64 65 76 5f 74 5c 20 |ct_disc(|kdev_t\ |
|00004740| 64 65 76 2c 20 69 6e 74 | 5c 20 6e 75 6d 62 65 72 |dev, int|\ number|
|00004750| 29 24 7d 0a 0a 49 66 20 | 74 68 65 20 64 72 69 76 |)$}..If |the driv|
|00004760| 65 20 63 61 6e 20 73 74 | 6f 72 65 20 6d 75 6c 74 |e can st|ore mult|
|00004770| 69 70 6c 65 20 64 69 73 | 63 73 20 28 61 20 6a 75 |iple dis|cs (a ju|
|00004780| 6b 65 2d 62 6f 78 29 2c | 20 69 74 20 69 73 20 6c |ke-box),| it is l|
|00004790| 69 6b 65 6c 79 20 74 68 | 61 74 0a 61 20 64 69 73 |ikely th|at.a dis|
|000047a0| 63 20 73 65 6c 65 63 74 | 69 6f 6e 20 63 61 6e 20 |c select|ion can |
|000047b0| 62 65 20 6d 61 64 65 20 | 62 79 20 73 6f 66 74 77 |be made |by softw|
|000047c0| 61 72 65 2e 20 54 68 69 | 73 20 66 75 6e 63 74 69 |are. Thi|s functi|
|000047d0| 6f 6e 20 73 68 6f 75 6c | 64 20 70 65 72 66 6f 72 |on shoul|d perfor|
|000047e0| 6d 0a 64 69 73 63 20 73 | 65 6c 65 63 74 69 6f 6e |m.disc s|election|
|000047f0| 2e 20 49 74 20 73 68 6f | 75 6c 64 20 72 65 74 75 |. It sho|uld retu|
|00004800| 72 6e 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |rn the n|umber of|
|00004810| 20 74 68 65 20 73 65 6c | 65 63 74 65 64 20 64 69 | the sel|ected di|
|00004820| 73 63 20 6f 6e 0a 73 75 | 63 63 65 73 73 2c 20 61 |sc on.su|ccess, a|
|00004830| 20 6e 65 67 61 74 69 76 | 65 20 76 61 6c 75 65 20 | negativ|e value |
|00004840| 6f 6e 20 65 72 72 6f 72 | 2e 20 43 75 72 72 65 6e |on error|. Curren|
|00004850| 74 6c 79 2c 20 6e 6f 6e | 65 20 6f 66 20 74 68 65 |tly, non|e of the|
|00004860| 20 5c 6c 69 6e 75 78 5c | 20 0a 5c 63 64 72 6f 6d | \linux\| .\cdrom|
|00004870| 5c 20 64 72 69 76 65 72 | 73 20 61 70 70 65 61 72 |\ driver|s appear|
|00004880| 73 20 74 6f 20 73 75 70 | 70 6f 72 74 20 73 75 63 |s to sup|port suc|
|00004890| 68 20 66 75 6e 63 74 69 | 6f 6e 61 6c 69 74 79 2c |h functi|onality,|
|000048a0| 20 62 75 74 20 69 74 20 | 69 73 20 64 65 66 69 6e | but it |is defin|
|000048b0| 65 64 0a 68 65 72 65 20 | 66 6f 72 20 66 75 74 75 |ed.here |for futu|
|000048c0| 72 65 20 70 75 72 70 6f | 73 65 73 2e 0a 0a 5c 73 |re purpo|ses...\s|
|000048d0| 75 62 73 65 63 74 69 6f | 6e 7b 24 47 65 74 5f 6c |ubsectio|n{$Get_l|
|000048e0| 61 73 74 5f 73 65 73 73 | 69 6f 6e 28 6b 64 65 76 |ast_sess|ion(kdev|
|000048f0| 5f 74 5c 20 64 65 76 2c | 20 73 74 72 75 63 74 5c |_t\ dev,| struct\|
|00004900| 20 63 64 72 6f 6d 5f 6d | 75 6c 74 69 73 65 73 73 | cdrom_m|ultisess|
|00004910| 69 6f 6e 20 2a 0a 6d 73 | 5f 69 6e 66 6f 29 24 7d |ion *.ms|_info)$}|
|00004920| 0a 0a 54 68 69 73 20 66 | 75 6e 63 74 69 6f 6e 20 |..This f|unction |
|00004930| 73 68 6f 75 6c 64 20 69 | 6d 70 6c 65 6d 65 6e 74 |should i|mplement|
|00004940| 20 74 68 65 20 6f 6c 64 | 20 63 6f 72 72 65 73 70 | the old| corresp|
|00004950| 6f 6e 64 69 6e 67 20 24 | 69 6f 63 74 6c 28 29 24 |onding $|ioctl()$|
|00004960| 2e 20 46 6f 72 0a 64 65 | 76 69 63 65 20 24 64 65 |. For.de|vice $de|
|00004970| 76 24 2c 20 74 68 65 20 | 73 74 61 72 74 20 6f 66 |v$, the |start of|
|00004980| 20 74 68 65 20 6c 61 73 | 74 20 73 65 73 73 69 6f | the las|t sessio|
|00004990| 6e 20 6f 66 20 74 68 65 | 20 63 75 72 72 65 6e 74 |n of the| current|
|000049a0| 20 64 69 73 63 20 73 68 | 6f 75 6c 64 0a 62 65 20 | disc sh|ould.be |
|000049b0| 72 65 74 75 72 6e 65 64 | 20 69 6e 20 74 68 65 20 |returned| in the |
|000049c0| 70 6f 69 6e 74 65 72 20 | 61 72 67 75 6d 65 6e 74 |pointer |argument|
|000049d0| 20 24 6d 73 5f 69 6e 66 | 6f 24 2e 20 4e 6f 74 65 | $ms_inf|o$. Note|
|000049e0| 20 74 68 61 74 20 72 6f | 75 74 69 6e 65 73 20 69 | that ro|utines i|
|000049f0| 6e 20 5c 63 64 72 6f 6d | 63 5c 20 68 61 76 65 20 |n \cdrom|c\ have |
|00004a00| 73 61 6e 69 74 69 7a 65 | 64 20 74 68 69 73 20 61 |sanitize|d this a|
|00004a10| 72 67 75 6d 65 6e 74 3a | 20 69 74 73 0a 72 65 71 |rgument:| its.req|
|00004a20| 75 65 73 74 65 64 20 66 | 6f 72 6d 61 74 20 77 69 |uested f|ormat wi|
|00004a30| 6c 6c 20 7b 5c 65 6d 20 | 61 6c 77 61 79 73 5c 2f |ll {\em |always\/|
|00004a40| 7d 20 62 65 20 6f 66 20 | 74 68 65 20 74 79 70 65 |} be of |the type|
|00004a50| 20 24 43 44 52 4f 4d 5f | 4c 42 41 24 0a 28 6c 69 | $CDROM_|LBA$.(li|
|00004a60| 6e 65 61 72 20 62 6c 6f | 63 6b 20 61 64 64 72 65 |near blo|ck addre|
|00004a70| 73 73 69 6e 67 20 6d 6f | 64 65 29 2c 20 77 68 61 |ssing mo|de), wha|
|00004a80| 74 65 76 65 72 20 74 68 | 65 20 63 61 6c 6c 69 6e |tever th|e callin|
|00004a90| 67 20 73 6f 66 74 77 61 | 72 65 0a 72 65 71 75 65 |g softwa|re.reque|
|00004aa0| 73 74 65 64 2e 20 42 75 | 74 20 73 61 6e 69 74 69 |sted. Bu|t saniti|
|00004ab0| 7a 61 74 69 6f 6e 20 67 | 6f 65 73 20 65 76 65 6e |zation g|oes even|
|00004ac0| 20 66 75 72 74 68 65 72 | 3a 20 74 68 65 20 6c 6f | further|: the lo|
|00004ad0| 77 2d 6c 65 76 65 6c 0a | 69 6d 70 6c 65 6d 65 6e |w-level.|implemen|
|00004ae0| 74 61 74 69 6f 6e 20 6d | 61 79 20 72 65 74 75 72 |tation m|ay retur|
|00004af0| 6e 20 74 68 65 20 72 65 | 71 75 65 73 74 65 64 20 |n the re|quested |
|00004b00| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 69 6e 20 24 |informat|ion in $|
|00004b10| 43 44 52 4f 4d 5f 4d 53 | 46 24 0a 66 6f 72 6d 61 |CDROM_MS|F$.forma|
|00004b20| 74 20 69 66 20 69 74 20 | 77 69 73 68 65 73 20 73 |t if it |wishes s|
|00004b30| 6f 20 28 73 65 74 74 69 | 6e 67 20 74 68 65 20 24 |o (setti|ng the $|
|00004b40| 6d 73 5f 69 6e 66 6f 5c | 72 69 67 68 74 61 72 72 |ms_info\|rightarr|
|00004b50| 6f 77 20 61 64 64 72 5f | 66 6f 72 6d 61 74 24 0a |ow addr_|format$.|
|00004b60| 66 69 65 6c 64 20 61 70 | 70 72 6f 70 72 69 61 74 |field ap|propriat|
|00004b70| 65 6c 79 2c 20 6f 66 20 | 63 6f 75 72 73 65 29 20 |ely, of |course) |
|00004b80| 61 6e 64 20 74 68 65 20 | 72 6f 75 74 69 6e 65 73 |and the |routines|
|00004b90| 20 69 6e 20 5c 63 64 72 | 6f 6d 63 5c 20 77 69 6c | in \cdr|omc\ wil|
|00004ba0| 6c 20 6d 61 6b 65 0a 74 | 68 65 20 74 72 61 6e 73 |l make.t|he trans|
|00004bb0| 66 6f 72 6d 20 69 66 20 | 6e 65 63 65 73 73 61 72 |form if |necessar|
|00004bc0| 79 2e 20 54 68 65 20 72 | 65 74 75 72 6e 20 76 61 |y. The r|eturn va|
|00004bd0| 6c 75 65 20 69 73 20 30 | 20 75 70 6f 6e 20 73 75 |lue is 0| upon su|
|00004be0| 63 63 65 73 73 2e 0a 0a | 5c 73 75 62 73 65 63 74 |ccess...|\subsect|
|00004bf0| 69 6f 6e 7b 24 47 65 74 | 5f 6d 63 6e 28 6b 64 65 |ion{$Get|_mcn(kde|
|00004c00| 76 5f 74 5c 20 64 65 76 | 2c 20 73 74 72 75 63 74 |v_t\ dev|, struct|
|00004c10| 5c 20 63 64 72 6f 6d 5f | 6d 63 6e 20 2a 20 6d 63 |\ cdrom_|mcn * mc|
|00004c20| 6e 29 24 7d 0a 0a 53 6f | 6d 65 20 64 69 73 63 73 |n)$}..So|me discs|
|00004c30| 20 63 61 72 72 79 20 61 | 20 60 4d 65 64 69 61 20 | carry a| `Media |
|00004c40| 43 61 74 61 6c 6f 67 20 | 4e 75 6d 62 65 72 27 20 |Catalog |Number' |
|00004c50| 28 4d 43 4e 29 2c 20 61 | 6c 73 6f 20 63 61 6c 6c |(MCN), a|lso call|
|00004c60| 65 64 0a 60 55 6e 69 76 | 65 72 73 61 6c 20 50 72 |ed.`Univ|ersal Pr|
|00004c70| 6f 64 75 63 74 20 43 6f | 64 65 27 20 28 55 50 43 |oduct Co|de' (UPC|
|00004c80| 29 2e 20 54 68 69 73 20 | 6e 75 6d 62 65 72 20 73 |). This |number s|
|00004c90| 68 6f 75 6c 64 20 72 65 | 66 6c 65 63 74 20 74 68 |hould re|flect th|
|00004ca0| 65 20 6e 75 6d 62 65 72 | 20 74 68 61 74 0a 69 73 |e number| that.is|
|00004cb0| 20 67 65 6e 65 72 61 6c | 6c 79 20 66 6f 75 6e 64 | general|ly found|
|00004cc0| 20 69 6e 20 74 68 65 20 | 62 61 72 2d 63 6f 64 65 | in the |bar-code|
|00004cd0| 20 6f 6e 20 74 68 65 20 | 70 72 6f 64 75 63 74 2e | on the |product.|
|00004ce0| 20 55 6e 66 6f 72 74 75 | 6e 61 74 65 6c 79 2c 20 | Unfortu|nately, |
|00004cf0| 74 68 65 0a 66 65 77 20 | 64 69 73 63 73 20 74 68 |the.few |discs th|
|00004d00| 61 74 20 63 61 72 72 79 | 20 73 75 63 68 20 61 20 |at carry| such a |
|00004d10| 6e 75 6d 62 65 72 20 6f | 6e 20 74 68 65 20 64 69 |number o|n the di|
|00004d20| 73 63 20 64 6f 6e 27 74 | 20 65 76 65 6e 20 75 73 |sc don't| even us|
|00004d30| 65 20 74 68 65 20 73 61 | 6d 65 0a 66 6f 72 6d 61 |e the sa|me.forma|
|00004d40| 74 2e 20 54 68 65 20 72 | 65 74 75 72 6e 20 61 72 |t. The r|eturn ar|
|00004d50| 67 75 6d 65 6e 74 20 74 | 6f 20 74 68 69 73 20 66 |gument t|o this f|
|00004d60| 75 6e 63 74 69 6f 6e 20 | 69 73 20 61 20 70 6f 69 |unction |is a poi|
|00004d70| 6e 74 65 72 20 74 6f 20 | 61 0a 70 72 65 2d 64 65 |nter to |a.pre-de|
|00004d80| 63 6c 61 72 65 64 20 6d | 65 6d 6f 72 79 20 72 65 |clared m|emory re|
|00004d90| 67 69 6f 6e 20 6f 66 20 | 74 79 70 65 20 24 73 74 |gion of |type $st|
|00004da0| 72 75 63 74 5c 20 63 64 | 72 6f 6d 5f 6d 63 6e 24 |ruct\ cd|rom_mcn$|
|00004db0| 2e 20 54 68 65 20 4d 43 | 4e 20 69 73 0a 65 78 70 |. The MC|N is.exp|
|00004dc0| 65 63 74 65 64 20 61 73 | 20 61 20 31 33 2d 63 68 |ected as| a 13-ch|
|00004dd0| 61 72 61 63 74 65 72 20 | 73 74 72 69 6e 67 2c 20 |aracter |string, |
|00004de0| 74 65 72 6d 69 6e 61 74 | 65 64 20 62 79 20 61 20 |terminat|ed by a |
|00004df0| 6e 75 6c 6c 2d 63 68 61 | 72 61 63 74 65 72 2e 0a |null-cha|racter..|
|00004e00| 0a 5c 73 75 62 73 65 63 | 74 69 6f 6e 7b 24 52 65 |.\subsec|tion{$Re|
|00004e10| 73 65 74 28 6b 64 65 76 | 5f 74 20 64 65 76 29 24 |set(kdev|_t dev)$|
|00004e20| 7d 0a 0a 54 68 69 73 20 | 63 61 6c 6c 20 73 68 6f |}..This |call sho|
|00004e30| 75 6c 64 20 69 6d 70 6c | 65 6d 65 6e 74 20 68 61 |uld impl|ement ha|
|00004e40| 72 64 2d 72 65 73 65 74 | 74 69 6e 67 20 74 68 65 |rd-reset|ting the|
|00004e50| 20 64 72 69 76 65 20 28 | 61 6c 74 68 6f 75 67 68 | drive (|although|
|00004e60| 20 69 6e 0a 63 69 72 63 | 75 6d 73 74 61 6e 63 65 | in.circ|umstance|
|00004e70| 73 20 74 68 61 74 20 61 | 20 68 61 72 64 2d 72 65 |s that a| hard-re|
|00004e80| 73 65 74 20 69 73 20 6e | 65 63 65 73 73 61 72 79 |set is n|ecessary|
|00004e90| 2c 20 61 20 64 72 69 76 | 65 20 6d 61 79 20 76 65 |, a driv|e may ve|
|00004ea0| 72 79 20 77 65 6c 6c 0a | 6e 6f 74 20 6c 69 73 74 |ry well.|not list|
|00004eb0| 65 6e 20 74 6f 20 63 6f | 6d 6d 61 6e 64 73 20 61 |en to co|mmands a|
|00004ec0| 6e 79 6d 6f 72 65 29 2e | 20 50 72 65 66 65 72 61 |nymore).| Prefera|
|00004ed0| 62 6c 79 2c 20 63 6f 6e | 74 72 6f 6c 20 69 73 20 |bly, con|trol is |
|00004ee0| 72 65 74 75 72 6e 65 64 | 20 74 6f 20 74 68 65 0a |returned| to the.|
|00004ef0| 63 61 6c 6c 65 72 20 6f | 6e 6c 79 20 61 66 74 65 |caller o|nly afte|
|00004f00| 72 20 74 68 65 20 64 72 | 69 76 65 20 68 61 73 20 |r the dr|ive has |
|00004f10| 66 69 6e 69 73 68 65 64 | 20 72 65 73 65 74 74 69 |finished| resetti|
|00004f20| 6e 67 2e 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |ng...\su|bsection|
|00004f30| 7b 24 41 75 64 69 6f 5f | 69 6f 63 74 6c 28 6b 64 |{$Audio_|ioctl(kd|
|00004f40| 65 76 5f 74 5c 20 64 65 | 76 2c 20 75 6e 73 69 67 |ev_t\ de|v, unsig|
|00004f50| 6e 65 64 5c 20 69 6e 74 | 5c 20 63 6d 64 2c 20 76 |ned\ int|\ cmd, v|
|00004f60| 6f 69 64 20 2a 0a 61 72 | 67 29 24 7d 0a 0a 53 6f |oid *.ar|g)$}..So|
|00004f70| 6d 65 20 6f 66 20 74 68 | 65 20 5c 63 64 72 6f 6d |me of th|e \cdrom|
|00004f80| 2d 24 69 6f 63 74 6c 24 | 73 20 64 65 66 69 6e 65 |-$ioctl$|s define|
|00004f90| 64 20 69 6e 20 7b 5c 74 | 74 20 63 64 72 6f 6d 2e |d in {\t|t cdrom.|
|00004fa0| 68 7d 20 63 61 6e 20 62 | 65 0a 69 6d 70 6c 65 6d |h} can b|e.implem|
|00004fb0| 65 6e 74 65 64 20 62 79 | 20 74 68 65 20 72 6f 75 |ented by| the rou|
|00004fc0| 74 69 6e 65 73 20 64 65 | 73 63 72 69 62 65 64 20 |tines de|scribed |
|00004fd0| 61 62 6f 76 65 2c 20 61 | 6e 64 20 68 65 6e 63 65 |above, a|nd hence|
|00004fe0| 20 74 68 65 20 66 75 6e | 63 74 69 6f 6e 0a 24 63 | the fun|ction.$c|
|00004ff0| 64 72 6f 6d 5f 69 6f 63 | 74 6c 24 20 77 69 6c 6c |drom_ioc|tl$ will|
|00005000| 20 75 73 65 20 74 68 6f | 73 65 2e 20 48 6f 77 65 | use tho|se. Howe|
|00005010| 76 65 72 2c 20 6d 6f 73 | 74 20 24 69 6f 63 74 6c |ver, mos|t $ioctl|
|00005020| 24 73 20 64 65 61 6c 20 | 77 69 74 68 0a 61 75 64 |$s deal |with.aud|
|00005030| 69 6f 2d 63 6f 6e 74 72 | 6f 6c 2e 20 57 65 20 68 |io-contr|ol. We h|
|00005040| 61 76 65 20 64 65 63 69 | 64 65 64 20 74 6f 20 6c |ave deci|ded to l|
|00005050| 65 61 76 65 20 74 68 65 | 73 65 20 61 63 63 65 73 |eave the|se acces|
|00005060| 73 65 64 20 74 68 72 6f | 75 67 68 20 61 0a 73 69 |sed thro|ugh a.si|
|00005070| 6e 67 6c 65 20 66 75 6e | 63 74 69 6f 6e 2c 20 72 |ngle fun|ction, r|
|00005080| 65 70 65 61 74 69 6e 67 | 20 74 68 65 20 61 72 67 |epeating| the arg|
|00005090| 75 6d 65 6e 74 73 20 24 | 63 6d 64 24 20 61 6e 64 |uments $|cmd$ and|
|000050a0| 20 24 61 72 67 24 2e 20 | 4e 6f 74 65 20 74 68 61 | $arg$. |Note tha|
|000050b0| 74 0a 74 68 65 20 6c 61 | 74 74 65 72 20 69 73 20 |t.the la|tter is |
|000050c0| 6f 66 20 74 79 70 65 20 | 24 76 6f 69 64 2a 7b 7d |of type |$void*{}|
|000050d0| 24 2c 20 72 61 74 68 65 | 72 20 74 68 61 6e 20 24 |$, rathe|r than $|
|000050e0| 75 6e 73 69 67 6e 65 64 | 5c 20 6c 6f 6e 67 5c 0a |unsigned|\ long\.|
|000050f0| 69 6e 74 24 2e 20 54 68 | 65 20 72 6f 75 74 69 6e |int$. Th|e routin|
|00005100| 65 20 24 63 64 72 6f 6d | 5f 69 6f 63 74 6c 28 29 |e $cdrom|_ioctl()|
|00005110| 24 20 64 6f 65 73 20 64 | 6f 20 73 6f 6d 65 20 75 |$ does d|o some u|
|00005120| 73 65 66 75 6c 20 74 68 | 69 6e 67 73 2c 0a 74 68 |seful th|ings,.th|
|00005130| 6f 75 67 68 2e 20 49 74 | 20 73 61 6e 69 74 69 7a |ough. It| sanitiz|
|00005140| 65 73 20 74 68 65 20 61 | 64 64 72 65 73 73 20 66 |es the a|ddress f|
|00005150| 6f 72 6d 61 74 20 74 79 | 70 65 20 74 6f 20 24 43 |ormat ty|pe to $C|
|00005160| 44 52 4f 4d 5f 4d 53 46 | 24 20 28 4d 69 6e 75 74 |DROM_MSF|$ (Minut|
|00005170| 65 73 2c 0a 53 65 63 6f | 6e 64 73 2c 20 46 72 61 |es,.Seco|nds, Fra|
|00005180| 6d 65 73 29 20 66 6f 72 | 20 61 6c 6c 20 61 75 64 |mes) for| all aud|
|00005190| 69 6f 20 63 61 6c 6c 73 | 2e 20 49 74 20 61 6c 73 |io calls|. It als|
|000051a0| 6f 20 76 65 72 69 66 69 | 65 73 20 74 68 65 20 6d |o verifi|es the m|
|000051b0| 65 6d 6f 72 79 0a 6c 6f | 63 61 74 69 6f 6e 20 6f |emory.lo|cation o|
|000051c0| 66 20 24 61 72 67 24 2c | 20 61 6e 64 20 72 65 73 |f $arg$,| and res|
|000051d0| 65 72 76 65 73 20 73 74 | 61 63 6b 2d 6d 65 6d 6f |erves st|ack-memo|
|000051e0| 72 79 20 66 6f 72 20 74 | 68 65 20 61 72 67 75 6d |ry for t|he argum|
|000051f0| 65 6e 74 2e 20 54 68 69 | 73 0a 6d 61 6b 65 73 20 |ent. Thi|s.makes |
|00005200| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 20 6f |implemen|tation o|
|00005210| 66 20 74 68 65 20 24 61 | 75 64 69 6f 5f 69 6f 63 |f the $a|udio_ioc|
|00005220| 74 6c 28 29 24 20 6d 75 | 63 68 20 73 69 6d 70 6c |tl()$ mu|ch simpl|
|00005230| 65 72 20 74 68 61 6e 20 | 69 6e 20 74 68 65 0a 6f |er than |in the.o|
|00005240| 6c 64 20 64 72 69 76 65 | 72 20 73 63 68 65 6d 65 |ld drive|r scheme|
|00005250| 2e 20 46 6f 72 20 61 6e | 20 65 78 61 6d 70 6c 65 |. For an| example|
|00005260| 20 79 6f 75 20 6d 61 79 | 20 6c 6f 6f 6b 20 75 70 | you may| look up|
|00005270| 20 74 68 65 20 66 75 6e | 63 74 69 6f 6e 0a 24 63 | the fun|ction.$c|
|00005280| 6d 32 30 36 5f 61 75 64 | 69 6f 5f 69 6f 63 74 6c |m206_aud|io_ioctl|
|00005290| 28 29 24 20 69 6e 20 7b | 5c 74 74 20 63 6d 32 30 |()$ in {|\tt cm20|
|000052a0| 36 2e 63 7d 20 74 68 61 | 74 20 73 68 6f 75 6c 64 |6.c} tha|t should|
|000052b0| 20 62 65 20 75 70 64 61 | 74 65 64 20 77 69 74 68 | be upda|ted with|
|000052c0| 0a 74 68 69 73 20 64 6f | 63 75 6d 65 6e 74 61 74 |.this do|cumentat|
|000052d0| 69 6f 6e 2e 20 0a 0a 41 | 6e 20 75 6e 69 6d 70 6c |ion. ..A|n unimpl|
|000052e0| 65 6d 65 6e 74 65 64 20 | 69 6f 63 74 6c 20 73 68 |emented |ioctl sh|
|000052f0| 6f 75 6c 64 20 72 65 74 | 75 72 6e 20 24 2d 45 49 |ould ret|urn $-EI|
|00005300| 4e 56 41 4c 24 2c 20 62 | 75 74 20 61 20 68 61 72 |NVAL$, b|ut a har|
|00005310| 6d 6c 65 73 73 20 72 65 | 71 75 65 73 74 0a 28 65 |mless re|quest.(e|
|00005320| 2e 67 2e 2c 20 24 43 44 | 52 4f 4d 53 54 41 52 54 |.g., $CD|ROMSTART|
|00005330| 24 29 20 6d 61 79 20 62 | 65 20 69 67 6e 6f 72 65 |$) may b|e ignore|
|00005340| 64 20 62 79 20 72 65 74 | 75 72 6e 69 6e 67 20 30 |d by ret|urning 0|
|00005350| 20 28 73 75 63 63 65 73 | 73 29 2e 20 4f 74 68 65 | (succes|s). Othe|
|00005360| 72 0a 65 72 72 6f 72 73 | 20 73 68 6f 75 6c 64 20 |r.errors| should |
|00005370| 62 65 20 61 63 63 6f 72 | 64 69 6e 67 20 74 6f 20 |be accor|ding to |
|00005380| 74 68 65 20 73 74 61 6e | 64 61 72 64 73 2c 20 77 |the stan|dards, w|
|00005390| 68 61 74 65 76 65 72 20 | 74 68 65 79 20 61 72 65 |hatever |they are|
|000053a0| 2e 20 28 57 65 0a 6d 61 | 79 20 64 65 63 69 64 65 |. (We.ma|y decide|
|000053b0| 20 74 6f 20 73 61 6e 69 | 74 69 7a 65 20 74 68 65 | to sani|tize the|
|000053c0| 20 72 65 74 75 72 6e 20 | 76 61 6c 75 65 20 69 6e | return |value in|
|000053d0| 20 24 63 64 72 6f 6d 5f | 69 6f 63 74 6c 28 29 24 | $cdrom_|ioctl()$|
|000053e0| 2c 20 69 6e 20 6f 72 64 | 65 72 0a 74 6f 20 67 75 |, in ord|er.to gu|
|000053f0| 61 72 61 6e 74 65 65 20 | 61 20 75 6e 69 66 6f 72 |arantee |a unifor|
|00005400| 6d 20 69 6e 74 65 72 66 | 61 63 65 20 74 6f 20 74 |m interf|ace to t|
|00005410| 68 65 20 61 75 64 69 6f | 2d 70 6c 61 79 65 72 20 |he audio|-player |
|00005420| 73 6f 66 74 77 61 72 65 | 2e 29 0a 0a 5c 73 75 62 |software|.)..\sub|
|00005430| 73 65 63 74 69 6f 6e 7b | 24 44 65 76 5f 69 6f 63 |section{|$Dev_ioc|
|00005440| 74 6c 28 6b 64 65 76 5f | 74 5c 20 64 65 76 2c 20 |tl(kdev_|t\ dev, |
|00005450| 75 6e 73 69 67 6e 65 64 | 5c 20 69 6e 74 5c 20 63 |unsigned|\ int\ c|
|00005460| 6d 64 2c 20 75 6e 73 69 | 67 6e 65 64 5c 20 6c 6f |md, unsi|gned\ lo|
|00005470| 6e 67 5c 0a 61 72 67 29 | 24 7d 0a 0a 53 6f 6d 65 |ng\.arg)|$}..Some|
|00005480| 20 24 69 6f 63 74 6c 24 | 73 20 73 65 65 6d 20 74 | $ioctl$|s seem t|
|00005490| 6f 20 62 65 20 73 70 65 | 63 69 66 69 63 20 74 6f |o be spe|cific to|
|000054a0| 20 63 65 72 74 61 69 6e | 20 5c 63 64 72 6f 6d 5c | certain| \cdrom\|
|000054b0| 20 64 72 69 76 65 73 2e | 20 54 68 61 74 20 69 73 | drives.| That is|
|000054c0| 2c 0a 74 68 65 79 20 61 | 72 65 20 69 6e 74 72 6f |,.they a|re intro|
|000054d0| 64 75 63 65 64 20 74 6f | 20 73 65 72 76 69 63 65 |duced to| service|
|000054e0| 20 73 6f 6d 65 20 63 61 | 70 61 62 69 6c 69 74 69 | some ca|pabiliti|
|000054f0| 65 73 20 6f 66 20 63 65 | 72 74 61 69 6e 20 64 72 |es of ce|rtain dr|
|00005500| 69 76 65 73 2e 20 49 6e | 0a 66 61 63 74 2c 20 74 |ives. In|.fact, t|
|00005510| 68 65 72 65 20 61 72 65 | 20 36 20 64 69 66 66 65 |here are| 6 diffe|
|00005520| 72 65 6e 74 20 24 69 6f | 63 74 6c 24 73 20 66 6f |rent $io|ctl$s fo|
|00005530| 72 20 72 65 61 64 69 6e | 67 20 64 61 74 61 2c 20 |r readin|g data, |
|00005540| 65 69 74 68 65 72 20 69 | 6e 20 73 6f 6d 65 0a 70 |either i|n some.p|
|00005550| 61 72 74 69 63 75 6c 61 | 72 20 6b 69 6e 64 20 6f |articula|r kind o|
|00005560| 66 20 66 6f 72 6d 61 74 | 2c 20 6f 72 20 61 75 64 |f format|, or aud|
|00005570| 69 6f 20 64 61 74 61 2e | 20 4e 6f 74 20 6d 61 6e |io data.| Not man|
|00005580| 79 20 64 72 69 76 65 73 | 20 73 75 70 70 6f 72 74 |y drives| support|
|00005590| 0a 72 65 61 64 69 6e 67 | 20 61 75 64 69 6f 20 74 |.reading| audio t|
|000055a0| 72 61 63 6b 73 20 61 73 | 20 64 61 74 61 2c 20 49 |racks as| data, I|
|000055b0| 20 62 65 6c 69 65 76 65 | 20 74 68 69 73 20 69 73 | believe| this is|
|000055c0| 20 62 65 63 61 75 73 65 | 20 6f 66 20 70 72 6f 74 | because| of prot|
|000055d0| 65 63 74 69 6f 6e 0a 6f | 66 20 63 6f 70 79 72 69 |ection.o|f copyri|
|000055e0| 67 68 74 73 20 6f 66 20 | 61 72 74 69 73 74 73 2e |ghts of |artists.|
|000055f0| 20 4d 6f 72 65 6f 76 65 | 72 2c 20 49 20 74 68 69 | Moreove|r, I thi|
|00005600| 6e 6b 20 74 68 61 74 20 | 69 66 20 61 75 64 69 6f |nk that |if audio|
|00005610| 2d 74 72 61 63 6b 73 20 | 61 72 65 0a 73 75 70 70 |-tracks |are.supp|
|00005620| 6f 72 74 65 64 2c 20 69 | 74 20 73 68 6f 75 6c 64 |orted, i|t should|
|00005630| 20 62 65 20 64 6f 6e 65 | 20 74 68 72 6f 75 67 68 | be done| through|
|00005640| 20 74 68 65 20 56 46 53 | 20 61 6e 64 20 6e 6f 74 | the VFS| and not|
|00005650| 20 76 69 61 20 24 69 6f | 63 74 6c 24 73 2e 20 41 | via $io|ctl$s. A|
|00005660| 0a 70 72 6f 62 6c 65 6d | 20 68 65 72 65 20 63 6f |.problem| here co|
|00005670| 75 6c 64 20 62 65 20 74 | 68 65 20 66 61 63 74 20 |uld be t|he fact |
|00005680| 74 68 61 74 20 61 75 64 | 69 6f 2d 66 72 61 6d 65 |that aud|io-frame|
|00005690| 73 20 61 72 65 20 32 33 | 35 32 20 62 79 74 65 73 |s are 23|52 bytes|
|000056a0| 20 6c 6f 6e 67 2c 0a 73 | 6f 20 65 69 74 68 65 72 | long,.s|o either|
|000056b0| 20 74 68 65 20 61 75 64 | 69 6f 2d 66 69 6c 65 2d | the aud|io-file-|
|000056c0| 73 79 73 74 65 6d 20 73 | 68 6f 75 6c 64 20 61 73 |system s|hould as|
|000056d0| 6b 20 66 6f 72 20 37 35 | 32 36 34 20 62 79 74 65 |k for 75|264 byte|
|000056e0| 73 20 61 74 20 6f 6e 63 | 65 0a 28 74 68 65 20 6c |s at onc|e.(the l|
|000056f0| 65 61 73 74 20 63 6f 6d | 6d 6f 6e 20 6d 75 6c 74 |east com|mon mult|
|00005700| 69 70 6c 65 20 6f 66 20 | 35 31 32 20 61 6e 64 20 |iple of |512 and |
|00005710| 32 33 35 32 29 2c 20 6f | 72 20 74 68 65 20 64 72 |2352), o|r the dr|
|00005720| 69 76 65 72 73 20 73 68 | 6f 75 6c 64 0a 62 65 6e |ivers sh|ould.ben|
|00005730| 64 20 74 68 65 69 72 20 | 62 61 63 6b 73 20 74 6f |d their |backs to|
|00005740| 20 63 6f 70 65 20 77 69 | 74 68 20 74 68 69 73 20 | cope wi|th this |
|00005750| 69 6e 63 6f 68 65 72 65 | 6e 63 65 20 28 74 6f 20 |incohere|nce (to |
|00005760| 77 68 69 63 68 20 49 20 | 77 6f 75 6c 64 20 62 65 |which I |would be|
|00005770| 0a 6f 70 70 6f 73 65 64 | 29 2e 20 4f 6e 63 65 20 |.opposed|). Once |
|00005780| 74 68 69 73 20 71 75 65 | 73 74 69 6f 6e 20 69 73 |this que|stion is|
|00005790| 20 72 65 73 6f 6c 76 65 | 64 2c 20 74 68 69 73 20 | resolve|d, this |
|000057a0| 63 6f 64 65 20 73 68 6f | 75 6c 64 20 62 65 20 73 |code sho|uld be s|
|000057b0| 74 61 6e 64 61 72 64 69 | 7a 65 64 20 69 6e 20 0a |tandardi|zed in .|
|000057c0| 5c 63 64 72 6f 6d 63 2e | 0a 0a 42 65 63 61 75 73 |\cdromc.|..Becaus|
|000057d0| 65 20 74 68 65 72 65 20 | 61 72 65 20 73 6f 20 6d |e there |are so m|
|000057e0| 61 6e 79 20 24 69 6f 63 | 74 6c 24 73 20 74 68 61 |any $ioc|tl$s tha|
|000057f0| 74 20 73 65 65 6d 20 74 | 6f 20 62 65 20 69 6e 74 |t seem t|o be int|
|00005800| 72 6f 64 75 63 65 64 20 | 74 6f 0a 73 61 74 69 73 |roduced |to.satis|
|00005810| 66 79 20 63 65 72 74 61 | 69 6e 20 64 72 69 76 65 |fy certa|in drive|
|00005820| 72 73 2c 5c 66 6f 6f 74 | 6e 6f 74 65 7b 49 73 20 |rs,\foot|note{Is |
|00005830| 74 68 65 72 65 20 73 6f | 66 74 77 61 72 65 20 61 |there so|ftware a|
|00005840| 72 6f 75 6e 64 20 74 68 | 61 74 20 61 63 74 75 61 |round th|at actua|
|00005850| 6c 6c 79 20 75 73 65 73 | 0a 74 68 65 73 65 3f 20 |lly uses|.these? |
|00005860| 49 27 64 20 62 65 20 69 | 6e 74 65 72 65 73 74 65 |I'd be i|ntereste|
|00005870| 64 21 7d 20 61 6e 79 20 | 60 6e 6f 6e 2d 73 74 61 |d!} any |`non-sta|
|00005880| 6e 64 61 72 64 27 20 24 | 69 6f 63 74 6c 24 73 20 |ndard' $|ioctl$s |
|00005890| 61 72 65 20 72 6f 75 74 | 65 64 20 74 68 72 6f 75 |are rout|ed throu|
|000058a0| 67 68 0a 74 68 65 20 63 | 61 6c 6c 20 24 64 65 76 |gh.the c|all $dev|
|000058b0| 5f 69 6f 63 74 6c 28 29 | 24 2e 20 49 6e 20 70 72 |_ioctl()|$. In pr|
|000058c0| 69 6e 63 69 70 6c 65 2c | 20 60 70 72 69 76 61 74 |inciple,| `privat|
|000058d0| 65 27 20 24 69 6f 63 74 | 6c 24 73 20 73 68 6f 75 |e' $ioct|l$s shou|
|000058e0| 6c 64 20 62 65 0a 6e 75 | 6d 62 65 72 65 64 20 61 |ld be.nu|mbered a|
|000058f0| 66 74 65 72 20 74 68 65 | 20 64 65 76 69 63 65 27 |fter the| device'|
|00005900| 73 20 6d 61 6a 6f 72 20 | 6e 75 6d 62 65 72 2c 20 |s major |number, |
|00005910| 61 6e 64 20 6e 6f 74 20 | 74 68 65 20 67 65 6e 65 |and not |the gene|
|00005920| 72 61 6c 20 5c 63 64 72 | 6f 6d 5c 0a 24 69 6f 63 |ral \cdr|om\.$ioc|
|00005930| 74 6c 24 20 6e 75 6d 62 | 65 72 2c 20 7b 5c 74 74 |tl$ numb|er, {\tt|
|00005940| 20 30 78 35 33 7d 2e 20 | 43 75 72 72 65 6e 74 6c | 0x53}. |Currentl|
|00005950| 79 20 74 68 65 20 6e 6f | 6e 2d 73 75 70 70 6f 72 |y the no|n-suppor|
|00005960| 74 65 64 20 24 69 6f 63 | 74 6c 24 73 20 61 72 65 |ted $ioc|tl$s are|
|00005970| 3a 0a 7b 5c 69 74 20 43 | 44 52 4f 4d 52 45 41 44 |:.{\it C|DROMREAD|
|00005980| 4d 4f 44 45 31 2c 20 43 | 44 52 4f 4d 52 45 41 44 |MODE1, C|DROMREAD|
|00005990| 4d 4f 44 45 32 2c 20 43 | 44 52 4f 4d 52 45 41 44 |MODE2, C|DROMREAD|
|000059a0| 41 55 44 49 4f 2c 20 43 | 44 52 4f 4d 52 45 41 44 |AUDIO, C|DROMREAD|
|000059b0| 52 41 57 2c 0a 43 44 52 | 4f 4d 52 45 41 44 43 4f |RAW,.CDR|OMREADCO|
|000059c0| 4f 4b 45 44 2c 20 43 44 | 52 4f 4d 53 45 45 4b 2c |OKED, CD|ROMSEEK,|
|000059d0| 20 43 44 52 4f 4d 50 4c | 41 59 5c 2d 42 4c 4b 20 | CDROMPL|AY\-BLK |
|000059e0| 61 6e 64 20 43 44 52 4f | 4d 52 45 41 44 41 4c 4c |and CDRO|MREADALL|
|000059f0| 7d 2e 20 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |}. ..\su|bsection|
|00005a00| 7b 5c 63 64 72 6f 6d 5c | 20 63 61 70 61 62 69 6c |{\cdrom\| capabil|
|00005a10| 69 74 69 65 73 7d 0a 0a | 49 6e 73 74 65 61 64 20 |ities}..|Instead |
|00005a20| 6f 66 20 6a 75 73 74 20 | 69 6d 70 6c 65 6d 65 6e |of just |implemen|
|00005a30| 74 69 6e 67 20 73 6f 6d | 65 20 24 69 6f 63 74 6c |ting som|e $ioctl|
|00005a40| 24 20 63 61 6c 6c 73 2c | 20 74 68 65 20 69 6e 74 |$ calls,| the int|
|00005a50| 65 72 66 61 63 65 20 69 | 6e 0a 5c 63 64 72 6f 6d |erface i|n.\cdrom|
|00005a60| 63 5c 20 73 75 70 70 6c | 69 65 73 20 74 68 65 20 |c\ suppl|ies the |
|00005a70| 70 6f 73 73 69 62 69 6c | 69 74 79 20 74 6f 20 69 |possibil|ity to i|
|00005a80| 6e 64 69 63 61 74 65 20 | 74 68 65 20 7b 5c 65 6d |ndicate |the {\em|
|00005a90| 20 63 61 70 61 62 69 6c | 69 74 69 65 73 5c 2f 7d | capabil|ities\/}|
|00005aa0| 0a 6f 66 20 61 20 5c 63 | 64 72 6f 6d 5c 20 64 72 |.of a \c|drom\ dr|
|00005ab0| 69 76 65 2e 20 54 68 69 | 73 20 63 61 6e 20 62 65 |ive. Thi|s can be|
|00005ac0| 20 64 6f 6e 65 20 62 79 | 20 4f 52 69 6e 67 20 61 | done by| ORing a|
|00005ad0| 6e 79 20 6e 75 6d 62 65 | 72 20 6f 66 0a 63 61 70 |ny numbe|r of.cap|
|00005ae0| 61 62 69 6c 69 74 79 2d | 63 6f 6e 73 74 61 6e 74 |ability-|constant|
|00005af0| 73 20 74 68 61 74 20 61 | 72 65 20 64 65 66 69 6e |s that a|re defin|
|00005b00| 65 64 20 69 6e 20 5c 75 | 63 64 72 6f 6d 5c 20 61 |ed in \u|cdrom\ a|
|00005b10| 74 20 74 68 65 20 72 65 | 67 69 73 74 72 61 74 69 |t the re|gistrati|
|00005b20| 6f 6e 0a 70 68 61 73 65 | 2e 20 43 75 72 72 65 6e |on.phase|. Curren|
|00005b30| 74 6c 79 2c 20 74 68 65 | 20 63 61 70 61 62 69 6c |tly, the| capabil|
|00005b40| 69 74 69 65 73 20 61 72 | 65 20 61 6e 79 20 6f 66 |ities ar|e any of|
|00005b50| 3a 0a 24 24 0a 5c 68 61 | 6c 69 67 6e 7b 24 23 24 |:.$$.\ha|lign{$#$|
|00005b60| 5c 20 5c 68 66 69 6c 26 | 24 2f 2a 24 20 5c 72 6d |\ \hfil&|$/*$ \rm|
|00005b70| 23 20 24 2a 2f 24 5c 68 | 66 69 6c 5c 63 72 0a 43 |# $*/$\h|fil\cr.C|
|00005b80| 44 43 5f 43 4c 4f 53 45 | 5f 54 52 41 59 26 20 63 |DC_CLOSE|_TRAY& c|
|00005b90| 61 6e 20 63 6c 6f 73 65 | 20 74 72 61 79 20 62 79 |an close| tray by|
|00005ba0| 20 73 6f 66 74 77 61 72 | 65 20 63 6f 6e 74 72 6f | softwar|e contro|
|00005bb0| 6c 5c 63 72 0a 43 44 43 | 5f 4f 50 45 4e 5f 54 52 |l\cr.CDC|_OPEN_TR|
|00005bc0| 41 59 26 20 63 61 6e 20 | 6f 70 65 6e 20 74 72 61 |AY& can |open tra|
|00005bd0| 79 5c 63 72 0a 43 44 43 | 5f 4c 4f 43 4b 26 20 63 |y\cr.CDC|_LOCK& c|
|00005be0| 61 6e 20 6c 6f 63 6b 20 | 61 6e 64 20 75 6e 6c 6f |an lock |and unlo|
|00005bf0| 63 6b 20 74 68 65 20 64 | 6f 6f 72 5c 63 72 0a 43 |ck the d|oor\cr.C|
|00005c00| 44 43 5f 53 45 4c 45 43 | 54 5f 53 50 45 45 44 26 |DC_SELEC|T_SPEED&|
|00005c10| 20 63 61 6e 20 73 65 6c | 65 63 74 20 73 70 65 65 | can sel|ect spee|
|00005c20| 64 2c 20 69 6e 20 75 6e | 69 74 73 20 6f 66 20 24 |d, in un|its of $|
|00005c30| 5c 73 69 6d 24 31 35 30 | 5c 2c 6b 42 2f 73 5c 63 |\sim$150|\,kB/s\c|
|00005c40| 72 0a 43 44 43 5f 53 45 | 4c 45 43 54 5f 44 49 53 |r.CDC_SE|LECT_DIS|
|00005c50| 43 26 20 64 72 69 76 65 | 20 69 73 20 6a 75 6b 65 |C& drive| is juke|
|00005c60| 2d 62 6f 78 5c 63 72 0a | 43 44 43 5f 4d 55 4c 54 |-box\cr.|CDC_MULT|
|00005c70| 49 5f 53 45 53 53 49 4f | 4e 26 20 63 61 6e 20 72 |I_SESSIO|N& can r|
|00005c80| 65 61 64 20 73 65 73 73 | 69 6f 6e 73 20 24 3e 5c |ead sess|ions $>\|
|00005c90| 72 6d 31 24 5c 63 72 0a | 43 44 43 5f 4d 43 4e 26 |rm1$\cr.|CDC_MCN&|
|00005ca0| 20 63 61 6e 20 72 65 61 | 64 20 4d 65 64 69 75 6d | can rea|d Medium|
|00005cb0| 20 43 61 74 61 6c 6f 67 | 20 4e 75 6d 62 65 72 5c | Catalog| Number\|
|00005cc0| 63 72 0a 43 44 43 5f 4d | 45 44 49 41 5f 43 48 41 |cr.CDC_M|EDIA_CHA|
|00005cd0| 4e 47 45 44 26 20 63 61 | 6e 20 72 65 70 6f 72 74 |NGED& ca|n report|
|00005ce0| 20 69 66 20 64 69 73 63 | 20 68 61 73 20 63 68 61 | if disc| has cha|
|00005cf0| 6e 67 65 64 5c 63 72 0a | 43 44 43 5f 50 4c 41 59 |nged\cr.|CDC_PLAY|
|00005d00| 5f 41 55 44 49 4f 26 20 | 63 61 6e 20 70 65 72 66 |_AUDIO& |can perf|
|00005d10| 6f 72 6d 20 61 75 64 69 | 6f 2d 66 75 6e 63 74 69 |orm audi|o-functi|
|00005d20| 6f 6e 73 20 28 70 6c 61 | 79 2c 20 70 61 75 73 65 |ons (pla|y, pause|
|00005d30| 2c 20 65 74 63 29 5c 63 | 72 0a 7d 0a 24 24 0a 54 |, etc)\c|r.}.$$.T|
|00005d40| 68 65 20 63 61 70 61 62 | 69 6c 69 74 79 20 66 6c |he capab|ility fl|
|00005d50| 61 67 20 69 73 20 64 65 | 63 6c 61 72 65 64 20 24 |ag is de|clared $|
|00005d60| 63 6f 6e 73 74 24 2c 20 | 74 6f 20 70 72 65 76 65 |const$, |to preve|
|00005d70| 6e 74 20 64 72 69 76 65 | 72 73 20 66 72 6f 6d 0a |nt drive|rs from.|
|00005d80| 61 63 63 69 64 65 6e 74 | 61 6c 6c 79 20 74 61 6d |accident|ally tam|
|00005d90| 70 65 72 69 6e 67 20 77 | 69 74 68 20 74 68 65 20 |pering w|ith the |
|00005da0| 63 6f 6e 74 65 6e 74 73 | 2e 20 48 6f 77 65 76 65 |contents|. Howeve|
|00005db0| 72 2c 20 75 70 6f 6e 20 | 72 65 67 69 73 74 72 61 |r, upon |registra|
|00005dc0| 74 69 6f 6e 2c 0a 73 6f | 6d 65 20 28 63 6c 61 69 |tion,.so|me (clai|
|00005dd0| 6d 65 64 29 20 63 61 70 | 61 62 69 6c 69 74 79 20 |med) cap|ability |
|00005de0| 66 6c 61 67 73 20 6d 61 | 79 20 62 65 20 63 6c 65 |flags ma|y be cle|
|00005df0| 61 72 65 64 20 69 66 20 | 74 68 65 20 73 75 70 70 |ared if |the supp|
|00005e00| 6f 72 74 69 6e 67 0a 66 | 75 6e 63 74 69 6f 6e 20 |orting.f|unction |
|00005e10| 68 61 73 20 6e 6f 74 20 | 62 65 65 6e 20 69 6d 70 |has not |been imp|
|00005e20| 6c 65 6d 65 6e 74 65 64 | 20 28 73 65 65 20 24 72 |lemented| (see $r|
|00005e30| 65 67 69 73 74 65 72 5f | 63 64 72 6f 6d 28 29 24 |egister_|cdrom()$|
|00005e40| 20 69 6e 0a 5c 63 64 72 | 6f 6d 63 29 2e 20 0a 0a | in.\cdr|omc). ..|
|00005e50| 49 66 20 79 6f 75 20 77 | 61 6e 74 20 74 6f 20 64 |If you w|ant to d|
|00005e60| 69 73 61 62 6c 65 20 61 | 6e 79 20 6f 66 20 74 68 |isable a|ny of th|
|00005e70| 65 20 63 61 70 61 62 69 | 6c 69 74 69 65 73 2c 20 |e capabi|lities, |
|00005e80| 74 68 65 72 65 20 69 73 | 20 61 20 73 70 65 63 69 |there is| a speci|
|00005e90| 61 6c 0a 66 6c 61 67 20 | 72 65 67 69 73 74 65 72 |al.flag |register|
|00005ea0| 20 24 3c 64 65 76 69 63 | 65 3e 5f 64 6f 70 73 2e | $<devic|e>_dops.|
|00005eb0| 6d 61 73 6b 24 20 74 68 | 61 74 20 6d 61 79 20 28 |mask$ th|at may (|
|00005ec0| 74 65 6d 70 6f 72 61 72 | 69 6c 79 29 20 64 69 73 |temporar|ily) dis|
|00005ed0| 61 62 6c 65 0a 63 65 72 | 74 61 69 6e 20 63 61 70 |able.cer|tain cap|
|00005ee0| 61 62 69 6c 69 74 69 65 | 73 2e 20 49 6e 20 74 68 |abilitie|s. In th|
|00005ef0| 65 20 66 69 6c 65 20 5c | 63 64 72 6f 6d 63 5c 20 |e file \|cdromc\ |
|00005f00| 79 6f 75 20 77 69 6c 6c | 20 65 6e 63 6f 75 6e 74 |you will| encount|
|00005f10| 65 72 20 6d 61 6e 79 0a | 63 6f 6e 73 74 72 75 63 |er many.|construc|
|00005f20| 74 69 6f 6e 73 20 6f 66 | 20 74 68 65 20 74 79 70 |tions of| the typ|
|00005f30| 65 20 0a 24 24 5c 69 74 | 0a 69 66 5c 20 28 63 64 |e .$$\it|.if\ (cd|
|00005f40| 6f 5c 72 69 67 68 74 61 | 72 72 6f 77 20 63 61 70 |o\righta|rrow cap|
|00005f50| 61 62 69 6c 69 74 79 20 | 5c 6d 61 74 68 72 65 6c |ability |\mathrel|
|00005f60| 5c 26 20 5c 6d 61 74 68 | 6f 72 64 7b 5c 73 69 6d |\& \math|ord{\sim|
|00005f70| 7d 20 63 64 6f 5c 72 69 | 67 68 74 61 72 72 6f 77 |} cdo\ri|ghtarrow|
|00005f80| 20 6d 61 73 6b 20 0a 20 | 20 20 5c 6d 61 74 68 72 | mask . | \mathr|
|00005f90| 65 6c 7b 5c 26 7d 20 43 | 44 43 5f 3c 63 61 70 61 |el{\&} C|DC_<capa|
|00005fa0| 62 69 6c 69 74 79 3e 29 | 20 5c 6c 64 6f 74 73 0a |bility>)| \ldots.|
|00005fb0| 24 24 0a 54 68 65 20 24 | 6d 61 73 6b 24 20 63 6f |$$.The $|mask$ co|
|00005fc0| 75 6c 64 20 62 65 20 73 | 65 74 20 69 6e 20 74 68 |uld be s|et in th|
|00005fd0| 65 20 6c 6f 77 2d 6c 65 | 76 65 6c 20 64 72 69 76 |e low-le|vel driv|
|00005fe0| 65 72 20 63 6f 64 65 20 | 74 6f 20 64 69 73 61 62 |er code |to disab|
|00005ff0| 6c 65 0a 63 65 72 74 61 | 69 6e 20 63 61 70 61 62 |le.certa|in capab|
|00006000| 69 6c 69 74 69 65 73 20 | 66 6f 72 20 73 70 65 63 |ilities |for spec|
|00006010| 69 61 6c 20 62 72 61 6e | 64 73 20 6f 66 20 74 68 |ial bran|ds of th|
|00006020| 65 20 64 65 76 69 63 65 | 20 74 68 61 74 20 63 61 |e device| that ca|
|00006030| 6e 27 74 0a 70 65 72 66 | 6f 72 6d 20 74 68 65 20 |n't.perf|orm the |
|00006040| 61 63 74 69 6f 6e 73 2e | 20 20 48 6f 77 65 76 65 |actions.| Howeve|
|00006050| 72 2c 20 74 68 65 72 65 | 20 69 73 20 6e 6f 74 20 |r, there| is not |
|00006060| 28 79 65 74 29 20 61 6e | 20 24 69 6f 63 74 6c 24 |(yet) an| $ioctl$|
|00006070| 20 74 6f 20 73 65 74 0a | 74 68 65 20 6d 61 73 6b | to set.|the mask|
|00006080| 5c 64 6f 74 73 20 54 68 | 65 20 72 65 61 73 6f 6e |\dots Th|e reason|
|00006090| 20 69 73 20 74 68 61 74 | 20 49 20 74 68 69 6e 6b | is that| I think|
|000060a0| 20 69 74 20 69 73 20 62 | 65 74 74 65 72 20 74 6f | it is b|etter to|
|000060b0| 20 63 6f 6e 74 72 6f 6c | 20 74 68 65 0a 7b 5c 65 | control| the.{\e|
|000060c0| 6d 20 62 65 68 61 76 69 | 6f 72 5c 2f 7d 20 72 61 |m behavi|or\/} ra|
|000060d0| 74 68 65 72 20 74 68 61 | 6e 20 74 68 65 20 7b 5c |ther tha|n the {\|
|000060e0| 65 6d 20 63 61 70 61 62 | 69 6c 69 74 69 65 73 7d |em capab|ilities}|
|000060f0| 2e 0a 0a 5c 73 75 62 73 | 65 63 74 69 6f 6e 7b 4f |...\subs|ection{O|
|00006100| 70 74 69 6f 6e 73 7d 0a | 0a 41 20 66 69 6e 61 6c |ptions}.|.A final|
|00006110| 20 66 6c 61 67 20 72 65 | 67 69 73 74 65 72 20 63 | flag re|gister c|
|00006120| 6f 6e 74 72 6f 6c 73 20 | 74 68 65 20 7b 5c 65 6d |ontrols |the {\em|
|00006130| 20 62 65 68 61 76 69 6f | 72 5c 2f 7d 20 6f 66 20 | behavio|r\/} of |
|00006140| 74 68 65 20 5c 63 64 72 | 6f 6d 5c 0a 64 72 69 76 |the \cdr|om\.driv|
|00006150| 65 73 2c 20 69 6e 20 6f | 72 64 65 72 20 74 6f 20 |es, in o|rder to |
|00006160| 73 61 74 69 73 66 79 20 | 64 69 66 66 65 72 65 6e |satisfy |differen|
|00006170| 74 20 75 73 65 72 73 27 | 20 77 69 73 68 65 73 2c |t users'| wishes,|
|00006180| 20 68 6f 70 65 66 75 6c | 6c 79 0a 69 6e 64 65 70 | hopeful|ly.indep|
|00006190| 65 6e 64 65 6e 74 6c 79 | 20 6f 66 20 74 68 65 20 |endently| of the |
|000061a0| 69 64 65 61 73 20 6f 66 | 20 74 68 65 20 72 65 73 |ideas of| the res|
|000061b0| 70 65 63 74 69 76 65 20 | 61 75 74 68 6f 72 20 77 |pective |author w|
|000061c0| 68 6f 20 68 61 70 70 65 | 6e 65 64 20 74 6f 0a 68 |ho happe|ned to.h|
|000061d0| 61 76 65 20 6d 61 64 65 | 20 74 68 65 20 64 72 69 |ave made| the dri|
|000061e0| 76 65 27 73 20 73 75 70 | 70 6f 72 74 20 61 76 61 |ve's sup|port ava|
|000061f0| 69 6c 61 62 6c 65 20 74 | 6f 20 74 68 65 20 5c 6c |ilable t|o the \l|
|00006200| 69 6e 75 78 5c 20 63 6f | 6d 6d 75 6e 69 74 79 2e |inux\ co|mmunity.|
|00006210| 20 54 68 65 0a 63 75 72 | 72 65 6e 74 20 62 65 68 | The.cur|rent beh|
|00006220| 61 76 69 6f 72 20 6f 70 | 74 69 6f 6e 73 20 61 72 |avior op|tions ar|
|00006230| 65 3a 0a 24 24 0a 5c 68 | 61 6c 69 67 6e 7b 24 23 |e:.$$.\h|align{$#|
|00006240| 24 5c 20 5c 68 66 69 6c | 26 24 2f 2a 24 20 5c 72 |$\ \hfil|&$/*$ \r|
|00006250| 6d 23 20 24 2a 2f 24 5c | 68 66 69 6c 5c 63 72 0a |m# $*/$\|hfil\cr.|
|00006260| 43 44 4f 5f 41 55 54 4f | 5f 43 4c 4f 53 45 26 20 |CDO_AUTO|_CLOSE& |
|00006270| 74 72 79 20 74 6f 20 63 | 6c 6f 73 65 20 74 72 61 |try to c|lose tra|
|00006280| 79 20 75 70 6f 6e 20 64 | 65 76 69 63 65 20 24 6f |y upon d|evice $o|
|00006290| 70 65 6e 28 29 24 5c 63 | 72 0a 43 44 4f 5f 41 55 |pen()$\c|r.CDO_AU|
|000062a0| 54 4f 5f 45 4a 45 43 54 | 26 20 74 72 79 20 74 6f |TO_EJECT|& try to|
|000062b0| 20 6f 70 65 6e 20 74 72 | 61 79 20 6f 6e 20 6c 61 | open tr|ay on la|
|000062c0| 73 74 20 64 65 76 69 63 | 65 20 24 63 6c 6f 73 65 |st devic|e $close|
|000062d0| 28 29 24 5c 63 72 0a 43 | 44 4f 5f 55 53 45 5f 46 |()$\cr.C|DO_USE_F|
|000062e0| 46 4c 41 47 53 26 20 75 | 73 65 20 24 66 69 6c 65 |FLAGS& u|se $file|
|000062f0| 5f 70 6f 69 6e 74 65 72 | 5c 72 69 67 68 74 61 72 |_pointer|\rightar|
|00006300| 72 6f 77 20 66 5f 66 6c | 61 67 73 24 20 74 6f 20 |row f_fl|ags$ to |
|00006310| 69 6e 64 69 63 61 74 65 | 0a 20 70 75 72 70 6f 73 |indicate|. purpos|
|00006320| 65 20 66 6f 72 20 24 6f | 70 65 6e 28 29 24 5c 63 |e for $o|pen()$\c|
|00006330| 72 0a 43 44 4f 5f 4c 4f | 43 4b 26 20 74 72 79 20 |r.CDO_LO|CK& try |
|00006340| 74 6f 20 6c 6f 63 6b 20 | 64 6f 6f 72 20 69 66 20 |to lock |door if |
|00006350| 64 65 76 69 63 65 20 69 | 73 20 6f 70 65 6e 65 64 |device i|s opened|
|00006360| 5c 63 72 0a 43 44 4f 5f | 43 48 45 43 4b 5f 54 59 |\cr.CDO_|CHECK_TY|
|00006370| 50 45 26 20 65 6e 73 75 | 72 65 20 64 69 73 63 20 |PE& ensu|re disc |
|00006380| 74 79 70 65 20 69 73 20 | 64 61 74 61 20 69 66 20 |type is |data if |
|00006390| 6f 70 65 6e 65 64 20 66 | 6f 72 20 64 61 74 61 5c |opened f|or data\|
|000063a0| 63 72 0a 7d 0a 24 24 0a | 0a 54 68 65 20 69 6e 69 |cr.}.$$.|.The ini|
|000063b0| 74 69 61 6c 20 76 61 6c | 75 65 20 6f 66 20 74 68 |tial val|ue of th|
|000063c0| 69 73 20 72 65 67 69 73 | 74 65 72 20 69 73 20 24 |is regis|ter is $|
|000063d0| 43 44 4f 5f 41 55 54 4f | 5f 43 4c 4f 53 45 20 5c |CDO_AUTO|_CLOSE \|
|000063e0| 6d 61 74 68 72 65 6c 7c | 0a 43 44 4f 5f 55 53 45 |mathrel||.CDO_USE|
|000063f0| 5f 46 46 4c 41 47 53 20 | 5c 6d 61 74 68 72 65 6c |_FFLAGS |\mathrel|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.