Linux ATAPI-PD 儊儌

壛摗掑彶

skato@venus.dti.ne.jp

1999/01/?

偙偺暥彂偱偼丄Linux 偱 ATAPI-PD 傪巊梡偡傞嵺偺拲堄揰傪偍偍偞偭傁偵傑偲
傔偰偁傝傑偡丅

kernel 偺 make 摍偵偮偄偰偼抦偭偰傞傕偺偲傒側偟偰彂偄偰偄傑偡偺偱丄傢偐
傜側偄偐偨偼懠偺 JF 偺僪僉儏儊儞僩傗彂愋側偳傪偁偨偭偰偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

Table of Contents
1. 婎杮揑側偙偲
2. 幚嵺偺巊梡朄
3. kernel-2.0.35(or 36) 偱 ATAPI-PD 傪巊偆偵偼
4. 忋媺曇
5. 偦偺懠

1. 婎杮揑側偙偲

傑偢丄kernel 偼 2.0.33 傪巊梡偡傞偺偑偄偪偽傫娙扨偱偡丅埲壓偺愝掕偱
make 偟偰傗傞偩偗偱偡丅(2.0.35 傗 36 傪巊偄偨偄偐偨偼戞3復傪偛棗偔偩偝
偄)

億僀儞僩偼丄make *config偱

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆  - Floppy,IDE,and other block devices                              劆
劆丂  丂丂丂丂丒SCSI emulation support  亖丂Y                         劆
劆丂丂  丂丂丂丒Include丂IDE/ATAPI丂CDROM丂support丂亖丂N             劆
劆  - SCSI丂suppurt                                                   劆
劆丂  丂丂丂丂丒SCSI丂disk support丂亖丂Y                             劆
劆丂丂  丂丂丂丒SCSI丂CDROM support丂亖丂Y丂                          劆
劆丂丂丂  丂丂丒Probe all LUNs on each SCSI device丂亖丂Y             劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

偲偡傞偲偄偆偙偲偱偡丅ATAPI CDROM support 偼 N 側偺偵偛拲堄偔偩偝偄丅乽
壌偼 PD 埲奜偵 ATAPI-CDROM 僪儔僀僽傪帩偭偰偄傞傫偩偗偳偙傟偱偄偄偺偐側
丠乿偲巚偭偨偐偨丄戝忎晇偱偡丅ATAPI-CDROM 僪儔僀僽傕 PD 僪儔僀僽傕丄椉
曽偲傕 SCSI emulation 偱擣幆偝傟傑偡丅

嵟屻偺 Probe all LUNs 偼側偐側偐栤戣偺偁傞僆僾僔儑儞偱偟偰丄傛偔傢偐傜
傫偗偳偲偵偐偔擣幆偝偣偨偄傫偩両偲偄偆偐偨偼 Y 偵偟偲偔偺偑柍擄偱偡丅
Panasonic 偺傕偺側傜側偔偰傕偄偗傞応崌傕偁傝傑偡偺偱丄傑偢偼 Y 偱傗偭偰
傒偰丄偆傑偔偄偭偨傜N偵偟偰帋偟偰傒傞偲偄偆偺傕偄偄偱偟傚偆丅

傑偨丄Probe all LUNs 傪 Y 偵偡傞偲婲摦帪偵慡偰偺 SCSI ID 傪専嶕偟傑偡偺
偱丄婲摦帪偺儊僢僙乕僕偑偨偄傊傫偆傞偝偔側傝傑偡丅幚奞偼側偄偺偱偡偑丄
側傫偩偐婥帩偪埆偄偲偄偆偐偨偼丄僇乕僱儖偺僷儔儊乕僞偵 max_scsi_luns=?
傪梌偊偰傗傝傑偟傚偆丅偆偪偱偼 2 偵偟偰傑偟偨丅僇乕僱儖傊偺僆僔儑儞巜掕
偺傗傝偐偨偑傢偐傜傫偲偄偆偐偨偼丄lilo 傗 loadlin 偺僪僉儏儊儞僩傪撉傒
傑偟傚偆丅

側偍丄NEC 惢側偳偺 Probe all LUNs 偑 Y 偱側偄偲擣幆偝傟側偄 PD drive 偱
傕丄N 偵偱偒傞傛偆偵偡傞曽朄傕偁傝傑偡丅偨偩丄僇乕僱儖僜乕僗偵庤傪擖傟
側偔偰偼偄偗側偄偺偱丄忋媺曇偲偟偰嵟屻偵徯夘傑偡丅

偄偢傟偵偟偰傕丄偲傝偁偊偢偼 Y 偱偨傔偟偰傒傞偙偲傪偍偡偡傔偟傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2. 幚嵺偺巊梡朄

巹偺娐嫬偱偼丄PD 偺 CD 偼 /dev/scd2 偵傢傝偁偰傜傟傑偟偨丅偙傟偼婲摦帪
偵丄

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆  Detected scsi CD-ROM sr2 at scsi0, channel 0, id 1, lun 0           劆
劆    Vendor: NEC       Model: PD-1 ODX654P      Rev: A113              劆
劆    Type:   Optical Device                     ANSI SCSI revision: 02 劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

偲偄偆儊僢僙乕僕偑偱傞偙偲偐傜妋擣偟傑偟偨丅sr2 偲偄偆偺偑億僀儞僩偱偡
丅側偤 sr2 偑 scd2 偵側傞偺偐偼撲偱偡偑丄偦偆偄偆傕傫偺傛偆偱偡丅

/dev/ 傪尒傞偲丄scd2 偑側偐偭偨偺偱怴偨偵嶌偭偰傗傜側偗傟偽側傝傑偣傫偱
偟偨丅偙偆偄偆帪偼丄/dev/MAKEDEV 僐儅儞僪(偙傟偑側偗傟偽 mknod)傪巊偄傑
偡丅徻偟偔偼丄man MAKEDEV(mknod) 傪偳偆偧丅 PD 偲偟偰巊偆偲偒偼 /dev/
sda 偑傢傝偁偰傜傟偰偄傑偡丅偙偺傊傫偼娐嫬偵傛偭偰堎側傞偲巚偆偺偱丄婲
摦帪偺儊僢僙乕僕傪尒偰揔愗偵撉傒偐偊偰偔偩偝偄丅

PD 僪儔僀僽偱 PD 偲 CD 偑栤戣側偔 mount丄umount 偱偒傞偙偲傪妋擣偟偨屻
丄 /etc/fstab 傪彂偒偐偊傑偟傚偆丅椺偊偽丄巹偺 /etc/fstab 偼埲壓偺傛偆
偵側偭偰傑偡丅

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆  /dev/hda2       /       ext2        defaults   1   1              劆
劆  /dev/hda1       /win    vfat        defaults   1   2              劆
劆  /dev/hda3       swap    swap        defaults                      劆
劆  /dev/scd0       /cdrom  iso9660     user,ro,noauto                劆
劆  /dev/scd2       /pcd    iso9660     user,ro,noauto                劆
劆  /dev/sda        /pd     vfat        user,noauto                   劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

尒傟偽傢偐傞捠傝丄儅僂儞僩億僀儞僩偲偟偰 /pcd 偲 /pd 偲偄偆僨傿儗僋僩儕
傪偁傜偐偠傔嶌偭偰偄傑偡丅/cdrom 偼暿偵偮側偑偭偰偄傞 ATAPI-CDROM 僪儔
僀僽梡偱偡丅PD 偺僆僾僔儑儞傪 vfat 偵偟偨偺偼丄Win98 偲偺僨乕僞岎姺傕峫
偊偰偺偙偲偱偡偺偱丄屼巊梡側偝傞娐嫬偵偁傢偣偰揔愗偵愝掕偟偰偔偩偝偄丅

側偍丄幹懌偱偡偑偙偺傛偆偵 user 僆僾僔儑儞傪偮偗傞偲堦斒儐乕僓偱傕丄

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆  % mount /pcd        PD 偺 CD 傪 mount                             劆
劆  % mount /pd         PD 傪 mount                                   劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

側偳偲偱偒傞傛偆偵側偭偰曋棙偱偡丅徻偟偔偼 man mount 傪偳偆偧丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3. kernel-2.0.35(or 36) 偱 ATAPI-PD 傪巊偆偵偼

2.0.35(or 36) 偱偼側偤偐 PD 偑忢偵 read only 偱擣幆偝傟傞偲偄偆栤戣偑偁
傝傑偡丅偙傟傪夞旔偡傞偨傔偵偼丄kernel source 偺 drivers/scsi/
ide-scsi.c 偺 150-200 峴栚偺偁偨傝傪 2.0.33 偲摨偠偵偡傞偙偲偑昁梫側傛
偆偱偡丅偙偺曽朄偱偼傕偟偐偟偨傜側偵偐栤戣偑偁傞偺偐傕偟傟傑偣傫偑丄彮
偔偲傕偆偪偱偼埨掕摦嶌偟偰偄傑偡丅埲壓偼丄2.0.35 (or 36) 偱 ATAPI-PD 傪
巊偆 patch 偱偡丅fj.os.linux 偱崅奯偝傫偲偄偆偐偨偑丄2.0.34 梡偺 patch
傪岞奐偝傟偰偨 [1] 偺偱偡偑丄側偤偐偆傑偔偁偰傜傟側偐偭偨偺偱丄偦傟傪嶲
峫偵偟偰嶌傝傑偟偨丅

埲壓傪愗傝庢偭偰丄ide-scsi.c.diff 偲偱傕柤晅偗偰曐懚偟偰丄 drivers/scsi
/ 偱丄

  $ patch < ide-scsi.c.diff                                            

側偳偲偟偰偁偰偰偔偩偝偄丅偁偲偼 1 復偵廬偭偰 make 偡傞偩偗偱偡丅

--------- 偙偙偐傜 -----------                                                           
*** linux/drivers/scsi/ide-scsi.c.35.org        Mon Nov 16 21:45:00 1998                 
--- linux/drivers/scsi/ide-scsi.c       Tue Nov 17 05:07:21 1998                         
***************                                                                          
*** 156,162 ****                                                                         
  static inline void idescsi_transform_pc1 (ide_drive_t *drive, idescsi_pc_t *pc)        
  {                                                                                      
        idescsi_scsi_t *scsi = drive->scsi;                                              
!       u8 *c = pc->c;                                                                   
                                                                                         
        if (scsi->media == TYPE_ROM) {                                                   
                if (c[0] == READ_6 || c[0] == WRITE_6) {                                 
--- 156,163 ----                                                                         
  static inline void idescsi_transform_pc1 (ide_drive_t *drive, idescsi_pc_t *pc)        
  {                                                                                      
        idescsi_scsi_t *scsi = drive->scsi;                                              
!       u8 *c = pc->c, *buf = pc->buffer, *sc = pc->scsi_cmd->cmnd;                      
!       int i;                                                                           
                                                                                         
        if (scsi->media == TYPE_ROM) {                                                   
                if (c[0] == READ_6 || c[0] == WRITE_6) {                                 
***************                                                                          
*** 164,169 ****                                                                         
--- 165,178 ----                                                                         
                        c[3] = c[1] & 0x1f;     c[2] = 0;               c[1] &= 0xe0;    
                        c[0] += (READ_10 - READ_6);                                      
                }                                                                        
+               if (c[0] == MODE_SENSE || (c[0] == MODE_SELECT && buf[3] == 8)) {        
+                       pc->request_transfer -= 4;                                       
+                       memset (c, 0, 12);                                               
+                       c[0] = sc[0] | 0x40;c[2] = sc[2];c[8] = sc[4] - 4;               
+                       if (c[0] == MODE_SENSE_10) return;                               
+                       for (i = 0; i <= 7; i++) buf[i] = 0;                             
+                       for (i = 8; i < pc->buffer_size - 4; i++) buf[i] = buf[i + 4];   
+               }                                                                        
        }                                                                                
  }                                                                                      
                                                                                         
***************                                                                          
*** 171,181 ****                                                                         
  {                                                                                      
        idescsi_scsi_t *scsi = drive->scsi;                                              
        u8 *buf = pc->buffer;                                                            
                                                                                         
        if (scsi->media == TYPE_ROM) {                                                   
!               if (pc->c[0] == INQUIRY)                                                 
!                       buf[2] |= 2;                                                     
!       }                                                                                
  }                                                                                      
                                                                                         
  static inline void idescsi_free_bh (struct buffer_head *bh)                            
--- 180,198 ----                                                                         
  {                                                                                      
        idescsi_scsi_t *scsi = drive->scsi;                                              
        u8 *buf = pc->buffer;                                                            
+       int i;                                                                           
                                                                                         
        if (scsi->media == TYPE_ROM) {                                                   
!               if (pc->c[0] == MODE_SENSE_10 && pc->scsi_cmd->cmnd[0] == MODE_SENSE) {  
!                       buf[0] = buf[1];buf[1] = buf[2];                                 
!                       buf[2] = 0;buf[3] = 8;                                           
!                       for (i = pc->buffer_size - 1; i >= 12; i--)                      
!                       buf[i] = buf[i - 4];                                             
!                       for (i = 11; i >= 4; i--) buf[i] = 0;                            
!               }                                                                        
!               if (pc->c[0] == INQUIRY)                                                 
!                       buf[2] |= 2;                                                     
!         }                                                                              
  }                                                                                      
                                                                                         
  static inline void idescsi_free_bh (struct buffer_head *bh)                            
--------- 偙偙傑偱 -----------                                                           

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

4. 忋媺曇

婲摦帪偵弌椡偝傟傞PD僪儔僀僽偺 Vender 偲 Model 傪 drivers/scsi/scsi.c
偺僽儔僢僋儕僗僩偵搊榐偡傟偽丄捠忢偼 Probe all LUNs 偑昁梫側婡庬偱傕
OFF 偵偟偰傕傛偔側傞偙偲偑傢偐傝傑偟偨丅

偆偪偺婡夿偺応崌偼丄

*** scsi.c.bak  Fri Jan 29 08:28:58 1999                               
--- scsi.c      Fri Jan 29 08:28:58 1999                               
***************                                                        
*** 280,285 ****                                                       
--- 280,286 ----                                                       
  {"IOMEGA","Io20S         *F","*", BLIST_KEY},                        
  {"INSITE","Floptical   F*8I","*", BLIST_KEY},                        
  {"INSITE","I325VM","*", BLIST_KEY},                                  
+ {"NEC","PD-1 ODX654P","*", BLIST_FORCELUN | BLIST_SINGLELUN},        
  {"NRC","MBR-7","*", BLIST_FORCELUN | BLIST_SINGLELUN},               
  {"NRC","MBR-7.4","*", BLIST_FORCELUN | BLIST_SINGLELUN},             
  {"REGAL","CDC-4X","*", BLIST_MAX5LUN | BLIST_SINGLELUN},             

偲丄偟偰傑偡丅偨偭偨 1 峴偺捛壛偱偄偄偲偼妝偱偡偹丅偨偩偟偙偺寢壥丄 PD
偺 CD 偑 /dev/scd1 偵傢傝傆傜傟傞傛偆偵側偭偰偟傑偭偨(偙偭偪偺傎偆偑傑
偲傕側摦嶌偱偡偑)偺偱丄fstab 偺曄峏偑昁梫偱偟偨丅側偍丄偙偺忣曬偼
kernel-ML 偺傾乕僇僀僽偱摼傑偟偨丅

傕偟偁側偨偑懠偺儊乕僇乕偺傕偺傪偍巊偄偱傕丄dmesg 偟偰

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆  hdc: NEC PD-1 ODX654P, ATAPI CDROM drive - enabling SCSI emulation劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

側偳偲側偭偰傞偲偙傠傪尒偰丄Vender 偲 Model 傪抲偒姺偊偰傗傞偩偗偱偍傫
側偠傛偆偵偆傑偔偄偔傫偱偼側偄偐偲巚偄傑偡(偙偺庤偱偆傑偔偄偭偨偐偨偼嫵
偊偰偔偩偝偄)丅

偟偐偟 Probe All LUNs 偟側偔偰傛偔側傞偲偄偭偰傕丄幚嵺偼暿偵偄偄偙偲偼
側偵傕側偄偺偱偡偑丄側偵偟傠偙偺傎偆偑婥帩偪偄偄偱偡偹丅

偪側傒偵 2.2.[01] 偱偼 ide-scsi.c 偑偲偰傕 buggy 側偺偱丄ATAPI-PD 傪巊
偆尷傝偼忔傝姺偊傪偟偽傜偔峊偊偨傎偆偑柍擄偱偡丅SCSI-emulattion 傪 on
偵偟偰 Probe All LUNs 傪 on 偵偡傞偲丄PD 傪擣幆偟傛偆偲偡傞偁偨傝偱僐働
傑偡丅偐偲偄偭偰丄Probe All LUNs 傪 OFF 偵偟偰丄scsi.c 偵忋婰偺堦峴傪捛
壛偡傞偲偙傟傑偨僐働傑偡偺偱張抲側偟偱偡丅傕偟偆傑偔偄偭偰傞偐偨偑偄傜
偭偟傖偄傑偟偨傜屼堦曬偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

5. 偦偺懠

偙偺暥彂媦傃揧晅偝傟偨 patch 偼柍曐徹偱偡丅僩儔僽儖偑婲偙偭偰傕巹偼愑擟
偑偲傟傑偣傫偺偱丄偛帺暘偺愑擟偱巊梡偟偰偔偩偝偄丅娫堘偄偺巜揈丄姶憐側
偳偼戝娊寎偱偡丅

Minori TAKAGAKI <takagaki@aurora.dti.ne.jp> 條偐傜偼桳塿側僐儊儞僩傪偄
偨偩偒傑偟偨丅偁傝偑偲偆偛偞偄傑偟偨丅

嵞攝晍偵偮偄偰偼 GPL 偵廬偄傑偡丅

 

(LinuxDoc 曄姺丗2000/05/12 拞栰晲梇)
(DocBook 曄姺丗2001/03/03 愮扷桾巌) 

Notes

[1]  fj.os.linux                                                       
     Message-ID: <35D6E360.AF9D2BED@st.rim.or.jp>                      

