다음 이전 차례

2. 진행순서

이 곳은 내가 한 일 모두를 순서대로 적었다. kernel panic으로 인한 절차들은 건너 뛰어도 된다 :-). super-user로서 이 process를 진행시켜야 함을 명심하자.

2.1 전원을 끄고, CD-Writer를 컴퓨터와 연결한다. 그리고 reboot

--> kernel panic 발생

2.2 1.1.64 kernel로 upgrade

--> 여전히 Kernel panic

2.3 1542cf setting을 바꿈

Mike McKenna(우리 구역 hardware 담당자)와 나는 여기저기 약간 setting을 바꾸었다. 아래에 있는 list들중 하나가 모든 error를 잡았다. 나는 "Enable Disconnection"를 CD writer에 상응하는 SCSI ID#를 위해서 "no"로 바꾼 것이 error를 잡았다고 90% 확신한다. 하지만 setting을 한 뒤, CD를 구워본 적이 없다. 이 것을 먼저 해보고, 안 되면 다른 것을 해보기 바란다. booting할 때, Ctrl-A를 눌러 SCSI-select utility의 "Configure/View Host Adapter Settings"로 들어간다. 다음은 내가 했던 setting이다.


Host Adapter IRQ Channel -> 11
Host Adapter DMA Channel -> 5
Host Adapter SCSI ID     -> 7
[BIOS Revision: 2.02; Base Address: DC000h; Firmware: Rev. B.0; Checksum: A223h]
(these should be irrelevant to you; DO NOT change the settings above)

SCSI Parity Checking           Enabled
DMA Transfer Rate              5.0 MB/sec
Host Adapter SCSI Termination  Enabled

SCSI Device Configuration
(note hard drive = #0, writer = #1, 1542 = #7)

                               #0   #1   #2   #3   #4   #5   #6   #7
Enable Sync Negotiation        no   no   no   no   no   no   no   no
Enable FAST SCSI               no   no   no   no   no   no   no   no
Enable Disconnection           yes  no   yes  yes  yes  yes  yes  yes
Send Start Unit Command        no   yes  no   no   no   no   no   no
*(default is all yes for Enable Disconnection and all no for Send Start Unit Command)

Advanced Configuration Options
Floppy Controller I/O Port (AHA-1542CF only)                  3F0h-3F7h
Reset SCSI Bus at Power-On                                    Enabled
Host Adapter BIOS (Configuration Utility Reserves BIOS Space) Enabled
System Boot (INT 19h) Controlled by Host Adapter BIOS         Enabled
Extended BIOS Translation for DOS Drives > 1 GByte            Disabled
*Support Removable Disks Under BIOS as Fixed Disks            Enabled 
Dynamically Scan SCSI Bus for BIOS Devices                    Disabled
BIOS Support for More Than 2 Drives (MS-DOS(R) 5.0 and above) Disabled
Immediate Return On Seek Command                              Enabled 
Display <Ctrl><A> Message During BIOS Initialization          Enabled 
*BIOS Support for Floptical Drives                            Enabled 

*표와 다른 것은 default와 다른 것이다. 필요하지 않은 것까지 포함한 전체 list를 보여주게 되어 미안하다. 하지만, SCSI 초보자는 좋아할 것이라고 생각한다. REMEMBER: 내가 생각하기에 필요한 변화는 "Enable Disconnection for the ID#"뿐이다. yes를 no로 바꾸면 된다.

결과는: no panic; CDROM drive를 sr0로 인식하고, SCSI generic drvier는 항상 그렇듯이 인식했는지 여부를 알려오지 않았다.

2.4 mkisofs를 사용해서 binary image 생성하기

# mkisofs -o /home/cd.image /home/dir_to_archive

[tsx-11.mit.edu의 /pub/linux/BETA/cdrom/mkisofs-1.00.tar.gz를 가져다가 사용. version 1.01까지 있음.] 또 다른 tool인 iso9660-diagnose.tar.gz를 같은 디렉토리에서 가져 올 수 있다. section 3에서 mkisofs의 사용법 참조

2.5 SCSI generic device 만들다.

# /dev/MAKEDEV  sg

Joseph Julicher는 SCSI inquiry byte를 처리하도록 kernel hacking을 제안하였다. (0x1f와 bit masking을 하면 된다). 또한 TYPE_WORM drive를 "쓰기가능"으로 바꾸었다; 제대로 웅직이게 하는 데 필요한 것인지는 확신하지는 못하지만. 사실 나는 모든 것을 "쓰기가능"으로 바꾸어 놓았다. (볼품없지만, 효과적이다!)

The original /usr/src/{linux-1.1.64/}linux/drivers/scsi/scsi.c
(beginning around line 361)

    switch (type = scsi_result[0])
      {
      case TYPE_TAPE :
      case TYPE_DISK :
      case TYPE_MOD :
        SDpnt->writeable = 1;
        break;
      case TYPE_WORM :
      case TYPE_ROM :
        SDpnt->writeable = 0;
        break;
      default :

I changed it to:

    switch (type = scsi_result[0] & 0x1f)
      {
      case TYPE_TAPE :
      case TYPE_DISK :
      case TYPE_MOD :
      case TYPE_WORM :
      case TYPE_ROM :            /* probably shouldn't be writeable :) */
        SDpnt->writeable = 1;
        break;
      default :

2.6 cdwrite를 고친다. (내가 고친 것은 v1.3)

[tsx-11.mit.edu의 /pub/linux/BETA/cdrom/private/mkisofs/cdwrite-1.3.tar.gz를 가지고 있다.]

line 439부터 original program은 다음과 갈은 code를 갖고 있었다.

set_timeout(fd, timeout);

/* First make sure we know how to talk to this writer */
inquiry (fd, &reply_len, &reply, &manufacturer[0], &model[0]);
if(strcmp(manufacturer,"PHILLIPS")) {

나는 위에 다음 두줄을 첨가함으로써 program을 바꾸었다.

/* new #define from drivers/scsi/scsi.h; orig program had this defined */
#define SG_SET_TIMEOUT  0x2201

(Following code replaced orig. code around line 439)

/*   set_timeout(fd, timeout);*/
if (ioctl(fd, SG_SET_TIMEOUT, SG_SET_TIMEOUT, &timeout) < 0) {
   perror ("ioctl SG_SET_TIMEOUT");
   exit(5);
}

/* First make sure we know how to talk to this writer */
inquiry (fd, &reply_len, &reply, &manufacturer[0], &model[0]);
if(strcmp(manufacturer,"IMS")) {

Philips CDD 521은 "IMS"를 manufacturer로 반환하고, 나는 원래 program이 했던 것처럼 timeout을 설정하도록 고쳤다. cdwrite package를 풀면, 원 program은 "orig" directory에 있다.

2.7 kernel을 다시 compile하고 reboot...

SCSI generic support를 가능하게 할 것. 그러하지 아니하면 generic driver는 kernel에 포함되지 않는다. 현재 수행되고 있는 kernel을 바꾸기 위해서는 reboot를 해야한다.

2.8 CD를 굽는다!

예를 들어, "cdwrite /dev/sgb < /home/cd.image" sgb가 CD writer, 다시 말해 SCSI generic device b (hard drive가 generic device a이므로)이고, /home/cd.image는 mkisofs로 만든 ISO9660 image이다.


다음 이전 차례