home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / linux-2.0.34 / cdrom / cdrom-standard.tex < prev    next >
LaTeX Document  |  1996-08-16  |  42.5 KB

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: cdrom-standard.tex

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Corel 10 Texture (image/corel10Texture) ext Unsupported
1% dexvert Croteam texture file (image/croteamTextureFile) 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 (weak)
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 38 20 31 39 39 36 2f | 30 38 2f 31 30 20 31 30 |.8 1996/|08/10 10|
|00000050| 3a 35 37 3a 31 36 20 64 | 61 76 69 64 20 45 78 70 |:57:16 d|avid Exp|
|00000060| 20 24 7d 0a 0a 5c 65 76 | 65 6e 73 69 64 65 6d 61 | $}..\ev|ensidema|
|00000070| 72 67 69 6e 3d 30 70 74 | 0a 5c 6f 64 64 73 69 64 |rgin=0pt|.\oddsid|
|00000080| 65 6d 61 72 67 69 6e 3d | 30 70 74 0a 5c 74 6f 70 |emargin=|0pt.\top|
|00000090| 6d 61 72 67 69 6e 3d 2d | 5c 68 65 61 64 68 65 69 |margin=-|\headhei|
|000000a0| 67 68 74 20 5c 61 64 76 | 61 6e 63 65 5c 74 6f 70 |ght \adv|ance\top|
|000000b0| 6d 61 72 67 69 6e 20 62 | 79 20 2d 5c 68 65 61 64 |margin b|y -\head|
|000000c0| 73 65 70 0a 5c 74 65 78 | 74 77 69 64 74 68 3d 31 |sep.\tex|twidth=1|
|000000d0| 35 2e 39 39 63 6d 20 5c | 74 65 78 74 68 65 69 67 |5.99cm \|textheig|
|000000e0| 68 74 3d 32 34 2e 36 32 | 63 6d 20 25 20 6e 6f 72 |ht=24.62|cm % nor|
|000000f0| 6d 61 6c 20 41 34 2c 20 | 31 27 27 20 6d 61 72 67 |mal A4, |1'' marg|
|00000100| 69 6e 0a 0a 5c 64 65 66 | 5c 6c 69 6e 75 78 7b 7b |in..\def|\linux{{|
|00000110| 5c 73 63 20 4c 69 6e 75 | 78 7d 7d 0a 5c 64 65 66 |\sc Linu|x}}.\def|
|00000120| 5c 63 64 72 6f 6d 7b 7b | 5c 73 63 20 43 44 72 6f |\cdrom{{|\sc CDro|
|00000130| 6d 7d 7d 0a 5c 64 65 66 | 5c 63 64 72 6f 6d 63 7b |m}}.\def|\cdromc{|
|00000140| 7b 5c 74 74 20 63 64 72 | 6f 6d 2e 63 7d 7d 0a 5c |{\tt cdr|om.c}}.\|
|00000150| 64 65 66 5c 63 64 72 6f | 6d 68 7b 7b 5c 74 74 20 |def\cdro|mh{{\tt |
|00000160| 63 64 72 6f 6d 2e 68 7d | 7d 0a 5c 64 65 66 5c 75 |cdrom.h}|}.\def\u|
|00000170| 63 64 72 6f 6d 7b 7b 5c | 74 74 20 75 63 64 72 6f |cdrom{{\|tt ucdro|
|00000180| 6d 2e 68 7d 7d 0a 5c 64 | 65 66 5c 66 6f 7b 5c 73 |m.h}}.\d|ef\fo{\s|
|00000190| 6c 7d 0a 0a 5c 65 76 65 | 72 79 6d 61 74 68 7b 5c |l}..\eve|rymath{\|
|000001a0| 69 74 7d 20 5c 65 76 65 | 72 79 64 69 73 70 6c 61 |it} \eve|rydispla|
|000001b0| 79 7b 5c 69 74 7d 0a 5c | 63 61 74 63 6f 64 65 20 |y{\it}.\|catcode |
|000001c0| 60 5c 5f 3d 5c 61 63 74 | 69 76 65 20 5c 64 65 66 |`\_=\act|ive \def|
|000001d0| 5f 7b 5c 5f 5c 70 65 6e | 61 6c 74 79 31 30 30 20 |_{\_\pen|alty100 |
|000001e0| 7d 0a 5c 63 61 74 63 6f | 64 65 60 5c 3c 3d 5c 61 |}.\catco|de`\<=\a|
|000001f0| 63 74 69 76 65 20 5c 64 | 65 66 3c 23 31 3e 7b 7b |ctive \d|ef<#1>{{|
|00000200| 5c 6c 61 6e 67 6c 65 5c | 68 62 6f 78 7b 5c 72 6d |\langle\|hbox{\rm|
|00000210| 23 31 7d 5c 72 61 6e 67 | 6c 65 7d 7d 0a 0a 5c 62 |#1}\rang|le}}..\b|
|00000220| 65 67 69 6e 7b 64 6f 63 | 75 6d 65 6e 74 7d 0a 5c |egin{doc|ument}.\|
|00000230| 74 69 74 6c 65 7b 41 20 | 5c 6c 69 6e 75 78 5c 20 |title{A |\linux\ |
|00000240| 5c 63 64 72 6f 6d 5c 20 | 73 74 61 6e 64 61 72 64 |\cdrom\ |standard|
|00000250| 7d 0a 5c 61 75 74 68 6f | 72 7b 44 61 76 69 64 20 |}.\autho|r{David |
|00000260| 76 61 6e 20 4c 65 65 75 | 77 65 6e 5c 5c 7b 5c 6e |van Leeu|wen\\{\n|
|00000270| 6f 72 6d 61 6c 73 69 7a | 65 5c 74 74 20 64 61 76 |ormalsiz|e\tt dav|
|00000280| 69 64 40 74 6d 2e 74 6e | 6f 2e 6e 6c 7d 7d 0a 0a |id@tm.tn|o.nl}}..|
|00000290| 5c 6d 61 6b 65 74 69 74 | 6c 65 0a 0a 5c 73 65 63 |\maketit|le..\sec|
|000002a0| 74 69 6f 6e 7b 49 6e 74 | 72 6f 64 75 63 74 69 6f |tion{Int|roductio|
|000002b0| 6e 7d 0a 0a 5c 6c 69 6e | 75 78 5c 20 69 73 20 70 |n}..\lin|ux\ is p|
|000002c0| 72 6f 62 61 62 6c 79 20 | 74 68 65 20 55 6e 69 78 |robably |the Unix|
|000002d0| 2d 6c 69 6b 65 20 6f 70 | 65 72 61 74 69 6e 67 20 |-like op|erating |
|000002e0| 73 79 73 74 65 6d 20 74 | 68 61 74 20 73 75 70 70 |system t|hat supp|
|000002f0| 6f 72 74 73 20 74 68 65 | 20 77 69 64 65 73 74 0a |orts the| widest.|
|00000300| 76 61 72 69 65 74 79 20 | 6f 66 20 68 61 72 64 77 |variety |of hardw|
|00000310| 61 72 65 20 64 65 76 69 | 63 65 73 2e 20 54 68 65 |are devi|ces. The|
|00000320| 20 72 65 61 73 6f 6e 73 | 20 66 6f 72 20 74 68 69 | reasons| for thi|
|00000330| 73 20 61 72 65 20 70 72 | 65 73 75 6d 61 62 6c 79 |s are pr|esumably|
|00000340| 0a 5c 62 65 67 69 6e 7b | 69 74 65 6d 69 7a 65 7d |.\begin{|itemize}|
|00000350| 0a 5c 69 74 65 6d 20 54 | 68 65 20 6c 61 72 67 65 |.\item T|he large|
|00000360| 20 6c 69 73 74 20 6f 66 | 20 64 69 66 66 65 72 65 | list of| differe|
|00000370| 6e 74 20 68 61 72 64 77 | 61 72 65 20 64 65 76 69 |nt hardw|are devi|
|00000380| 63 65 73 20 61 76 61 69 | 6c 61 62 6c 65 20 66 6f |ces avai|lable fo|
|00000390| 72 20 74 68 65 20 70 6f | 70 75 6c 61 72 0a 49 42 |r the po|pular.IB|
|000003a0| 4d 20 50 43 2d 61 72 63 | 68 69 74 65 63 74 75 72 |M PC-arc|hitectur|
|000003b0| 65 2c 0a 5c 69 74 65 6d | 20 54 68 65 20 6f 70 65 |e,.\item| The ope|
|000003c0| 6e 20 64 65 73 69 67 6e | 20 6f 66 20 74 68 65 20 |n design| of the |
|000003d0| 6f 70 65 72 61 74 69 6e | 67 20 73 79 73 74 65 6d |operatin|g system|
|000003e0| 2c 20 73 75 63 68 20 74 | 68 61 74 20 65 76 65 72 |, such t|hat ever|
|000003f0| 79 62 6f 64 79 20 63 61 | 6e 0a 77 72 69 74 65 20 |ybody ca|n.write |
|00000400| 61 20 64 72 69 76 65 72 | 20 66 6f 72 20 4c 69 6e |a driver| for Lin|
|00000410| 75 78 20 28 73 6f 75 72 | 63 65 20 63 6f 64 65 20 |ux (sour|ce code |
|00000420| 65 78 61 6d 70 6c 65 73 | 29 2e 0a 5c 65 6e 64 7b |examples|)..\end{|
|00000430| 69 74 65 6d 69 7a 65 7d | 0a 54 68 65 20 76 61 73 |itemize}|.The vas|
|00000440| 74 20 63 68 6f 69 63 65 | 20 61 6e 64 20 6f 70 65 |t choice| and ope|
|00000450| 6e 6e 65 73 73 20 68 61 | 73 20 6c 65 61 64 20 6e |nness ha|s lead n|
|00000460| 6f 74 20 6f 6e 6c 79 20 | 74 6f 20 61 20 77 69 64 |ot only |to a wid|
|00000470| 65 20 73 75 70 70 6f 72 | 74 20 6f 66 0a 68 61 72 |e suppor|t of.har|
|00000480| 64 77 61 72 65 20 64 65 | 76 69 63 65 73 2c 20 62 |dware de|vices, b|
|00000490| 75 74 20 61 6c 73 6f 20 | 74 6f 20 61 20 63 65 72 |ut also |to a cer|
|000004a0| 74 61 69 6e 20 64 69 76 | 65 72 67 65 6e 63 65 20 |tain div|ergence |
|000004b0| 69 6e 20 62 65 68 61 76 | 69 6f 72 2e 0a 45 73 70 |in behav|ior..Esp|
|000004c0| 65 63 69 61 6c 6c 79 20 | 66 6f 72 20 5c 63 64 72 |ecially |for \cdr|
|000004d0| 6f 6d 5c 20 64 65 76 69 | 63 65 73 2c 20 74 68 65 |om\ devi|ces, the|
|000004e0| 20 77 61 79 20 61 20 70 | 61 72 74 69 63 75 6c 61 | way a p|articula|
|000004f0| 72 20 64 72 69 76 65 20 | 72 65 61 63 74 73 20 74 |r drive |reacts t|
|00000500| 6f 20 61 0a 60 73 74 61 | 6e 64 61 72 64 27 20 24 |o a.`sta|ndard' $|
|00000510| 69 6f 63 74 6c 28 29 24 | 20 63 61 6c 6c 20 76 61 |ioctl()$| call va|
|00000520| 72 69 65 73 20 61 20 6c | 6f 74 20 66 72 6f 6d 20 |ries a l|ot from |
|00000530| 6f 6e 65 20 62 72 61 6e | 64 20 74 6f 20 61 6e 6f |one bran|d to ano|
|00000540| 74 68 65 72 3b 0a 68 6f | 77 65 76 65 72 2c 20 74 |ther;.ho|wever, t|
|00000550| 68 65 20 5c 6c 69 6e 75 | 78 5c 20 5c 63 64 72 6f |he \linu|x\ \cdro|
|00000560| 6d 5c 20 64 72 69 76 65 | 72 20 77 72 69 74 65 72 |m\ drive|r writer|
|00000570| 73 20 6b 65 70 74 20 61 | 77 61 79 20 66 72 6f 6d |s kept a|way from|
|00000580| 20 77 69 6c 64 65 72 6e | 65 73 73 0a 62 79 20 74 | wildern|ess.by t|
|00000590| 68 65 20 70 72 61 63 74 | 69 63 65 20 6f 66 20 65 |he pract|ice of e|
|000005a0| 76 6f 6c 76 69 6e 67 20 | 61 20 6e 65 77 20 64 72 |volving |a new dr|
|000005b0| 69 76 65 72 20 62 79 20 | 63 6f 70 79 69 6e 67 2c |iver by |copying,|
|000005c0| 20 75 6e 64 65 72 73 74 | 61 6e 64 69 6e 67 20 61 | underst|anding a|
|000005d0| 6e 64 0a 63 68 61 6e 67 | 69 6e 67 20 61 6e 20 65 |nd.chang|ing an e|
|000005e0| 78 69 73 74 69 6e 67 20 | 6f 6e 65 2e 0a 0a 53 69 |xisting |one...Si|
|000005f0| 6e 63 65 20 74 68 65 20 | 62 65 67 69 6e 6e 69 6e |nce the |beginnin|
|00000600| 67 20 6f 66 20 74 68 65 | 20 5c 63 64 72 6f 6d 2c |g of the| \cdrom,|
|00000610| 20 6d 61 6e 79 20 64 69 | 66 66 65 72 65 6e 74 20 | many di|fferent |
|00000620| 69 6e 74 65 72 66 61 63 | 65 73 0a 64 65 76 65 6c |interfac|es.devel|
|00000630| 6f 70 65 64 2e 20 20 53 | 6f 6d 65 20 6f 66 20 74 |oped. S|ome of t|
|00000640| 68 65 6d 20 68 61 64 20 | 74 68 65 69 72 20 6f 77 |hem had |their ow|
|00000650| 6e 20 70 72 6f 70 72 69 | 65 74 61 72 79 20 64 65 |n propri|etary de|
|00000660| 73 69 67 6e 20 28 53 6f | 6e 79 2c 0a 4d 69 74 73 |sign (So|ny,.Mits|
|00000670| 75 6d 69 2c 20 50 61 6e | 61 73 6f 6e 69 63 2c 20 |umi, Pan|asonic, |
|00000680| 50 68 69 6c 69 70 73 29 | 2c 20 6f 74 68 65 72 20 |Philips)|, other |
|00000690| 6d 61 6e 75 66 61 63 74 | 75 72 65 72 73 20 61 64 |manufact|urers ad|
|000006a0| 6f 70 74 65 64 20 61 6e | 20 65 78 69 73 74 69 6e |opted an| existin|
|000006b0| 67 0a 65 6c 65 63 74 72 | 69 63 61 6c 20 69 6e 74 |g.electr|ical int|
|000006c0| 65 72 66 61 63 65 20 61 | 6e 64 20 63 68 61 6e 67 |erface a|nd chang|
|000006d0| 65 64 20 74 68 65 20 66 | 75 6e 63 74 69 6f 6e 61 |ed the f|unctiona|
|000006e0| 6c 69 74 79 0a 28 43 72 | 65 61 74 69 76 65 4c 61 |lity.(Cr|eativeLa|
|000006f0| 62 73 2f 53 6f 75 6e 64 | 42 6c 61 73 74 65 72 2c |bs/Sound|Blaster,|
|00000700| 20 54 65 61 63 2c 20 46 | 75 6e 61 69 29 20 6f 72 | Teac, F|unai) or|
|00000710| 20 73 69 6d 70 6c 79 20 | 61 64 61 70 74 65 64 20 | simply |adapted |
|00000720| 74 68 65 69 72 0a 64 72 | 69 76 65 73 20 74 6f 20 |their.dr|ives to |
|00000730| 6f 6e 65 20 6f 72 20 6d | 6f 72 65 20 6f 66 20 74 |one or m|ore of t|
|00000740| 68 65 20 61 6c 72 65 61 | 64 79 20 65 78 69 73 74 |he alrea|dy exist|
|00000750| 69 6e 67 20 65 6c 65 63 | 74 72 69 63 61 6c 20 69 |ing elec|trical i|
|00000760| 6e 74 65 72 66 61 63 65 | 73 0a 28 41 7a 74 65 63 |nterface|s.(Aztec|
|00000770| 68 2c 20 53 61 6e 79 6f | 2c 20 46 75 6e 61 69 2c |h, Sanyo|, Funai,|
|00000780| 20 56 65 72 74 6f 73 2c | 20 4c 6f 6e 67 73 68 69 | Vertos,| Longshi|
|00000790| 6e 65 2c 20 4f 70 74 69 | 63 73 20 53 74 6f 72 61 |ne, Opti|cs Stora|
|000007a0| 67 65 20 61 6e 64 20 6d | 6f 73 74 20 6f 66 0a 74 |ge and m|ost of.t|
|000007b0| 68 65 20 60 4e 6f 4e 61 | 6d 65 27 20 6d 61 6e 75 |he `NoNa|me' manu|
|000007c0| 66 61 63 74 75 72 65 72 | 73 29 2e 20 20 49 6e 20 |facturer|s). In |
|000007d0| 63 61 73 65 73 20 77 68 | 65 72 65 20 61 20 6e 65 |cases wh|ere a ne|
|000007e0| 77 20 64 72 69 76 65 20 | 72 65 61 6c 6c 79 0a 62 |w drive |really.b|
|000007f0| 72 6f 75 67 68 74 20 68 | 69 73 20 6f 77 6e 20 69 |rought h|is own i|
|00000800| 6e 74 65 72 66 61 63 65 | 20 6f 72 20 75 73 65 64 |nterface| or used|
|00000810| 20 68 69 73 20 6f 77 6e | 20 63 6f 6d 6d 61 6e 64 | his own| command|
|00000820| 20 73 65 74 20 61 6e 64 | 20 66 6c 6f 77 20 63 6f | set and| flow co|
|00000830| 6e 74 72 6f 6c 0a 73 63 | 68 65 6d 65 2c 20 65 69 |ntrol.sc|heme, ei|
|00000840| 74 68 65 72 20 61 20 73 | 65 70 61 72 61 74 65 20 |ther a s|eparate |
|00000850| 64 72 69 76 65 72 20 68 | 61 64 20 74 6f 20 62 65 |driver h|ad to be|
|00000860| 20 77 72 69 74 74 65 6e | 2c 20 6f 72 20 61 6e 20 | written|, or an |
|00000870| 65 78 69 73 74 69 6e 67 | 0a 64 72 69 76 65 72 20 |existing|.driver |
|00000880| 68 61 64 20 74 6f 20 67 | 65 74 20 65 6e 68 61 6e |had to g|et enhan|
|00000890| 63 65 64 2e 0a 0a 4e 6f | 77 61 64 61 79 73 2c 20 |ced...No|wadays, |
|000008a0| 61 6c 6d 6f 73 74 20 61 | 6c 6c 20 6e 65 77 20 5c |almost a|ll new \|
|000008b0| 63 64 72 6f 6d 5c 20 74 | 79 70 65 73 20 61 72 65 |cdrom\ t|ypes are|
|000008c0| 20 65 69 74 68 65 72 20 | 41 54 41 50 49 2f 49 44 | either |ATAPI/ID|
|000008d0| 45 20 6f 72 20 53 43 53 | 49 3b 0a 69 74 20 69 73 |E or SCS|I;.it is|
|000008e0| 20 76 65 72 79 20 75 6e | 6c 69 6b 65 6c 79 20 74 | very un|likely t|
|000008f0| 68 61 74 20 61 6e 79 20 | 6d 61 6e 75 66 61 63 74 |hat any |manufact|
|00000900| 75 72 65 72 20 73 74 69 | 6c 6c 20 77 69 6c 6c 20 |urer sti|ll will |
|00000910| 63 72 65 61 74 65 20 61 | 20 6e 65 77 0a 69 6e 74 |create a| new.int|
|00000920| 65 72 66 61 63 65 2c 20 | 61 6e 64 20 6e 65 77 20 |erface, |and new |
|00000930| 64 72 69 76 65 73 20 66 | 6f 72 20 74 68 65 20 65 |drives f|or the e|
|00000940| 78 69 73 74 69 6e 67 20 | 70 72 6f 70 72 69 65 74 |xisting |propriet|
|00000950| 61 72 79 20 69 6e 74 65 | 72 66 61 63 65 73 20 61 |ary inte|rfaces a|
|00000960| 72 65 0a 67 65 74 74 69 | 6e 67 20 72 61 72 65 2e |re.getti|ng rare.|
|00000970| 20 20 42 75 74 20 68 69 | 73 74 6f 72 79 20 68 61 | But hi|story ha|
|00000980| 73 20 64 65 6c 69 76 65 | 72 65 64 20 75 73 20 5c |s delive|red us \|
|00000990| 63 64 72 6f 6d 5c 20 73 | 75 70 70 6f 72 74 20 66 |cdrom\ s|upport f|
|000009a0| 6f 72 20 6d 61 6e 79 0a | 64 69 66 66 65 72 65 6e |or many.|differen|
|000009b0| 74 20 69 6e 74 65 72 66 | 61 63 65 73 2e 0a 0a 57 |t interf|aces...W|
|000009c0| 68 65 6e 20 28 69 6e 20 | 74 68 65 20 31 2e 33 2e |hen (in |the 1.3.|
|000009d0| 37 30 27 73 29 20 49 20 | 6c 6f 6f 6b 65 64 20 61 |70's) I |looked a|
|000009e0| 74 20 74 68 65 20 65 78 | 69 73 74 69 6e 67 20 69 |t the ex|isting i|
|000009f0| 6e 74 65 72 66 61 63 65 | 20 77 68 69 63 68 20 69 |nterface| which i|
|00000a00| 73 0a 65 78 70 72 65 73 | 73 65 64 20 74 68 72 6f |s.expres|sed thro|
|00000a10| 75 67 68 20 5c 63 64 72 | 6f 6d 68 5c 20 69 74 20 |ugh \cdr|omh\ it |
|00000a20| 61 70 70 65 61 72 65 64 | 20 74 6f 20 62 65 20 61 |appeared| to be a|
|00000a30| 20 72 61 74 68 65 72 20 | 77 69 6c 64 20 73 65 74 | rather |wild set|
|00000a40| 20 6f 66 0a 63 6f 6d 6d | 61 6e 64 73 20 61 6e 64 | of.comm|ands and|
|00000a50| 20 64 61 74 61 20 66 6f | 72 6d 61 74 73 2e 5c 66 | data fo|rmats.\f|
|00000a60| 6f 6f 74 6e 6f 74 65 7b | 49 20 63 61 6e 6e 6f 74 |ootnote{|I cannot|
|00000a70| 20 72 65 63 6f 6c 6c 65 | 63 74 20 77 68 61 74 20 | recolle|ct what |
|00000a80| 6b 65 72 6e 65 6c 0a 20 | 20 76 65 72 73 69 6f 6e |kernel. | version|
|00000a90| 20 49 20 6c 6f 6f 6b 65 | 64 20 61 74 2c 20 74 68 | I looke|d at, th|
|00000aa0| 65 6e 2c 20 70 72 65 73 | 75 6d 61 62 6c 79 20 31 |en, pres|umably 1|
|00000ab0| 2e 32 2e 31 33 20 61 6e | 64 20 31 2e 33 2e 33 34 |.2.13 an|d 1.3.34|
|00000ac0| 2d 2d 2d 74 68 65 20 6c | 61 74 65 73 74 0a 20 20 |---the l|atest. |
|00000ad0| 6b 65 72 6e 65 6c 20 74 | 68 61 74 20 49 20 77 61 |kernel t|hat I wa|
|00000ae0| 73 20 69 6e 64 69 72 65 | 63 74 6c 79 20 69 6e 76 |s indire|ctly inv|
|00000af0| 6f 6c 76 65 64 20 69 6e | 2e 7d 20 49 74 20 73 65 |olved in|.} It se|
|00000b00| 65 6d 65 64 20 74 68 61 | 74 20 6d 61 6e 79 0a 66 |emed tha|t many.f|
|00000b10| 65 61 74 75 72 65 73 20 | 6f 66 20 74 68 65 20 69 |eatures |of the i|
|00000b20| 6e 74 65 72 66 61 63 65 | 20 68 61 76 65 20 62 65 |nterface| have be|
|00000b30| 65 6e 20 61 64 64 65 64 | 20 74 6f 20 69 6e 63 6c |en added| to incl|
|00000b40| 75 64 65 20 63 65 72 74 | 61 69 6e 20 73 70 65 63 |ude cert|ain spec|
|00000b50| 69 66 69 63 0a 63 61 70 | 61 62 69 6c 69 74 69 65 |ific.cap|abilitie|
|00000b60| 73 20 6f 66 20 63 65 72 | 74 61 69 6e 20 64 72 69 |s of cer|tain dri|
|00000b70| 76 65 73 2c 20 69 6e 20 | 61 6e 20 7b 5c 66 6f 20 |ves, in |an {\fo |
|00000b80| 61 64 20 68 6f 63 5c 2f | 7d 20 6d 61 6e 6e 65 72 |ad hoc\/|} manner|
|00000b90| 2e 20 4d 6f 72 65 0a 69 | 6d 70 6f 72 74 61 6e 74 |. More.i|mportant|
|00000ba0| 6c 79 2c 20 69 74 20 61 | 70 70 65 61 72 65 64 20 |ly, it a|ppeared |
|00000bb0| 74 68 61 74 20 61 63 74 | 75 61 6c 20 65 78 65 63 |that act|ual exec|
|00000bc0| 75 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 63 6f 6d |ution of| the com|
|00000bd0| 6d 61 6e 64 73 20 69 73 | 0a 64 69 66 66 65 72 65 |mands is|.differe|
|00000be0| 6e 74 20 66 6f 72 20 6d | 6f 73 74 20 6f 66 20 74 |nt for m|ost of t|
|00000bf0| 68 65 20 64 69 66 66 65 | 72 65 6e 74 20 64 72 69 |he diffe|rent dri|
|00000c00| 76 65 72 73 3a 20 65 2e | 67 2e 2c 20 73 6f 6d 65 |vers: e.|g., some|
|00000c10| 20 64 72 69 76 65 72 73 | 20 63 6c 6f 73 65 0a 74 | drivers| close.t|
|00000c20| 68 65 20 74 72 61 79 20 | 69 66 20 61 6e 20 24 6f |he tray |if an $o|
|00000c30| 70 65 6e 28 29 24 20 63 | 61 6c 6c 20 6f 63 63 75 |pen()$ c|all occu|
|00000c40| 72 73 20 77 68 69 6c 65 | 20 74 68 65 20 74 72 61 |rs while| the tra|
|00000c50| 79 20 69 73 20 75 6e 6c | 6f 61 64 65 64 2c 20 77 |y is unl|oaded, w|
|00000c60| 68 69 6c 65 0a 6f 74 68 | 65 72 73 20 64 6f 20 6e |hile.oth|ers do n|
|00000c70| 6f 74 2e 20 53 6f 6d 65 | 20 64 72 69 76 65 72 73 |ot. Some| drivers|
|00000c80| 20 6c 6f 63 6b 20 74 68 | 65 20 64 6f 6f 72 20 75 | lock th|e door u|
|00000c90| 70 6f 6e 20 6f 70 65 6e | 69 6e 67 20 74 68 65 20 |pon open|ing the |
|00000ca0| 64 65 76 69 63 65 2c 20 | 74 6f 0a 70 72 65 76 65 |device, |to.preve|
|00000cb0| 6e 74 20 61 6e 20 69 6e | 63 6f 68 65 72 65 6e 74 |nt an in|coherent|
|00000cc0| 20 66 69 6c 65 20 73 79 | 73 74 65 6d 2c 20 62 75 | file sy|stem, bu|
|00000cd0| 74 20 6f 74 68 65 72 73 | 20 64 6f 6e 27 74 2c 20 |t others| don't, |
|00000ce0| 74 6f 20 61 6c 6c 6f 77 | 20 73 6f 66 74 77 61 72 |to allow| softwar|
|00000cf0| 65 0a 65 6a 65 63 74 69 | 6f 6e 2e 20 20 55 6e 64 |e.ejecti|on. Und|
|00000d00| 6f 75 62 74 65 64 6c 79 | 2c 20 74 68 65 20 63 61 |oubtedly|, the ca|
|00000d10| 70 61 62 69 6c 69 74 69 | 65 73 20 6f 66 20 74 68 |pabiliti|es of th|
|00000d20| 65 20 64 69 66 66 65 72 | 65 6e 74 20 64 72 69 76 |e differ|ent driv|
|00000d30| 65 73 20 76 61 72 79 2c | 0a 62 75 74 20 65 76 65 |es vary,|.but eve|
|00000d40| 6e 20 77 68 65 6e 20 74 | 77 6f 20 64 72 69 76 65 |n when t|wo drive|
|00000d50| 73 20 68 61 76 65 20 74 | 68 65 20 73 61 6d 65 20 |s have t|he same |
|00000d60| 63 61 70 61 62 69 6c 69 | 74 79 20 74 68 65 20 64 |capabili|ty the d|
|00000d70| 72 69 76 65 72 20 62 65 | 68 61 76 69 6f 72 0a 6d |river be|havior.m|
|00000d80| 61 79 20 62 65 20 64 69 | 66 66 65 72 65 6e 74 2e |ay be di|fferent.|
|00000d90| 0a 0a 49 20 64 65 63 69 | 64 65 64 20 74 6f 20 73 |..I deci|ded to s|
|00000da0| 74 61 72 74 20 61 20 64 | 69 73 63 75 73 73 69 6f |tart a d|iscussio|
|00000db0| 6e 20 6f 6e 20 68 6f 77 | 20 74 6f 20 69 6d 70 72 |n on how| to impr|
|00000dc0| 6f 76 65 20 75 6e 69 66 | 6f 72 6d 69 74 79 2c 0a |ove unif|ormity,.|
|00000dd0| 61 64 64 72 65 73 73 69 | 6e 67 20 61 6c 6c 20 5c |addressi|ng all \|
|00000de0| 63 64 72 6f 6d 2d 64 72 | 69 76 65 72 20 64 65 76 |cdrom-dr|iver dev|
|00000df0| 65 6c 6f 70 65 72 73 20 | 66 6f 75 6e 64 20 69 6e |elopers |found in|
|00000e00| 20 74 68 65 20 76 61 72 | 69 6f 75 73 20 64 72 69 | the var|ious dri|
|00000e10| 76 65 72 0a 66 69 6c 65 | 73 2e 20 54 68 65 20 72 |ver.file|s. The r|
|00000e20| 65 61 63 74 69 6f 6e 73 | 20 65 6e 63 6f 75 72 61 |eactions| encoura|
|00000e30| 67 65 64 20 6d 65 20 74 | 6f 20 77 72 69 74 65 20 |ged me t|o write |
|00000e40| 61 20 75 6e 69 66 6f 72 | 6d 20 28 63 6f 6d 70 61 |a unifor|m (compa|
|00000e50| 74 69 62 6c 65 29 0a 73 | 6f 66 74 77 61 72 65 20 |tible).s|oftware |
|00000e60| 6c 65 76 65 6c 20 5c 63 | 64 72 6f 6d 63 5c 20 74 |level \c|dromc\ t|
|00000e70| 6f 20 77 68 69 63 68 20 | 74 68 69 73 20 64 6f 63 |o which |this doc|
|00000e80| 75 6d 65 6e 74 20 69 73 | 20 74 68 65 20 64 6f 63 |ument is| the doc|
|00000e90| 75 6d 65 6e 74 61 74 69 | 6f 6e 2e 0a 49 6e 20 74 |umentati|on..In t|
|00000ea0| 68 65 20 6d 65 61 6e 20 | 74 69 6d 65 2c 20 74 68 |he mean |time, th|
|00000eb0| 65 20 64 61 74 61 20 73 | 74 72 75 63 74 75 72 65 |e data s|tructure|
|00000ec0| 20 64 65 66 69 6e 69 74 | 69 6f 6e 73 20 69 6e 20 | definit|ions in |
|00000ed0| 5c 63 64 72 6f 6d 68 5c | 20 68 61 64 20 62 65 65 |\cdromh\| had bee|
|00000ee0| 6e 0a 63 6c 65 61 6e 65 | 64 20 75 70 20 61 20 6c |n.cleane|d up a l|
|00000ef0| 6f 74 2d 2d 2d 77 68 69 | 63 68 20 77 61 73 20 76 |ot---whi|ch was v|
|00000f00| 65 72 79 20 68 65 6c 70 | 66 75 6c 20 66 6f 72 20 |ery help|ful for |
|00000f10| 74 68 65 20 6e 65 77 20 | 63 6f 64 65 2e 0a 20 0a |the new |code.. .|
|00000f20| 5c 62 65 67 69 6e 7b 71 | 75 6f 74 65 7d 0a 5c 73 |\begin{q|uote}.\s|
|00000f30| 6d 61 6c 6c 0a 5b 41 70 | 70 61 72 65 6e 74 6c 79 |mall.[Ap|parently|
|00000f40| 2c 20 6e 6f 74 20 61 6c | 6c 20 5c 63 64 72 6f 6d |, not al|l \cdrom|
|00000f50| 5c 20 64 65 76 65 6c 6f | 70 65 72 73 20 73 75 70 |\ develo|pers sup|
|00000f60| 70 6f 72 74 20 74 68 69 | 73 20 69 6e 69 74 69 61 |port thi|s initia|
|00000f70| 74 69 76 65 2e 0a 54 68 | 65 79 2d 2d 2d 6d 61 69 |tive..Th|ey---mai|
|00000f80| 6e 6c 79 20 74 68 6f 73 | 65 20 77 68 6f 20 75 73 |nly thos|e who us|
|00000f90| 65 64 20 74 68 65 20 61 | 6c 72 65 61 64 79 20 65 |ed the a|lready e|
|00000fa0| 78 69 73 74 69 6e 67 20 | 64 72 69 76 65 72 73 20 |xisting |drivers |
|00000fb0| 6e 6f 74 20 6f 6e 6c 79 | 20 61 73 0a 61 20 63 6f |not only| as.a co|
|00000fc0| 64 69 6e 67 20 65 78 61 | 6d 70 6c 65 2c 20 62 75 |ding exa|mple, bu|
|00000fd0| 74 20 61 6c 73 6f 20 61 | 73 20 61 20 60 75 73 65 |t also a|s a `use|
|00000fe0| 72 20 69 6e 74 65 72 66 | 61 63 65 27 20 72 65 66 |r interf|ace' ref|
|00000ff0| 65 72 65 6e 63 65 20 64 | 75 72 69 6e 67 0a 74 68 |erence d|uring.th|
|00001000| 65 69 72 20 6f 77 6e 20 | 64 65 76 65 6c 6f 70 6d |eir own |developm|
|00001010| 65 6e 74 2d 2d 2d 68 61 | 76 65 20 74 61 6b 65 6e |ent---ha|ve taken|
|00001020| 20 63 61 72 65 20 74 68 | 61 74 20 5c 63 64 72 6f | care th|at \cdro|
|00001030| 6d 68 5c 20 72 65 66 6c | 65 63 74 73 20 61 0a 73 |mh\ refl|ects a.s|
|00001040| 6f 66 74 77 61 72 65 20 | 69 6e 74 65 72 66 61 63 |oftware |interfac|
|00001050| 65 20 74 6f 20 60 75 73 | 65 72 20 70 72 6f 67 72 |e to `us|er progr|
|00001060| 61 6d 73 27 20 77 68 69 | 63 68 20 69 73 20 75 6e |ams' whi|ch is un|
|00001070| 69 71 75 65 20 62 65 74 | 77 65 65 6e 20 61 6c 6c |ique bet|ween all|
|00001080| 0a 64 72 69 76 65 72 73 | 20 61 73 20 6d 75 63 68 |.drivers| as much|
|00001090| 20 61 73 20 70 6f 73 73 | 69 62 6c 65 3b 20 74 68 | as poss|ible; th|
|000010a0| 65 73 65 20 64 72 69 76 | 65 72 20 77 72 69 74 65 |ese driv|er write|
|000010b0| 72 73 20 77 69 6c 6c 20 | 63 6f 6e 74 69 6e 75 65 |rs will |continue|
|000010c0| 20 74 6f 0a 72 65 66 69 | 6e 65 20 74 68 65 20 65 | to.refi|ne the e|
|000010d0| 78 69 73 74 69 6e 67 20 | 5c 63 64 72 6f 6d 68 5c |xisting |\cdromh\|
|000010e0| 20 77 68 65 72 65 20 69 | 74 20 73 65 65 6d 73 20 | where i|t seems |
|000010f0| 6e 65 63 65 73 73 61 72 | 79 2c 20 61 6e 64 20 74 |necessar|y, and t|
|00001100| 68 65 79 20 74 65 6e 64 | 0a 74 6f 20 6c 6f 6f 6b |hey tend|.to look|
|00001110| 20 69 66 20 61 6e 79 20 | 6e 65 77 6c 79 20 72 65 | if any |newly re|
|00001120| 71 75 65 73 74 65 64 20 | 66 75 6e 63 74 69 6f 6e |quested |function|
|00001130| 61 6c 69 74 79 20 69 73 | 6e 27 74 20 61 6c 72 65 |ality is|n't alre|
|00001140| 61 64 79 20 74 68 65 72 | 65 0a 62 65 66 6f 72 65 |ady ther|e.before|
|00001150| 20 74 68 65 79 20 61 72 | 65 20 72 65 61 64 79 20 | they ar|e ready |
|00001160| 74 6f 20 64 65 66 69 6e | 65 20 6e 65 77 20 73 74 |to defin|e new st|
|00001170| 72 75 63 74 75 72 65 73 | 2e 20 54 68 65 20 7b 5c |ructures|. The {\|
|00001180| 74 74 20 73 62 70 63 64 | 7d 20 64 72 69 76 65 72 |tt sbpcd|} driver|
|00001190| 0a 67 69 76 65 73 20 61 | 6e 20 65 78 61 6d 70 6c |.gives a|n exampl|
|000011a0| 65 20 74 68 61 74 20 69 | 74 20 69 73 20 70 6f 73 |e that i|t is pos|
|000011b0| 73 69 62 6c 65 20 74 6f | 20 6c 65 74 20 61 20 72 |sible to| let a r|
|000011c0| 6f 62 6f 74 20 61 72 6d | 20 70 6c 61 79 20 6a 75 |obot arm| play ju|
|000011d0| 6b 65 0a 62 6f 78 2d 2d | 2d 65 69 74 68 65 72 20 |ke.box--|-either |
|000011e0| 77 69 74 68 20 61 75 64 | 69 6f 20 6f 72 20 77 69 |with aud|io or wi|
|000011f0| 74 68 20 64 61 74 61 20 | 43 44 73 2d 2d 2d 61 6e |th data |CDs---an|
|00001200| 64 20 74 68 61 74 20 69 | 74 20 69 73 20 70 6f 73 |d that i|t is pos|
|00001210| 73 69 62 6c 65 20 74 6f | 0a 6c 65 74 20 74 68 65 |sible to|.let the|
|00001220| 20 6a 75 6b 65 20 62 6f | 78 20 77 6f 72 6b 20 6f | juke bo|x work o|
|00001230| 6e 20 65 76 65 6e 20 69 | 66 20 61 20 64 69 73 6b |n even i|f a disk|
|00001240| 20 68 61 73 20 66 61 6c | 6c 65 6e 20 75 70 6f 6e | has fal|len upon|
|00001250| 20 74 68 65 20 66 6c 6f | 6f 72 20 61 6e 64 0a 74 | the flo|or and.t|
|00001260| 68 65 20 64 72 69 76 65 | 20 64 6f 6f 72 20 68 61 |he drive| door ha|
|00001270| 73 20 63 6c 6f 73 65 64 | 20 77 69 74 68 6f 75 74 |s closed| without|
|00001280| 20 68 61 76 69 6e 67 20 | 61 20 64 69 73 6b 20 69 | having |a disk i|
|00001290| 6e 73 69 64 65 3b 20 77 | 69 74 68 6f 75 74 20 61 |nside; w|ithout a|
|000012a0| 6e 79 0a 6e 65 77 20 73 | 6f 66 74 77 61 72 65 20 |ny.new s|oftware |
|000012b0| 6c 61 79 65 72 20 6f 72 | 20 61 6e 79 20 73 74 72 |layer or| any str|
|000012c0| 75 63 74 75 72 65 73 20 | 77 68 69 63 68 20 61 72 |uctures |which ar|
|000012d0| 65 20 6e 6f 74 20 61 6c | 72 65 61 64 79 20 70 72 |e not al|ready pr|
|000012e0| 65 73 65 6e 74 20 69 6e | 0a 5c 63 64 72 6f 6d 68 |esent in|.\cdromh|
|000012f0| 2e 20 20 54 68 69 73 20 | 60 6f 74 68 65 72 27 20 |. This |`other' |
|00001300| 67 72 6f 75 70 20 6f 66 | 20 5c 6c 69 6e 75 78 5c |group of| \linux\|
|00001310| 20 5c 63 64 72 6f 6d 5c | 20 64 72 69 76 65 72 20 | \cdrom\| driver |
|00001320| 77 72 69 74 65 72 73 0a | 65 78 70 6c 69 63 69 74 |writers.|explicit|
|00001330| 6c 79 20 64 6f 65 73 20 | 7b 5c 65 6d 20 6e 6f 74 |ly does |{\em not|
|00001340| 5c 2f 7d 20 73 75 70 70 | 6f 72 74 20 74 68 65 20 |\/} supp|ort the |
|00001350| 69 64 65 61 20 74 6f 20 | 64 65 66 69 6e 65 20 61 |idea to |define a|
|00001360| 6e 20 61 64 64 69 74 69 | 6f 6e 61 6c 0a 73 6f 66 |n additi|onal.sof|
|00001370| 74 77 61 72 65 20 6c 61 | 79 65 72 20 62 65 74 77 |tware la|yer betw|
|00001380| 65 65 6e 20 64 72 69 76 | 65 72 20 61 6e 64 20 75 |een driv|er and u|
|00001390| 73 65 72 20 70 72 6f 67 | 72 61 6d 2e 5d 5c 70 61 |ser prog|ram.]\pa|
|000013a0| 72 66 69 6c 6c 73 6b 69 | 70 3d 30 70 74 0a 5c 65 |rfillski|p=0pt.\e|
|000013b0| 6e 64 7b 71 75 6f 74 65 | 7d 0a 0a 54 68 65 20 65 |nd{quote|}..The e|
|000013c0| 66 66 6f 72 74 20 28 5c | 63 64 72 6f 6d 63 29 20 |ffort (\|cdromc) |
|000013d0| 6f 66 20 77 68 69 63 68 | 20 74 68 69 73 20 69 73 |of which| this is|
|000013e0| 20 74 68 65 20 64 6f 63 | 75 6d 65 6e 74 61 74 69 | the doc|umentati|
|000013f0| 6f 6e 20 69 73 20 7b 5c | 65 6d 20 6e 6f 74 5c 2f |on is {\|em not\/|
|00001400| 7d 0a 6d 65 61 6e 74 20 | 74 6f 20 64 72 69 76 65 |}.meant |to drive|
|00001410| 20 61 20 77 65 64 67 65 | 20 62 65 74 77 65 65 6e | a wedge| between|
|00001420| 20 74 77 6f 20 67 72 6f | 75 70 73 20 6f 66 20 64 | two gro|ups of d|
|00001430| 72 69 76 65 72 20 64 65 | 76 65 6c 6f 70 65 72 73 |river de|velopers|
|00001440| 2c 20 62 75 74 0a 72 61 | 74 68 65 72 20 74 6f 20 |, but.ra|ther to |
|00001450| 65 6e 61 62 6c 65 20 73 | 68 61 72 69 6e 67 20 6f |enable s|haring o|
|00001460| 66 20 60 73 74 72 61 74 | 65 67 69 63 20 63 6f 64 |f `strat|egic cod|
|00001470| 65 27 20 61 6d 6f 6e 67 | 20 64 72 69 76 65 72 73 |e' among| drivers|
|00001480| 2e 20 54 68 65 20 63 6f | 64 65 0a 73 68 6f 75 6c |. The co|de.shoul|
|00001490| 64 20 7b 5c 65 6d 20 6e | 6f 74 5c 2f 7d 20 62 65 |d {\em n|ot\/} be|
|000014a0| 20 76 69 65 77 65 64 20 | 61 73 20 61 20 6e 65 77 | viewed |as a new|
|000014b0| 20 69 6e 74 65 72 66 61 | 63 65 20 74 6f 20 75 73 | interfa|ce to us|
|000014c0| 65 72 2d 6c 65 76 65 6c | 0a 70 72 6f 67 72 61 6d |er-level|.program|
|000014d0| 73 2c 20 62 75 74 20 72 | 61 74 68 65 72 20 61 73 |s, but r|ather as|
|000014e0| 20 61 20 6e 65 77 20 69 | 6e 74 65 72 66 61 63 65 | a new i|nterface|
|000014f0| 20 62 65 74 77 65 65 6e | 20 64 72 69 76 65 72 20 | between| driver |
|00001500| 63 6f 64 65 20 61 6e 64 | 0a 6b 65 72 6e 65 6c 2e |code and|.kernel.|
|00001510| 20 0a 0a 43 61 72 65 20 | 69 73 20 74 61 6b 65 6e | ..Care |is taken|
|00001520| 20 74 68 61 74 20 31 30 | 30 5c 2c 5c 25 20 63 6f | that 10|0\,\% co|
|00001530| 6d 70 61 74 69 62 69 6c | 69 74 79 20 65 78 69 73 |mpatibil|ity exis|
|00001540| 74 73 20 77 69 74 68 20 | 74 68 65 20 64 61 74 61 |ts with |the data|
|00001550| 0a 73 74 72 75 63 74 75 | 72 65 73 20 61 6e 64 20 |.structu|res and |
|00001560| 70 72 6f 67 72 61 6d 6d | 65 72 27 73 20 69 6e 74 |programm|er's int|
|00001570| 65 72 66 61 63 65 20 64 | 65 66 69 6e 65 64 20 69 |erface d|efined i|
|00001580| 6e 20 5c 63 64 72 6f 6d | 68 2c 20 61 6e 64 20 69 |n \cdrom|h, and i|
|00001590| 6e 20 6f 72 64 65 72 0a | 6e 6f 74 20 74 6f 20 69 |n order.|not to i|
|000015a0| 6e 74 65 72 66 65 72 65 | 20 77 69 74 68 20 6f 6e |nterfere| with on|
|000015b0| 67 6f 69 6e 67 20 64 65 | 76 65 6c 6f 70 6d 65 6e |going de|velopmen|
|000015c0| 74 20 69 6e 20 5c 63 64 | 72 6f 6d 68 2c 20 61 6e |t in \cd|romh, an|
|000015d0| 79 20 60 6e 65 77 27 20 | 64 61 74 61 0a 73 74 72 |y `new' |data.str|
|000015e0| 75 63 74 75 72 65 73 20 | 68 61 76 65 20 62 65 65 |uctures |have bee|
|000015f0| 6e 20 70 75 74 20 69 6e | 20 61 20 73 65 70 61 72 |n put in| a separ|
|00001600| 61 74 65 20 68 65 61 64 | 65 72 20 66 69 6c 65 20 |ate head|er file |
|00001610| 63 61 6c 6c 65 64 20 5c | 75 63 64 72 6f 6d 2e 0a |called \|ucdrom..|
|00001620| 42 65 63 61 75 73 65 20 | 74 68 65 20 64 61 74 61 |Because |the data|
|00001630| 20 73 74 72 75 63 74 75 | 72 65 73 20 6f 66 20 5c | structu|res of \|
|00001640| 63 64 72 6f 6d 68 5c 20 | 61 72 65 20 66 75 6c 6c |cdromh\ |are full|
|00001650| 79 20 73 75 70 70 6f 72 | 74 65 64 2c 20 74 68 69 |y suppor|ted, thi|
|00001660| 73 0a 64 6f 63 75 6d 65 | 6e 74 61 74 69 6f 6e 20 |s.docume|ntation |
|00001670| 6d 61 79 20 61 6c 73 6f | 20 62 65 20 6f 66 20 68 |may also| be of h|
|00001680| 65 6c 70 20 74 6f 20 74 | 68 65 20 70 72 6f 67 72 |elp to t|he progr|
|00001690| 61 6d 6d 65 72 73 20 75 | 73 69 6e 67 20 74 68 65 |ammers u|sing the|
|000016a0| 0a 69 6e 74 65 72 66 61 | 63 65 20 64 65 66 69 6e |.interfa|ce defin|
|000016b0| 65 64 20 69 6e 20 5c 63 | 64 72 6f 6d 68 2c 20 62 |ed in \c|dromh, b|
|000016c0| 75 74 20 74 68 69 73 20 | 67 75 69 64 65 20 69 73 |ut this |guide is|
|000016d0| 20 70 72 69 6d 61 72 69 | 6c 79 20 77 72 69 74 74 | primari|ly writt|
|000016e0| 65 6e 20 74 6f 0a 68 65 | 6c 70 20 5c 63 64 72 6f |en to.he|lp \cdro|
|000016f0| 6d 5c 20 64 72 69 76 65 | 72 20 64 65 76 65 6c 6f |m\ drive|r develo|
|00001700| 70 65 72 73 20 61 64 61 | 70 74 20 74 68 65 69 72 |pers ada|pt their|
|00001710| 20 63 6f 64 65 20 74 6f | 20 75 73 65 20 74 68 65 | code to| use the|
|00001720| 20 60 63 6f 6d 6d 6f 6e | 0a 5c 63 64 72 6f 6d 27 | `common|.\cdrom'|
|00001730| 20 63 6f 64 65 20 69 6e | 20 5c 63 64 72 6f 6d 63 | code in| \cdromc|
|00001740| 2e 0a 0a 50 65 72 73 6f | 6e 61 6c 6c 79 2c 20 49 |...Perso|nally, I|
|00001750| 20 74 68 69 6e 6b 20 74 | 68 61 74 20 74 68 65 20 | think t|hat the |
|00001760| 6d 6f 73 74 20 69 6d 70 | 6f 72 74 61 6e 74 20 68 |most imp|ortant h|
|00001770| 61 72 64 77 61 72 65 20 | 69 6e 74 65 72 66 61 63 |ardware |interfac|
|00001780| 65 73 20 77 69 6c 6c 0a | 62 65 20 74 68 65 20 49 |es will.|be the I|
|00001790| 44 45 2f 41 54 41 50 49 | 20 64 72 69 76 65 73 20 |DE/ATAPI| drives |
|000017a0| 61 6e 64 20 6f 66 20 63 | 6f 75 72 73 65 20 74 68 |and of c|ourse th|
|000017b0| 65 20 53 43 53 49 20 64 | 72 69 76 65 73 2c 20 62 |e SCSI d|rives, b|
|000017c0| 75 74 20 61 73 20 70 72 | 69 63 65 73 0a 6f 66 20 |ut as pr|ices.of |
|000017d0| 68 61 72 64 77 61 72 65 | 20 64 72 6f 70 20 63 6f |hardware| drop co|
|000017e0| 6e 74 69 6e 75 6f 75 73 | 6c 79 2c 20 69 74 20 69 |ntinuous|ly, it i|
|000017f0| 73 20 6e 6f 74 20 75 6e | 6c 69 6b 65 6c 79 20 74 |s not un|likely t|
|00001800| 68 61 74 20 70 65 6f 70 | 6c 65 20 77 69 6c 6c 0a |hat peop|le will.|
|00001810| 68 61 76 65 20 6d 6f 72 | 65 20 74 68 61 6e 20 6f |have mor|e than o|
|00001820| 6e 65 20 5c 63 64 72 6f | 6d 5c 20 64 72 69 76 65 |ne \cdro|m\ drive|
|00001830| 2c 20 70 6f 73 73 69 62 | 6c 79 20 6f 66 20 6d 69 |, possib|ly of mi|
|00001840| 78 65 64 20 74 79 70 65 | 73 2e 20 49 74 20 69 73 |xed type|s. It is|
|00001850| 0a 69 6d 70 6f 72 74 61 | 6e 74 20 74 68 61 74 20 |.importa|nt that |
|00001860| 74 68 65 73 65 20 64 72 | 69 76 65 73 20 62 65 68 |these dr|ives beh|
|00001870| 61 76 65 20 69 6e 20 74 | 68 65 20 73 61 6d 65 20 |ave in t|he same |
|00001880| 77 61 79 2e 20 28 49 6e | 20 44 65 63 65 6d 62 65 |way. (In| Decembe|
|00001890| 72 20 31 39 39 34 2c 0a | 6f 6e 65 20 6f 66 20 74 |r 1994,.|one of t|
|000018a0| 68 65 20 63 68 65 61 70 | 65 73 74 20 5c 63 64 72 |he cheap|est \cdr|
|000018b0| 6f 6d 5c 20 64 72 69 76 | 65 73 20 77 61 73 20 61 |om\ driv|es was a|
|000018c0| 20 50 68 69 6c 69 70 73 | 20 63 6d 32 30 36 2c 20 | Philips| cm206, |
|000018d0| 61 20 64 6f 75 62 6c 65 | 2d 73 70 65 65 64 0a 70 |a double|-speed.p|
|000018e0| 72 6f 70 72 69 65 74 61 | 72 79 20 64 72 69 76 65 |roprieta|ry drive|
|000018f0| 2e 20 49 6e 20 74 68 65 | 20 6d 6f 6e 74 68 73 20 |. In the| months |
|00001900| 74 68 61 74 20 49 20 77 | 61 73 20 62 75 73 79 20 |that I w|as busy |
|00001910| 77 72 69 74 69 6e 67 20 | 61 20 5c 6c 69 6e 75 78 |writing |a \linux|
|00001920| 5c 20 0a 64 72 69 76 65 | 72 20 66 6f 72 20 69 74 |\ .drive|r for it|
|00001930| 2c 20 70 72 6f 70 72 69 | 65 74 61 72 79 20 64 72 |, propri|etary dr|
|00001940| 69 76 65 73 20 62 65 63 | 61 6d 65 20 6f 6c 64 2d |ives bec|ame old-|
|00001950| 66 61 73 68 69 6f 6e 65 | 64 20 61 6e 64 20 49 44 |fashione|d and ID|
|00001960| 45 2f 41 54 41 50 49 0a | 64 72 69 76 65 73 20 62 |E/ATAPI.|drives b|
|00001970| 65 63 61 6d 65 20 73 74 | 61 6e 64 61 72 64 2e 20 |ecame st|andard. |
|00001980| 41 74 20 74 68 65 20 74 | 69 6d 65 20 6f 66 20 77 |At the t|ime of w|
|00001990| 72 69 74 69 6e 67 20 28 | 41 70 72 69 6c 20 31 39 |riting (|April 19|
|000019a0| 39 36 29 20 74 68 65 0a | 63 68 65 61 70 65 73 74 |96) the.|cheapest|
|000019b0| 20 64 6f 75 62 6c 65 20 | 73 70 65 65 64 20 64 72 | double |speed dr|
|000019c0| 69 76 65 20 69 73 20 49 | 44 45 20 61 6e 64 20 61 |ive is I|DE and a|
|000019d0| 74 20 6f 6e 65 20 66 69 | 66 74 68 20 6f 66 20 74 |t one fi|fth of t|
|000019e0| 68 65 20 70 72 69 63 65 | 20 6f 66 0a 69 74 73 20 |he price| of.its |
|000019f0| 70 72 65 64 65 63 65 73 | 73 6f 72 2e 20 45 69 67 |predeces|sor. Eig|
|00001a00| 68 74 20 73 70 65 65 64 | 20 64 72 69 76 65 73 20 |ht speed| drives |
|00001a10| 61 72 65 20 61 76 61 69 | 6c 61 62 6c 65 20 6e 6f |are avai|lable no|
|00001a20| 77 2e 29 0a 0a 54 68 69 | 73 20 64 6f 63 75 6d 65 |w.)..Thi|s docume|
|00001a30| 6e 74 20 64 65 66 69 6e | 65 73 20 28 69 6e 20 70 |nt defin|es (in p|
|00001a40| 72 65 2d 72 65 6c 65 61 | 73 65 20 76 65 72 73 69 |re-relea|se versi|
|00001a50| 6f 6e 73 3a 20 70 72 6f | 70 6f 73 65 73 29 20 74 |ons: pro|poses) t|
|00001a60| 68 65 20 76 61 72 69 6f | 75 73 0a 24 69 6f 63 74 |he vario|us.$ioct|
|00001a70| 6c 24 73 2c 20 61 6e 64 | 20 74 68 65 20 77 61 79 |l$s, and| the way|
|00001a80| 20 74 68 65 20 64 72 69 | 76 65 72 73 20 73 68 6f | the dri|vers sho|
|00001a90| 75 6c 64 20 69 6d 70 6c | 65 6d 65 6e 74 20 74 68 |uld impl|ement th|
|00001aa0| 69 73 2e 0a 0a 5c 73 65 | 63 74 69 6f 6e 7b 53 74 |is...\se|ction{St|
|00001ab0| 61 6e 64 61 72 64 69 7a | 69 6e 67 20 74 68 72 6f |andardiz|ing thro|
|00001ac0| 75 67 68 20 61 6e 6f 74 | 68 65 72 20 73 6f 66 74 |ugh anot|her soft|
|00001ad0| 77 61 72 65 20 6c 65 76 | 65 6c 7d 0a 5c 6c 61 62 |ware lev|el}.\lab|
|00001ae0| 65 6c 7b 63 64 72 6f 6d | 2e 63 7d 0a 0a 41 74 20 |el{cdrom|.c}..At |
|00001af0| 74 68 65 20 74 69 6d 65 | 20 74 68 69 73 20 64 6f |the time| this do|
|00001b00| 63 75 6d 65 6e 74 20 69 | 73 20 77 72 69 74 74 65 |cument i|s writte|
|00001b10| 6e 2c 20 61 6c 6c 20 64 | 72 69 76 65 72 73 20 64 |n, all d|rivers d|
|00001b20| 69 72 65 63 74 6c 79 20 | 69 6d 70 6c 65 6d 65 6e |irectly |implemen|
|00001b30| 74 0a 74 68 65 20 24 69 | 6f 63 74 6c 28 29 24 20 |t.the $i|octl()$ |
|00001b40| 63 61 6c 6c 73 20 74 68 | 72 6f 75 67 68 20 74 68 |calls th|rough th|
|00001b50| 65 69 72 20 6f 77 6e 20 | 72 6f 75 74 69 6e 65 73 |eir own |routines|
|00001b60| 2c 20 77 69 74 68 20 74 | 68 65 20 64 61 6e 67 65 |, with t|he dange|
|00001b70| 72 20 6f 66 0a 66 6f 72 | 67 65 74 74 69 6e 67 20 |r of.for|getting |
|00001b80| 63 61 6c 6c 73 20 74 6f | 20 24 76 65 72 69 66 79 |calls to| $verify|
|00001b90| 5f 61 72 65 61 28 29 24 | 20 61 6e 64 20 74 68 65 |_area()$| and the|
|00001ba0| 20 72 69 73 6b 20 6f 66 | 20 64 69 76 65 72 67 65 | risk of| diverge|
|00001bb0| 6e 63 65 20 69 6e 0a 69 | 6d 70 6c 65 6d 65 6e 74 |nce in.i|mplement|
|00001bc0| 61 74 69 6f 6e 2e 20 0a | 0a 46 6f 72 20 74 68 69 |ation. .|.For thi|
|00001bd0| 73 20 72 65 61 73 6f 6e | 2c 20 77 65 5c 66 6f 6f |s reason|, we\foo|
|00001be0| 74 6e 6f 74 65 7b 54 68 | 65 20 77 72 69 74 69 6e |tnote{Th|e writin|
|00001bf0| 67 20 73 74 79 6c 65 20 | 69 73 20 73 75 63 68 20 |g style |is such |
|00001c00| 74 68 61 74 20 60 77 65 | 27 20 69 73 0a 75 73 65 |that `we|' is.use|
|00001c10| 64 20 77 68 65 6e 20 28 | 61 74 20 6c 65 61 73 74 |d when (|at least|
|00001c20| 20 70 61 72 74 20 6f 66 | 29 20 74 68 65 20 5c 63 | part of|) the \c|
|00001c30| 64 72 6f 6d 2d 64 65 76 | 69 63 65 20 64 72 69 76 |drom-dev|ice driv|
|00001c40| 65 72 20 61 75 74 68 6f | 72 73 20 73 75 70 70 6f |er autho|rs suppo|
|00001c50| 72 74 0a 74 68 65 20 69 | 64 65 61 2c 20 61 6e 20 |rt.the i|dea, an |
|00001c60| 60 49 27 20 69 73 20 75 | 73 65 64 20 66 6f 72 20 |`I' is u|sed for |
|00001c70| 70 65 72 73 6f 6e 61 6c | 20 6f 70 69 6e 69 6f 6e |personal| opinion|
|00001c80| 73 7d 20 70 72 6f 70 6f | 73 65 20 74 6f 20 64 65 |s} propo|se to de|
|00001c90| 66 69 6e 65 0a 61 6e 6f | 74 68 65 72 20 73 6f 66 |fine.ano|ther sof|
|00001ca0| 74 77 61 72 65 2d 6c 65 | 76 65 6c 2c 20 74 68 61 |tware-le|vel, tha|
|00001cb0| 74 20 73 65 70 61 72 61 | 74 65 73 20 74 68 65 20 |t separa|tes the |
|00001cc0| 24 69 6f 63 74 6c 28 29 | 24 20 61 6e 64 20 24 6f |$ioctl()|$ and $o|
|00001cd0| 70 65 6e 28 29 24 0a 69 | 6d 70 6c 65 6d 65 6e 74 |pen()$.i|mplement|
|00001ce0| 61 74 69 6f 6e 20 66 72 | 6f 6d 20 74 68 65 20 61 |ation fr|om the a|
|00001cf0| 63 74 75 61 6c 20 68 61 | 72 64 77 61 72 65 20 69 |ctual ha|rdware i|
|00001d00| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 2e 20 4e |mplement|ation. N|
|00001d10| 6f 74 65 20 74 68 61 74 | 20 77 65 0a 64 6f 20 6e |ote that| we.do n|
|00001d20| 6f 74 20 77 69 73 68 20 | 74 6f 20 61 6c 74 65 72 |ot wish |to alter|
|00001d30| 20 74 68 65 20 65 78 69 | 73 74 69 6e 67 20 61 70 | the exi|sting ap|
|00001d40| 70 6c 69 63 61 74 69 6f | 6e 20 69 6e 74 65 72 66 |plicatio|n interf|
|00001d50| 61 63 65 20 64 65 66 69 | 6e 65 64 20 69 6e 0a 5c |ace defi|ned in.\|
|00001d60| 63 64 72 6f 6d 68 2c 20 | 62 75 74 20 72 61 74 68 |cdromh, |but rath|
|00001d70| 65 72 20 77 61 6e 74 20 | 74 6f 20 72 65 2d 72 6f |er want |to re-ro|
|00001d80| 6f 74 20 74 68 65 20 68 | 61 72 64 77 61 72 65 2d |ot the h|ardware-|
|00001d90| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 20 74 |implemen|tation t|
|00001da0| 68 72 6f 75 67 68 0a 73 | 6f 6d 65 20 63 6f 6d 6d |hrough.s|ome comm|
|00001db0| 6f 6e 20 63 6f 64 65 2e | 20 0a 0a 57 65 20 62 65 |on code.| ..We be|
|00001dc0| 6c 69 65 76 65 20 74 68 | 61 74 20 5c 63 64 72 6f |lieve th|at \cdro|
|00001dd0| 6d 5c 20 64 72 69 76 65 | 73 20 61 72 65 20 73 70 |m\ drive|s are sp|
|00001de0| 65 63 69 66 69 63 20 65 | 6e 6f 75 67 68 20 28 69 |ecific e|nough (i|
|00001df0| 2e 65 2e 2c 20 64 69 66 | 66 65 72 65 6e 74 0a 66 |.e., dif|ferent.f|
|00001e00| 72 6f 6d 20 6f 74 68 65 | 72 20 62 6c 6f 63 6b 2d |rom othe|r block-|
|00001e10| 64 65 76 69 63 65 73 20 | 73 75 63 68 20 61 73 20 |devices |such as |
|00001e20| 66 6c 6f 70 70 79 20 6f | 72 20 68 61 72 64 20 64 |floppy o|r hard d|
|00001e30| 69 73 63 20 64 72 69 76 | 65 73 29 2c 20 74 6f 0a |isc driv|es), to.|
|00001e40| 64 65 66 69 6e 65 20 61 | 20 73 65 74 20 6f 66 20 |define a| set of |
|00001e50| 7b 5c 65 6d 20 5c 63 64 | 72 6f 6d 5c 20 64 65 76 |{\em \cd|rom\ dev|
|00001e60| 69 63 65 20 6f 70 65 72 | 61 74 69 6f 6e 73 7d 2c |ice oper|ations},|
|00001e70| 0a 24 3c 63 64 72 6f 6d | 2d 64 65 76 69 63 65 3e |.$<cdrom|-device>|
|00001e80| 5f 64 6f 70 73 24 2e 20 | 54 68 65 73 65 20 61 72 |_dops$. |These ar|
|00001e90| 65 20 6f 66 20 61 20 64 | 69 66 66 65 72 65 6e 74 |e of a d|ifferent|
|00001ea0| 20 6e 61 74 75 72 65 20 | 74 68 61 6e 20 74 68 65 | nature |than the|
|00001eb0| 0a 63 6c 61 73 73 69 63 | 61 6c 20 62 6c 6f 63 6b |.classic|al block|
|00001ec0| 2d 64 65 76 69 63 65 20 | 66 69 6c 65 20 6f 70 65 |-device |file ope|
|00001ed0| 72 61 74 69 6f 6e 73 20 | 24 3c 62 6c 6f 63 6b 2d |rations |$<block-|
|00001ee0| 64 65 76 69 63 65 3e 5f | 66 6f 70 73 24 2e 0a 0a |device>_|fops$...|
|00001ef0| 54 68 65 20 65 78 74 72 | 61 20 69 6e 74 65 72 66 |The extr|a interf|
|00001f00| 61 63 69 6e 67 20 6c 65 | 76 65 6c 20 72 6f 75 74 |acing le|vel rout|
|00001f10| 69 6e 65 73 20 61 72 65 | 20 69 6d 70 6c 65 6d 65 |ines are| impleme|
|00001f20| 6e 74 65 64 20 69 6e 20 | 61 20 66 69 6c 65 0a 5c |nted in |a file.\|
|00001f30| 63 64 72 6f 6d 63 2c 20 | 61 6e 64 20 61 20 6c 6f |cdromc, |and a lo|
|00001f40| 77 2d 6c 65 76 65 6c 20 | 5c 63 64 72 6f 6d 5c 20 |w-level |\cdrom\ |
|00001f50| 64 72 69 76 65 72 20 68 | 61 6e 64 73 20 6f 76 65 |driver h|ands ove|
|00001f60| 72 20 74 68 65 20 69 6e | 74 65 72 66 61 63 69 6e |r the in|terfacin|
|00001f70| 67 20 74 6f 0a 74 68 65 | 20 6b 65 72 6e 65 6c 20 |g to.the| kernel |
|00001f80| 62 79 20 72 65 67 69 73 | 74 65 72 69 6e 67 20 74 |by regis|tering t|
|00001f90| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 67 65 6e |he follo|wing gen|
|00001fa0| 65 72 61 6c 20 24 73 74 | 72 75 63 74 5c 20 66 69 |eral $st|ruct\ fi|
|00001fb0| 6c 65 5f 6f 70 65 72 61 | 74 69 6f 6e 73 24 3a 0a |le_opera|tions$:.|
|00001fc0| 24 24 0a 5c 68 61 6c 69 | 67 6e 7b 24 23 24 5c 20 |$$.\hali|gn{$#$\ |
|00001fd0| 5c 68 66 69 6c 26 24 23 | 24 5c 20 5c 68 66 69 6c |\hfil&$#|$\ \hfil|
|00001fe0| 26 24 2f 2a 24 20 5c 72 | 6d 23 20 24 2a 2f 24 5c |&$/*$ \r|m# $*/$\|
|00001ff0| 68 66 69 6c 5c 63 72 0a | 73 74 72 75 63 74 26 20 |hfil\cr.|struct& |
|00002000| 66 69 6c 65 5f 6f 70 65 | 72 61 74 69 6f 6e 73 5c |file_ope|rations\|
|00002010| 20 63 64 72 6f 6d 5f 66 | 6f 70 73 20 3d 20 5c 7b | cdrom_f|ops = \{|
|00002020| 5c 68 69 64 65 77 69 64 | 74 68 5c 63 72 0a 20 20 |\hidewid|th\cr. |
|00002030| 20 20 20 20 20 20 26 4e | 55 4c 4c 2c 20 20 20 20 | &N|ULL, |
|00002040| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 26 20 | | & |
|00002050| 6c 73 65 65 6b 20 5c 63 | 72 0a 20 20 20 20 20 20 |lseek \c|r. |
|00002060| 20 20 26 62 6c 6f 63 6b | 5f 72 65 61 64 2c 20 20 | &block|_read, |
|00002070| 20 20 20 20 20 20 20 20 | 20 20 26 20 72 65 61 64 | | & read|
|00002080| 2d 2d 2d 67 65 6e 65 72 | 61 6c 5c 20 62 6c 6f 63 |---gener|al\ bloc|
|00002090| 6b 2d 64 65 76 5c 20 72 | 65 61 64 20 5c 63 72 0a |k-dev\ r|ead \cr.|
|000020a0| 20 20 20 20 20 20 20 20 | 26 62 6c 6f 63 6b 5f 77 | |&block_w|
|000020b0| 72 69 74 65 2c 20 20 20 | 20 20 20 20 20 20 20 20 |rite, | |
|000020c0| 26 20 77 72 69 74 65 2d | 2d 2d 67 65 6e 65 72 61 |& write-|--genera|
|000020d0| 6c 20 62 6c 6f 63 6b 2d | 64 65 76 20 77 72 69 74 |l block-|dev writ|
|000020e0| 65 20 5c 63 72 0a 20 20 | 20 20 20 20 20 20 26 4e |e \cr. | &N|
|000020f0| 55 4c 4c 2c 20 20 20 20 | 20 20 20 20 20 20 20 20 |ULL, | |
|00002100| 20 20 20 20 20 20 26 20 | 72 65 61 64 64 69 72 20 | & |readdir |
|00002110| 5c 63 72 0a 20 20 20 20 | 20 20 20 20 26 4e 55 4c |\cr. | &NUL|
|00002120| 4c 2c 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |L, | |
|00002130| 20 20 20 20 26 20 73 65 | 6c 65 63 74 20 5c 63 72 | & se|lect \cr|
|00002140| 0a 20 20 20 20 20 20 20 | 20 26 63 64 72 6f 6d 5f |. | &cdrom_|
|00002150| 69 6f 63 74 6c 2c 20 20 | 20 20 20 20 20 20 20 20 |ioctl, | |
|00002160| 20 26 20 69 6f 63 74 6c | 20 5c 63 72 0a 20 20 20 | & ioctl| \cr. |
|00002170| 20 20 20 20 20 26 4e 55 | 4c 4c 2c 20 20 20 20 20 | &NU|LL, |
|00002180| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 26 20 6d | | & m|
|00002190| 6d 61 70 20 5c 63 72 0a | 20 20 20 20 20 20 20 20 |map \cr.| |
|000021a0| 26 63 64 72 6f 6d 5f 6f | 70 65 6e 2c 20 20 20 20 |&cdrom_o|pen, |
|000021b0| 20 20 20 20 20 20 20 20 | 26 20 6f 70 65 6e 20 5c | |& open \|
|000021c0| 63 72 0a 20 20 20 20 20 | 20 20 20 26 63 64 72 6f |cr. | &cdro|
|000021d0| 6d 5f 72 65 6c 65 61 73 | 65 2c 20 20 20 20 20 20 |m_releas|e, |
|000021e0| 20 20 20 26 20 72 65 6c | 65 61 73 65 20 5c 63 72 | & rel|ease \cr|
|000021f0| 0a 20 20 20 20 20 20 20 | 20 26 4e 55 4c 4c 2c 20 |. | &NULL, |
|00002200| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002210| 20 26 20 66 73 79 6e 63 | 20 5c 63 72 0a 20 20 20 | & fsync| \cr. |
|00002220| 20 20 20 20 20 26 4e 55 | 4c 4c 2c 20 20 20 20 20 | &NU|LL, |
|00002230| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 26 20 66 | | & f|
|00002240| 61 73 79 6e 63 20 5c 63 | 72 0a 20 20 20 20 20 20 |async \c|r. |
|00002250| 20 20 26 63 64 72 6f 6d | 5f 6d 65 64 69 61 5f 63 | &cdrom|_media_c|
|00002260| 68 61 6e 67 65 64 2c 20 | 20 20 26 20 6d 65 64 69 |hanged, | & medi|
|00002270| 61 5f 63 68 61 6e 67 65 | 20 5c 63 72 0a 20 20 20 |a_change| \cr. |
|00002280| 20 20 20 20 20 26 4e 55 | 4c 4c 20 20 20 20 20 20 | &NU|LL |
|00002290| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 26 20 72 | | & r|
|000022a0| 65 76 61 6c 69 64 61 74 | 65 20 5c 63 72 0a 5c 7d |evalidat|e \cr.\}|
|000022b0| 3b 5c 63 72 0a 7d 0a 24 | 24 0a 45 76 65 72 79 20 |;\cr.}.$|$.Every |
|000022c0| 61 63 74 69 76 65 20 5c | 63 64 72 6f 6d 5c 20 64 |active \|cdrom\ d|
|000022d0| 65 76 69 63 65 20 73 68 | 61 72 65 73 20 74 68 69 |evice sh|ares thi|
|000022e0| 73 20 24 73 74 72 75 63 | 74 24 2e 20 54 68 65 20 |s $struc|t$. The |
|000022f0| 72 6f 75 74 69 6e 65 73 | 20 64 65 63 6c 61 72 65 |routines| declare|
|00002300| 64 0a 61 62 6f 76 65 20 | 61 72 65 20 61 6c 6c 20 |d.above |are all |
|00002310| 69 6d 70 6c 65 6d 65 6e | 74 65 64 20 69 6e 20 5c |implemen|ted in \|
|00002320| 63 64 72 6f 6d 63 2c 20 | 61 6e 64 20 74 68 69 73 |cdromc, |and this|
|00002330| 20 69 73 20 74 68 65 20 | 70 6c 61 63 65 20 77 68 | is the |place wh|
|00002340| 65 72 65 20 74 68 65 0a | 7b 5c 65 6d 20 62 65 68 |ere the.|{\em beh|
|00002350| 61 76 69 6f 72 5c 2f 7d | 20 6f 66 20 61 6c 6c 20 |avior\/}| of all |
|00002360| 5c 63 64 72 6f 6d 2d 64 | 65 76 69 63 65 73 20 69 |\cdrom-d|evices i|
|00002370| 73 20 64 65 66 69 6e 65 | 64 2c 20 61 6e 64 20 68 |s define|d, and h|
|00002380| 65 6e 63 65 0a 73 74 61 | 6e 64 61 72 64 69 7a 65 |ence.sta|ndardize|
|00002390| 64 2e 20 54 68 65 20 69 | 6d 70 6c 65 6d 65 6e 74 |d. The i|mplement|
|000023a0| 61 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 69 6e 74 |ation of| the int|
|000023b0| 65 72 66 61 63 69 6e 67 | 20 74 6f 20 74 68 65 20 |erfacing| to the |
|000023c0| 76 61 72 69 6f 75 73 0a | 74 79 70 65 73 20 6f 66 |various.|types of|
|000023d0| 20 68 61 72 64 77 61 72 | 65 20 73 74 69 6c 6c 20 | hardwar|e still |
|000023e0| 69 73 20 64 6f 6e 65 20 | 62 79 20 74 68 65 20 76 |is done |by the v|
|000023f0| 61 72 69 6f 75 73 20 5c | 63 64 72 6f 6d 2d 64 65 |arious \|cdrom-de|
|00002400| 76 69 63 65 20 64 72 69 | 76 65 72 73 2c 0a 62 75 |vice dri|vers,.bu|
|00002410| 74 20 74 68 65 73 65 20 | 72 6f 75 74 69 6e 65 73 |t these |routines|
|00002420| 20 6f 6e 6c 79 20 69 6d | 70 6c 65 6d 65 6e 74 20 | only im|plement |
|00002430| 63 65 72 74 61 69 6e 20 | 7b 5c 65 6d 20 63 61 70 |certain |{\em cap|
|00002440| 61 62 69 6c 69 74 69 65 | 73 5c 2f 7d 20 74 68 61 |abilitie|s\/} tha|
|00002450| 74 0a 61 72 65 20 74 79 | 70 69 63 61 6c 20 74 6f |t.are ty|pical to|
|00002460| 20 5c 63 64 72 6f 6d 5c | 20 28 72 65 6d 6f 76 61 | \cdrom\| (remova|
|00002470| 62 6c 65 2d 6d 65 64 69 | 61 29 20 64 65 76 69 63 |ble-medi|a) devic|
|00002480| 65 73 2e 0a 0a 52 65 67 | 69 73 74 72 61 74 69 6f |es...Reg|istratio|
|00002490| 6e 20 6f 66 20 74 68 65 | 20 5c 63 64 72 6f 6d 5c |n of the| \cdrom\|
|000024a0| 20 64 65 76 69 63 65 20 | 64 72 69 76 65 72 20 73 | device |driver s|
|000024b0| 68 6f 75 6c 64 20 6e 6f | 77 20 62 65 20 74 6f 20 |hould no|w be to |
|000024c0| 74 68 65 20 67 65 6e 65 | 72 61 6c 0a 72 6f 75 74 |the gene|ral.rout|
|000024d0| 69 6e 65 73 20 69 6e 20 | 5c 63 64 72 6f 6d 63 2c |ines in |\cdromc,|
|000024e0| 20 6e 6f 74 20 74 6f 20 | 74 68 65 20 56 46 53 20 | not to |the VFS |
|000024f0| 61 6e 79 20 6d 6f 72 65 | 2e 20 54 68 69 73 20 69 |any more|. This i|
|00002500| 73 20 64 6f 6e 65 20 74 | 68 6f 75 67 68 20 74 68 |s done t|hough th|
|00002510| 65 0a 63 61 6c 6c 0a 24 | 24 72 65 67 69 73 74 65 |e.call.$|$registe|
|00002520| 72 5f 63 64 72 6f 6d 28 | 69 6e 74 5c 20 6d 61 6a |r_cdrom(|int\ maj|
|00002530| 6f 72 2c 20 63 68 61 72 | 20 2a 20 6e 61 6d 65 2c |or, char| * name,|
|00002540| 20 0a 20 20 73 74 72 75 | 63 74 5c 20 63 64 72 6f | . stru|ct\ cdro|
|00002550| 6d 5f 64 65 76 69 63 65 | 5f 6f 70 73 5c 20 64 65 |m_device|_ops\ de|
|00002560| 76 69 63 65 5f 6f 70 74 | 69 6f 6e 73 29 0a 24 24 |vice_opt|ions).$$|
|00002570| 0a 0a 54 68 65 20 64 65 | 76 69 63 65 20 6f 70 65 |..The de|vice ope|
|00002580| 72 61 74 69 6f 6e 73 20 | 73 74 72 75 63 74 75 72 |rations |structur|
|00002590| 65 20 6c 69 73 74 73 20 | 74 68 65 20 69 6d 70 6c |e lists |the impl|
|000025a0| 65 6d 65 6e 74 65 64 20 | 72 6f 75 74 69 6e 65 73 |emented |routines|
|000025b0| 20 66 6f 72 0a 69 6e 74 | 65 72 66 61 63 69 6e 67 | for.int|erfacing|
|000025c0| 20 74 6f 20 74 68 65 20 | 68 61 72 64 77 61 72 65 | to the |hardware|
|000025d0| 2c 20 61 6e 64 20 73 6f | 6d 65 20 73 70 65 63 69 |, and so|me speci|
|000025e0| 66 69 63 61 74 69 6f 6e | 73 20 6f 66 20 63 61 70 |fication|s of cap|
|000025f0| 61 62 69 6c 69 74 69 65 | 73 0a 6f 66 20 74 68 65 |abilitie|s.of the|
|00002600| 20 64 65 76 69 63 65 2c | 20 73 75 63 68 20 61 73 | device,| such as|
|00002610| 20 74 68 65 20 6d 61 78 | 69 6d 75 6d 20 68 65 61 | the max|imum hea|
|00002620| 64 2d 74 72 61 6e 73 66 | 65 72 20 72 61 74 65 2e |d-transf|er rate.|
|00002630| 20 20 5b 49 74 20 69 73 | 0a 69 6d 70 6f 73 73 69 | [It is|.impossi|
|00002640| 62 6c 65 20 74 6f 20 63 | 6f 6d 65 20 75 70 20 77 |ble to c|ome up w|
|00002650| 69 74 68 20 61 20 63 6f | 6d 70 6c 65 74 65 20 6c |ith a co|mplete l|
|00002660| 69 73 74 20 6f 66 20 61 | 6c 6c 20 63 61 70 61 62 |ist of a|ll capab|
|00002670| 69 6c 69 74 69 65 73 20 | 6f 66 0a 28 66 75 74 75 |ilities |of.(futu|
|00002680| 72 65 29 20 5c 63 64 72 | 6f 6d 5c 20 64 72 69 76 |re) \cdr|om\ driv|
|00002690| 65 73 2c 20 61 73 20 74 | 68 65 20 64 65 76 65 6c |es, as t|he devel|
|000026a0| 6f 70 6d 65 6e 74 73 20 | 69 6e 20 74 65 63 68 6e |opments |in techn|
|000026b0| 6f 6c 6f 67 79 20 66 6f | 6c 6c 6f 77 2d 75 70 0a |ology fo|llow-up.|
|000026c0| 61 74 20 61 6e 20 69 6e | 63 72 65 64 69 62 6c 65 |at an in|credible|
|000026d0| 20 72 61 74 65 2e 20 4d | 61 79 62 65 20 77 72 69 | rate. M|aybe wri|
|000026e0| 74 65 2d 6f 70 65 72 61 | 74 69 6f 6e 20 28 57 4f |te-opera|tion (WO|
|000026f0| 52 4d 20 64 65 76 69 63 | 65 73 29 20 77 69 6c 6c |RM devic|es) will|
|00002700| 0a 62 65 63 6f 6d 65 20 | 76 65 72 79 20 70 6f 70 |.become |very pop|
|00002710| 75 6c 61 72 20 69 6e 20 | 74 68 65 20 66 75 74 75 |ular in |the futu|
|00002720| 72 65 2e 5d 20 20 54 68 | 65 20 6c 69 73 74 20 6e |re.] Th|e list n|
|00002730| 6f 77 20 69 73 3a 0a 24 | 24 0a 5c 68 61 6c 69 67 |ow is:.$|$.\halig|
|00002740| 6e 7b 24 23 24 5c 20 5c | 68 66 69 6c 26 24 23 24 |n{$#$\ \|hfil&$#$|
|00002750| 5c 20 5c 68 66 69 6c 26 | 5c 68 62 6f 78 20 74 6f |\ \hfil&|\hbox to|
|00002760| 20 31 30 65 6d 7b 24 23 | 24 5c 68 73 73 7d 26 0a | 10em{$#|$\hss}&.|
|00002770| 20 20 24 2f 2a 24 20 5c | 72 6d 23 20 24 2a 2f 24 | $/*$ \|rm# $*/$|
|00002780| 5c 68 66 69 6c 5c 63 72 | 0a 73 74 72 75 63 74 26 |\hfil\cr|.struct&|
|00002790| 20 63 64 72 6f 6d 5f 64 | 65 76 69 63 65 5f 6f 70 | cdrom_d|evice_op|
|000027a0| 73 5c 20 5c 7b 20 5c 68 | 69 64 65 77 69 64 74 68 |s\ \{ \h|idewidth|
|000027b0| 5c 63 72 0a 20 20 26 69 | 6e 74 26 20 28 2a 20 6f |\cr. &i|nt& (* o|
|000027c0| 70 65 6e 29 28 6b 64 65 | 76 5f 74 2c 20 69 6e 74 |pen)(kde|v_t, int|
|000027d0| 29 5c 63 72 0a 20 20 26 | 76 6f 69 64 26 20 28 2a |)\cr. &|void& (*|
|000027e0| 20 72 65 6c 65 61 73 65 | 29 28 6b 64 65 76 5f 74 | release|)(kdev_t|
|000027f0| 29 3b 5c 63 72 20 0a 20 | 20 26 69 6e 74 26 20 28 |);\cr . | &int& (|
|00002800| 2a 20 6f 70 65 6e 5f 66 | 69 6c 65 73 29 28 6b 64 |* open_f|iles)(kd|
|00002810| 65 76 5f 74 29 3b 20 20 | 5c 63 72 0a 20 20 26 69 |ev_t); |\cr. &i|
|00002820| 6e 74 26 20 28 2a 20 64 | 72 69 76 65 5f 73 74 61 |nt& (* d|rive_sta|
|00002830| 74 75 73 29 28 6b 64 65 | 76 5f 74 29 3b 5c 63 72 |tus)(kde|v_t);\cr|
|00002840| 20 20 20 20 20 0a 20 20 | 26 69 6e 74 26 20 28 2a | . |&int& (*|
|00002850| 20 64 69 73 63 5f 73 74 | 61 74 75 73 29 28 6b 64 | disc_st|atus)(kd|
|00002860| 65 76 5f 74 29 3b 5c 63 | 72 20 20 20 20 20 20 0a |ev_t);\c|r .|
|00002870| 20 20 26 69 6e 74 26 20 | 28 2a 20 6d 65 64 69 61 | &int& |(* media|
|00002880| 5f 63 68 61 6e 67 65 64 | 29 28 6b 64 65 76 5f 74 |_changed|)(kdev_t|
|00002890| 29 3b 5c 63 72 20 0a 20 | 20 26 69 6e 74 26 20 28 |);\cr . | &int& (|
|000028a0| 2a 20 74 72 61 79 5f 6d | 6f 76 65 29 28 6b 64 65 |* tray_m|ove)(kde|
|000028b0| 76 5f 74 2c 20 69 6e 74 | 29 3b 5c 63 72 0a 20 20 |v_t, int|);\cr. |
|000028c0| 26 69 6e 74 26 20 28 2a | 20 6c 6f 63 6b 5f 64 6f |&int& (*| lock_do|
|000028d0| 6f 72 29 28 6b 64 65 76 | 5f 74 2c 20 69 6e 74 29 |or)(kdev|_t, int)|
|000028e0| 3b 5c 63 72 0a 20 20 26 | 69 6e 74 26 20 28 2a 20 |;\cr. &|int& (* |
|000028f0| 73 65 6c 65 63 74 5f 73 | 70 65 65 64 29 28 6b 64 |select_s|peed)(kd|
|00002900| 65 76 5f 74 2c 20 69 6e | 74 29 3b 5c 63 72 0a 20 |ev_t, in|t);\cr. |
|00002910| 20 26 69 6e 74 26 20 28 | 2a 20 73 65 6c 65 63 74 | &int& (|* select|
|00002920| 5f 64 69 73 63 29 28 6b | 64 65 76 5f 74 2c 20 69 |_disc)(k|dev_t, i|
|00002930| 6e 74 29 3b 5c 63 72 0a | 20 20 26 69 6e 74 26 20 |nt);\cr.| &int& |
|00002940| 28 2a 20 67 65 74 5f 6c | 61 73 74 5f 73 65 73 73 |(* get_l|ast_sess|
|00002950| 69 6f 6e 29 20 28 6b 64 | 65 76 5f 74 2c 20 73 74 |ion) (kd|ev_t, st|
|00002960| 72 75 63 74 5c 20 63 64 | 72 6f 6d 5f 6d 75 6c 74 |ruct\ cd|rom_mult|
|00002970| 69 73 65 73 73 69 6f 6e | 20 2a 7b 7d 29 3b 5c 63 |isession| *{});\c|
|00002980| 72 0a 20 20 26 69 6e 74 | 26 20 28 2a 20 67 65 74 |r. &int|& (* get|
|00002990| 5f 6d 63 6e 29 28 6b 64 | 65 76 5f 74 2c 20 73 74 |_mcn)(kd|ev_t, st|
|000029a0| 72 75 63 74 5c 20 63 64 | 72 6f 6d 5f 6d 63 6e 20 |ruct\ cd|rom_mcn |
|000029b0| 2a 7b 7d 29 3b 5c 63 72 | 0a 20 20 26 69 6e 74 26 |*{});\cr|. &int&|
|000029c0| 20 28 2a 20 72 65 73 65 | 74 29 28 6b 64 65 76 5f | (* rese|t)(kdev_|
|000029d0| 74 29 3b 5c 63 72 0a 20 | 20 26 69 6e 74 26 20 28 |t);\cr. | &int& (|
|000029e0| 2a 20 61 75 64 69 6f 5f | 69 6f 63 74 6c 29 28 6b |* audio_|ioctl)(k|
|000029f0| 64 65 76 5f 74 2c 20 75 | 6e 73 69 67 6e 65 64 5c |dev_t, u|nsigned\|
|00002a00| 20 69 6e 74 2c 20 76 6f | 69 64 20 2a 7b 7d 29 3b | int, vo|id *{});|
|00002a10| 5c 63 72 20 0a 20 20 26 | 69 6e 74 26 20 28 2a 20 |\cr . &|int& (* |
|00002a20| 64 65 76 5f 69 6f 63 74 | 6c 29 28 6b 64 65 76 5f |dev_ioct|l)(kdev_|
|00002a30| 74 2c 20 75 6e 73 69 67 | 6e 65 64 5c 20 69 6e 74 |t, unsig|ned\ int|
|00002a40| 2c 20 75 6e 73 69 67 6e | 65 64 5c 20 6c 6f 6e 67 |, unsign|ed\ long|
|00002a50| 29 3b 5c 63 72 0a 5c 6e | 6f 61 6c 69 67 6e 7b 5c |);\cr.\n|oalign{\|
|00002a60| 6d 65 64 73 6b 69 70 7d | 0a 20 20 26 5c 6c 6c 61 |medskip}|. &\lla|
|00002a70| 70 7b 63 6f 6e 73 74 5c | 20 7d 69 6e 74 26 20 63 |p{const\| }int& c|
|00002a80| 61 70 61 62 69 6c 69 74 | 79 3b 26 20 20 63 61 70 |apabilit|y;& cap|
|00002a90| 61 62 69 6c 69 74 79 20 | 66 6c 61 67 73 20 5c 63 |ability |flags \c|
|00002aa0| 72 0a 20 20 26 69 6e 74 | 26 20 6d 61 73 6b 3b 26 |r. &int|& mask;&|
|00002ab0| 20 6d 61 73 6b 20 6f 66 | 20 63 61 70 61 62 69 6c | mask of| capabil|
|00002ac0| 69 74 79 3a 20 64 69 73 | 61 62 6c 65 73 20 74 68 |ity: dis|ables th|
|00002ad0| 65 6d 20 5c 63 72 0a 20 | 20 26 5c 6c 6c 61 70 7b |em \cr. | &\llap{|
|00002ae0| 24 63 6f 6e 73 74 5c 20 | 24 7d 69 6e 74 26 20 73 |$const\ |$}int& s|
|00002af0| 70 65 65 64 3b 26 20 20 | 6d 61 78 69 6d 75 6d 20 |peed;& |maximum |
|00002b00| 73 70 65 65 64 20 66 6f | 72 20 72 65 61 64 69 6e |speed fo|r readin|
|00002b10| 67 20 64 61 74 61 20 5c | 63 72 0a 20 20 26 5c 6c |g data \|cr. &\l|
|00002b20| 6c 61 70 7b 24 63 6f 6e | 73 74 5c 20 24 7d 69 6e |lap{$con|st\ $}in|
|00002b30| 74 26 20 6d 69 6e 6f 72 | 73 3b 26 20 6e 75 6d 62 |t& minor|s;& numb|
|00002b40| 65 72 20 6f 66 20 73 75 | 70 70 6f 72 74 65 64 20 |er of su|pported |
|00002b50| 6d 69 6e 6f 72 20 64 65 | 76 69 63 65 73 20 5c 63 |minor de|vices \c|
|00002b60| 72 0a 20 20 26 5c 6c 6c | 61 70 7b 24 63 6f 6e 73 |r. &\ll|ap{$cons|
|00002b70| 74 5c 20 24 7d 69 6e 74 | 26 20 63 61 70 61 63 69 |t\ $}int|& capaci|
|00002b80| 74 79 3b 26 20 6e 75 6d | 62 65 72 20 6f 66 20 64 |ty;& num|ber of d|
|00002b90| 69 73 63 73 20 69 6e 20 | 6a 75 6b 65 62 6f 78 20 |iscs in |jukebox |
|00002ba0| 5c 63 72 0a 5c 6e 6f 61 | 6c 69 67 6e 7b 5c 6d 65 |\cr.\noa|lign{\me|
|00002bb0| 64 73 6b 69 70 7d 0a 20 | 20 26 69 6e 74 26 20 6f |dskip}. | &int& o|
|00002bc0| 70 74 69 6f 6e 73 3b 26 | 20 6f 70 74 69 6f 6e 73 |ptions;&| options|
|00002bd0| 20 66 6c 61 67 73 20 5c | 63 72 0a 20 20 26 6c 6f | flags \|cr. &lo|
|00002be0| 6e 67 26 20 6d 63 5f 66 | 6c 61 67 73 3b 26 20 6d |ng& mc_f|lags;& m|
|00002bf0| 65 64 69 61 2d 63 68 61 | 6e 67 65 20 62 75 66 66 |edia-cha|nge buff|
|00002c00| 65 72 20 66 6c 61 67 73 | 20 28 24 32 5c 74 69 6d |er flags| ($2\tim|
|00002c10| 65 73 31 36 24 29 20 5c | 63 72 0a 5c 7d 5c 63 72 |es16$) \|cr.\}\cr|
|00002c20| 0a 7d 0a 24 24 20 54 68 | 65 20 5c 63 64 72 6f 6d |.}.$$ Th|e \cdrom|
|00002c30| 2d 64 72 69 76 65 72 20 | 73 68 6f 75 6c 64 20 73 |-driver |should s|
|00002c40| 69 6d 70 6c 79 20 69 6d | 70 6c 65 6d 65 6e 74 20 |imply im|plement |
|00002c50| 28 73 6f 6d 65 20 6f 66 | 29 20 74 68 65 73 65 0a |(some of|) these.|
|00002c60| 66 75 6e 63 74 69 6f 6e | 73 2c 20 61 6e 64 20 72 |function|s, and r|
|00002c70| 65 67 69 73 74 65 72 20 | 74 68 65 20 66 75 6e 63 |egister |the func|
|00002c80| 74 69 6f 6e 73 20 74 6f | 20 74 68 65 20 67 6c 6f |tions to| the glo|
|00002c90| 62 61 6c 20 5c 63 64 72 | 6f 6d 5c 20 64 72 69 76 |bal \cdr|om\ driv|
|00002ca0| 65 72 2c 0a 77 68 69 63 | 68 20 70 65 72 66 6f 72 |er,.whic|h perfor|
|00002cb0| 6d 73 20 69 6e 74 65 72 | 66 61 63 69 6e 67 20 77 |ms inter|facing w|
|00002cc0| 69 74 68 20 74 68 65 20 | 56 69 72 74 75 61 6c 20 |ith the |Virtual |
|00002cd0| 46 69 6c 65 20 53 79 73 | 74 65 6d 20 61 6e 64 20 |File Sys|tem and |
|00002ce0| 73 79 73 74 65 6d 0a 24 | 69 6f 63 74 6c 24 73 2e |system.$|ioctl$s.|
|00002cf0| 20 54 68 65 20 66 6c 61 | 67 73 20 24 63 61 70 61 | The fla|gs $capa|
|00002d00| 62 69 6c 69 74 79 24 20 | 73 70 65 63 69 66 79 20 |bility$ |specify |
|00002d10| 74 68 65 20 68 61 72 64 | 77 61 72 65 2d 63 61 70 |the hard|ware-cap|
|00002d20| 61 62 69 6c 69 74 69 65 | 73 20 6f 6e 0a 72 65 67 |abilitie|s on.reg|
|00002d30| 69 73 74 72 61 74 69 6f | 6e 20 6f 66 20 74 68 65 |istratio|n of the|
|00002d40| 20 64 65 76 69 63 65 2c | 20 74 68 65 20 66 6c 61 | device,| the fla|
|00002d50| 67 73 20 24 6d 61 73 6b | 24 20 63 61 6e 20 62 65 |gs $mask|$ can be|
|00002d60| 20 75 73 65 64 20 74 6f | 20 6d 61 73 6b 20 73 6f | used to| mask so|
|00002d70| 6d 65 0a 6f 66 20 74 68 | 6f 73 65 20 63 61 70 61 |me.of th|ose capa|
|00002d80| 62 69 6c 69 74 69 65 73 | 20 28 66 6f 72 20 6f 6e |bilities| (for on|
|00002d90| 65 20 72 65 61 73 6f 6e | 20 6f 72 20 61 6e 6f 74 |e reason| or anot|
|00002da0| 68 65 72 29 2e 20 54 68 | 65 20 76 61 6c 75 65 20 |her). Th|e value |
|00002db0| 24 6d 69 6e 6f 72 73 24 | 0a 73 68 6f 75 6c 64 20 |$minors$|.should |
|00002dc0| 62 65 20 61 20 70 6f 73 | 69 74 69 76 65 20 76 61 |be a pos|itive va|
|00002dd0| 6c 75 65 20 69 6e 64 69 | 63 61 74 69 6e 67 20 74 |lue indi|cating t|
|00002de0| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 6d 69 6e |he numbe|r of min|
|00002df0| 6f 72 20 64 65 76 69 63 | 65 73 20 74 68 61 74 0a |or devic|es that.|
|00002e00| 61 72 65 20 73 75 70 70 | 6f 72 74 65 64 20 62 79 |are supp|orted by|
|00002e10| 20 74 68 65 20 64 72 69 | 76 65 72 2c 20 6e 6f 72 | the dri|ver, nor|
|00002e20| 6d 61 6c 6c 79 7e 31 2e | 20 20 28 54 68 65 79 20 |mally~1.| (They |
|00002e30| 61 72 65 20 73 75 70 70 | 6f 73 65 64 20 74 6f 20 |are supp|osed to |
|00002e40| 62 65 0a 6e 75 6d 62 65 | 72 65 64 20 66 72 6f 6d |be.numbe|red from|
|00002e50| 20 30 20 75 70 77 61 72 | 64 73 29 2e 20 54 68 65 | 0 upwar|ds). The|
|00002e60| 20 76 61 6c 75 65 20 24 | 63 61 70 61 63 69 74 79 | value $|capacity|
|00002e70| 24 20 73 68 6f 75 6c 64 | 20 62 65 20 74 68 65 20 |$ should| be the |
|00002e80| 6e 75 6d 62 65 72 20 6f | 66 0a 64 69 73 63 73 20 |number o|f.discs |
|00002e90| 74 68 65 20 64 72 69 76 | 65 20 63 61 6e 20 68 6f |the driv|e can ho|
|00002ea0| 6c 64 20 73 69 6d 75 6c | 74 61 6e 65 6f 75 73 6c |ld simul|taneousl|
|00002eb0| 79 2c 20 69 66 20 69 74 | 20 69 73 20 64 65 73 69 |y, if it| is desi|
|00002ec0| 67 6e 65 64 20 61 73 20 | 61 0a 6a 75 6b 65 2d 62 |gned as |a.juke-b|
|00002ed0| 6f 78 2c 20 6f 72 20 6f | 74 68 65 72 77 69 73 65 |ox, or o|therwise|
|00002ee0| 7e 31 2e 0a 0a 54 77 6f | 20 72 65 67 69 73 74 65 |~1...Two| registe|
|00002ef0| 72 73 20 63 6f 6e 74 61 | 69 6e 20 76 61 72 69 61 |rs conta|in varia|
|00002f00| 62 6c 65 73 20 6c 6f 63 | 61 6c 20 74 6f 20 74 68 |bles loc|al to th|
|00002f10| 65 20 5c 63 64 72 6f 6d | 5c 20 64 65 76 69 63 65 |e \cdrom|\ device|
|00002f20| 2e 20 54 68 65 20 66 6c | 61 67 73 0a 24 6f 70 74 |. The fl|ags.$opt|
|00002f30| 69 6f 6e 73 24 20 61 72 | 65 20 75 73 65 64 20 74 |ions$ ar|e used t|
|00002f40| 6f 20 73 70 65 63 69 66 | 79 20 68 6f 77 20 74 68 |o specif|y how th|
|00002f50| 65 20 67 65 6e 65 72 61 | 6c 20 5c 63 64 72 6f 6d |e genera|l \cdrom|
|00002f60| 5c 20 72 6f 75 74 69 6e | 65 73 0a 73 68 6f 75 6c |\ routin|es.shoul|
|00002f70| 64 20 62 65 68 61 76 65 | 2e 20 54 68 65 73 65 20 |d behave|. These |
|00002f80| 76 61 72 69 6f 75 73 20 | 66 6c 61 67 73 20 72 65 |various |flags re|
|00002f90| 67 69 73 74 65 72 73 20 | 73 68 6f 75 6c 64 20 70 |gisters |should p|
|00002fa0| 72 6f 76 69 64 65 20 65 | 6e 6f 75 67 68 0a 66 6c |rovide e|nough.fl|
|00002fb0| 65 78 69 62 69 6c 69 74 | 79 20 74 6f 20 61 64 61 |exibilit|y to ada|
|00002fc0| 70 74 20 74 6f 20 74 68 | 65 20 64 69 66 66 65 72 |pt to th|e differ|
|00002fd0| 65 6e 74 20 75 73 65 72 | 27 73 20 77 69 73 68 65 |ent user|'s wishe|
|00002fe0| 73 20 28 61 6e 64 20 7b | 5c 65 6d 20 6e 6f 74 5c |s (and {|\em not\|
|00002ff0| 2f 7d 0a 74 68 65 20 60 | 61 72 62 69 74 72 61 72 |/}.the `|arbitrar|
|00003000| 79 27 20 77 69 73 68 65 | 73 20 6f 66 20 74 68 65 |y' wishe|s of the|
|00003010| 20 61 75 74 68 6f 72 20 | 6f 66 20 74 68 65 20 6c | author |of the l|
|00003020| 6f 77 2d 6c 65 76 65 6c | 20 64 65 76 69 63 65 20 |ow-level| device |
|00003030| 64 72 69 76 65 72 2c 0a | 61 73 20 69 73 20 74 68 |driver,.|as is th|
|00003040| 65 20 63 61 73 65 20 69 | 6e 20 74 68 65 20 6f 6c |e case i|n the ol|
|00003050| 64 20 73 63 68 65 6d 65 | 29 2e 20 54 68 65 20 72 |d scheme|). The r|
|00003060| 65 67 69 73 74 65 72 20 | 24 6d 63 5f 66 6c 61 67 |egister |$mc_flag|
|00003070| 73 24 20 69 73 20 75 73 | 65 64 20 74 6f 0a 62 75 |s$ is us|ed to.bu|
|00003080| 66 66 65 72 20 74 68 65 | 20 69 6e 66 6f 72 6d 61 |ffer the| informa|
|00003090| 74 69 6f 6e 20 66 72 6f | 6d 20 24 6d 65 64 69 61 |tion fro|m $media|
|000030a0| 5f 63 68 61 6e 67 65 64 | 28 29 24 20 74 6f 20 74 |_changed|()$ to t|
|000030b0| 77 6f 20 73 65 70 61 72 | 61 74 65 20 71 75 65 75 |wo separ|ate queu|
|000030c0| 65 73 2e 20 0a 0a 4e 6f | 74 65 20 74 68 61 74 20 |es. ..No|te that |
|000030d0| 6d 6f 73 74 20 66 75 6e | 63 74 69 6f 6e 73 20 68 |most fun|ctions h|
|000030e0| 61 76 65 20 66 65 77 65 | 72 20 70 61 72 61 6d 65 |ave fewe|r parame|
|000030f0| 74 65 72 73 20 74 68 61 | 6e 20 74 68 65 69 72 0a |ters tha|n their.|
|00003100| 24 62 6c 6b 64 65 76 5f | 66 6f 70 73 24 20 63 6f |$blkdev_|fops$ co|
|00003110| 75 6e 74 65 72 70 61 72 | 74 73 2e 20 54 68 69 73 |unterpar|ts. This|
|00003120| 20 69 73 20 62 65 63 61 | 75 73 65 20 76 65 72 79 | is beca|use very|
|00003130| 20 6c 69 74 74 6c 65 20 | 6f 66 20 74 68 65 0a 69 | little |of the.i|
|00003140| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 69 6e 20 74 68 |nformati|on in th|
|00003150| 65 20 73 74 72 75 63 74 | 75 72 65 73 20 24 69 6e |e struct|ures $in|
|00003160| 6f 64 65 24 20 61 6e 64 | 20 24 66 69 6c 65 24 20 |ode$ and| $file$ |
|00003170| 61 72 65 20 75 73 65 64 | 2c 20 74 68 65 20 6d 61 |are used|, the ma|
|00003180| 69 6e 0a 70 61 72 61 6d | 65 74 65 72 20 69 73 20 |in.param|eter is |
|00003190| 74 68 65 20 64 65 76 69 | 63 65 20 24 64 65 76 24 |the devi|ce $dev$|
|000031a0| 2c 20 66 72 6f 6d 20 77 | 68 69 63 68 20 74 68 65 |, from w|hich the|
|000031b0| 20 6d 69 6e 6f 72 2d 6e | 75 6d 62 65 72 20 63 61 | minor-n|umber ca|
|000031c0| 6e 20 62 65 0a 65 78 74 | 72 61 63 74 65 64 2e 20 |n be.ext|racted. |
|000031d0| 28 4d 6f 73 74 20 6c 6f | 77 2d 6c 65 76 65 6c 20 |(Most lo|w-level |
|000031e0| 5c 63 64 72 6f 6d 5c 20 | 64 72 69 76 65 72 73 20 |\cdrom\ |drivers |
|000031f0| 64 6f 6e 27 74 20 65 76 | 65 6e 20 6c 6f 6f 6b 20 |don't ev|en look |
|00003200| 61 74 20 74 68 61 74 20 | 76 61 6c 75 65 0a 61 73 |at that |value.as|
|00003210| 20 6f 6e 6c 79 20 6f 6e | 65 20 64 65 76 69 63 65 | only on|e device|
|00003220| 20 69 73 20 73 75 70 70 | 6f 72 74 65 64 2e 29 0a | is supp|orted.).|
|00003230| 0a 54 68 65 20 69 6e 74 | 65 72 6d 65 64 69 61 74 |.The int|ermediat|
|00003240| 65 20 73 6f 66 74 77 61 | 72 65 20 6c 61 79 65 72 |e softwa|re layer|
|00003250| 20 74 68 61 74 20 5c 63 | 64 72 6f 6d 63 5c 20 66 | that \c|dromc\ f|
|00003260| 6f 72 6d 73 20 77 69 6c | 6c 20 70 65 72 66 6f 72 |orms wil|l perfor|
|00003270| 6d 73 20 73 6f 6d 65 0a | 61 64 64 69 74 69 6f 6e |ms some.|addition|
|00003280| 61 6c 20 62 6f 6f 6b 6b | 65 65 70 69 6e 67 2e 20 |al bookk|eeping. |
|00003290| 54 68 65 20 6d 69 6e 6f | 72 20 6e 75 6d 62 65 72 |The mino|r number|
|000032a0| 20 6f 66 20 74 68 65 20 | 64 65 76 69 63 65 20 69 | of the |device i|
|000032b0| 73 20 63 68 65 63 6b 65 | 64 0a 61 67 61 69 6e 73 |s checke|d.agains|
|000032c0| 74 20 74 68 65 20 6d 61 | 78 69 6d 75 6d 20 72 65 |t the ma|ximum re|
|000032d0| 67 69 73 74 65 72 65 64 | 20 69 6e 20 24 3c 64 65 |gistered| in $<de|
|000032e0| 76 69 63 65 3e 5f 64 6f | 70 73 24 2e 20 54 68 65 |vice>_do|ps$. The|
|000032f0| 20 66 75 6e 63 74 69 6f | 6e 0a 24 63 64 72 6f 6d | functio|n.$cdrom|
|00003300| 5f 69 6f 63 74 6c 28 29 | 24 20 77 69 6c 6c 20 76 |_ioctl()|$ will v|
|00003310| 65 72 69 66 79 20 74 68 | 65 20 61 70 70 72 6f 70 |erify th|e approp|
|00003320| 72 69 61 74 65 20 75 73 | 65 72 2d 6d 65 6d 6f 72 |riate us|er-memor|
|00003330| 79 20 72 65 67 69 6f 6e | 73 20 66 6f 72 0a 72 65 |y region|s for.re|
|00003340| 61 64 20 61 6e 64 20 77 | 72 69 74 65 2c 20 61 6e |ad and w|rite, an|
|00003350| 64 20 69 6e 20 63 61 73 | 65 20 61 20 6c 6f 63 61 |d in cas|e a loca|
|00003360| 74 69 6f 6e 20 6f 6e 20 | 74 68 65 20 43 44 20 69 |tion on |the CD i|
|00003370| 73 20 74 72 61 6e 73 66 | 65 72 72 65 64 2c 20 69 |s transf|erred, i|
|00003380| 74 0a 77 69 6c 6c 20 60 | 73 61 6e 69 74 69 7a 65 |t.will `|sanitize|
|00003390| 27 20 74 68 65 20 66 6f | 72 6d 61 74 20 62 79 20 |' the fo|rmat by |
|000033a0| 6d 61 6b 69 6e 67 20 72 | 65 71 75 65 73 74 73 20 |making r|equests |
|000033b0| 74 6f 20 74 68 65 20 6c | 6f 77 2d 6c 65 76 65 6c |to the l|ow-level|
|000033c0| 20 64 72 69 76 65 72 73 | 0a 69 6e 20 61 20 73 74 | drivers|.in a st|
|000033d0| 61 6e 64 61 72 64 20 66 | 6f 72 6d 61 74 2c 20 61 |andard f|ormat, a|
|000033e0| 6e 64 20 74 72 61 6e 73 | 6c 61 74 69 6e 67 20 61 |nd trans|lating a|
|000033f0| 6c 6c 20 66 6f 72 6d 61 | 74 73 20 62 65 74 77 65 |ll forma|ts betwe|
|00003400| 65 6e 20 74 68 65 0a 75 | 73 65 72 2d 73 6f 66 74 |en the.u|ser-soft|
|00003410| 77 61 72 65 20 61 6e 64 | 20 6c 6f 77 20 6c 65 76 |ware and| low lev|
|00003420| 65 6c 20 64 72 69 76 65 | 72 73 2e 20 54 68 69 73 |el drive|rs. This|
|00003430| 20 72 65 6c 69 65 76 65 | 73 20 6d 75 63 68 20 6f | relieve|s much o|
|00003440| 66 20 74 68 65 20 64 72 | 69 76 65 72 73 0a 6d 65 |f the dr|ivers.me|
|00003450| 6d 6f 72 79 20 63 68 65 | 63 6b 69 6e 67 20 61 6e |mory che|cking an|
|00003460| 64 20 66 6f 72 6d 61 74 | 20 63 68 65 63 6b 69 6e |d format| checkin|
|00003470| 67 20 61 6e 64 20 74 72 | 61 6e 73 6c 61 74 69 6f |g and tr|anslatio|
|00003480| 6e 2e 20 41 6c 73 6f 2c | 20 74 68 65 0a 6e 65 63 |n. Also,| the.nec|
|00003490| 65 73 73 61 72 79 20 73 | 74 72 75 63 74 75 72 65 |essary s|tructure|
|000034a0| 73 20 77 69 6c 6c 20 62 | 65 20 64 65 63 6c 61 72 |s will b|e declar|
|000034b0| 65 64 20 6f 6e 20 74 68 | 65 20 70 72 6f 67 72 61 |ed on th|e progra|
|000034c0| 6d 20 73 74 61 63 6b 2e | 0a 0a 54 68 65 20 69 6d |m stack.|..The im|
|000034d0| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 6f 66 20 |plementa|tion of |
|000034e0| 74 68 65 20 66 75 6e 63 | 74 69 6f 6e 73 20 73 68 |the func|tions sh|
|000034f0| 6f 75 6c 64 20 62 65 20 | 61 73 20 64 65 66 69 6e |ould be |as defin|
|00003500| 65 64 20 69 6e 20 74 68 | 65 0a 66 6f 6c 6c 6f 77 |ed in th|e.follow|
|00003510| 69 6e 67 20 73 65 63 74 | 69 6f 6e 73 2e 20 54 68 |ing sect|ions. Th|
|00003520| 72 65 65 20 66 75 6e 63 | 74 69 6f 6e 73 20 7b 5c |ree func|tions {\|
|00003530| 65 6d 20 6d 75 73 74 5c | 2f 7d 20 62 65 20 69 6d |em must\|/} be im|
|00003540| 70 6c 65 6d 65 6e 74 65 | 64 2c 0a 6e 61 6d 65 6c |plemente|d,.namel|
|00003550| 79 20 24 6f 70 65 6e 28 | 29 24 2c 20 24 72 65 6c |y $open(|)$, $rel|
|00003560| 65 61 73 65 28 29 24 20 | 61 6e 64 20 24 6f 70 65 |ease()$ |and $ope|
|00003570| 6e 5f 66 69 6c 65 73 28 | 29 24 2e 20 4f 74 68 65 |n_files(|)$. Othe|
|00003580| 72 20 66 75 6e 63 74 69 | 6f 6e 73 20 6d 61 79 0a |r functi|ons may.|
|00003590| 62 65 20 6f 6d 69 74 74 | 65 64 2c 20 74 68 65 69 |be omitt|ed, thei|
|000035a0| 72 20 63 6f 72 72 65 73 | 70 6f 6e 64 69 6e 67 20 |r corres|ponding |
|000035b0| 63 61 70 61 62 69 6c 69 | 74 79 20 66 6c 61 67 73 |capabili|ty flags|
|000035c0| 20 77 69 6c 6c 20 62 65 | 20 63 6c 65 61 72 65 64 | will be| cleared|
|000035d0| 20 75 70 6f 6e 0a 72 65 | 67 69 73 74 72 61 74 69 | upon.re|gistrati|
|000035e0| 6f 6e 2e 20 47 65 6e 65 | 72 61 6c 6c 79 2c 20 61 |on. Gene|rally, a|
|000035f0| 20 66 75 6e 63 74 69 6f | 6e 20 72 65 74 75 72 6e | functio|n return|
|00003600| 73 20 7a 65 72 6f 20 6f | 6e 20 73 75 63 63 65 73 |s zero o|n succes|
|00003610| 73 20 61 6e 64 0a 6e 65 | 67 61 74 69 76 65 20 6f |s and.ne|gative o|
|00003620| 6e 20 65 72 72 6f 72 2e | 20 41 20 66 75 6e 63 74 |n error.| A funct|
|00003630| 69 6f 6e 20 63 61 6c 6c | 20 73 68 6f 75 6c 64 20 |ion call| should |
|00003640| 72 65 74 75 72 6e 20 6f | 6e 6c 79 20 61 66 74 65 |return o|nly afte|
|00003650| 72 20 74 68 65 0a 63 6f | 6d 6d 61 6e 64 20 68 61 |r the.co|mmand ha|
|00003660| 73 20 63 6f 6d 70 6c 65 | 74 65 64 2c 20 62 75 74 |s comple|ted, but|
|00003670| 20 6f 66 20 63 6f 75 72 | 73 65 20 77 61 69 74 69 | of cour|se waiti|
|00003680| 6e 67 20 66 6f 72 20 74 | 68 65 20 64 65 76 69 63 |ng for t|he devic|
|00003690| 65 20 73 68 6f 75 6c 64 | 20 6e 6f 74 0a 75 73 65 |e should| not.use|
|000036a0| 20 70 72 6f 63 65 73 73 | 6f 72 20 74 69 6d 65 2e | process|or time.|
|000036b0| 0a 0a 5c 73 75 62 73 65 | 63 74 69 6f 6e 7b 24 4f |..\subse|ction{$O|
|000036c0| 70 65 6e 28 6b 64 65 76 | 5f 74 5c 20 64 65 76 2c |pen(kdev|_t\ dev,|
|000036d0| 20 69 6e 74 5c 20 70 75 | 72 70 6f 73 65 29 24 7d | int\ pu|rpose)$}|
|000036e0| 0a 0a 24 4f 70 65 6e 28 | 29 24 20 73 68 6f 75 6c |..$Open(|)$ shoul|
|000036f0| 64 20 74 72 79 20 74 6f | 20 6f 70 65 6e 20 74 68 |d try to| open th|
|00003700| 65 20 64 65 76 69 63 65 | 20 66 6f 72 20 61 20 73 |e device| for a s|
|00003710| 70 65 63 69 66 69 63 20 | 24 70 75 72 70 6f 73 65 |pecific |$purpose|
|00003720| 24 2c 20 77 68 69 63 68 | 0a 63 61 6e 20 62 65 20 |$, which|.can be |
|00003730| 65 69 74 68 65 72 3a 0a | 5c 62 65 67 69 6e 7b 69 |either:.|\begin{i|
|00003740| 74 65 6d 69 7a 65 7d 0a | 5c 69 74 65 6d 5b 30 5d |temize}.|\item[0]|
|00003750| 20 4f 70 65 6e 20 66 6f | 72 20 64 61 74 61 20 72 | Open fo|r data r|
|00003760| 65 61 64 2c 20 61 73 20 | 69 73 20 75 73 65 64 20 |ead, as |is used |
|00003770| 62 79 20 7b 5c 74 74 20 | 6d 6f 75 6e 74 28 29 7d |by {\tt |mount()}|
|00003780| 20 28 32 29 2c 20 6f 72 | 20 74 68 65 0a 75 73 65 | (2), or| the.use|
|00003790| 72 20 63 6f 6d 6d 61 6e | 64 73 20 7b 5c 74 74 20 |r comman|ds {\tt |
|000037a0| 64 64 7d 20 6f 72 20 7b | 5c 74 74 20 63 61 74 7d |dd} or {|\tt cat}|
|000037b0| 2e 20 20 0a 5c 69 74 65 | 6d 5b 31 5d 20 4f 70 65 |. .\ite|m[1] Ope|
|000037c0| 6e 20 66 6f 72 20 24 69 | 6f 63 74 6c 24 20 63 6f |n for $i|octl$ co|
|000037d0| 6d 6d 61 6e 64 69 6e 67 | 2c 20 61 73 20 69 73 20 |mmanding|, as is |
|000037e0| 75 73 65 64 20 66 6f 72 | 20 61 75 64 69 6f 2d 43 |used for| audio-C|
|000037f0| 44 20 70 6c 61 79 69 6e | 67 0a 70 72 6f 67 72 61 |D playin|g.progra|
|00003800| 6d 73 20 6d 6f 73 74 6c | 79 2e 20 0a 5c 65 6e 64 |ms mostl|y. .\end|
|00003810| 7b 69 74 65 6d 69 7a 65 | 7d 0a 49 6e 20 74 68 69 |{itemize|}.In thi|
|00003820| 73 20 72 6f 75 74 69 6e | 65 2c 20 61 20 73 74 61 |s routin|e, a sta|
|00003830| 74 69 63 20 63 6f 75 6e | 74 65 72 20 73 68 6f 75 |tic coun|ter shou|
|00003840| 6c 64 20 62 65 20 75 70 | 64 61 74 65 64 2c 20 72 |ld be up|dated, r|
|00003850| 65 66 6c 65 63 74 69 6e | 67 20 74 68 65 0a 6e 75 |eflectin|g the.nu|
|00003860| 6d 62 65 72 20 6f 66 20 | 74 69 6d 65 73 20 74 68 |mber of |times th|
|00003870| 65 20 73 70 65 63 69 66 | 69 63 20 64 65 76 69 63 |e specif|ic devic|
|00003880| 65 20 69 73 20 73 75 63 | 63 65 73 73 66 75 6c 6c |e is suc|cessfull|
|00003890| 79 20 6f 70 65 6e 65 64 | 20 28 61 6e 64 20 69 6e |y opened| (and in|
|000038a0| 0a 63 61 73 65 20 74 68 | 65 20 64 72 69 76 65 72 |.case th|e driver|
|000038b0| 20 73 75 70 70 6f 72 74 | 73 20 6d 6f 64 75 6c 65 | support|s module|
|000038c0| 73 2c 20 74 68 65 20 63 | 61 6c 6c 20 24 4d 4f 44 |s, the c|all $MOD|
|000038d0| 5f 49 4e 43 5f 55 53 45 | 5f 43 4f 55 4e 54 24 0a |_INC_USE|_COUNT$.|
|000038e0| 73 68 6f 75 6c 64 20 62 | 65 20 70 65 72 66 6f 72 |should b|e perfor|
|000038f0| 6d 65 64 20 65 78 61 63 | 74 6c 79 20 6f 6e 63 65 |med exac|tly once|
|00003900| 2c 20 69 66 20 73 75 63 | 63 65 73 73 66 75 6c 29 |, if suc|cessful)|
|00003910| 2e 20 54 68 65 20 72 65 | 74 75 72 6e 20 76 61 6c |. The re|turn val|
|00003920| 75 65 20 69 73 0a 6e 65 | 67 61 74 69 76 65 20 6f |ue is.ne|gative o|
|00003930| 6e 20 65 72 72 6f 72 2c | 20 61 6e 64 20 7a 65 72 |n error,| and zer|
|00003940| 6f 20 6f 6e 20 73 75 63 | 63 65 73 73 2e 20 54 68 |o on suc|cess. Th|
|00003950| 65 20 6f 70 65 6e 2d 66 | 6f 72 2d 69 6f 63 74 6c |e open-f|or-ioctl|
|00003960| 20 63 61 6c 6c 20 63 61 | 6e 0a 6f 6e 6c 79 20 66 | call ca|n.only f|
|00003970| 61 69 6c 20 69 66 20 74 | 68 65 72 65 20 69 73 20 |ail if t|here is |
|00003980| 6e 6f 20 68 61 72 64 77 | 61 72 65 2e 0a 0a 4e 6f |no hardw|are...No|
|00003990| 74 69 63 65 20 74 68 61 | 74 20 61 6e 79 20 73 74 |tice tha|t any st|
|000039a0| 72 61 74 65 67 69 63 20 | 63 6f 64 65 20 28 63 6c |rategic |code (cl|
|000039b0| 6f 73 69 6e 67 20 74 72 | 61 79 20 75 70 6f 6e 20 |osing tr|ay upon |
|000039c0| 24 6f 70 65 6e 28 29 24 | 2c 20 65 74 63 2e 29 5c |$open()$|, etc.)\|
|000039d0| 20 69 73 0a 64 6f 6e 65 | 20 62 79 20 74 68 65 20 | is.done| by the |
|000039e0| 63 61 6c 6c 69 6e 67 20 | 72 6f 75 74 69 6e 65 20 |calling |routine |
|000039f0| 69 6e 20 5c 63 64 72 6f | 6d 63 2c 20 73 6f 20 74 |in \cdro|mc, so t|
|00003a00| 68 65 20 6c 6f 77 2d 6c | 65 76 65 6c 20 72 6f 75 |he low-l|evel rou|
|00003a10| 74 69 6e 65 0a 73 68 6f | 75 6c 64 20 6f 6e 6c 79 |tine.sho|uld only|
|00003a20| 20 62 65 20 63 6f 6e 63 | 65 72 6e 65 64 20 77 69 | be conc|erned wi|
|00003a30| 74 68 20 70 72 6f 70 65 | 72 20 69 6e 69 74 69 61 |th prope|r initia|
|00003a40| 6c 69 7a 61 74 69 6f 6e | 20 61 6e 64 20 64 65 76 |lization| and dev|
|00003a50| 69 63 65 2d 75 73 65 0a | 63 6f 75 6e 74 2e 0a 0a |ice-use.|count...|
|00003a60| 5c 73 75 62 73 65 63 74 | 69 6f 6e 7b 24 52 65 6c |\subsect|ion{$Rel|
|00003a70| 65 61 73 65 28 6b 64 65 | 76 5f 74 5c 20 64 65 76 |ease(kde|v_t\ dev|
|00003a80| 29 24 7d 0a 0a 54 68 65 | 20 75 73 65 2d 63 6f 75 |)$}..The| use-cou|
|00003a90| 6e 74 20 6f 66 20 74 68 | 65 20 64 65 76 69 63 65 |nt of th|e device|
|00003aa0| 20 24 64 65 76 24 20 73 | 68 6f 75 6c 64 20 62 65 | $dev$ s|hould be|
|00003ab0| 20 64 65 63 72 65 61 73 | 65 64 20 62 79 20 31 2c | decreas|ed by 1,|
|00003ac0| 20 61 6e 64 20 61 0a 73 | 69 6e 67 6c 65 20 63 61 | and a.s|ingle ca|
|00003ad0| 6c 6c 20 24 4d 4f 44 5f | 44 45 43 5f 55 53 45 5f |ll $MOD_|DEC_USE_|
|00003ae0| 43 4f 55 4e 54 24 20 73 | 68 6f 75 6c 64 20 62 65 |COUNT$ s|hould be|
|00003af0| 20 63 6f 64 65 64 20 68 | 65 72 65 2e 20 20 50 6f | coded h|ere. Po|
|00003b00| 73 73 69 62 6c 79 20 6f | 74 68 65 72 0a 64 65 76 |ssibly o|ther.dev|
|00003b10| 69 63 65 2d 73 70 65 63 | 69 66 69 63 20 61 63 74 |ice-spec|ific act|
|00003b20| 69 6f 6e 73 20 73 68 6f | 75 6c 64 20 62 65 20 74 |ions sho|uld be t|
|00003b30| 61 6b 65 6e 20 73 75 63 | 68 20 61 73 20 73 70 69 |aken suc|h as spi|
|00003b40| 6e 6e 69 6e 67 20 64 6f | 77 6e 20 74 68 65 0a 64 |nning do|wn the.d|
|00003b50| 65 76 69 63 65 2e 20 48 | 6f 77 65 76 65 72 2c 20 |evice. H|owever, |
|00003b60| 73 74 72 61 74 65 67 69 | 63 20 61 63 74 69 6f 6e |strategi|c action|
|00003b70| 73 20 73 75 63 68 20 61 | 73 20 65 6a 65 63 74 69 |s such a|s ejecti|
|00003b80| 6f 6e 20 6f 66 20 74 68 | 65 20 74 72 61 79 2c 20 |on of th|e tray, |
|00003b90| 6f 72 0a 75 6e 6c 6f 63 | 6b 69 6e 67 20 74 68 65 |or.unloc|king the|
|00003ba0| 20 64 6f 6f 72 2c 20 73 | 68 6f 75 6c 64 20 62 65 | door, s|hould be|
|00003bb0| 20 6c 65 66 74 20 6f 76 | 65 72 20 74 6f 20 74 68 | left ov|er to th|
|00003bc0| 65 20 67 65 6e 65 72 61 | 6c 20 72 6f 75 74 69 6e |e genera|l routin|
|00003bd0| 65 0a 24 63 64 72 6f 6d | 5f 72 65 6c 65 61 73 65 |e.$cdrom|_release|
|00003be0| 28 29 24 2e 20 41 6c 73 | 6f 2c 20 74 68 65 20 69 |()$. Als|o, the i|
|00003bf0| 6e 76 61 6c 69 64 61 74 | 69 6f 6e 20 6f 66 20 74 |nvalidat|ion of t|
|00003c00| 68 65 20 61 6c 6c 6f 63 | 61 74 65 64 20 62 75 66 |he alloc|ated buf|
|00003c10| 66 65 72 73 20 69 6e 0a | 74 68 65 20 56 46 53 20 |fers in.|the VFS |
|00003c20| 69 73 20 74 61 6b 65 6e | 20 63 61 72 65 20 6f 66 |is taken| care of|
|00003c30| 20 62 79 20 74 68 65 20 | 72 6f 75 74 69 6e 65 20 | by the |routine |
|00003c40| 69 6e 20 5c 63 64 72 6f | 6d 63 2e 0a 0a 5c 73 75 |in \cdro|mc...\su|
|00003c50| 62 73 65 63 74 69 6f 6e | 7b 24 4f 70 65 6e 5f 66 |bsection|{$Open_f|
|00003c60| 69 6c 65 73 28 6b 64 65 | 76 5f 74 5c 20 64 65 76 |iles(kde|v_t\ dev|
|00003c70| 29 24 7d 0a 0a 54 68 69 | 73 20 66 75 6e 63 74 69 |)$}..Thi|s functi|
|00003c80| 6f 6e 20 73 68 6f 75 6c | 64 20 72 65 74 75 72 6e |on shoul|d return|
|00003c90| 20 74 68 65 20 69 6e 74 | 65 72 6e 61 6c 20 76 61 | the int|ernal va|
|00003ca0| 72 69 61 62 6c 65 20 75 | 73 65 2d 63 6f 75 6e 74 |riable u|se-count|
|00003cb0| 20 6f 66 20 74 68 65 0a | 64 65 76 69 63 65 20 24 | of the.|device $|
|00003cc0| 64 65 76 24 2e 20 54 68 | 65 20 75 73 65 2d 63 6f |dev$. Th|e use-co|
|00003cd0| 75 6e 74 20 69 73 20 6e | 6f 74 20 69 6d 70 6c 65 |unt is n|ot imple|
|00003ce0| 6d 65 6e 74 65 64 20 69 | 6e 20 74 68 65 20 72 6f |mented i|n the ro|
|00003cf0| 75 74 69 6e 65 73 20 69 | 6e 0a 5c 63 64 72 6f 6d |utines i|n.\cdrom|
|00003d00| 63 5c 20 69 74 73 65 6c | 66 2c 20 62 65 63 61 75 |c\ itsel|f, becau|
|00003d10| 73 65 20 74 68 65 72 65 | 20 6d 61 79 20 62 65 20 |se there| may be |
|00003d20| 6d 61 6e 79 20 6d 69 6e | 6f 72 20 64 65 76 69 63 |many min|or devic|
|00003d30| 65 73 20 63 6f 6e 6e 65 | 63 74 65 64 20 74 6f 0a |es conne|cted to.|
|00003d40| 61 20 73 69 6e 67 6c 65 | 20 6c 6f 77 2d 6c 65 76 |a single| low-lev|
|00003d50| 65 6c 20 64 72 69 76 65 | 72 2e 0a 0a 5c 73 75 62 |el drive|r...\sub|
|00003d60| 73 65 63 74 69 6f 6e 7b | 24 44 72 69 76 65 5f 73 |section{|$Drive_s|
|00003d70| 74 61 74 75 73 28 6b 64 | 65 76 5f 74 5c 20 64 65 |tatus(kd|ev_t\ de|
|00003d80| 76 29 24 7d 0a 5c 6c 61 | 62 65 6c 7b 64 72 69 76 |v)$}.\la|bel{driv|
|00003d90| 65 20 73 74 61 74 75 73 | 7d 0a 0a 54 68 65 20 66 |e status|}..The f|
|00003da0| 75 6e 63 74 69 6f 6e 20 | 24 64 72 69 76 65 5f 73 |unction |$drive_s|
|00003db0| 74 61 74 75 73 24 2c 20 | 69 66 20 69 6d 70 6c 65 |tatus$, |if imple|
|00003dc0| 6d 65 6e 74 65 64 2c 20 | 73 68 6f 75 6c 64 20 70 |mented, |should p|
|00003dd0| 72 6f 76 69 64 65 0a 69 | 6e 66 6f 72 6d 61 74 69 |rovide.i|nformati|
|00003de0| 6f 6e 20 6f 66 20 74 68 | 65 20 73 74 61 74 75 73 |on of th|e status|
|00003df0| 20 6f 66 20 74 68 65 20 | 64 72 69 76 65 20 28 6e | of the |drive (n|
|00003e00| 6f 74 20 74 68 65 20 73 | 74 61 74 75 73 20 6f 66 |ot the s|tatus of|
|00003e10| 20 74 68 65 20 64 69 73 | 63 2c 0a 77 68 69 63 68 | the dis|c,.which|
|00003e20| 20 6d 61 79 20 6f 72 20 | 6d 61 79 20 6e 6f 74 20 | may or |may not |
|00003e30| 62 65 20 69 6e 20 74 68 | 65 20 64 72 69 76 65 29 |be in th|e drive)|
|00003e40| 2e 20 49 6e 20 5c 75 63 | 64 72 6f 6d 5c 20 74 68 |. In \uc|drom\ th|
|00003e50| 65 20 70 6f 73 73 69 62 | 69 6c 69 74 69 65 73 0a |e possib|ilities.|
|00003e60| 61 72 65 20 6c 69 73 74 | 65 64 3a 20 0a 24 24 0a |are list|ed: .$$.|
|00003e70| 5c 68 61 6c 69 67 6e 7b | 24 23 24 5c 20 5c 68 66 |\halign{|$#$\ \hf|
|00003e80| 69 6c 26 24 2f 2a 24 20 | 5c 72 6d 23 20 24 2a 2f |il&$/*$ |\rm# $*/|
|00003e90| 24 5c 68 66 69 6c 5c 63 | 72 0a 43 44 53 5f 4e 4f |$\hfil\c|r.CDS_NO|
|00003ea0| 5f 49 4e 46 4f 26 20 6e | 6f 20 69 6e 66 6f 72 6d |_INFO& n|o inform|
|00003eb0| 61 74 69 6f 6e 20 61 76 | 61 69 6c 61 62 6c 65 5c |ation av|ailable\|
|00003ec0| 63 72 0a 43 44 53 5f 4e | 4f 5f 44 49 53 43 26 20 |cr.CDS_N|O_DISC& |
|00003ed0| 6e 6f 20 64 69 73 63 20 | 69 73 20 69 6e 73 65 72 |no disc |is inser|
|00003ee0| 74 65 64 2c 20 74 72 61 | 79 20 69 73 20 63 6c 6f |ted, tra|y is clo|
|00003ef0| 73 65 64 5c 63 72 0a 43 | 44 53 5f 54 52 41 59 5f |sed\cr.C|DS_TRAY_|
|00003f00| 4f 50 45 4e 26 20 74 72 | 61 79 20 69 73 20 6f 70 |OPEN& tr|ay is op|
|00003f10| 65 6e 65 64 5c 63 72 0a | 43 44 53 5f 44 52 49 56 |ened\cr.|CDS_DRIV|
|00003f20| 45 5f 4e 4f 54 5f 52 45 | 41 44 59 26 20 73 6f 6d |E_NOT_RE|ADY& som|
|00003f30| 65 74 68 69 6e 67 20 69 | 73 20 77 72 6f 6e 67 2c |ething i|s wrong,|
|00003f40| 20 74 72 61 79 20 69 73 | 20 6d 6f 76 69 6e 67 3f | tray is| moving?|
|00003f50| 5c 63 72 0a 43 44 53 5f | 44 49 53 43 5f 4f 4b 26 |\cr.CDS_|DISC_OK&|
|00003f60| 20 61 20 64 69 73 63 20 | 69 73 20 6c 6f 61 64 65 | a disc |is loade|
|00003f70| 64 20 61 6e 64 20 65 76 | 65 72 79 74 68 69 6e 67 |d and ev|erything|
|00003f80| 20 69 73 20 66 69 6e 65 | 5c 63 72 0a 7d 0a 24 24 | is fine|\cr.}.$$|
|00003f90| 0a 0a 5c 73 75 62 73 65 | 63 74 69 6f 6e 7b 24 44 |..\subse|ction{$D|
|00003fa0| 69 73 63 5f 73 74 61 74 | 75 73 28 6b 64 65 76 5f |isc_stat|us(kdev_|
|00003fb0| 74 5c 20 64 65 76 29 24 | 7d 0a 5c 6c 61 62 65 6c |t\ dev)$|}.\label|
|00003fc0| 7b 64 69 73 63 20 73 74 | 61 74 75 73 7d 0a 0a 41 |{disc st|atus}..A|
|00003fd0| 73 20 61 20 63 6f 6d 70 | 6c 65 6d 65 6e 74 20 74 |s a comp|lement t|
|00003fe0| 6f 20 24 64 72 69 76 65 | 5f 73 74 61 74 75 73 28 |o $drive|_status(|
|00003ff0| 29 24 2c 20 74 68 69 73 | 20 66 75 6e 63 74 69 6f |)$, this| functio|
|00004000| 6e 20 63 61 6e 20 70 72 | 6f 76 69 64 65 20 74 68 |n can pr|ovide th|
|00004010| 65 0a 67 65 6e 65 72 61 | 6c 20 5c 63 64 72 6f 6d |e.genera|l \cdrom|
|00004020| 2d 72 6f 75 74 69 6e 65 | 73 20 77 69 74 68 20 69 |-routine|s with i|
|00004030| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 61 62 6f 75 74 |nformati|on about|
|00004040| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 64 69 73 | the cur|rent dis|
|00004050| 63 20 74 68 61 74 20 69 | 73 0a 69 6e 73 65 72 74 |c that i|s.insert|
|00004060| 65 64 20 69 6e 20 74 68 | 65 20 64 72 69 76 65 20 |ed in th|e drive |
|00004070| 72 65 70 72 65 73 65 6e | 74 65 64 20 62 79 20 24 |represen|ted by $|
|00004080| 64 65 76 24 2e 20 54 68 | 65 20 68 69 73 74 6f 72 |dev$. Th|e histor|
|00004090| 79 20 6f 66 20 64 65 76 | 65 6c 6f 70 6d 65 6e 74 |y of dev|elopment|
|000040a0| 0a 6f 66 20 74 68 65 20 | 43 44 27 73 20 75 73 65 |.of the |CD's use|
|000040b0| 20 61 73 20 61 20 63 61 | 72 72 69 65 72 20 6d 65 | as a ca|rrier me|
|000040c0| 64 69 75 6d 20 66 6f 72 | 20 76 61 72 69 6f 75 73 |dium for| various|
|000040d0| 20 64 69 67 69 74 61 6c | 20 69 6e 66 6f 72 6d 61 | digital| informa|
|000040e0| 74 69 6f 6e 0a 68 61 73 | 20 6c 65 61 64 20 74 6f |tion.has| lead to|
|000040f0| 20 6d 61 6e 79 20 64 69 | 66 66 65 72 65 6e 74 20 | many di|fferent |
|00004100| 64 69 73 63 20 74 79 70 | 65 73 2c 20 68 65 6e 63 |disc typ|es, henc|
|00004110| 65 20 74 68 69 73 20 66 | 75 6e 63 74 69 6f 6e 20 |e this f|unction |
|00004120| 63 61 6e 20 72 65 74 75 | 72 6e 3a 0a 24 24 0a 5c |can retu|rn:.$$.\|
|00004130| 68 61 6c 69 67 6e 7b 24 | 23 24 5c 20 5c 68 66 69 |halign{$|#$\ \hfi|
|00004140| 6c 26 24 2f 2a 24 20 5c | 72 6d 23 20 24 2a 2f 24 |l&$/*$ \|rm# $*/$|
|00004150| 5c 68 66 69 6c 5c 63 72 | 0a 43 44 53 5f 4e 4f 5f |\hfil\cr|.CDS_NO_|
|00004160| 49 4e 46 4f 26 20 6e 6f | 20 69 6e 66 6f 72 6d 61 |INFO& no| informa|
|00004170| 74 69 6f 6e 20 61 76 61 | 69 6c 61 62 6c 65 5c 63 |tion ava|ilable\c|
|00004180| 72 0a 43 44 53 5f 4e 4f | 5f 44 49 53 43 26 20 6e |r.CDS_NO|_DISC& n|
|00004190| 6f 20 64 69 73 63 20 69 | 73 20 69 6e 73 65 72 74 |o disc i|s insert|
|000041a0| 65 64 2c 20 6f 72 20 74 | 72 61 79 20 69 73 20 6f |ed, or t|ray is o|
|000041b0| 70 65 6e 65 64 5c 63 72 | 0a 43 44 53 5f 41 55 44 |pened\cr|.CDS_AUD|
|000041c0| 49 4f 26 20 41 75 64 69 | 6f 20 64 69 73 63 20 28 |IO& Audi|o disc (|
|000041d0| 32 33 35 32 20 61 75 64 | 69 6f 20 62 79 74 65 73 |2352 aud|io bytes|
|000041e0| 2f 66 72 61 6d 65 29 5c | 63 72 0a 43 44 53 5f 44 |/frame)\|cr.CDS_D|
|000041f0| 41 54 41 5f 31 26 20 64 | 61 74 61 20 64 69 73 63 |ATA_1& d|ata disc|
|00004200| 2c 20 6d 6f 64 65 20 31 | 20 28 32 30 34 38 20 75 |, mode 1| (2048 u|
|00004210| 73 65 72 20 62 79 74 65 | 73 2f 66 72 61 6d 65 29 |ser byte|s/frame)|
|00004220| 5c 63 72 0a 43 44 53 5f | 44 41 54 41 5f 32 26 20 |\cr.CDS_|DATA_2& |
|00004230| 64 61 74 61 20 64 69 73 | 63 2c 20 6d 6f 64 65 20 |data dis|c, mode |
|00004240| 32 20 28 32 33 33 36 20 | 75 73 65 72 20 62 79 74 |2 (2336 |user byt|
|00004250| 65 73 2f 66 72 61 6d 65 | 29 5c 63 72 0a 43 44 53 |es/frame|)\cr.CDS|
|00004260| 5f 58 41 5f 32 5f 31 26 | 20 6d 69 78 65 64 20 64 |_XA_2_1&| mixed d|
|00004270| 61 74 61 20 28 58 41 29 | 2c 20 6d 6f 64 65 20 32 |ata (XA)|, mode 2|
|00004280| 2c 20 66 6f 72 6d 20 31 | 20 28 32 30 34 38 20 75 |, form 1| (2048 u|
|00004290| 73 65 72 20 62 79 74 65 | 73 29 5c 63 72 0a 43 44 |ser byte|s)\cr.CD|
|000042a0| 53 5f 58 41 5f 32 5f 32 | 26 20 6d 69 78 65 64 20 |S_XA_2_2|& mixed |
|000042b0| 64 61 74 61 20 28 58 41 | 29 2c 20 6d 6f 64 65 20 |data (XA|), mode |
|000042c0| 32 2c 20 66 6f 72 6d 20 | 31 20 28 32 33 32 34 20 |2, form |1 (2324 |
|000042d0| 20 75 73 65 72 20 62 79 | 74 65 73 29 5c 63 72 0a | user by|tes)\cr.|
|000042e0| 7d 0a 24 24 0a 41 73 20 | 66 61 72 20 61 73 20 49 |}.$$.As |far as I|
|000042f0| 20 6b 6e 6f 77 2c 20 5c | 63 64 72 6f 6d 20 73 20 | know, \|cdrom s |
|00004300| 61 72 65 20 61 6c 77 61 | 79 73 20 6f 66 20 74 79 |are alwa|ys of ty|
|00004310| 70 65 20 24 43 44 53 5f | 44 41 54 41 5f 31 24 2e |pe $CDS_|DATA_1$.|
|00004320| 20 46 6f 72 0a 73 6f 6d | 65 20 69 6e 66 6f 72 6d | For.som|e inform|
|00004330| 61 74 69 6f 6e 20 63 6f | 6e 63 65 72 6e 69 6e 67 |ation co|ncerning|
|00004340| 20 66 72 61 6d 65 20 6c | 61 79 6f 75 74 20 6f 66 | frame l|ayout of|
|00004350| 20 74 68 65 20 76 61 72 | 69 6f 75 73 20 64 69 73 | the var|ious dis|
|00004360| 63 20 74 79 70 65 73 2c | 20 73 65 65 0a 61 20 72 |c types,| see.a r|
|00004370| 65 63 65 6e 74 20 76 65 | 72 73 69 6f 6e 20 6f 66 |ecent ve|rsion of|
|00004380| 20 7b 5c 74 74 20 63 64 | 72 6f 6d 2e 68 7d 2e 20 | {\tt cd|rom.h}. |
|00004390| 0a 0a 5c 73 75 62 73 65 | 63 74 69 6f 6e 7b 24 4d |..\subse|ction{$M|
|000043a0| 65 64 69 61 5f 63 68 61 | 6e 67 65 64 28 64 65 76 |edia_cha|nged(dev|
|000043b0| 5c 5f 74 5c 20 64 65 76 | 29 24 7d 0a 0a 54 68 69 |\_t\ dev|)$}..Thi|
|000043c0| 73 20 66 75 6e 63 74 69 | 6f 6e 20 69 73 20 76 65 |s functi|on is ve|
|000043d0| 72 79 20 73 69 6d 69 6c | 61 72 20 74 6f 20 74 68 |ry simil|ar to th|
|000043e0| 65 20 6f 72 69 67 69 6e | 61 6c 20 66 75 6e 63 74 |e origin|al funct|
|000043f0| 69 6f 6e 20 69 6e 20 24 | 73 74 72 75 63 74 5c 0a |ion in $|struct\.|
|00004400| 66 69 6c 65 5f 6f 70 65 | 72 61 74 69 6f 6e 73 24 |file_ope|rations$|
|00004410| 2e 20 49 74 20 72 65 74 | 75 72 6e 73 20 31 20 69 |. It ret|urns 1 i|
|00004420| 66 20 74 68 65 20 6d 65 | 64 69 75 6d 20 6f 66 20 |f the me|dium of |
|00004430| 74 68 65 20 64 65 76 69 | 63 65 20 24 64 65 76 24 |the devi|ce $dev$|
|00004440| 20 68 61 73 0a 63 68 61 | 6e 67 65 64 20 73 69 6e | has.cha|nged sin|
|00004450| 63 65 20 74 68 65 20 6c | 61 73 74 20 63 61 6c 6c |ce the l|ast call|
|00004460| 2c 20 61 6e 64 20 30 20 | 6f 74 68 65 72 77 69 73 |, and 0 |otherwis|
|00004470| 65 2e 20 4e 6f 74 65 20 | 74 68 61 74 20 62 79 20 |e. Note |that by |
|00004480| 60 72 65 2d 72 6f 75 74 | 69 6e 67 27 0a 74 68 69 |`re-rout|ing'.thi|
|00004490| 73 20 66 75 6e 63 74 69 | 6f 6e 20 74 68 72 6f 75 |s functi|on throu|
|000044a0| 67 68 20 24 63 64 72 6f | 6d 5f 6d 65 64 69 61 5f |gh $cdro|m_media_|
|000044b0| 63 68 61 6e 67 65 64 28 | 29 24 2c 20 77 65 20 63 |changed(|)$, we c|
|000044c0| 61 6e 20 69 6d 70 6c 65 | 6d 65 6e 74 0a 73 65 70 |an imple|ment.sep|
|000044d0| 61 72 61 74 65 20 71 75 | 65 75 65 73 20 66 6f 72 |arate qu|eues for|
|000044e0| 20 74 68 65 20 56 46 53 | 20 61 6e 64 20 61 20 6e | the VFS| and a n|
|000044f0| 65 77 20 24 69 6f 63 74 | 6c 28 29 24 20 66 75 6e |ew $ioct|l()$ fun|
|00004500| 63 74 69 6f 6e 20 74 68 | 61 74 20 63 61 6e 0a 72 |ction th|at can.r|
|00004510| 65 70 6f 72 74 20 64 65 | 76 69 63 65 20 63 68 61 |eport de|vice cha|
|00004520| 6e 67 65 73 20 74 6f 20 | 73 6f 66 74 77 61 72 65 |nges to |software|
|00004530| 20 28 65 2e 67 2e 2c 20 | 61 6e 20 61 75 74 6f 2d | (e.g., |an auto-|
|00004540| 6d 6f 75 6e 74 69 6e 67 | 20 64 61 65 6d 6f 6e 29 |mounting| daemon)|
|00004550| 2e 20 0a 0a 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |. ..\sub|section{|
|00004560| 24 54 72 61 79 5f 6d 6f | 76 65 28 6b 64 65 76 5f |$Tray_mo|ve(kdev_|
|00004570| 74 5c 20 64 65 76 2c 20 | 69 6e 74 5c 20 70 6f 73 |t\ dev, |int\ pos|
|00004580| 69 74 69 6f 6e 29 24 7d | 0a 0a 54 68 69 73 20 66 |ition)$}|..This f|
|00004590| 75 6e 63 74 69 6f 6e 2c | 20 69 66 20 69 6d 70 6c |unction,| if impl|
|000045a0| 65 6d 65 6e 74 65 64 2c | 20 73 68 6f 75 6c 64 20 |emented,| should |
|000045b0| 63 6f 6e 74 72 6f 6c 20 | 74 68 65 20 74 72 61 79 |control |the tray|
|000045c0| 20 6d 6f 76 65 6d 65 6e | 74 2e 20 28 4e 6f 0a 6f | movemen|t. (No.o|
|000045d0| 74 68 65 72 20 66 75 6e | 63 74 69 6f 6e 20 73 68 |ther fun|ction sh|
|000045e0| 6f 75 6c 64 20 63 6f 6e | 74 72 6f 6c 20 74 68 69 |ould con|trol thi|
|000045f0| 73 2e 29 20 54 68 65 20 | 70 61 72 61 6d 65 74 65 |s.) The |paramete|
|00004600| 72 20 24 70 6f 73 69 74 | 69 6f 6e 24 20 63 6f 6e |r $posit|ion$ con|
|00004610| 74 72 6f 6c 73 0a 74 68 | 65 20 64 65 73 69 72 65 |trols.th|e desire|
|00004620| 64 20 64 69 72 65 63 74 | 69 6f 6e 20 6f 66 20 6d |d direct|ion of m|
|00004630| 6f 76 65 6d 65 6e 74 3a | 0a 5c 62 65 67 69 6e 7b |ovement:|.\begin{|
|00004640| 69 74 65 6d 69 7a 65 7d | 0a 5c 69 74 65 6d 5b 30 |itemize}|.\item[0|
|00004650| 5d 20 43 6c 6f 73 65 20 | 74 72 61 79 0a 5c 69 74 |] Close |tray.\it|
|00004660| 65 6d 5b 31 5d 20 4f 70 | 65 6e 20 74 72 61 79 0a |em[1] Op|en tray.|
|00004670| 5c 65 6e 64 7b 69 74 65 | 6d 69 7a 65 7d 0a 54 68 |\end{ite|mize}.Th|
|00004680| 69 73 20 66 75 6e 63 74 | 69 6f 6e 20 72 65 74 75 |is funct|ion retu|
|00004690| 72 6e 73 20 30 20 75 70 | 6f 6e 20 73 75 63 63 65 |rns 0 up|on succe|
|000046a0| 73 73 2c 20 61 6e 64 20 | 61 20 6e 6f 6e 2d 7a 65 |ss, and |a non-ze|
|000046b0| 72 6f 20 76 61 6c 75 65 | 20 75 70 6f 6e 0a 65 72 |ro value| upon.er|
|000046c0| 72 6f 72 2e 20 4e 6f 74 | 65 20 74 68 61 74 20 69 |ror. Not|e that i|
|000046d0| 66 20 74 68 65 20 74 72 | 61 79 20 69 73 20 61 6c |f the tr|ay is al|
|000046e0| 72 65 61 64 79 20 69 6e | 20 74 68 65 20 64 65 73 |ready in| the des|
|000046f0| 69 72 65 64 20 70 6f 73 | 69 74 69 6f 6e 2c 20 6e |ired pos|ition, n|
|00004700| 6f 0a 61 63 74 69 6f 6e | 20 6e 65 65 64 20 62 65 |o.action| need be|
|00004710| 20 74 61 6b 65 6e 2c 20 | 61 6e 64 20 74 68 65 20 | taken, |and the |
|00004720| 72 65 74 75 72 6e 20 76 | 61 6c 75 65 20 73 68 6f |return v|alue sho|
|00004730| 75 6c 64 20 62 65 20 30 | 2e 20 0a 0a 5c 73 75 62 |uld be 0|. ..\sub|
|00004740| 73 65 63 74 69 6f 6e 7b | 24 4c 6f 63 6b 5f 64 6f |section{|$Lock_do|
|00004750| 6f 72 28 6b 64 65 76 5f | 74 5c 20 64 65 76 2c 20 |or(kdev_|t\ dev, |
|00004760| 69 6e 74 5c 20 6c 6f 63 | 6b 29 24 7d 0a 0a 54 68 |int\ loc|k)$}..Th|
|00004770| 69 73 20 66 75 6e 63 74 | 69 6f 6e 20 28 61 6e 64 |is funct|ion (and|
|00004780| 20 6e 6f 20 6f 74 68 65 | 72 20 63 6f 64 65 29 20 | no othe|r code) |
|00004790| 63 6f 6e 74 72 6f 6c 73 | 20 6c 6f 63 6b 69 6e 67 |controls| locking|
|000047a0| 20 6f 66 20 74 68 65 20 | 64 6f 6f 72 2c 20 69 66 | of the |door, if|
|000047b0| 20 74 68 65 0a 64 72 69 | 76 65 20 61 6c 6c 6f 77 | the.dri|ve allow|
|000047c0| 73 20 74 68 69 73 2e 20 | 54 68 65 20 76 61 6c 75 |s this. |The valu|
|000047d0| 65 20 6f 66 20 24 6c 6f | 63 6b 24 20 63 6f 6e 74 |e of $lo|ck$ cont|
|000047e0| 72 6f 6c 73 20 74 68 65 | 20 64 65 73 69 72 65 64 |rols the| desired|
|000047f0| 20 6c 6f 63 6b 69 6e 67 | 0a 73 74 61 74 65 3a 0a | locking|.state:.|
|00004800| 5c 62 65 67 69 6e 7b 69 | 74 65 6d 69 7a 65 7d 0a |\begin{i|temize}.|
|00004810| 5c 69 74 65 6d 5b 30 5d | 20 55 6e 6c 6f 63 6b 20 |\item[0]| Unlock |
|00004820| 64 6f 6f 72 2c 20 6d 61 | 6e 75 61 6c 20 6f 70 65 |door, ma|nual ope|
|00004830| 6e 69 6e 67 20 69 73 20 | 61 6c 6c 6f 77 65 64 0a |ning is |allowed.|
|00004840| 5c 69 74 65 6d 5b 31 5d | 20 4c 6f 63 6b 20 64 6f |\item[1]| Lock do|
|00004850| 6f 72 2c 20 74 72 61 79 | 20 63 61 6e 6e 6f 74 20 |or, tray| cannot |
|00004860| 62 65 20 65 6a 65 63 74 | 65 64 20 6d 61 6e 75 61 |be eject|ed manua|
|00004870| 6c 6c 79 0a 5c 65 6e 64 | 7b 69 74 65 6d 69 7a 65 |lly.\end|{itemize|
|00004880| 7d 0a 52 65 74 75 72 6e | 20 76 61 6c 75 65 73 20 |}.Return| values |
|00004890| 61 72 65 20 61 73 20 66 | 6f 72 20 24 74 72 61 79 |are as f|or $tray|
|000048a0| 5f 6d 6f 76 65 28 29 24 | 2e 0a 0a 5c 73 75 62 73 |_move()$|...\subs|
|000048b0| 65 63 74 69 6f 6e 7b 24 | 53 65 6c 65 63 74 5f 73 |ection{$|Select_s|
|000048c0| 70 65 65 64 28 6b 64 65 | 76 5f 74 5c 20 64 65 76 |peed(kde|v_t\ dev|
|000048d0| 2c 20 69 6e 74 5c 20 73 | 70 65 65 64 29 24 7d 0a |, int\ s|peed)$}.|
|000048e0| 0a 41 6c 74 68 6f 75 67 | 68 20 6e 6f 6e 65 20 6f |.Althoug|h none o|
|000048f0| 66 20 74 68 65 20 64 72 | 69 76 65 72 73 20 68 61 |f the dr|ivers ha|
|00004900| 73 20 69 6d 70 6c 65 6d | 65 6e 74 65 64 20 74 68 |s implem|ented th|
|00004910| 69 73 20 66 75 6e 63 74 | 69 6f 6e 20 73 6f 20 66 |is funct|ion so f|
|00004920| 61 72 2c 0a 73 6f 6d 65 | 20 64 72 69 76 65 73 20 |ar,.some| drives |
|00004930| 61 72 65 20 63 61 70 61 | 62 6c 65 20 6f 66 20 68 |are capa|ble of h|
|00004940| 65 61 64 2d 73 70 65 65 | 64 20 73 65 6c 65 63 74 |ead-spee|d select|
|00004950| 69 6f 6e 2c 20 61 6e 64 | 20 68 65 6e 63 65 20 74 |ion, and| hence t|
|00004960| 68 69 73 20 69 73 20 61 | 0a 63 61 70 61 62 69 6c |his is a|.capabil|
|00004970| 69 74 79 20 74 68 61 74 | 20 73 68 6f 75 6c 64 20 |ity that| should |
|00004980| 62 65 20 73 74 61 6e 64 | 61 72 64 69 7a 65 64 20 |be stand|ardized |
|00004990| 74 68 72 6f 75 67 68 20 | 61 20 66 75 6e 63 74 69 |through |a functi|
|000049a0| 6f 6e 20 69 6e 20 74 68 | 65 0a 64 65 76 69 63 65 |on in th|e.device|
|000049b0| 2d 6f 70 65 72 61 74 69 | 6f 6e 73 20 73 74 72 75 |-operati|ons stru|
|000049c0| 63 74 75 72 65 2e 20 54 | 68 69 73 20 66 75 6e 63 |cture. T|his func|
|000049d0| 74 69 6f 6e 20 73 68 6f | 75 6c 64 20 73 65 6c 65 |tion sho|uld sele|
|000049e0| 63 74 20 74 68 65 20 73 | 70 65 65 64 20 61 74 0a |ct the s|peed at.|
|000049f0| 77 68 69 63 68 20 64 61 | 74 61 20 69 73 20 72 65 |which da|ta is re|
|00004a00| 61 64 20 6f 72 20 61 75 | 64 69 6f 20 69 73 20 70 |ad or au|dio is p|
|00004a10| 6c 61 79 65 64 20 62 61 | 63 6b 2e 20 54 68 65 20 |layed ba|ck. The |
|00004a20| 73 70 65 63 69 61 6c 20 | 76 61 6c 75 65 20 60 30 |special |value `0|
|00004a30| 27 0a 6d 65 61 6e 73 20 | 60 61 75 74 6f 2d 73 65 |'.means |`auto-se|
|00004a40| 6c 65 63 74 69 6f 6e 27 | 2c 20 69 2e 65 2e 2c 20 |lection'|, i.e., |
|00004a50| 6d 61 78 69 6d 75 6d 20 | 64 61 74 61 2d 72 61 74 |maximum |data-rat|
|00004a60| 65 20 6f 72 20 72 65 61 | 6c 2d 74 69 6d 65 20 61 |e or rea|l-time a|
|00004a70| 75 64 69 6f 0a 72 61 74 | 65 2e 20 49 66 20 74 68 |udio.rat|e. If th|
|00004a80| 65 20 64 72 69 76 65 20 | 64 6f 65 73 6e 27 74 20 |e drive |doesn't |
|00004a90| 68 61 76 65 20 74 68 69 | 73 20 60 61 75 74 6f 2d |have thi|s `auto-|
|00004aa0| 73 65 6c 65 63 74 69 6f | 6e 27 20 63 61 70 61 62 |selectio|n' capab|
|00004ab0| 69 6c 69 74 79 2c 20 74 | 68 65 0a 64 65 63 69 73 |ility, t|he.decis|
|00004ac0| 69 6f 6e 20 73 68 6f 75 | 6c 64 20 62 65 20 6d 61 |ion shou|ld be ma|
|00004ad0| 64 65 20 6f 6e 20 74 68 | 65 20 63 75 72 72 65 6e |de on th|e curren|
|00004ae0| 74 20 64 69 73 63 20 6c | 6f 61 64 65 64 20 61 6e |t disc l|oaded an|
|00004af0| 64 20 74 68 65 20 72 65 | 74 75 72 6e 0a 76 61 6c |d the re|turn.val|
|00004b00| 75 65 20 73 68 6f 75 6c | 64 20 62 65 20 70 6f 73 |ue shoul|d be pos|
|00004b10| 69 74 69 76 65 2e 20 41 | 20 6e 65 67 61 74 69 76 |itive. A| negativ|
|00004b20| 65 20 72 65 74 75 72 6e | 20 76 61 6c 75 65 20 69 |e return| value i|
|00004b30| 6e 64 69 63 61 74 65 73 | 20 61 6e 0a 65 72 72 6f |ndicates| an.erro|
|00004b40| 72 2e 20 28 41 6c 74 68 | 6f 75 67 68 20 74 68 65 |r. (Alth|ough the|
|00004b50| 20 61 75 64 69 6f 2d 6c | 6f 77 2d 70 61 73 73 20 | audio-l|ow-pass |
|00004b60| 66 69 6c 74 65 72 73 20 | 70 72 6f 62 61 62 6c 79 |filters |probably|
|00004b70| 20 61 72 65 6e 27 74 20 | 64 65 73 69 67 6e 65 64 | aren't |designed|
|00004b80| 0a 66 6f 72 20 69 74 2c | 20 6d 6f 72 65 20 74 68 |.for it,| more th|
|00004b90| 61 6e 20 72 65 61 6c 2d | 74 69 6d 65 20 70 6c 61 |an real-|time pla|
|00004ba0| 79 62 61 63 6b 20 6f 66 | 20 61 75 64 69 6f 20 6d |yback of| audio m|
|00004bb0| 69 67 68 74 20 62 65 20 | 75 73 65 64 20 66 6f 72 |ight be |used for|
|00004bc0| 0a 68 69 67 68 2d 73 70 | 65 65 64 20 63 6f 70 79 |.high-sp|eed copy|
|00004bd0| 69 6e 67 20 6f 66 20 61 | 75 64 69 6f 20 74 72 61 |ing of a|udio tra|
|00004be0| 63 6b 73 29 2e 20 42 61 | 64 6c 79 20 70 72 65 73 |cks). Ba|dly pres|
|00004bf0| 73 65 64 20 5c 63 64 72 | 6f 6d 20 73 20 6d 61 79 |sed \cdr|om s may|
|00004c00| 0a 62 65 6e 65 66 69 74 | 20 66 72 6f 6d 20 6c 65 |.benefit| from le|
|00004c10| 73 73 2d 74 68 61 6e 2d | 6d 61 78 69 6d 75 6d 20 |ss-than-|maximum |
|00004c20| 68 65 61 64 20 72 61 74 | 65 2e 0a 0a 5c 73 75 62 |head rat|e...\sub|
|00004c30| 73 65 63 74 69 6f 6e 7b | 24 53 65 6c 65 63 74 5f |section{|$Select_|
|00004c40| 64 69 73 63 28 6b 64 65 | 76 5f 74 5c 20 64 65 76 |disc(kde|v_t\ dev|
|00004c50| 2c 20 69 6e 74 5c 20 6e | 75 6d 62 65 72 29 24 7d |, int\ n|umber)$}|
|00004c60| 0a 0a 49 66 20 74 68 65 | 20 64 72 69 76 65 20 63 |..If the| drive c|
|00004c70| 61 6e 20 73 74 6f 72 65 | 20 6d 75 6c 74 69 70 6c |an store| multipl|
|00004c80| 65 20 64 69 73 63 73 20 | 28 61 20 6a 75 6b 65 2d |e discs |(a juke-|
|00004c90| 62 6f 78 29 2c 20 69 74 | 20 69 73 20 6c 69 6b 65 |box), it| is like|
|00004ca0| 6c 79 20 74 68 61 74 0a | 61 20 64 69 73 63 20 73 |ly that.|a disc s|
|00004cb0| 65 6c 65 63 74 69 6f 6e | 20 63 61 6e 20 62 65 20 |election| can be |
|00004cc0| 6d 61 64 65 20 62 79 20 | 73 6f 66 74 77 61 72 65 |made by |software|
|00004cd0| 2e 20 54 68 69 73 20 66 | 75 6e 63 74 69 6f 6e 20 |. This f|unction |
|00004ce0| 73 68 6f 75 6c 64 20 70 | 65 72 66 6f 72 6d 0a 64 |should p|erform.d|
|00004cf0| 69 73 63 20 73 65 6c 65 | 63 74 69 6f 6e 2e 20 49 |isc sele|ction. I|
|00004d00| 74 20 73 68 6f 75 6c 64 | 20 72 65 74 75 72 6e 20 |t should| return |
|00004d10| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 74 68 |the numb|er of th|
|00004d20| 65 20 73 65 6c 65 63 74 | 65 64 20 64 69 73 63 20 |e select|ed disc |
|00004d30| 6f 6e 0a 73 75 63 63 65 | 73 73 2c 20 61 20 6e 65 |on.succe|ss, a ne|
|00004d40| 67 61 74 69 76 65 20 76 | 61 6c 75 65 20 6f 6e 20 |gative v|alue on |
|00004d50| 65 72 72 6f 72 2e 20 43 | 75 72 72 65 6e 74 6c 79 |error. C|urrently|
|00004d60| 2c 20 6e 6f 6e 65 20 6f | 66 20 74 68 65 20 5c 6c |, none o|f the \l|
|00004d70| 69 6e 75 78 5c 20 0a 5c | 63 64 72 6f 6d 5c 20 64 |inux\ .\|cdrom\ d|
|00004d80| 72 69 76 65 72 73 20 61 | 70 70 65 61 72 73 20 74 |rivers a|ppears t|
|00004d90| 6f 20 73 75 70 70 6f 72 | 74 20 73 75 63 68 20 66 |o suppor|t such f|
|00004da0| 75 6e 63 74 69 6f 6e 61 | 6c 69 74 79 2c 20 62 75 |unctiona|lity, bu|
|00004db0| 74 20 69 74 20 69 73 20 | 64 65 66 69 6e 65 64 0a |t it is |defined.|
|00004dc0| 68 65 72 65 20 66 6f 72 | 20 66 75 74 75 72 65 20 |here for| future |
|00004dd0| 70 75 72 70 6f 73 65 73 | 2e 0a 0a 5c 73 75 62 73 |purposes|...\subs|
|00004de0| 65 63 74 69 6f 6e 7b 24 | 47 65 74 5f 6c 61 73 74 |ection{$|Get_last|
|00004df0| 5f 73 65 73 73 69 6f 6e | 28 6b 64 65 76 5f 74 5c |_session|(kdev_t\|
|00004e00| 20 64 65 76 2c 20 73 74 | 72 75 63 74 5c 20 63 64 | dev, st|ruct\ cd|
|00004e10| 72 6f 6d 5f 6d 75 6c 74 | 69 73 65 73 73 69 6f 6e |rom_mult|isession|
|00004e20| 20 2a 0a 6d 73 5f 69 6e | 66 6f 29 24 7d 0a 0a 54 | *.ms_in|fo)$}..T|
|00004e30| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 73 68 6f |his func|tion sho|
|00004e40| 75 6c 64 20 69 6d 70 6c | 65 6d 65 6e 74 20 74 68 |uld impl|ement th|
|00004e50| 65 20 6f 6c 64 20 63 6f | 72 72 65 73 70 6f 6e 64 |e old co|rrespond|
|00004e60| 69 6e 67 20 24 69 6f 63 | 74 6c 28 29 24 2e 20 46 |ing $ioc|tl()$. F|
|00004e70| 6f 72 0a 64 65 76 69 63 | 65 20 24 64 65 76 24 2c |or.devic|e $dev$,|
|00004e80| 20 74 68 65 20 73 74 61 | 72 74 20 6f 66 20 74 68 | the sta|rt of th|
|00004e90| 65 20 6c 61 73 74 20 73 | 65 73 73 69 6f 6e 20 6f |e last s|ession o|
|00004ea0| 66 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 64 69 |f the cu|rrent di|
|00004eb0| 73 63 20 73 68 6f 75 6c | 64 0a 62 65 20 72 65 74 |sc shoul|d.be ret|
|00004ec0| 75 72 6e 65 64 20 69 6e | 20 74 68 65 20 70 6f 69 |urned in| the poi|
|00004ed0| 6e 74 65 72 20 61 72 67 | 75 6d 65 6e 74 20 24 6d |nter arg|ument $m|
|00004ee0| 73 5f 69 6e 66 6f 24 2e | 20 4e 6f 74 65 20 74 68 |s_info$.| Note th|
|00004ef0| 61 74 20 72 6f 75 74 69 | 6e 65 73 20 69 6e 20 5c |at routi|nes in \|
|00004f00| 63 64 72 6f 6d 63 5c 20 | 68 61 76 65 20 73 61 6e |cdromc\ |have san|
|00004f10| 69 74 69 7a 65 64 20 74 | 68 69 73 20 61 72 67 75 |itized t|his argu|
|00004f20| 6d 65 6e 74 3a 20 69 74 | 73 0a 72 65 71 75 65 73 |ment: it|s.reques|
|00004f30| 74 65 64 20 66 6f 72 6d | 61 74 20 77 69 6c 6c 20 |ted form|at will |
|00004f40| 7b 5c 65 6d 20 61 6c 77 | 61 79 73 5c 2f 7d 20 62 |{\em alw|ays\/} b|
|00004f50| 65 20 6f 66 20 74 68 65 | 20 74 79 70 65 20 24 43 |e of the| type $C|
|00004f60| 44 52 4f 4d 5f 4c 42 41 | 24 0a 28 6c 69 6e 65 61 |DROM_LBA|$.(linea|
|00004f70| 72 20 62 6c 6f 63 6b 20 | 61 64 64 72 65 73 73 69 |r block |addressi|
|00004f80| 6e 67 20 6d 6f 64 65 29 | 2c 20 77 68 61 74 65 76 |ng mode)|, whatev|
|00004f90| 65 72 20 74 68 65 20 63 | 61 6c 6c 69 6e 67 20 73 |er the c|alling s|
|00004fa0| 6f 66 74 77 61 72 65 0a | 72 65 71 75 65 73 74 65 |oftware.|requeste|
|00004fb0| 64 2e 20 42 75 74 20 73 | 61 6e 69 74 69 7a 61 74 |d. But s|anitizat|
|00004fc0| 69 6f 6e 20 67 6f 65 73 | 20 65 76 65 6e 20 66 75 |ion goes| even fu|
|00004fd0| 72 74 68 65 72 3a 20 74 | 68 65 20 6c 6f 77 2d 6c |rther: t|he low-l|
|00004fe0| 65 76 65 6c 0a 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |evel.imp|lementat|
|00004ff0| 69 6f 6e 20 6d 61 79 20 | 72 65 74 75 72 6e 20 74 |ion may |return t|
|00005000| 68 65 20 72 65 71 75 65 | 73 74 65 64 20 69 6e 66 |he reque|sted inf|
|00005010| 6f 72 6d 61 74 69 6f 6e | 20 69 6e 20 24 43 44 52 |ormation| in $CDR|
|00005020| 4f 4d 5f 4d 53 46 24 0a | 66 6f 72 6d 61 74 20 69 |OM_MSF$.|format i|
|00005030| 66 20 69 74 20 77 69 73 | 68 65 73 20 73 6f 20 28 |f it wis|hes so (|
|00005040| 73 65 74 74 69 6e 67 20 | 74 68 65 20 24 6d 73 5f |setting |the $ms_|
|00005050| 69 6e 66 6f 5c 72 69 67 | 68 74 61 72 72 6f 77 20 |info\rig|htarrow |
|00005060| 61 64 64 72 5f 66 6f 72 | 6d 61 74 24 0a 66 69 65 |addr_for|mat$.fie|
|00005070| 6c 64 20 61 70 70 72 6f | 70 72 69 61 74 65 6c 79 |ld appro|priately|
|00005080| 2c 20 6f 66 20 63 6f 75 | 72 73 65 29 20 61 6e 64 |, of cou|rse) and|
|00005090| 20 74 68 65 20 72 6f 75 | 74 69 6e 65 73 20 69 6e | the rou|tines in|
|000050a0| 20 5c 63 64 72 6f 6d 63 | 5c 20 77 69 6c 6c 20 6d | \cdromc|\ will m|
|000050b0| 61 6b 65 0a 74 68 65 20 | 74 72 61 6e 73 66 6f 72 |ake.the |transfor|
|000050c0| 6d 20 69 66 20 6e 65 63 | 65 73 73 61 72 79 2e 20 |m if nec|essary. |
|000050d0| 54 68 65 20 72 65 74 75 | 72 6e 20 76 61 6c 75 65 |The retu|rn value|
|000050e0| 20 69 73 20 30 20 75 70 | 6f 6e 20 73 75 63 63 65 | is 0 up|on succe|
|000050f0| 73 73 2e 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |ss...\su|bsection|
|00005100| 7b 24 47 65 74 5f 6d 63 | 6e 28 6b 64 65 76 5f 74 |{$Get_mc|n(kdev_t|
|00005110| 5c 20 64 65 76 2c 20 73 | 74 72 75 63 74 5c 20 63 |\ dev, s|truct\ c|
|00005120| 64 72 6f 6d 5f 6d 63 6e | 20 2a 20 6d 63 6e 29 24 |drom_mcn| * mcn)$|
|00005130| 7d 0a 0a 53 6f 6d 65 20 | 64 69 73 63 73 20 63 61 |}..Some |discs ca|
|00005140| 72 72 79 20 61 20 60 4d | 65 64 69 61 20 43 61 74 |rry a `M|edia Cat|
|00005150| 61 6c 6f 67 20 4e 75 6d | 62 65 72 27 20 28 4d 43 |alog Num|ber' (MC|
|00005160| 4e 29 2c 20 61 6c 73 6f | 20 63 61 6c 6c 65 64 0a |N), also| called.|
|00005170| 60 55 6e 69 76 65 72 73 | 61 6c 20 50 72 6f 64 75 |`Univers|al Produ|
|00005180| 63 74 20 43 6f 64 65 27 | 20 28 55 50 43 29 2e 20 |ct Code'| (UPC). |
|00005190| 54 68 69 73 20 6e 75 6d | 62 65 72 20 73 68 6f 75 |This num|ber shou|
|000051a0| 6c 64 20 72 65 66 6c 65 | 63 74 20 74 68 65 20 6e |ld refle|ct the n|
|000051b0| 75 6d 62 65 72 20 74 68 | 61 74 0a 69 73 20 67 65 |umber th|at.is ge|
|000051c0| 6e 65 72 61 6c 6c 79 20 | 66 6f 75 6e 64 20 69 6e |nerally |found in|
|000051d0| 20 74 68 65 20 62 61 72 | 2d 63 6f 64 65 20 6f 6e | the bar|-code on|
|000051e0| 20 74 68 65 20 70 72 6f | 64 75 63 74 2e 20 55 6e | the pro|duct. Un|
|000051f0| 66 6f 72 74 75 6e 61 74 | 65 6c 79 2c 20 74 68 65 |fortunat|ely, the|
|00005200| 0a 66 65 77 20 64 69 73 | 63 73 20 74 68 61 74 20 |.few dis|cs that |
|00005210| 63 61 72 72 79 20 73 75 | 63 68 20 61 20 6e 75 6d |carry su|ch a num|
|00005220| 62 65 72 20 6f 6e 20 74 | 68 65 20 64 69 73 63 20 |ber on t|he disc |
|00005230| 64 6f 6e 27 74 20 65 76 | 65 6e 20 75 73 65 20 74 |don't ev|en use t|
|00005240| 68 65 20 73 61 6d 65 0a | 66 6f 72 6d 61 74 2e 20 |he same.|format. |
|00005250| 54 68 65 20 72 65 74 75 | 72 6e 20 61 72 67 75 6d |The retu|rn argum|
|00005260| 65 6e 74 20 74 6f 20 74 | 68 69 73 20 66 75 6e 63 |ent to t|his func|
|00005270| 74 69 6f 6e 20 69 73 20 | 61 20 70 6f 69 6e 74 65 |tion is |a pointe|
|00005280| 72 20 74 6f 20 61 0a 70 | 72 65 2d 64 65 63 6c 61 |r to a.p|re-decla|
|00005290| 72 65 64 20 6d 65 6d 6f | 72 79 20 72 65 67 69 6f |red memo|ry regio|
|000052a0| 6e 20 6f 66 20 74 79 70 | 65 20 24 73 74 72 75 63 |n of typ|e $struc|
|000052b0| 74 5c 20 63 64 72 6f 6d | 5f 6d 63 6e 24 2e 20 54 |t\ cdrom|_mcn$. T|
|000052c0| 68 65 20 4d 43 4e 20 69 | 73 0a 65 78 70 65 63 74 |he MCN i|s.expect|
|000052d0| 65 64 20 61 73 20 61 20 | 31 33 2d 63 68 61 72 61 |ed as a |13-chara|
|000052e0| 63 74 65 72 20 73 74 72 | 69 6e 67 2c 20 74 65 72 |cter str|ing, ter|
|000052f0| 6d 69 6e 61 74 65 64 20 | 62 79 20 61 20 6e 75 6c |minated |by a nul|
|00005300| 6c 2d 63 68 61 72 61 63 | 74 65 72 2e 0a 0a 5c 73 |l-charac|ter...\s|
|00005310| 75 62 73 65 63 74 69 6f | 6e 7b 24 52 65 73 65 74 |ubsectio|n{$Reset|
|00005320| 28 6b 64 65 76 5f 74 20 | 64 65 76 29 24 7d 0a 0a |(kdev_t |dev)$}..|
|00005330| 54 68 69 73 20 63 61 6c | 6c 20 73 68 6f 75 6c 64 |This cal|l should|
|00005340| 20 69 6d 70 6c 65 6d 65 | 6e 74 20 68 61 72 64 2d | impleme|nt hard-|
|00005350| 72 65 73 65 74 74 69 6e | 67 20 74 68 65 20 64 72 |resettin|g the dr|
|00005360| 69 76 65 20 28 61 6c 74 | 68 6f 75 67 68 20 69 6e |ive (alt|hough in|
|00005370| 0a 63 69 72 63 75 6d 73 | 74 61 6e 63 65 73 20 74 |.circums|tances t|
|00005380| 68 61 74 20 61 20 68 61 | 72 64 2d 72 65 73 65 74 |hat a ha|rd-reset|
|00005390| 20 69 73 20 6e 65 63 65 | 73 73 61 72 79 2c 20 61 | is nece|ssary, a|
|000053a0| 20 64 72 69 76 65 20 6d | 61 79 20 76 65 72 79 20 | drive m|ay very |
|000053b0| 77 65 6c 6c 0a 6e 6f 74 | 20 6c 69 73 74 65 6e 20 |well.not| listen |
|000053c0| 74 6f 20 63 6f 6d 6d 61 | 6e 64 73 20 61 6e 79 6d |to comma|nds anym|
|000053d0| 6f 72 65 29 2e 20 50 72 | 65 66 65 72 61 62 6c 79 |ore). Pr|eferably|
|000053e0| 2c 20 63 6f 6e 74 72 6f | 6c 20 69 73 20 72 65 74 |, contro|l is ret|
|000053f0| 75 72 6e 65 64 20 74 6f | 20 74 68 65 0a 63 61 6c |urned to| the.cal|
|00005400| 6c 65 72 20 6f 6e 6c 79 | 20 61 66 74 65 72 20 74 |ler only| after t|
|00005410| 68 65 20 64 72 69 76 65 | 20 68 61 73 20 66 69 6e |he drive| has fin|
|00005420| 69 73 68 65 64 20 72 65 | 73 65 74 74 69 6e 67 2e |ished re|setting.|
|00005430| 0a 0a 5c 73 75 62 73 65 | 63 74 69 6f 6e 7b 24 41 |..\subse|ction{$A|
|00005440| 75 64 69 6f 5f 69 6f 63 | 74 6c 28 6b 64 65 76 5f |udio_ioc|tl(kdev_|
|00005450| 74 5c 20 64 65 76 2c 20 | 75 6e 73 69 67 6e 65 64 |t\ dev, |unsigned|
|00005460| 5c 20 69 6e 74 5c 20 63 | 6d 64 2c 20 76 6f 69 64 |\ int\ c|md, void|
|00005470| 20 2a 0a 61 72 67 29 24 | 7d 0a 0a 53 6f 6d 65 20 | *.arg)$|}..Some |
|00005480| 6f 66 20 74 68 65 20 5c | 63 64 72 6f 6d 2d 24 69 |of the \|cdrom-$i|
|00005490| 6f 63 74 6c 24 73 20 64 | 65 66 69 6e 65 64 20 69 |octl$s d|efined i|
|000054a0| 6e 20 7b 5c 74 74 20 63 | 64 72 6f 6d 2e 68 7d 20 |n {\tt c|drom.h} |
|000054b0| 63 61 6e 20 62 65 0a 69 | 6d 70 6c 65 6d 65 6e 74 |can be.i|mplement|
|000054c0| 65 64 20 62 79 20 74 68 | 65 20 72 6f 75 74 69 6e |ed by th|e routin|
|000054d0| 65 73 20 64 65 73 63 72 | 69 62 65 64 20 61 62 6f |es descr|ibed abo|
|000054e0| 76 65 2c 20 61 6e 64 20 | 68 65 6e 63 65 20 74 68 |ve, and |hence th|
|000054f0| 65 20 66 75 6e 63 74 69 | 6f 6e 0a 24 63 64 72 6f |e functi|on.$cdro|
|00005500| 6d 5f 69 6f 63 74 6c 24 | 20 77 69 6c 6c 20 75 73 |m_ioctl$| will us|
|00005510| 65 20 74 68 6f 73 65 2e | 20 48 6f 77 65 76 65 72 |e those.| However|
|00005520| 2c 20 6d 6f 73 74 20 24 | 69 6f 63 74 6c 24 73 20 |, most $|ioctl$s |
|00005530| 64 65 61 6c 20 77 69 74 | 68 0a 61 75 64 69 6f 2d |deal wit|h.audio-|
|00005540| 63 6f 6e 74 72 6f 6c 2e | 20 57 65 20 68 61 76 65 |control.| We have|
|00005550| 20 64 65 63 69 64 65 64 | 20 74 6f 20 6c 65 61 76 | decided| to leav|
|00005560| 65 20 74 68 65 73 65 20 | 61 63 63 65 73 73 65 64 |e these |accessed|
|00005570| 20 74 68 72 6f 75 67 68 | 20 61 0a 73 69 6e 67 6c | through| a.singl|
|00005580| 65 20 66 75 6e 63 74 69 | 6f 6e 2c 20 72 65 70 65 |e functi|on, repe|
|00005590| 61 74 69 6e 67 20 74 68 | 65 20 61 72 67 75 6d 65 |ating th|e argume|
|000055a0| 6e 74 73 20 24 63 6d 64 | 24 20 61 6e 64 20 24 61 |nts $cmd|$ and $a|
|000055b0| 72 67 24 2e 20 4e 6f 74 | 65 20 74 68 61 74 0a 74 |rg$. Not|e that.t|
|000055c0| 68 65 20 6c 61 74 74 65 | 72 20 69 73 20 6f 66 20 |he latte|r is of |
|000055d0| 74 79 70 65 20 24 76 6f | 69 64 2a 7b 7d 24 2c 20 |type $vo|id*{}$, |
|000055e0| 72 61 74 68 65 72 20 74 | 68 61 6e 20 24 75 6e 73 |rather t|han $uns|
|000055f0| 69 67 6e 65 64 5c 20 6c | 6f 6e 67 5c 0a 69 6e 74 |igned\ l|ong\.int|
|00005600| 24 2e 20 54 68 65 20 72 | 6f 75 74 69 6e 65 20 24 |$. The r|outine $|
|00005610| 63 64 72 6f 6d 5f 69 6f | 63 74 6c 28 29 24 20 64 |cdrom_io|ctl()$ d|
|00005620| 6f 65 73 20 64 6f 20 73 | 6f 6d 65 20 75 73 65 66 |oes do s|ome usef|
|00005630| 75 6c 20 74 68 69 6e 67 | 73 2c 0a 74 68 6f 75 67 |ul thing|s,.thoug|
|00005640| 68 2e 20 49 74 20 73 61 | 6e 69 74 69 7a 65 73 20 |h. It sa|nitizes |
|00005650| 74 68 65 20 61 64 64 72 | 65 73 73 20 66 6f 72 6d |the addr|ess form|
|00005660| 61 74 20 74 79 70 65 20 | 74 6f 20 24 43 44 52 4f |at type |to $CDRO|
|00005670| 4d 5f 4d 53 46 24 20 28 | 4d 69 6e 75 74 65 73 2c |M_MSF$ (|Minutes,|
|00005680| 0a 53 65 63 6f 6e 64 73 | 2c 20 46 72 61 6d 65 73 |.Seconds|, Frames|
|00005690| 29 20 66 6f 72 20 61 6c | 6c 20 61 75 64 69 6f 20 |) for al|l audio |
|000056a0| 63 61 6c 6c 73 2e 20 49 | 74 20 61 6c 73 6f 20 76 |calls. I|t also v|
|000056b0| 65 72 69 66 69 65 73 20 | 74 68 65 20 6d 65 6d 6f |erifies |the memo|
|000056c0| 72 79 0a 6c 6f 63 61 74 | 69 6f 6e 20 6f 66 20 24 |ry.locat|ion of $|
|000056d0| 61 72 67 24 2c 20 61 6e | 64 20 72 65 73 65 72 76 |arg$, an|d reserv|
|000056e0| 65 73 20 73 74 61 63 6b | 2d 6d 65 6d 6f 72 79 20 |es stack|-memory |
|000056f0| 66 6f 72 20 74 68 65 20 | 61 72 67 75 6d 65 6e 74 |for the |argument|
|00005700| 2e 20 54 68 69 73 0a 6d | 61 6b 65 73 20 69 6d 70 |. This.m|akes imp|
|00005710| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 6f 66 20 74 |lementat|ion of t|
|00005720| 68 65 20 24 61 75 64 69 | 6f 5f 69 6f 63 74 6c 28 |he $audi|o_ioctl(|
|00005730| 29 24 20 6d 75 63 68 20 | 73 69 6d 70 6c 65 72 20 |)$ much |simpler |
|00005740| 74 68 61 6e 20 69 6e 20 | 74 68 65 0a 6f 6c 64 20 |than in |the.old |
|00005750| 64 72 69 76 65 72 20 73 | 63 68 65 6d 65 2e 20 46 |driver s|cheme. F|
|00005760| 6f 72 20 61 6e 20 65 78 | 61 6d 70 6c 65 20 79 6f |or an ex|ample yo|
|00005770| 75 20 6d 61 79 20 6c 6f | 6f 6b 20 75 70 20 74 68 |u may lo|ok up th|
|00005780| 65 20 66 75 6e 63 74 69 | 6f 6e 0a 24 63 6d 32 30 |e functi|on.$cm20|
|00005790| 36 5f 61 75 64 69 6f 5f | 69 6f 63 74 6c 28 29 24 |6_audio_|ioctl()$|
|000057a0| 20 69 6e 20 7b 5c 74 74 | 20 63 6d 32 30 36 2e 63 | in {\tt| cm206.c|
|000057b0| 7d 20 74 68 61 74 20 73 | 68 6f 75 6c 64 20 62 65 |} that s|hould be|
|000057c0| 20 75 70 64 61 74 65 64 | 20 77 69 74 68 0a 74 68 | updated| with.th|
|000057d0| 69 73 20 64 6f 63 75 6d | 65 6e 74 61 74 69 6f 6e |is docum|entation|
|000057e0| 2e 20 0a 0a 41 6e 20 75 | 6e 69 6d 70 6c 65 6d 65 |. ..An u|nimpleme|
|000057f0| 6e 74 65 64 20 69 6f 63 | 74 6c 20 73 68 6f 75 6c |nted ioc|tl shoul|
|00005800| 64 20 72 65 74 75 72 6e | 20 24 2d 45 49 4e 56 41 |d return| $-EINVA|
|00005810| 4c 24 2c 20 62 75 74 20 | 61 20 68 61 72 6d 6c 65 |L$, but |a harmle|
|00005820| 73 73 20 72 65 71 75 65 | 73 74 0a 28 65 2e 67 2e |ss reque|st.(e.g.|
|00005830| 2c 20 24 43 44 52 4f 4d | 53 54 41 52 54 24 29 20 |, $CDROM|START$) |
|00005840| 6d 61 79 20 62 65 20 69 | 67 6e 6f 72 65 64 20 62 |may be i|gnored b|
|00005850| 79 20 72 65 74 75 72 6e | 69 6e 67 20 30 20 28 73 |y return|ing 0 (s|
|00005860| 75 63 63 65 73 73 29 2e | 20 4f 74 68 65 72 0a 65 |uccess).| Other.e|
|00005870| 72 72 6f 72 73 20 73 68 | 6f 75 6c 64 20 62 65 20 |rrors sh|ould be |
|00005880| 61 63 63 6f 72 64 69 6e | 67 20 74 6f 20 74 68 65 |accordin|g to the|
|00005890| 20 73 74 61 6e 64 61 72 | 64 73 2c 20 77 68 61 74 | standar|ds, what|
|000058a0| 65 76 65 72 20 74 68 65 | 79 20 61 72 65 2e 20 28 |ever the|y are. (|
|000058b0| 57 65 0a 6d 61 79 20 64 | 65 63 69 64 65 20 74 6f |We.may d|ecide to|
|000058c0| 20 73 61 6e 69 74 69 7a | 65 20 74 68 65 20 72 65 | sanitiz|e the re|
|000058d0| 74 75 72 6e 20 76 61 6c | 75 65 20 69 6e 20 24 63 |turn val|ue in $c|
|000058e0| 64 72 6f 6d 5f 69 6f 63 | 74 6c 28 29 24 2c 20 69 |drom_ioc|tl()$, i|
|000058f0| 6e 20 6f 72 64 65 72 0a | 74 6f 20 67 75 61 72 61 |n order.|to guara|
|00005900| 6e 74 65 65 20 61 20 75 | 6e 69 66 6f 72 6d 20 69 |ntee a u|niform i|
|00005910| 6e 74 65 72 66 61 63 65 | 20 74 6f 20 74 68 65 20 |nterface| to the |
|00005920| 61 75 64 69 6f 2d 70 6c | 61 79 65 72 20 73 6f 66 |audio-pl|ayer sof|
|00005930| 74 77 61 72 65 2e 29 0a | 0a 5c 73 75 62 73 65 63 |tware.).|.\subsec|
|00005940| 74 69 6f 6e 7b 24 44 65 | 76 5f 69 6f 63 74 6c 28 |tion{$De|v_ioctl(|
|00005950| 6b 64 65 76 5f 74 5c 20 | 64 65 76 2c 20 75 6e 73 |kdev_t\ |dev, uns|
|00005960| 69 67 6e 65 64 5c 20 69 | 6e 74 5c 20 63 6d 64 2c |igned\ i|nt\ cmd,|
|00005970| 20 75 6e 73 69 67 6e 65 | 64 5c 20 6c 6f 6e 67 5c | unsigne|d\ long\|
|00005980| 0a 61 72 67 29 24 7d 0a | 0a 53 6f 6d 65 20 24 69 |.arg)$}.|.Some $i|
|00005990| 6f 63 74 6c 24 73 20 73 | 65 65 6d 20 74 6f 20 62 |octl$s s|eem to b|
|000059a0| 65 20 73 70 65 63 69 66 | 69 63 20 74 6f 20 63 65 |e specif|ic to ce|
|000059b0| 72 74 61 69 6e 20 5c 63 | 64 72 6f 6d 5c 20 64 72 |rtain \c|drom\ dr|
|000059c0| 69 76 65 73 2e 20 54 68 | 61 74 20 69 73 2c 0a 74 |ives. Th|at is,.t|
|000059d0| 68 65 79 20 61 72 65 20 | 69 6e 74 72 6f 64 75 63 |hey are |introduc|
|000059e0| 65 64 20 74 6f 20 73 65 | 72 76 69 63 65 20 73 6f |ed to se|rvice so|
|000059f0| 6d 65 20 63 61 70 61 62 | 69 6c 69 74 69 65 73 20 |me capab|ilities |
|00005a00| 6f 66 20 63 65 72 74 61 | 69 6e 20 64 72 69 76 65 |of certa|in drive|
|00005a10| 73 2e 20 49 6e 0a 66 61 | 63 74 2c 20 74 68 65 72 |s. In.fa|ct, ther|
|00005a20| 65 20 61 72 65 20 36 20 | 64 69 66 66 65 72 65 6e |e are 6 |differen|
|00005a30| 74 20 24 69 6f 63 74 6c | 24 73 20 66 6f 72 20 72 |t $ioctl|$s for r|
|00005a40| 65 61 64 69 6e 67 20 64 | 61 74 61 2c 20 65 69 74 |eading d|ata, eit|
|00005a50| 68 65 72 20 69 6e 20 73 | 6f 6d 65 0a 70 61 72 74 |her in s|ome.part|
|00005a60| 69 63 75 6c 61 72 20 6b | 69 6e 64 20 6f 66 20 66 |icular k|ind of f|
|00005a70| 6f 72 6d 61 74 2c 20 6f | 72 20 61 75 64 69 6f 20 |ormat, o|r audio |
|00005a80| 64 61 74 61 2e 20 4e 6f | 74 20 6d 61 6e 79 20 64 |data. No|t many d|
|00005a90| 72 69 76 65 73 20 73 75 | 70 70 6f 72 74 0a 72 65 |rives su|pport.re|
|00005aa0| 61 64 69 6e 67 20 61 75 | 64 69 6f 20 74 72 61 63 |ading au|dio trac|
|00005ab0| 6b 73 20 61 73 20 64 61 | 74 61 2c 20 49 20 62 65 |ks as da|ta, I be|
|00005ac0| 6c 69 65 76 65 20 74 68 | 69 73 20 69 73 20 62 65 |lieve th|is is be|
|00005ad0| 63 61 75 73 65 20 6f 66 | 20 70 72 6f 74 65 63 74 |cause of| protect|
|00005ae0| 69 6f 6e 0a 6f 66 20 63 | 6f 70 79 72 69 67 68 74 |ion.of c|opyright|
|00005af0| 73 20 6f 66 20 61 72 74 | 69 73 74 73 2e 20 4d 6f |s of art|ists. Mo|
|00005b00| 72 65 6f 76 65 72 2c 20 | 49 20 74 68 69 6e 6b 20 |reover, |I think |
|00005b10| 74 68 61 74 20 69 66 20 | 61 75 64 69 6f 2d 74 72 |that if |audio-tr|
|00005b20| 61 63 6b 73 20 61 72 65 | 0a 73 75 70 70 6f 72 74 |acks are|.support|
|00005b30| 65 64 2c 20 69 74 20 73 | 68 6f 75 6c 64 20 62 65 |ed, it s|hould be|
|00005b40| 20 64 6f 6e 65 20 74 68 | 72 6f 75 67 68 20 74 68 | done th|rough th|
|00005b50| 65 20 56 46 53 20 61 6e | 64 20 6e 6f 74 20 76 69 |e VFS an|d not vi|
|00005b60| 61 20 24 69 6f 63 74 6c | 24 73 2e 20 41 0a 70 72 |a $ioctl|$s. A.pr|
|00005b70| 6f 62 6c 65 6d 20 68 65 | 72 65 20 63 6f 75 6c 64 |oblem he|re could|
|00005b80| 20 62 65 20 74 68 65 20 | 66 61 63 74 20 74 68 61 | be the |fact tha|
|00005b90| 74 20 61 75 64 69 6f 2d | 66 72 61 6d 65 73 20 61 |t audio-|frames a|
|00005ba0| 72 65 20 32 33 35 32 20 | 62 79 74 65 73 20 6c 6f |re 2352 |bytes lo|
|00005bb0| 6e 67 2c 0a 73 6f 20 65 | 69 74 68 65 72 20 74 68 |ng,.so e|ither th|
|00005bc0| 65 20 61 75 64 69 6f 2d | 66 69 6c 65 2d 73 79 73 |e audio-|file-sys|
|00005bd0| 74 65 6d 20 73 68 6f 75 | 6c 64 20 61 73 6b 20 66 |tem shou|ld ask f|
|00005be0| 6f 72 20 37 35 32 36 34 | 20 62 79 74 65 73 20 61 |or 75264| bytes a|
|00005bf0| 74 20 6f 6e 63 65 0a 28 | 74 68 65 20 6c 65 61 73 |t once.(|the leas|
|00005c00| 74 20 63 6f 6d 6d 6f 6e | 20 6d 75 6c 74 69 70 6c |t common| multipl|
|00005c10| 65 20 6f 66 20 35 31 32 | 20 61 6e 64 20 32 33 35 |e of 512| and 235|
|00005c20| 32 29 2c 20 6f 72 20 74 | 68 65 20 64 72 69 76 65 |2), or t|he drive|
|00005c30| 72 73 20 73 68 6f 75 6c | 64 0a 62 65 6e 64 20 74 |rs shoul|d.bend t|
|00005c40| 68 65 69 72 20 62 61 63 | 6b 73 20 74 6f 20 63 6f |heir bac|ks to co|
|00005c50| 70 65 20 77 69 74 68 20 | 74 68 69 73 20 69 6e 63 |pe with |this inc|
|00005c60| 6f 68 65 72 65 6e 63 65 | 20 28 74 6f 20 77 68 69 |oherence| (to whi|
|00005c70| 63 68 20 49 20 77 6f 75 | 6c 64 20 62 65 0a 6f 70 |ch I wou|ld be.op|
|00005c80| 70 6f 73 65 64 29 2e 20 | 4f 6e 63 65 20 74 68 69 |posed). |Once thi|
|00005c90| 73 20 71 75 65 73 74 69 | 6f 6e 20 69 73 20 72 65 |s questi|on is re|
|00005ca0| 73 6f 6c 76 65 64 2c 20 | 74 68 69 73 20 63 6f 64 |solved, |this cod|
|00005cb0| 65 20 73 68 6f 75 6c 64 | 20 62 65 20 73 74 61 6e |e should| be stan|
|00005cc0| 64 61 72 64 69 7a 65 64 | 20 69 6e 20 0a 5c 63 64 |dardized| in .\cd|
|00005cd0| 72 6f 6d 63 2e 0a 0a 42 | 65 63 61 75 73 65 20 74 |romc...B|ecause t|
|00005ce0| 68 65 72 65 20 61 72 65 | 20 73 6f 20 6d 61 6e 79 |here are| so many|
|00005cf0| 20 24 69 6f 63 74 6c 24 | 73 20 74 68 61 74 20 73 | $ioctl$|s that s|
|00005d00| 65 65 6d 20 74 6f 20 62 | 65 20 69 6e 74 72 6f 64 |eem to b|e introd|
|00005d10| 75 63 65 64 20 74 6f 0a | 73 61 74 69 73 66 79 20 |uced to.|satisfy |
|00005d20| 63 65 72 74 61 69 6e 20 | 64 72 69 76 65 72 73 2c |certain |drivers,|
|00005d30| 5c 66 6f 6f 74 6e 6f 74 | 65 7b 49 73 20 74 68 65 |\footnot|e{Is the|
|00005d40| 72 65 20 73 6f 66 74 77 | 61 72 65 20 61 72 6f 75 |re softw|are arou|
|00005d50| 6e 64 20 74 68 61 74 20 | 61 63 74 75 61 6c 6c 79 |nd that |actually|
|00005d60| 20 75 73 65 73 0a 74 68 | 65 73 65 3f 20 49 27 64 | uses.th|ese? I'd|
|00005d70| 20 62 65 20 69 6e 74 65 | 72 65 73 74 65 64 21 7d | be inte|rested!}|
|00005d80| 20 61 6e 79 20 60 6e 6f | 6e 2d 73 74 61 6e 64 61 | any `no|n-standa|
|00005d90| 72 64 27 20 24 69 6f 63 | 74 6c 24 73 20 61 72 65 |rd' $ioc|tl$s are|
|00005da0| 20 72 6f 75 74 65 64 20 | 74 68 72 6f 75 67 68 0a | routed |through.|
|00005db0| 74 68 65 20 63 61 6c 6c | 20 24 64 65 76 5f 69 6f |the call| $dev_io|
|00005dc0| 63 74 6c 28 29 24 2e 20 | 49 6e 20 70 72 69 6e 63 |ctl()$. |In princ|
|00005dd0| 69 70 6c 65 2c 20 60 70 | 72 69 76 61 74 65 27 20 |iple, `p|rivate' |
|00005de0| 24 69 6f 63 74 6c 24 73 | 20 73 68 6f 75 6c 64 20 |$ioctl$s| should |
|00005df0| 62 65 0a 6e 75 6d 62 65 | 72 65 64 20 61 66 74 65 |be.numbe|red afte|
|00005e00| 72 20 74 68 65 20 64 65 | 76 69 63 65 27 73 20 6d |r the de|vice's m|
|00005e10| 61 6a 6f 72 20 6e 75 6d | 62 65 72 2c 20 61 6e 64 |ajor num|ber, and|
|00005e20| 20 6e 6f 74 20 74 68 65 | 20 67 65 6e 65 72 61 6c | not the| general|
|00005e30| 20 5c 63 64 72 6f 6d 5c | 0a 24 69 6f 63 74 6c 24 | \cdrom\|.$ioctl$|
|00005e40| 20 6e 75 6d 62 65 72 2c | 20 7b 5c 74 74 20 30 78 | number,| {\tt 0x|
|00005e50| 35 33 7d 2e 20 43 75 72 | 72 65 6e 74 6c 79 20 74 |53}. Cur|rently t|
|00005e60| 68 65 20 6e 6f 6e 2d 73 | 75 70 70 6f 72 74 65 64 |he non-s|upported|
|00005e70| 20 24 69 6f 63 74 6c 24 | 73 20 61 72 65 3a 0a 7b | $ioctl$|s are:.{|
|00005e80| 5c 69 74 20 43 44 52 4f | 4d 52 45 41 44 4d 4f 44 |\it CDRO|MREADMOD|
|00005e90| 45 31 2c 20 43 44 52 4f | 4d 52 45 41 44 4d 4f 44 |E1, CDRO|MREADMOD|
|00005ea0| 45 32 2c 20 43 44 52 4f | 4d 52 45 41 44 41 55 44 |E2, CDRO|MREADAUD|
|00005eb0| 49 4f 2c 20 43 44 52 4f | 4d 52 45 41 44 52 41 57 |IO, CDRO|MREADRAW|
|00005ec0| 2c 0a 43 44 52 4f 4d 52 | 45 41 44 43 4f 4f 4b 45 |,.CDROMR|EADCOOKE|
|00005ed0| 44 2c 20 43 44 52 4f 4d | 53 45 45 4b 2c 20 43 44 |D, CDROM|SEEK, CD|
|00005ee0| 52 4f 4d 50 4c 41 59 5c | 2d 42 4c 4b 20 61 6e 64 |ROMPLAY\|-BLK and|
|00005ef0| 20 43 44 52 4f 4d 52 45 | 41 44 41 4c 4c 7d 2e 20 | CDROMRE|ADALL}. |
|00005f00| 0a 0a 5c 73 75 62 73 65 | 63 74 69 6f 6e 7b 5c 63 |..\subse|ction{\c|
|00005f10| 64 72 6f 6d 5c 20 63 61 | 70 61 62 69 6c 69 74 69 |drom\ ca|pabiliti|
|00005f20| 65 73 7d 0a 0a 49 6e 73 | 74 65 61 64 20 6f 66 20 |es}..Ins|tead of |
|00005f30| 6a 75 73 74 20 69 6d 70 | 6c 65 6d 65 6e 74 69 6e |just imp|lementin|
|00005f40| 67 20 73 6f 6d 65 20 24 | 69 6f 63 74 6c 24 20 63 |g some $|ioctl$ c|
|00005f50| 61 6c 6c 73 2c 20 74 68 | 65 20 69 6e 74 65 72 66 |alls, th|e interf|
|00005f60| 61 63 65 20 69 6e 0a 5c | 63 64 72 6f 6d 63 5c 20 |ace in.\|cdromc\ |
|00005f70| 73 75 70 70 6c 69 65 73 | 20 74 68 65 20 70 6f 73 |supplies| the pos|
|00005f80| 73 69 62 69 6c 69 74 79 | 20 74 6f 20 69 6e 64 69 |sibility| to indi|
|00005f90| 63 61 74 65 20 74 68 65 | 20 7b 5c 65 6d 20 63 61 |cate the| {\em ca|
|00005fa0| 70 61 62 69 6c 69 74 69 | 65 73 5c 2f 7d 0a 6f 66 |pabiliti|es\/}.of|
|00005fb0| 20 61 20 5c 63 64 72 6f | 6d 5c 20 64 72 69 76 65 | a \cdro|m\ drive|
|00005fc0| 2e 20 54 68 69 73 20 63 | 61 6e 20 62 65 20 64 6f |. This c|an be do|
|00005fd0| 6e 65 20 62 79 20 4f 52 | 69 6e 67 20 61 6e 79 20 |ne by OR|ing any |
|00005fe0| 6e 75 6d 62 65 72 20 6f | 66 0a 63 61 70 61 62 69 |number o|f.capabi|
|00005ff0| 6c 69 74 79 2d 63 6f 6e | 73 74 61 6e 74 73 20 74 |lity-con|stants t|
|00006000| 68 61 74 20 61 72 65 20 | 64 65 66 69 6e 65 64 20 |hat are |defined |
|00006010| 69 6e 20 5c 75 63 64 72 | 6f 6d 5c 20 61 74 20 74 |in \ucdr|om\ at t|
|00006020| 68 65 20 72 65 67 69 73 | 74 72 61 74 69 6f 6e 0a |he regis|tration.|
|00006030| 70 68 61 73 65 2e 20 43 | 75 72 72 65 6e 74 6c 79 |phase. C|urrently|
|00006040| 2c 20 74 68 65 20 63 61 | 70 61 62 69 6c 69 74 69 |, the ca|pabiliti|
|00006050| 65 73 20 61 72 65 20 61 | 6e 79 20 6f 66 3a 0a 24 |es are a|ny of:.$|
|00006060| 24 0a 5c 68 61 6c 69 67 | 6e 7b 24 23 24 5c 20 5c |$.\halig|n{$#$\ \|
|00006070| 68 66 69 6c 26 24 2f 2a | 24 20 5c 72 6d 23 20 24 |hfil&$/*|$ \rm# $|
|00006080| 2a 2f 24 5c 68 66 69 6c | 5c 63 72 0a 43 44 43 5f |*/$\hfil|\cr.CDC_|
|00006090| 43 4c 4f 53 45 5f 54 52 | 41 59 26 20 63 61 6e 20 |CLOSE_TR|AY& can |
|000060a0| 63 6c 6f 73 65 20 74 72 | 61 79 20 62 79 20 73 6f |close tr|ay by so|
|000060b0| 66 74 77 61 72 65 20 63 | 6f 6e 74 72 6f 6c 5c 63 |ftware c|ontrol\c|
|000060c0| 72 0a 43 44 43 5f 4f 50 | 45 4e 5f 54 52 41 59 26 |r.CDC_OP|EN_TRAY&|
|000060d0| 20 63 61 6e 20 6f 70 65 | 6e 20 74 72 61 79 5c 63 | can ope|n tray\c|
|000060e0| 72 0a 43 44 43 5f 4c 4f | 43 4b 26 20 63 61 6e 20 |r.CDC_LO|CK& can |
|000060f0| 6c 6f 63 6b 20 61 6e 64 | 20 75 6e 6c 6f 63 6b 20 |lock and| unlock |
|00006100| 74 68 65 20 64 6f 6f 72 | 5c 63 72 0a 43 44 43 5f |the door|\cr.CDC_|
|00006110| 53 45 4c 45 43 54 5f 53 | 50 45 45 44 26 20 63 61 |SELECT_S|PEED& ca|
|00006120| 6e 20 73 65 6c 65 63 74 | 20 73 70 65 65 64 2c 20 |n select| speed, |
|00006130| 69 6e 20 75 6e 69 74 73 | 20 6f 66 20 24 5c 73 69 |in units| of $\si|
|00006140| 6d 24 31 35 30 5c 2c 6b | 42 2f 73 5c 63 72 0a 43 |m$150\,k|B/s\cr.C|
|00006150| 44 43 5f 53 45 4c 45 43 | 54 5f 44 49 53 43 26 20 |DC_SELEC|T_DISC& |
|00006160| 64 72 69 76 65 20 69 73 | 20 6a 75 6b 65 2d 62 6f |drive is| juke-bo|
|00006170| 78 5c 63 72 0a 43 44 43 | 5f 4d 55 4c 54 49 5f 53 |x\cr.CDC|_MULTI_S|
|00006180| 45 53 53 49 4f 4e 26 20 | 63 61 6e 20 72 65 61 64 |ESSION& |can read|
|00006190| 20 73 65 73 73 69 6f 6e | 73 20 24 3e 5c 72 6d 31 | session|s $>\rm1|
|000061a0| 24 5c 63 72 0a 43 44 43 | 5f 4d 43 4e 26 20 63 61 |$\cr.CDC|_MCN& ca|
|000061b0| 6e 20 72 65 61 64 20 4d | 65 64 69 75 6d 20 43 61 |n read M|edium Ca|
|000061c0| 74 61 6c 6f 67 20 4e 75 | 6d 62 65 72 5c 63 72 0a |talog Nu|mber\cr.|
|000061d0| 43 44 43 5f 4d 45 44 49 | 41 5f 43 48 41 4e 47 45 |CDC_MEDI|A_CHANGE|
|000061e0| 44 26 20 63 61 6e 20 72 | 65 70 6f 72 74 20 69 66 |D& can r|eport if|
|000061f0| 20 64 69 73 63 20 68 61 | 73 20 63 68 61 6e 67 65 | disc ha|s change|
|00006200| 64 5c 63 72 0a 43 44 43 | 5f 50 4c 41 59 5f 41 55 |d\cr.CDC|_PLAY_AU|
|00006210| 44 49 4f 26 20 63 61 6e | 20 70 65 72 66 6f 72 6d |DIO& can| perform|
|00006220| 20 61 75 64 69 6f 2d 66 | 75 6e 63 74 69 6f 6e 73 | audio-f|unctions|
|00006230| 20 28 70 6c 61 79 2c 20 | 70 61 75 73 65 2c 20 65 | (play, |pause, e|
|00006240| 74 63 29 5c 63 72 0a 7d | 0a 24 24 0a 54 68 65 20 |tc)\cr.}|.$$.The |
|00006250| 63 61 70 61 62 69 6c 69 | 74 79 20 66 6c 61 67 20 |capabili|ty flag |
|00006260| 69 73 20 64 65 63 6c 61 | 72 65 64 20 24 63 6f 6e |is decla|red $con|
|00006270| 73 74 24 2c 20 74 6f 20 | 70 72 65 76 65 6e 74 20 |st$, to |prevent |
|00006280| 64 72 69 76 65 72 73 20 | 66 72 6f 6d 0a 61 63 63 |drivers |from.acc|
|00006290| 69 64 65 6e 74 61 6c 6c | 79 20 74 61 6d 70 65 72 |identall|y tamper|
|000062a0| 69 6e 67 20 77 69 74 68 | 20 74 68 65 20 63 6f 6e |ing with| the con|
|000062b0| 74 65 6e 74 73 2e 20 48 | 6f 77 65 76 65 72 2c 20 |tents. H|owever, |
|000062c0| 75 70 6f 6e 20 72 65 67 | 69 73 74 72 61 74 69 6f |upon reg|istratio|
|000062d0| 6e 2c 0a 73 6f 6d 65 20 | 28 63 6c 61 69 6d 65 64 |n,.some |(claimed|
|000062e0| 29 20 63 61 70 61 62 69 | 6c 69 74 79 20 66 6c 61 |) capabi|lity fla|
|000062f0| 67 73 20 6d 61 79 20 62 | 65 20 63 6c 65 61 72 65 |gs may b|e cleare|
|00006300| 64 20 69 66 20 74 68 65 | 20 73 75 70 70 6f 72 74 |d if the| support|
|00006310| 69 6e 67 0a 66 75 6e 63 | 74 69 6f 6e 20 68 61 73 |ing.func|tion has|
|00006320| 20 6e 6f 74 20 62 65 65 | 6e 20 69 6d 70 6c 65 6d | not bee|n implem|
|00006330| 65 6e 74 65 64 20 28 73 | 65 65 20 24 72 65 67 69 |ented (s|ee $regi|
|00006340| 73 74 65 72 5f 63 64 72 | 6f 6d 28 29 24 20 69 6e |ster_cdr|om()$ in|
|00006350| 0a 5c 63 64 72 6f 6d 63 | 29 2e 20 0a 0a 49 66 20 |.\cdromc|). ..If |
|00006360| 79 6f 75 20 77 61 6e 74 | 20 74 6f 20 64 69 73 61 |you want| to disa|
|00006370| 62 6c 65 20 61 6e 79 20 | 6f 66 20 74 68 65 20 63 |ble any |of the c|
|00006380| 61 70 61 62 69 6c 69 74 | 69 65 73 2c 20 74 68 65 |apabilit|ies, the|
|00006390| 72 65 20 69 73 20 61 20 | 73 70 65 63 69 61 6c 0a |re is a |special.|
|000063a0| 66 6c 61 67 20 72 65 67 | 69 73 74 65 72 20 24 3c |flag reg|ister $<|
|000063b0| 64 65 76 69 63 65 3e 5f | 64 6f 70 73 2e 6d 61 73 |device>_|dops.mas|
|000063c0| 6b 24 20 74 68 61 74 20 | 6d 61 79 20 28 74 65 6d |k$ that |may (tem|
|000063d0| 70 6f 72 61 72 69 6c 79 | 29 20 64 69 73 61 62 6c |porarily|) disabl|
|000063e0| 65 0a 63 65 72 74 61 69 | 6e 20 63 61 70 61 62 69 |e.certai|n capabi|
|000063f0| 6c 69 74 69 65 73 2e 20 | 49 6e 20 74 68 65 20 66 |lities. |In the f|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.