Mar 8, 1999 frc7v-cl1: Server Solaris 2.6、cc ドライバのテスト --- クライアントシステム上での cc ドライバのデバッグ#01(その6) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (http://www-online.kek.jp/~inoue/CAMAC/onl8v1-sol2.6-serv/ Cli1-CAMAC/debug-step06.txt) 高エネルギー加速器研究機構 素粒子原子核研究所 物理、オンライングループ 井上 栄二 (1). 現状確認 (A). 株式会社ロジックハウスの白田様より SPARC CPU-8VT と、VMEドライバ v2.3.1 を借用した。 (B). 株式会社ロジックハウスの白田様より Server Solaris 2.6 のシステム がインストールされているハードディスクを借用した。 (C). 借用したハードディスクのサーバ側のシステム設定を変更して、KEK の FP クラスタ上で立ち上げた。 (D). ファイルを直接修正する方法で、クライアント(その1)側のシステム 設定を変更したがクライアントは立ち上がれなかった。 (E). Solsticeを起動してホストマネージャを使って、frc7v-cl1ディスクレス クライアントの設定をやり直した。 (F). ディスクレス・クライアントのシステム、frc7v-cl1 が起動できること を確認した。 (G). frc7v-cl1 のシステムにVMEドライバ、FRCvme-2.3.1 をインストールし、 その後、frc7v-cl1 のシステム設定をやり直した。 (H). Solsticeを起動してホストマネージャを使って、frc7v-cl2ディスクレス クライアントの設定をやり直した。 (I). ディスクレス・クライアントのシステム、frc7v-cl2 が起動できること を確認した。 (J). frc7v-cl1、クライアントのシステムに ccドライバをインストールした。 (K). frc7v-cl1、クライアントのシステム上でサンプル・プログラムを実行 シングルアクションの 24ビットread/write は ok. LAM割り込み処理は、ok. ブロック転送 read/write は NG. (L). CPU-7Vのボードで FRCvme2.3.1 が正しく動作できることを確認した。 (M). frc8vt、サーバ・システムに ccドライバをインストールした。 (N). frc8vt、サーバ・システム上でンプル・プログラムを実行 シングルアクションの 24ビットread/write は ok. LAM割り込み処理は、ok. ブロック転送 read/write は 16 および 24ビットとも、ok. (O). 株式会社ロジックハウスの高橋様の修正された ccドライバを実行したが 状況に変化はなかった。 (P). 株式会社ロジックハウスの白田様の提案より、デスクレス・クライアント のシステムにローカル・ディスクをつなぎ、マウントした後で ccドライバ を実行したが状況に変化はなかった。 (Q). cam2 プログラムを実行すると、 cc.cプログラム中のどの命令を実行 した時にパニックを起こすのか調べた。 (R). 株式会社ロジックハウスの高橋様の提案より、savecore について調べる。 savecoreコマンドにより、vmcore.x および unix.x ファイルを入手した。 (S). ドライバ・プログラムが DMA完了の待ち状態のままになっているのを       確認 (2). ここでやるべきこと 正常に cam2プログラムが実行できている、frc8vt、サーバシステム上で トレースして、frc7v-cl1 での実行と比べて調べる。 (3). frc7v-cl1 上での実行再確認 割り込み処理ルーチンにトレースのための文を追加してから、実行を再確認 する。  ロジックハウスの高橋さんからのメール。 >なぜcc_intr()ルーチンが実行されないのでしょう。 >おそらく、DMA転送が終了しないか、DMAが開始されていないなどの理由で >割り込みが発生しないなどの原因ではないでしょうか? >正常に動作するシステムにてデバッグの表示をさせて比較を取ってみては >如何でしょうか? (3-1). まず、frc7v-cl1上での割り込み処理をトレースする (3-1-1). cc.c を編集、トレース用の文を付加する frc7v-cl1[42]% vi cc.c : static int cc_strategy(struct buf *bp) { register struct cc_device *cc = &ccdevice[0]; register struct K_REG *k = cc->k; register u_long dma_addr; register mode = cc->mode; register naf = cc->naf; register int wc = (mode & CC_BIT16) ? cc->len : cc->len * 2; register u_int flags; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step03. --- enter cc_strategy()"); /* E.Inoue: end */ /* check DMA mode and set flags */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step04. --- found the camac read"); /* E.Inoue: end */ flags = DDI_DMA_READ; break; case 0x0010: /* CAMAC write */ flags = DDI_DMA_WRITE; break; default: cc->status = CC_STA_BLOCK_INVFUNC; return 0; } /* change logichouse */ /* setup DMA bufer */ if((ddi_dma_buf_bind_handle(cc->handle, bp , flags | DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, (caddr_t)0, &cc->dma_cookie, &cc->ccount) != DDI_DMA_MAPPED)){ cmn_err(CE_WARN,"cc_strategy: ddi_dma_buf_bind_handle failed"); bp->b_flags |= B_ERROR; bp->b_error = EIO; return bp->b_flags; } /* if (ddi_dma_buf_setup(cc->dip, bp, flags, DDI_DMA_SLEEP, NULL, &dma_lim, &cc->handle) != DDI_DMA_MAPPED) { bp->b_error |= EIO; bp->b_flags |= B_ERROR; return bp->b_flags; } */ /* get a virtual address to hand to our device */ /* if (ddi_dma_htoc(cc->handle, NULL, &cc->dma_cookie) != DDI_SUCCESS) { bp->b_error |= EIO; bp->b_flags |= B_ERROR; return bp->b_flags; } */ /* end */ /* set up variables */ cc->bp = bp; dma_addr = cc->dma_cookie.dmac_address; /* count = cc->dma_cookie.dmac_size; */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step04-1. --- dma_addr = 0x%x", dma_add r); /* E.Inoue: end */ /* */ /* uprintf("count in 32bit=%d\n", cc->dma_cookie.dmac_size); */ cmn_err(CE_NOTE,"count in 32bit=%d", cc->dma_cookie.dmac_size); /* */ cc->retlen = 0; /* k->csr = CC_RST; */ /* K2917 Reset */ if (cc->klist == CC_KLIST_NO) { k->cma = CC_CMA_INIT; /* Initialize memory pointer */ k->cmr = mode | (cc->cur_crate << 8); k->cmr = naf; k->cmr = -(cc->len & 0xFFFF); /* Max len = 1MWord */ k->cmr = 0xFFFF; k->cmr = CC_HALT; k->cma = CC_CMA_INIT; /* Reset memory pointer */ k->maclo = dma_addr & 0xFFFF; /* Set DMA base address */ k->machi = dma_addr >> 16; k->amr = CC_AMR_INIT; /* Set VME AM code */ k->mtc = wc; k->cser = CC_DMA_RESET; /* DMA reset */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ k->docr = CC_DOCR_INIT | CC_DMA_READ; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr &= ~CC_WRITE; break; case 0x0010: /* CAMAC write */ k->docr = CC_DOCR_INIT | CC_DMA_WRITE; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr |= CC_WRITE; break; default: /* ERROR */ cc->status = CC_STA_BLOCK_INVFUNC; return 0; } } /* Kinetic list-processing */ else { k->cma = now_cma; /* Initialize memory pointer */ k->maclo = dma_addr & 0xFFFF; /* Set DMA base address */ k->machi = dma_addr >> 16; k->amr = CC_AMR_INIT; /* Set VME AM code */ k->mtc = now_wc; k->cser = CC_DMA_RESET; /* DMA reset */ k->docr = CC_DOCR_INIT | CC_DMA_READ; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr &= ~CC_WRITE; } /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step05. --- start DMA"); /* E.Inoue: end */ /* start DMA */ cc->executing_dma_flag = 1; cc->timeout_id = timeout(cc_timeout, NULL, CC_TIMEOUT_DMA * hz); k->csr |= CC_GO; /* Go! */ k->donc = CC_INT_AUTO_CLEAR | CC_INT_ENABLE | intrpri; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step06. --- return DMA"); /* E.Inoue: end */ /* wait at physio() */ /* E.Inoue: from */ mutex_enter(&cc->mutex); /* start MUTEX */ cv_wait_sig(&cc->cv, &cc->mutex); /* if (cv_wait_sig(&cc->cv, &cc->mutex) == 0) { */ /* untimeout(cc->timeout_id); */ /* mutex_exit(&cc->mutex); */ /* end MUTEX */ /* return EINTR; */ /* } */ mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: end */ return 0; } static int camac_b(struct cc_device *cc, u_short mode, u_short naf, int len, int *retlen) { register dev_t dev = cc->dev; register struct K_REG *k = cc->k; register struct uio *uio = cc->uio; /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step01. --- enter camac_b()"); /* E.Inoue: end */ cc->klist = CC_KLIST_NO; cc->mode = mode; cc->naf = naf; cc->len = len; /* set uio for DMA */ uio->uio_iov->iov_base = (caddr_t)cc->ptr_udata; uio->uio_iov->iov_len = (mode & CC_BIT16) ? len * 2: len * 4; uio->uio_iovcnt = 1; uio->uio_segflg = UIO_USERSPACE; uio->uio_offset = 0; /* */ /* uprintf(" in: 0x%x %d %d %d %d %d\n", uio->uio_iov->iov_base, uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); */ cmn_err(CE_NOTE," in: 0x%x %d %d %d %d %d", uio->uio_iov->iov_base, uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); /* */ /* execute DMA transfer */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step02. --- call physio()"); /* E.Inoue: end */ physio(cc_strategy, NULL, dev, B_READ, cc_minphys, uio); /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step07. --- return physio()"); /* E.Inoue: end */ break; case 0x0010: /* CAMAC write */ physio(cc_strategy, NULL, dev, B_WRITE, cc_minphys, uio); break; default: cc->status = CC_STA_BLOCK_INVFUNC; return 0; } k->donc = CC_INT_AUTO_CLEAR | intrpri; cc->camac_qx = k->csr; cc_sys_status = cc->bp->b_error; /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step08. --- cc_sys_status = 0x%x", cc_sys_s tatus); /* E.Inoue: end */ /* check timeout */ if (cc->interrupt & CC_INT_TIMEOUT ) { cc->interrupt &= ~CC_INT_TIMEOUT; cc->status = CC_STA_BLOCK_TIMEOUT; *retlen = 0; return cc->status; } /* */ /* uprintf("out: %d %d %d %d %d\n", uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); */ cmn_err(CE_NOTE,"out: %d %d %d %d %d", uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); /* */ /* Q-STOP mode or no error */ if ((mode & CC_QSCAN) == 0 || (k->csr & CC_ERR) == 0) { if ((mode & CC_BIT16) == 0) { cc->retlen = cc->len - k->mtc / 2; /* retlen=number of transfer */ if ((mode & CC_QSCAN) == 0 && (k->csr & CC_ERR) != 0) /* Q-STOP */ cc->retlen = cc->retlen - 2; /* delete the data of Q=0 */ cc->ptr_udata += cc->retlen * 2; /* ptr(2bytes),retlen(4bytes) */ cc->len_udata += cc->retlen * 2; } else { cc->retlen = cc->len - k->mtc; if ((mode & CC_QSCAN) == 0 && (k->csr & CC_ERR) != 0) /* Q-STOP */ cc->retlen--; /* delete the data of Q=0 */ cc->ptr_udata += cc->retlen; /* ptr(2bytes),retlen(2bytes) */ cc->len_udata += cc->retlen; } } /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step09. --- return"); /* E.Inoue: end */ /* return */ *retlen = cc->retlen; return cc->status; } "cc.c" 2761 lines, 68526 characters frc7v-cl1[43]% (3-1-2). cc.c をコンパイルする frc7v-cl1[45]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[46]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc7v-cl1[47]% (3-1-3). cc および cc.conf frc8vt:/usr/kernel/drv にコピーする rc8vt# pwd /usr/kernel/drv frc8vt# ls audio* ipdcm* lockstat.conf tnf* audiocs* ipdcm.conf logindmux* tnf.conf cc ipdptp* logindmux.conf vol* cc.conf ipdptp.conf pm* vol.conf dbri* kstat* pm.conf winlock* dump* kstat.conf ptm* winlock.conf dump.conf ksyms* ptm.conf ipd* ksyms.conf pts* ipd.conf lockstat* pts.conf frc8vt# ls -l cc* -rw-r--r-- 1 root other 56436 Mar 3 16:03 cc -rw-r--r-- 1 root other 288 Mar 3 16:03 cc.conf frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/ cc . frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/ cc.conf . frc8vt# ls -l cc* -rw-r--r-- 1 root other 56540 Mar 4 10:56 cc -rw-r--r-- 1 root other 288 Mar 4 10:56 cc.conf frc8vt# (3-1-4). ccドライバをアンロード および ロードする frc7v-cl1# pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc7v-cl1# make load ./script/cc_load.sh [Installing CAMAC device driver] cp: cannot create /usr/kernel/drv/cc: Read-only file system cp: cannot create /usr/kernel/drv/cc.conf: Read-only file system [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc7v-cl1# ls -l /dev/cc lrwxrwxrwx 1 root other 69 Mar 4 1999 /dev/cc -> /devices/iommu@ 0,10000000/sbus@0,10001000/VME@5,ffffe00/cc@2d,ff00:cc frc7v-cl1# (3-1-5). cam2プログラムを実行する frc7v-cl1[61]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[62]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 0 ここで、フリーズしてしまった。 このときコンソール上には次のようにメッセージが表示されている。 NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: camac_b: debug step02. --- call physio() NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04. --- found the camac read NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step07. --- enter cc_intr() NOTICE: cc_strategy: debug step06. --- return DMA ここで、コンソールから killコマンドをキーインして cam2 の中断を試みる。 # ps -ef UID PID PPID C STIME TTY TIME CMD root 0 0 0 16:03:33 ? 0:01 sched root 1 0 0 16:03:36 ? 0:01 /etc/init - root 2 0 0 16:03:36 ? 0:00 pageout root 3 0 0 16:03:36 ? 0:00 fsflush root 313 1 0 16:05:36 ? 0:00 /usr/lib/saf/sac -t 300 root 314 1 0 16:05:36 console 0:01 -sh root 255 1 0 16:05:26 ? 0:00 /usr/sbin/vold root 150 1 0 16:05:08 ? 0:01 /usr/sbin/inetd -s root 122 1 0 16:04:53 ? 0:00 /usr/sbin/rpcbind root 124 1 0 16:04:53 ? 0:00 /usr/sbin/keyserv root 175 1 0 16:05:11 ? 0:06 /usr/lib/autofs/automountd root 155 1 0 16:05:08 ? 0:00 /usr/lib/nfs/statd root 157 1 0 16:05:09 ? 0:01 /usr/lib/nfs/lockd root 199 1 0 16:05:15 ? 0:04 /usr/sbin/nscd root 179 1 0 16:05:12 ? 0:01 /usr/sbin/syslogd root 187 1 0 16:05:13 ? 0:00 /usr/sbin/cron root 209 1 0 16:05:18 ? 0:00 /usr/lib/lpsched root 233 1 0 16:05:21 ? 0:01 /usr/lib/sendmail -bd -q1h inoue 467 465 0 09:20:07 pts/1 0:02 -csh root 230 1 0 16:05:21 ? 0:00 /usr/lib/power/powerd root 243 1 0 16:05:22 ? 0:00 /usr/lib/utmpd root 260 1 0 16:05:26 ? 0:00 /usr/lib/locale/ja/wnn/dpkeyserv root 264 1 0 16:05:27 ? 0:00 /usr/lib/locale/ja/wnn/jserver root 265 264 0 16:05:27 ? 0:00 /usr/lib/locale/ja/wnn/jserver_m root 316 313 0 16:05:37 ? 0:00 /usr/lib/saf/ttymon root 307 1 0 16:05:35 ? 0:01 /usr/lib/dmi/snmpXdmid -s frc7v-c l1 root 465 150 0 09:20:06 ? 0:00 in.rlogind root 294 1 0 16:05:32 ? 0:00 /usr/lib/snmp/snmpdx -y -c /etc/s nmp/conf inoue 338 336 0 16:10:09 pts/0 0:02 -csh root 336 150 0 16:10:09 ? 0:00 in.rlogind root 299 1 0 16:05:33 ? 0:02 /usr/dt/bin/dtlogin -daemon root 317 294 0 16:05:38 ? 0:01 mibiisa -p 32797 root 306 1 0 16:05:35 ? 0:01 /usr/lib/dmi/dmispd root 486 150 0 10:32:28 ? 0:00 in.rlogind inoue 488 486 0 10:32:29 pts/2 0:02 -csh inoue 578 338 0 11:26:48 pts/0 0:00 cam2 root 579 314 1 11:28:58 console 0:00 ps -ef # kill 578 e=9 rp=fc0c18e4 addr=f6146f5c mmu_fsr=326 rw=1htsyp() cam2: Data fault kernel read fault at addr=0xf6146f5c, pme=0x0 MMU sfsr=326: Invalid Address on supv data fetch at level 3 pte addr = 0xf604fe18, level = 3 wrong ctx/as ctx 0, as 0xf5914510 wrong ctx/as 2 ctx 0, as 0x3f pid=578, pc=0xf607f540, sp=0xfc0c1930, psr=0x44010c5, context=0 g1-g7: f026de48, 13da3, f6055198, c00, 200, 1, f5edecc0 Begin traceback... sp = fc0c1930 Called from f6077dd0, fp=fc0c19a0, args=0 2a 600 fc0c1ad8 f6101f00 f00000 Called from f00bd3ac, fp=fc0c1a70, args=f00000 5 600 2a fc0c1b08 f5c86850 Called from f0068900, fp=fc0c1b80, args=f593bae0 f5c85044 22 3 22 3 Called from 11f30, fp=effff8c0, args=1 600 3f53c0 5 24a70 24a80 End traceback... panic: Data fault syncing file systems... 2 done 2795 static and sysmap kernel pages 82 dynamic kernel data pages 490 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 287 current user process pages 3654 total pages (3654 chunks) dumping to vp f59444dc, offset 138744 3654 total pages, dump succeeded rebooting... Resetting ... ^?screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory / Type help for more information ok boot net Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump...System went down at Thu Mar 4 11:29:30 1999 Saving 3654 pages of image in vmcore.7 3654 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.7 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: (3-1-6). cc_intr()ルーチンのトレースをもっと細かくする /****************************************************** * cc_intr * ******************************************************/ static u_int cc_intr() { register struct cc_device *cc = &ccdevice[0]; register struct K_REG *k = cc->k; mutex_enter(&cc->mutex); /* start MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06. --- enter cc_intr()"); /* E.Inoue: end */ /* check K2917 register */ if ((k->csr & CC_LAM) != 0) cc->interrupt |= CC_INT_LAM; if ((k->csr & CC_DONE) != 0) cc->interrupt |= CC_INT_DONE; if ((k->empc & CC_INT_ENABLE) == 0) cc->interrupt |= CC_INT_EMPTY; if ((k->aboc & CC_INT_ENABLE) == 0) cc->interrupt |= CC_INT_ABORT; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06a. --- cc->interrupt=0x%x", cc->inter rupt); /* E.Inoue: end */ /* free DMA resources */ if (cc->executing_dma_flag != 0) { /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06b. --- cc->executing_dma_flag != 0"); /* E.Inoue: end */ /* change logichouse */ /* ddi_dma_free(cc->handle); */ ddi_dma_unbind_handle(cc->handle); /* end */ biodone(cc->bp); cc->executing_dma_flag = 0; } if (cc->interrupt == 0) { /* reject interrupt, then return */ mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06c. --- reject interrupt: return cc_in tr()"); /* E.Inoue: end */ return DDI_INTR_UNCLAIMED; } else { /* accept interrupt, then wake up waiting process, then return */ untimeout(cc->timeout_id); cv_signal(&cc->cv); mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06d. --- accept interrupt: return cc_in tr()"); /* E.Inoue: end */ return DDI_INTR_CLAIMED; } } : : static int cc_strategy(struct buf *bp) { register struct cc_device *cc = &ccdevice[0]; register struct K_REG *k = cc->k; register u_long dma_addr; register mode = cc->mode; register naf = cc->naf; register int wc = (mode & CC_BIT16) ? cc->len : cc->len * 2; register u_int flags; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step03. --- enter cc_strategy()"); /* E.Inoue: end */ /* check DMA mode and set flags */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step04. --- found the camac read"); /* E.Inoue: end */ flags = DDI_DMA_READ; break; case 0x0010: /* CAMAC write */ flags = DDI_DMA_WRITE; break; default: cc->status = CC_STA_BLOCK_INVFUNC; return 0; } /* change logichouse */ /* setup DMA bufer */ if((ddi_dma_buf_bind_handle(cc->handle, bp , flags | DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, (caddr_t)0, &cc->dma_cookie, &cc->ccount) != DDI_DMA_MAPPED)){ cmn_err(CE_WARN,"cc_strategy: ddi_dma_buf_bind_handle failed"); bp->b_flags |= B_ERROR; bp->b_error = EIO; return bp->b_flags; } /* if (ddi_dma_buf_setup(cc->dip, bp, flags, DDI_DMA_SLEEP, NULL, &dma_lim, &cc->handle) != DDI_DMA_MAPPED) { bp->b_error |= EIO; bp->b_flags |= B_ERROR; return bp->b_flags; } */ /* get a virtual address to hand to our device */ /* if (ddi_dma_htoc(cc->handle, NULL, &cc->dma_cookie) != DDI_SUCCESS) { bp->b_error |= EIO; bp->b_flags |= B_ERROR; return bp->b_flags; } */ /* end */ /* set up variables */ cc->bp = bp; dma_addr = cc->dma_cookie.dmac_address; /* count = cc->dma_cookie.dmac_size; */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step04-1. --- dma_addr = 0x%x", dma_add r); /* E.Inoue: end */ /* */ /* uprintf("count in 32bit=%d\n", cc->dma_cookie.dmac_size); */ cmn_err(CE_NOTE,"count in 32bit=%d", cc->dma_cookie.dmac_size); /* */ cc->retlen = 0; /* k->csr = CC_RST; */ /* K2917 Reset */ if (cc->klist == CC_KLIST_NO) { k->cma = CC_CMA_INIT; /* Initialize memory pointer */ k->cmr = mode | (cc->cur_crate << 8); k->cmr = naf; k->cmr = -(cc->len & 0xFFFF); /* Max len = 1MWord */ k->cmr = 0xFFFF; k->cmr = CC_HALT; k->cma = CC_CMA_INIT; /* Reset memory pointer */ k->maclo = dma_addr & 0xFFFF; /* Set DMA base address */ k->machi = dma_addr >> 16; k->amr = CC_AMR_INIT; /* Set VME AM code */ k->mtc = wc; k->cser = CC_DMA_RESET; /* DMA reset */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ k->docr = CC_DOCR_INIT | CC_DMA_READ; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr &= ~CC_WRITE; break; case 0x0010: /* CAMAC write */ k->docr = CC_DOCR_INIT | CC_DMA_WRITE; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr |= CC_WRITE; break; default: /* ERROR */ cc->status = CC_STA_BLOCK_INVFUNC; return 0; } } /* Kinetic list-processing */ else { k->cma = now_cma; /* Initialize memory pointer */ k->maclo = dma_addr & 0xFFFF; /* Set DMA base address */ k->machi = dma_addr >> 16; k->amr = CC_AMR_INIT; /* Set VME AM code */ k->mtc = now_wc; k->cser = CC_DMA_RESET; /* DMA reset */ k->docr = CC_DOCR_INIT | CC_DMA_READ; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr &= ~CC_WRITE; } /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step05. --- start DMA"); /* E.Inoue: end */ /* start DMA */ cc->executing_dma_flag = 1; cc->timeout_id = timeout(cc_timeout, NULL, CC_TIMEOUT_DMA * hz); k->csr |= CC_GO; /* Go! */ k->donc = CC_INT_AUTO_CLEAR | CC_INT_ENABLE | intrpri; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07. --- return DMA"); /* E.Inoue: end */ /* wait at physio() */ /* E.Inoue: from */ mutex_enter(&cc->mutex); /* start MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07a. --- call cv_wait_sig()"); /* E.Inoue: end */ /* cv_wait_sig(&cc->cv, &cc->mutex); */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07b. --- return cv_wait_sig()"); /* E.Inoue: end */ /* if (cv_wait_sig(&cc->cv, &cc->mutex) == 0) { */ /* untimeout(cc->timeout_id); */ /* mutex_exit(&cc->mutex); */ /* end MUTEX */ /* return EINTR; */ /* } */ mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: end */ return 0; } static int camac_b(struct cc_device *cc, u_short mode, u_short naf, int len, int *retlen) { register dev_t dev = cc->dev; register struct K_REG *k = cc->k; register struct uio *uio = cc->uio; /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step01. --- enter camac_b()"); /* E.Inoue: end */ cc->klist = CC_KLIST_NO; cc->mode = mode; cc->naf = naf; cc->len = len; /* set uio for DMA */ uio->uio_iov->iov_base = (caddr_t)cc->ptr_udata; uio->uio_iov->iov_len = (mode & CC_BIT16) ? len * 2: len * 4; uio->uio_iovcnt = 1; uio->uio_segflg = UIO_USERSPACE; uio->uio_offset = 0; /* */ /* uprintf(" in: 0x%x %d %d %d %d %d\n", uio->uio_iov->iov_base, uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); */ cmn_err(CE_NOTE," in: 0x%x %d %d %d %d %d", uio->uio_iov->iov_base, uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); /* */ /* execute DMA transfer */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step02. --- call physio()"); /* E.Inoue: end */ physio(cc_strategy, NULL, dev, B_READ, cc_minphys, uio); /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step07. --- return physio()"); /* E.Inoue: end */ break; case 0x0010: /* CAMAC write */ physio(cc_strategy, NULL, dev, B_WRITE, cc_minphys, uio); break; default: cc->status = CC_STA_BLOCK_INVFUNC; return 0; } k->donc = CC_INT_AUTO_CLEAR | intrpri; cc->camac_qx = k->csr; cc_sys_status = cc->bp->b_error; /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step08. --- cc_sys_status = 0x%x", cc_sys_s tatus); /* E.Inoue: end */ /* check timeout */ if (cc->interrupt & CC_INT_TIMEOUT ) { cc->interrupt &= ~CC_INT_TIMEOUT; cc->status = CC_STA_BLOCK_TIMEOUT; *retlen = 0; return cc->status; } /* */ /* uprintf("out: %d %d %d %d %d\n", uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); */ cmn_err(CE_NOTE,"out: %d %d %d %d %d", uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); /* */ /* Q-STOP mode or no error */ if ((mode & CC_QSCAN) == 0 || (k->csr & CC_ERR) == 0) { if ((mode & CC_BIT16) == 0) { cc->retlen = cc->len - k->mtc / 2; /* retlen=number of transfer */ if ((mode & CC_QSCAN) == 0 && (k->csr & CC_ERR) != 0) /* Q-STOP */ cc->retlen = cc->retlen - 2; /* delete the data of Q=0 */ cc->ptr_udata += cc->retlen * 2; /* ptr(2bytes),retlen(4bytes) */ cc->len_udata += cc->retlen * 2; } else { cc->retlen = cc->len - k->mtc; if ((mode & CC_QSCAN) == 0 && (k->csr & CC_ERR) != 0) /* Q-STOP */ cc->retlen--; /* delete the data of Q=0 */ cc->ptr_udata += cc->retlen; /* ptr(2bytes),retlen(2bytes) */ cc->len_udata += cc->retlen; } } /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step09. --- return"); /* E.Inoue: end */ /* return */ *retlen = cc->retlen; return cc->status; } cam2 を実行 frc7v-cl1[73]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 16 Input data >555 camac スイッチ・レジスタのデータ・ビット LED は、d1、d2、d4、d6、d10 の各ビットが点灯した。 write した値は、555(dec) = 22B(hex) だから 正しい値が camac write できたことが確認できた。 cam2プログラムの実行はここでフリーズしている。 このときのコンソール・メッセージは次のとおり。 NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step06. --- enter cc_intr() NOTICE: cc_intr: debug step06a. --- cc->interrupt=0xe NOTICE: cc_intr: debug step06b. --- cc->executing_dma_flag != 0 NOTICE: cc_intr: debug step06d. --- accept interrupt: return cc_intr() NOTICE: cc_strategy: debug step07. --- return DMA NOTICE: cc_strategy: debug step07a. --- call cv_wait_sig() cam2 の実行を中断するために CTL-C をキーインすると、システムはパニック を起こしてリブートした。 NOTBCA: D _stTatRgy: dAPug st: t7y. --p eetu=9 cv_wait_sig() rp=fc05e8e4 addr=f617af5c mmu_fsr=326 rw=1 cam2: Data fault kernel read fault at addr=0xf617af5c, pme=0x0 MMU sfsr=326: Invalid Address on supv data fetch at level 3 pte addr = 0xf60401e8, level = 3 wrong ctx/as ctx 0, as 0xf59146a0 wrong ctx/as 2 ctx 0, as 0x8e pid=496, pc=0xf604e5f8, sp=0xfc05e930, psr=0x44010c5, context=0 g1-g7: f5900000, f026f0bc, a00, c00, 200, 1, f5d63ca0 Begin traceback... sp = fc05e930 Called from f6046df8, fp=fc05e9a0, args=0 2a 610 fc05ead8 f6172f00 f00000 Called from f00bd3ac, fp=fc05ea70, args=f00000 5 610 2a fc05eb08 f5e04e68 Called from f0068900, fp=fc05eb80, args=f5b1ac98 f5deb584 22 3 22 3 Called from 11f30, fp=effff8c0, args=1 610 3f53c0 5 24a70 24a80 End traceback... panic: Data fault syncing file systems... 2 done 2855 static and sysmap kernel pages 66 dynamic kernel data pages 480 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 287 current user process pages 3688 total pages (3688 chunks) dumping to vp f59444dc, offset 138472 3688 total pages, dump succeeded rebooting... Resetting ... ^?screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory - Type help for more information ok boot net Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump...System went down at Tue Mar 9 14:45:58 1999 Saving 3688 pages of image in vmcore.14 3688 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.14 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: システムは正常に立ち上がった。 ホームディレクトリをマウントする。 onlsun1[70]% !! rlogin frc7v-cl1 Password: No directory! Logging in with home=/ Last login: Tue Mar 9 14:13:17 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1% su Password: # mount frc8vt:/export/home/frc8vt /export/home/frc7v-cl1 # frc7v-cl1% logout Connection closed. onlsun1[71]% !! rlogin frc7v-cl1 Last login: Tue Mar 9 15:19:06 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1[33]% ls -l total 8 drwxr-xr-x 3 inoue staff 512 Feb 9 15:34 CAMAC/ drwxr-xr-x 3 inoue staff 512 Nov 6 11:07 FORCE/ drwxr-xr-x 2 inoue staff 512 Feb 18 10:29 Ktaka/ -rw------- 1 inoue staff 592 Feb 26 16:49 mbox frc7v-cl1[34]% cv_wait_sig()コールをはずしてみる。 frc7v-cl1[39]% vi cc.c : /* wait at physio() */ /* E.Inoue: from */ mutex_enter(&cc->mutex); /* start MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07a. --- call cv_wait_sig()"); /* E.Inoue: end */ /* cv_wait_sig(&cc->cv, &cc->mutex); */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07b. --- return cv_wait_sig()"); /* E.Inoue: end */ /* if (cv_wait_sig(&cc->cv, &cc->mutex) == 0) { */ /* untimeout(cc->timeout_id); */ /* mutex_exit(&cc->mutex); */ /* end MUTEX */ /* return EINTR; */ /* } */ mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: end */ "cc.c" 2784 lines, 69270 characters frc7v-cl1[42]% cc.cファイルをコンパイルする。 frc7v-cl1[42]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc7v-cl1[43]% cc および cc.confファイルをコピーし直す。 frc8vt# ls -l cc* -rwxr-xr-x 1 root sys 57284 Mar 9 14:41 cc* -rwxr-xr-x 1 root sys 288 Mar 9 14:41 cc.conf* frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/ cc . frc8vt# ^cc^cc.conf rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc.conf . frc8vt# ls -l cc* -rwxr-xr-x 1 root sys 57248 Mar 9 15:28 cc* -rwxr-xr-x 1 root sys 288 Mar 9 15:29 cc.conf* frc8vt# ccドライバをロードし直す。 frc7v-cl1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc7v-cl1# make load ./script/cc_load.sh [Installing CAMAC device driver] cp: cannot create /usr/kernel/drv/cc: Read-only file system cp: cannot create /usr/kernel/drv/cc.conf: Read-only file system [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc7v-cl1# ls -l /dev/cc lrwxrwxrwx 1 root other 69 Mar 9 1999 /dev/cc -> /devices/iommu@ 1,10000000/sbus@0,10001000/VME@5,ffffe00/cc@2d,ff00:cc frc7v-cl1# cam2プログラムを実行。 frc7v-cl1[46]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 16 Input data >777 camac スイッチ・レジスタのデータ・ビット LED は、d1、d4、d9、d10 の各ビットが点灯した。 write した値は、777(dec) = 309(hex) だから 正しい値が camac write できたことが確認できた。 cam2プログラムはここでフリーズ。 システムはリブートしてしまった。 NOTICE:B Aamac_b: D Tug step01. -RA Pnter cam:c_b() NOTICE ty: 0x3fp3c0e1= 1 34 0 0 9OTICE: cc srrptegy: =ebug fce0038 --- entcr8cc_strategy() dNOrICE:=cfunt6i1 32bit=10g step04-d. --- dma_addr = 0x3c0 NO3bCE: cf5stcategy debmg step0m. --- staut DMA NOTI_E: cc_infs: reb=g step03. 2-6 rnwer cc_in=r() N1TICE: cam2: Data fault kernel read fault at addr=0xf613bf5c, pme=0x0 MMU sfsr=326: Invalid Address on supv data fetch at level 3 pte addr = 0xf60fcfec, level = 3 wrong ctx/as ctx 0, as 0xf59147e0 wrong ctx/as 2 ctx 0, as 0xf7 pid=405, pc=0xf60785e0, sp=0xfc08c930, psr=0x44010c7, context=0 g1-g7: f5900000, f026f0bc, a00, c00, 200, 1, f5fb7b00 cc_Bntre debug steg06a.i--- cc-n nterruptr0xe tesTICEp cc_i=t : febug stec068c --- a9ce3t 0ting.dma_flag != 0 ruptCaretull cc_inte() d TICE: cc_strftegyr dobm sfep076 -0- 70tdrn DMf 8OTICE:, cc stfategy: debug spe=f7a.c--- call0cv_8aitc9ia(0 NOTI,E: cc_strategy:arebuggsteps7b=0- - return2cv_waat_si ()610 fc08cad8 f60fbf 00 f00000 Called from f00bd3ac, fp=fc08ca70, args=f00000 5 610 2a fc08cb08 f5c84790 Called from f0068900, fp=fc08cb80, args=f5b19d88 f5c86d8c 22 3 22 3 Called from 11f30, fp=effff8c0, args=1 610 3f53c0 5 24a70 24a80 End traceback... panic: Data fault syncing file systems... 2 done 2790 static and sysmap kernel pages 102 dynamic kernel data pages 496 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 287 current user process pages 3675 total pages (3675 chunks) dumping to vp f59444dc, offset 138576 3675 total pages, dump succeeded rebooting... Resetting ... ^?screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory / Type help for more information ok ok boot net Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Rebooting with command: net Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump...System went down at Tue Mar 9 15:24:13 1999 Saving 3675 pages of image in vmcore.15 3675 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.15 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: システムは正常に立ち上がった。 ホームディレクトリをマウントする。 onlsun1[72]% !! rlogin frc7v-cl1 Password: No directory! Logging in with home=/ Last login: Tue Mar 9 15:19:56 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1% su Password: # mount frc8vt:/export/home/frc8vt /export/home/frc7v-cl1 # frc7v-cl1% logout Connection closed. onlsun1[73]% !! rlogin frc7v-cl1 Last login: Tue Mar 9 15:36:30 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1[33]% ls -l total 8 drwxr-xr-x 3 inoue staff 512 Feb 9 15:34 CAMAC/ drwxr-xr-x 3 inoue staff 512 Nov 6 11:07 FORCE/ drwxr-xr-x 2 inoue staff 512 Feb 18 10:29 Ktaka/ -rw------- 1 inoue staff 592 Feb 26 16:49 mbox frc7v-cl1[34]% パニック時のスタックトレース frc7v-cl1[37]% adb -k unix.15 vmcore.15 physmem 3e2d $c complete_panic(0x0,0x4401ce2,0x0,0x44010e2,0x0,0xf00) + 5c do_panic(0x1,0xfc08c794,0x0,0x48010e2,0x1,0xf5bc5500) + a8 vcmn_err(0x3,0xf0269878,0xfc08c794,0x3,0xffeec000,0x0) + 180 cmn_err(0x3,0xf0269878,0xfc08d,0x53,0x53,0xf025e400) + 1c die(0x9,0xfc08c8e4,0xf613bf5c,0x326,0x1,0xf0269878) + bc trap(0x0,0xfc08c8e4,0xf0000000,0x0,0x6,0x1) + 930 fault(?) + 84 physio(0x0,0xf028c49c,0xa,0x100,0xf59147e0,0xfc08cad8) camac_b(0x0,0x2a,0x610,0xfc08cad8,0xf60fbf00,0xf00000) + 248 cc_write(0xf00000,0x5,0x610,0x2a,0xfc08cb08,0xf5c84790) + 418 writev(0xf5b19d88) + 2b0 $q frc7v-cl1[38]% 現在、camacスイッチ・レジスタには 777(dec) の値が書かれている。 ここで、read時に正しい値が読み出されるかどうかを確認するために readコマンドを発行してみる。 frc7v-cl1[61]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >^C *** TERMINATING cam2 *** Received signal 2 SIGINT frc7v-cl1[62]% cam2プログラムを最初から実行すると、ブロック転送をやる前に camacイニシャライズを実行するので先ほどスイッチレジスタのバッファに 書き込んだデータはクリアされてしまう。 そこで、スイッチレジスタの バッファを読むのではなくて、スイッチの設定データを読んでみることに する。 スイッチの設定は、7(hex)に設定しておく。 frc7v-cl1[62]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[63]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 1 0 cam2プログラムはここでフリーズした。 この時、camacデータウェイ・ディスプレー・モジュールは、 read dataビットは、d1、d2、d3 だけが点灯している。 サブアドレスは sa1 だけが点灯している。 そして、x、q の LED も点灯している。 以上のことから、DMA リードの実行で読み出し先からは正しい値のデータ 7(hex)が読み出されているといえる。 cam2プログラムがフリーズした時点で、システムはパニックを起こして リブートしてしまった。 TICE:B AamacDb Tebug RtAp01.P--- en:er camac_b() NOTIC : intypx3fe3c0 10 1 3= 09 NOTIrp=fcc0mac_b: deb7g ctep028 -e- c4l phyaiod) NOdICE:r=fc6stra0egy: debdg step03.f5-- enc r cm_smruteg_() NfTICEsr=cc_str3tegy: debug s2ep6 .rw-- f=u1d cam2: Data fault kernel read fault at addr=0xf60d0f5c, pme=0x0 MMU sfsr=326: Invalid Address on supv data fetch at level 3 pte addr = 0xf603ee40, level = 3 wrong ctx/as ctx 0, as 0xf5914600 wrong ctx/as 2 ctx 0, as 0x91 pid=487, pc=0xf604b5e0, sp=0xfc07c930, psr=0x44010c4, context=0 g1-g7: f026de48, 123b3, f60287f8, c00, 200, 1, f5e479e0 e camac rBad .N. IsE: count in 32bip=1 g etep0ba1. --- dmc_addr = kx3.0 NO=ICE: cfctrategy: de0ug st7p05. --c s9a3t 0MA 6NOTICE: cc_in0r4 debu3 stepd6a. --- dc0>,nte rupt=0xf p=TICE: cc_intr: febug step06c. 0-- cc-7cx9auting_dma_fla0 != 0 6NOTICE: cc_2tra0eg : dfbugcstep07.0--- r7curn DMadt: ret rn cc_intr() 8OTICE: cc_strategy: debugf step07a. --- 6all cv_wait_s0gce _sigCf: 0cc0 trategf: deb0g step07b. 0-- 0e0urn cv_0ai C NOaICE: camal_bl eebug dtep0 .f--r retuonmphy if() 00bd3ac, fp=fc07ca70, args=f00000 5 620 2a fc07cb08 f5c85cd0 Called from f0068900, fp=fc07cb80, args=f5b19d10 f5c84a5c 22 3 22 3 Called from 11f30, fp=effff8c0, args=1 620 3f53c0 5 24a70 24a80 End traceback... panic: Data fault syncing file systems... 2 done 2678 static and sysmap kernel pages 90 dynamic kernel data pages 382 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 287 current user process pages 3437 total pages (3437 chunks) dumping to vp f59444dc, offset 140480 3437 total pages, dump succeeded rebooting... Resetting ... ^?screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Rebooting with command: ok ok boot net Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Rebooting with command: net Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 The system is coming up. Please wait. checking for crash dump...System went down at Wed Mar 10 10:19:05 1999 Saving 3437 pages of image in vmcore.16 3437 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.16 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: システムは正常に立ち上がった。 ホームディレクトリをマウントする。 onlsun1[74]% !! rlogin frc7v-cl1 Password: No directory! Logging in with home=/ Last login: Tue Mar 9 15:47:17 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1% su Password: # mount frc8vt:/export/home/frc8vt /export/home/frc7v-cl1 # frc7v-cl1% logout Connection closed. onlsun1[75]% !! rlogin frc7v-cl1 Last login: Wed Mar 10 10:28:48 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1[33]% ls -l total 8 drwxr-xr-x 3 inoue staff 512 Feb 9 15:34 CAMAC/ drwxr-xr-x 3 inoue staff 512 Nov 6 11:07 FORCE/ drwxr-xr-x 2 inoue staff 512 Feb 18 10:29 Ktaka/ -rw------- 1 inoue staff 592 Feb 26 16:49 mbox frc7v-cl1[34]% ここまでの状況から言えることは、DMAのデータ転送は正しく行われている。 つまり、DMAアドレスは正しく設定されており、データの受け渡しは問題なく 行えている。 その後、システムが DMA手続きを終わろうとするところで エラーを起こしている。 <<< frc8vt でのトレース >>> 高橋さんからのメール。 ----- ここから 新しいクラッシュダンプを入手して解析した結果をお知らせします。 adbコマンドにて $c complete_panic(0x0,0x4401ce1,0x0,0x44010e1,0x0,0xf00) + 5c do_panic(0x1,0xfc04f794,0x0,0x48010e1,0x1,0xf5bd7b00) + a8 vcmn_err(0x3,0xf0269878,0xfc04f794,0x3,0xffeec000,0x0) + 180 cmn_err(0x3,0xf0269878,0xfc050,0x53,0x53,0xf025e400) + 1c die(0x9,0xfc04f8e4,0xf61a1f5c,0x326,0x1,0xf0269878) + bc trap(0x0,0xfc04f8e4,0xf0000000,0x0,0x6,0x1) + 930 fault(?) + 84 cmn_err(0x1,0xf60e0ec8,0xa,0x40,0xf5914790,0xfc04fad8)  <-- uprintfが cmn_errに変わっている。 camac_b(0x0,0x2a,0x600,0xfc04fad8,0xf6162f00,0xf00000) + 208 cc_write(0xf00000,0x5,0x600,0x2a,0xfc04fb08,0xf5fe00c8) + 3f0 writev(0xf593bd38) + 2b0 $q panicする原因が、uprintf()からcmn_err()に変わってしまいまし た。 cmn_err()で表示しようとしている変数のアドレスが無いなどの理由かと思いま す。 また、CTRL+Cを入力するとpanicしてしまうのはcv_wait_sig()から復帰して 再びドライバルーチンの実行が開始される為です。 しかし、なぜcc_intr()ルーチンが実行されないのでしょう。 おそらく、DMA転送が終了しないか、DMAが開始されていないなどの理由で 割り込みが発生しないなどの原因ではないでしょうか? 正常に動作するシステムにてデバッグの表示をさせて比較を取ってみては 如何でしょうか? また、このときにcc_intr()ルーチンが実際に呼ばれたかどうか確認する為、デバッ グの表示を いれて確認するのが良いかと思います。 ----- ここまで まず、frc7v-cl1上での割り込み処理をトレース frc7v-cl1[42]% vi cc.c : static int cc_strategy(struct buf *bp) { register struct cc_device *cc = &ccdevice[0]; register struct K_REG *k = cc->k; register u_long dma_addr; register mode = cc->mode; register naf = cc->naf; register int wc = (mode & CC_BIT16) ? cc->len : cc->len * 2; register u_int flags; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step03. --- enter cc_strategy()"); /* E.Inoue: end */ /* check DMA mode and set flags */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step04. --- found the camac read"); /* E.Inoue: end */ flags = DDI_DMA_READ; break; case 0x0010: /* CAMAC write */ flags = DDI_DMA_WRITE; break; default: cc->status = CC_STA_BLOCK_INVFUNC; return 0; } /* change logichouse */ /* setup DMA bufer */ if((ddi_dma_buf_bind_handle(cc->handle, bp , flags | DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, (caddr_t)0, &cc->dma_cookie, &cc->ccount) != DDI_DMA_MAPPED)){ cmn_err(CE_WARN,"cc_strategy: ddi_dma_buf_bind_handle failed"); bp->b_flags |= B_ERROR; bp->b_error = EIO; return bp->b_flags; } /* if (ddi_dma_buf_setup(cc->dip, bp, flags, DDI_DMA_SLEEP, NULL, &dma_lim, &cc->handle) != DDI_DMA_MAPPED) { bp->b_error |= EIO; bp->b_flags |= B_ERROR; return bp->b_flags; } */ /* get a virtual address to hand to our device */ /* if (ddi_dma_htoc(cc->handle, NULL, &cc->dma_cookie) != DDI_SUCCESS) { bp->b_error |= EIO; bp->b_flags |= B_ERROR; return bp->b_flags; } */ /* end */ /* set up variables */ cc->bp = bp; dma_addr = cc->dma_cookie.dmac_address; /* count = cc->dma_cookie.dmac_size; */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step04-1. --- dma_addr = 0x%x", dma_add r); /* E.Inoue: end */ /* */ /* uprintf("count in 32bit=%d\n", cc->dma_cookie.dmac_size); */ cmn_err(CE_NOTE,"count in 32bit=%d", cc->dma_cookie.dmac_size); /* */ cc->retlen = 0; /* k->csr = CC_RST; */ /* K2917 Reset */ if (cc->klist == CC_KLIST_NO) { k->cma = CC_CMA_INIT; /* Initialize memory pointer */ k->cmr = mode | (cc->cur_crate << 8); k->cmr = naf; k->cmr = -(cc->len & 0xFFFF); /* Max len = 1MWord */ k->cmr = 0xFFFF; k->cmr = CC_HALT; k->cma = CC_CMA_INIT; /* Reset memory pointer */ k->maclo = dma_addr & 0xFFFF; /* Set DMA base address */ k->machi = dma_addr >> 16; k->amr = CC_AMR_INIT; /* Set VME AM code */ k->mtc = wc; k->cser = CC_DMA_RESET; /* DMA reset */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ k->docr = CC_DOCR_INIT | CC_DMA_READ; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr &= ~CC_WRITE; break; case 0x0010: /* CAMAC write */ k->docr = CC_DOCR_INIT | CC_DMA_WRITE; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr |= CC_WRITE; break; default: /* ERROR */ cc->status = CC_STA_BLOCK_INVFUNC; return 0; } } /* Kinetic list-processing */ else { k->cma = now_cma; /* Initialize memory pointer */ k->maclo = dma_addr & 0xFFFF; /* Set DMA base address */ k->machi = dma_addr >> 16; k->amr = CC_AMR_INIT; /* Set VME AM code */ k->mtc = now_wc; k->cser = CC_DMA_RESET; /* DMA reset */ k->docr = CC_DOCR_INIT | CC_DMA_READ; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr &= ~CC_WRITE; } /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step05. --- start DMA"); /* E.Inoue: end */ /* start DMA */ cc->executing_dma_flag = 1; cc->timeout_id = timeout(cc_timeout, NULL, CC_TIMEOUT_DMA * hz); k->csr |= CC_GO; /* Go! */ k->donc = CC_INT_AUTO_CLEAR | CC_INT_ENABLE | intrpri; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step06. --- return DMA"); /* E.Inoue: end */ /* wait at physio() */ /* E.Inoue: from */ mutex_enter(&cc->mutex); /* start MUTEX */ cv_wait_sig(&cc->cv, &cc->mutex); /* if (cv_wait_sig(&cc->cv, &cc->mutex) == 0) { */ /* untimeout(cc->timeout_id); */ /* mutex_exit(&cc->mutex); */ /* end MUTEX */ /* return EINTR; */ /* } */ mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: end */ return 0; } static int camac_b(struct cc_device *cc, u_short mode, u_short naf, int len, int *retlen) { register dev_t dev = cc->dev; register struct K_REG *k = cc->k; register struct uio *uio = cc->uio; /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step01. --- enter camac_b()"); /* E.Inoue: end */ cc->klist = CC_KLIST_NO; cc->mode = mode; cc->naf = naf; cc->len = len; /* set uio for DMA */ uio->uio_iov->iov_base = (caddr_t)cc->ptr_udata; uio->uio_iov->iov_len = (mode & CC_BIT16) ? len * 2: len * 4; uio->uio_iovcnt = 1; uio->uio_segflg = UIO_USERSPACE; uio->uio_offset = 0; /* */ /* uprintf(" in: 0x%x %d %d %d %d %d\n", uio->uio_iov->iov_base, uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); */ cmn_err(CE_NOTE," in: 0x%x %d %d %d %d %d", uio->uio_iov->iov_base, uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); /* */ /* execute DMA transfer */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step02. --- call physio()"); /* E.Inoue: end */ physio(cc_strategy, NULL, dev, B_READ, cc_minphys, uio); /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step07. --- return physio()"); /* E.Inoue: end */ break; case 0x0010: /* CAMAC write */ physio(cc_strategy, NULL, dev, B_WRITE, cc_minphys, uio); break; default: cc->status = CC_STA_BLOCK_INVFUNC; return 0; } k->donc = CC_INT_AUTO_CLEAR | intrpri; cc->camac_qx = k->csr; cc_sys_status = cc->bp->b_error; /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step08. --- cc_sys_status = 0x%x", cc_sys_s tatus); /* E.Inoue: end */ /* check timeout */ if (cc->interrupt & CC_INT_TIMEOUT ) { cc->interrupt &= ~CC_INT_TIMEOUT; cc->status = CC_STA_BLOCK_TIMEOUT; *retlen = 0; return cc->status; } /* */ /* uprintf("out: %d %d %d %d %d\n", uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); */ cmn_err(CE_NOTE,"out: %d %d %d %d %d", uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); /* */ /* Q-STOP mode or no error */ if ((mode & CC_QSCAN) == 0 || (k->csr & CC_ERR) == 0) { if ((mode & CC_BIT16) == 0) { cc->retlen = cc->len - k->mtc / 2; /* retlen=number of transfer */ if ((mode & CC_QSCAN) == 0 && (k->csr & CC_ERR) != 0) /* Q-STOP */ cc->retlen = cc->retlen - 2; /* delete the data of Q=0 */ cc->ptr_udata += cc->retlen * 2; /* ptr(2bytes),retlen(4bytes) */ cc->len_udata += cc->retlen * 2; } else { cc->retlen = cc->len - k->mtc; if ((mode & CC_QSCAN) == 0 && (k->csr & CC_ERR) != 0) /* Q-STOP */ cc->retlen--; /* delete the data of Q=0 */ cc->ptr_udata += cc->retlen; /* ptr(2bytes),retlen(2bytes) */ cc->len_udata += cc->retlen; } } /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step09. --- return"); /* E.Inoue: end */ /* return */ *retlen = cc->retlen; return cc->status; } "cc.c" 2761 lines, 68526 characters frc7v-cl1[43]% frc7v-cl1[45]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[46]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc7v-cl1[47]% frc8vt# pwd /usr/kernel/drv frc8vt# ls audio* ipdcm* lockstat.conf tnf* audiocs* ipdcm.conf logindmux* tnf.conf cc ipdptp* logindmux.conf vol* cc.conf ipdptp.conf pm* vol.conf dbri* kstat* pm.conf winlock* dump* kstat.conf ptm* winlock.conf dump.conf ksyms* ptm.conf ipd* ksyms.conf pts* ipd.conf lockstat* pts.conf frc8vt# ls -l cc* -rw-r--r-- 1 root other 56436 Mar 3 16:03 cc -rw-r--r-- 1 root other 288 Mar 3 16:03 cc.conf frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/ cc . frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/ cc.conf . frc8vt# ls -l cc* -rw-r--r-- 1 root other 56540 Mar 4 10:56 cc -rw-r--r-- 1 root other 288 Mar 4 10:56 cc.conf frc8vt# frc7v-cl1# pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc7v-cl1# make load ./script/cc_load.sh [Installing CAMAC device driver] cp: cannot create /usr/kernel/drv/cc: Read-only file system cp: cannot create /usr/kernel/drv/cc.conf: Read-only file system [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc7v-cl1# ls -l /dev/cc lrwxrwxrwx 1 root other 69 Mar 4 1999 /dev/cc -> /devices/iommu@ 0,10000000/sbus@0,10001000/VME@5,ffffe00/cc@2d,ff00:cc frc7v-cl1# frc7v-cl1[61]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[62]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 0 NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: camac_b: debug step02. --- call physio() NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04. --- found the camac read NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step07. --- enter cc_intr() NOTICE: cc_strategy: debug step06. --- return DMA ^C # ps -ef UID PID PPID C STIME TTY TIME CMD root 0 0 0 16:03:33 ? 0:01 sched root 1 0 0 16:03:36 ? 0:01 /etc/init - root 2 0 0 16:03:36 ? 0:00 pageout root 3 0 0 16:03:36 ? 0:00 fsflush root 313 1 0 16:05:36 ? 0:00 /usr/lib/saf/sac -t 300 root 314 1 0 16:05:36 console 0:01 -sh root 255 1 0 16:05:26 ? 0:00 /usr/sbin/vold root 150 1 0 16:05:08 ? 0:01 /usr/sbin/inetd -s root 122 1 0 16:04:53 ? 0:00 /usr/sbin/rpcbind root 124 1 0 16:04:53 ? 0:00 /usr/sbin/keyserv root 175 1 0 16:05:11 ? 0:06 /usr/lib/autofs/automountd root 155 1 0 16:05:08 ? 0:00 /usr/lib/nfs/statd root 157 1 0 16:05:09 ? 0:01 /usr/lib/nfs/lockd root 199 1 0 16:05:15 ? 0:04 /usr/sbin/nscd root 179 1 0 16:05:12 ? 0:01 /usr/sbin/syslogd root 187 1 0 16:05:13 ? 0:00 /usr/sbin/cron root 209 1 0 16:05:18 ? 0:00 /usr/lib/lpsched root 233 1 0 16:05:21 ? 0:01 /usr/lib/sendmail -bd -q1h inoue 467 465 0 09:20:07 pts/1 0:02 -csh root 230 1 0 16:05:21 ? 0:00 /usr/lib/power/powerd root 243 1 0 16:05:22 ? 0:00 /usr/lib/utmpd root 260 1 0 16:05:26 ? 0:00 /usr/lib/locale/ja/wnn/dpkeyserv root 264 1 0 16:05:27 ? 0:00 /usr/lib/locale/ja/wnn/jserver root 265 264 0 16:05:27 ? 0:00 /usr/lib/locale/ja/wnn/jserver_m root 316 313 0 16:05:37 ? 0:00 /usr/lib/saf/ttymon root 307 1 0 16:05:35 ? 0:01 /usr/lib/dmi/snmpXdmid -s frc7v-c l1 root 465 150 0 09:20:06 ? 0:00 in.rlogind root 294 1 0 16:05:32 ? 0:00 /usr/lib/snmp/snmpdx -y -c /etc/s nmp/conf inoue 338 336 0 16:10:09 pts/0 0:02 -csh root 336 150 0 16:10:09 ? 0:00 in.rlogind root 299 1 0 16:05:33 ? 0:02 /usr/dt/bin/dtlogin -daemon root 317 294 0 16:05:38 ? 0:01 mibiisa -p 32797 root 306 1 0 16:05:35 ? 0:01 /usr/lib/dmi/dmispd root 486 150 0 10:32:28 ? 0:00 in.rlogind inoue 488 486 0 10:32:29 pts/2 0:02 -csh inoue 578 338 0 11:26:48 pts/0 0:00 cam2 root 579 314 1 11:28:58 console 0:00 ps -ef # kill 578 e=9 rp=fc0c18e4 addr=f6146f5c mmu_fsr=326 rw=1htsyp() cam2: Data fault kernel read fault at addr=0xf6146f5c, pme=0x0 MMU sfsr=326: Invalid Address on supv data fetch at level 3 pte addr = 0xf604fe18, level = 3 wrong ctx/as ctx 0, as 0xf5914510 wrong ctx/as 2 ctx 0, as 0x3f pid=578, pc=0xf607f540, sp=0xfc0c1930, psr=0x44010c5, context=0 g1-g7: f026de48, 13da3, f6055198, c00, 200, 1, f5edecc0 Begin traceback... sp = fc0c1930 Called from f6077dd0, fp=fc0c19a0, args=0 2a 600 fc0c1ad8 f6101f00 f00000 Called from f00bd3ac, fp=fc0c1a70, args=f00000 5 600 2a fc0c1b08 f5c86850 Called from f0068900, fp=fc0c1b80, args=f593bae0 f5c85044 22 3 22 3 Called from 11f30, fp=effff8c0, args=1 600 3f53c0 5 24a70 24a80 End traceback... panic: Data fault syncing file systems... 2 done 2795 static and sysmap kernel pages 82 dynamic kernel data pages 490 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 287 current user process pages 3654 total pages (3654 chunks) dumping to vp f59444dc, offset 138744 3654 total pages, dump succeeded rebooting... Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory / Type help for more information ok boot net Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump...System went down at Thu Mar 4 11:29:30 1999 Saving 3654 pages of image in vmcore.7 3654 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.7 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: cc_intr()ルーチンのトレースをもっと細かくする onlsun1[44]% rlogin frc7v-cl1 Password: No directory! Logging in with home=/ Last login: Thu Mar 4 10:34:11 from onlax2.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1% su Password: # mount frc8vt:/export/home/frc8vt /export/home/frc7v-cl1 # frc7v-cl1% logout Connection closed. onlsun1[45]% !! rlogin frc7v-cl1 Last login: Thu Mar 4 11:37:55 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1[33]% ls -l total 8 drwxr-xr-x 3 inoue staff 512 Feb 9 15:34 CAMAC/ drwxr-xr-x 3 inoue staff 512 Nov 6 11:07 FORCE/ drwxr-xr-x 2 inoue staff 512 Feb 18 10:29 Ktaka/ -rw------- 1 inoue staff 592 Feb 26 16:49 mbox frc7v-cl1[34]% frc7v-cl1[42]% vi cc.c : /****************************************************** * cc_intr * ******************************************************/ static u_int cc_intr() { register struct cc_device *cc = &ccdevice[0]; register struct K_REG *k = cc->k; mutex_enter(&cc->mutex); /* start MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step07. --- enter cc_intr()"); /* E.Inoue: end */ /* check K2917 register */ if ((k->csr & CC_LAM) != 0) cc->interrupt |= CC_INT_LAM; if ((k->csr & CC_DONE) != 0) cc->interrupt |= CC_INT_DONE; if ((k->empc & CC_INT_ENABLE) == 0) cc->interrupt |= CC_INT_EMPTY; if ((k->aboc & CC_INT_ENABLE) == 0) cc->interrupt |= CC_INT_ABORT; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step07a. --- cc->interrupt=0x%x", cc->inter rupt); /* E.Inoue: end */ /* free DMA resources */ if (cc->executing_dma_flag != 0) { /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step07b. --- cc->executing_dma_flag != 0"); /* E.Inoue: end */ /* change logichouse */ /* ddi_dma_free(cc->handle); */ ddi_dma_unbind_handle(cc->handle); /* end */ biodone(cc->bp); cc->executing_dma_flag = 0; } if (cc->interrupt == 0) { /* reject interrupt, then return */ mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step07c. --- reject interrupt: return cc_in tr()"); /* E.Inoue: end */ return DDI_INTR_UNCLAIMED; } else { /* accept interrupt, then wake up waiting process, then return */ untimeout(cc->timeout_id); cv_signal(&cc->cv); mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step07d. --- accept interrupt: return cc_in tr()"); /* E.Inoue: end */ return DDI_INTR_CLAIMED; } } "cc.c" 2776 lines, 69029 characters frc7v-cl1[43]% frc7v-cl1[44]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[45]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc7v-cl1[46]% frc8vt# pwd /usr/kernel/drv frc8vt# ls -l cc* -rw-r--r-- 1 root other 56540 Mar 4 10:56 cc -rw-r--r-- 1 root other 288 Mar 4 10:56 cc.conf frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc . frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc.conf . frc8vt# ls -l cc* -rw-r--r-- 1 root other 57048 Mar 4 13:44 cc -rw-r--r-- 1 root other 288 Mar 4 13:44 cc.conf frc8vt# frc7v-cl1上での cam2 実行 frc7v-cl1[40]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 0 NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: camac_b: debug step02. --- call physio() NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04. --- found the camac read NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step07. --- enter cc_intr() NOTICE: cc_intr: debug step07a. --- cc->interrupt=0xe NOTICE: cc_intr: debug step07b. --- cc->executing_dma_flag != 0 NOTICE: cc_intr: debug step07d. --- accept interrupt: return cc_intr() NOTICE: cc_strategy: debug step06. --- return DMA ^C NOTICE: camaB_b: debug stepA7.D--- retur TphRsio() AP: type=9 rp=fbf988e4 addr=f60f4f5c mmu_fsr=326 rw=1 cam2: Data fault kernel read fault at addr=0xf60f4f5c, pme=0x0 MMU sfsr=326: Invalid Address on supv data fetch at level 3 pte addr = 0xf60544d0, level = 3 wrong ctx/as ctx 0, as 0xf5914600 wrong ctx/as 2 ctx 0, as 0xd7 pid=392, pc=0xf60715c0, sp=0xfbf98930, psr=0x44010c5, context=0 g1-g7: f5a41f78, 966f, f6023f78, c00, 200, 1, f5e43460 Begin traceback... sp = fbf98930 Called from f6069dd0, fp=fbf989a0, args=0 2a 600 fbf98ad8 f60f3f00 f00000 Called from f00bd3ac, fp=fbf98a70, args=f00000 5 600 2a fbf98b08 f5c88cd0 Called from f0068900, fp=fbf98b80, args=f5b1dce8 f5c87d8c 22 3 22 3 Called from 11f30, fp=effff8c0, args=1 600 3f53c0 5 24a70 24a80 End traceback... panic: Data fault syncing file systems... 2 done 2714 static and sysmap kernel pages 66 dynamic kernel data pages 378 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 287 current user process pages 3445 total pages (3445 chunks) dumping to vp f59444dc, offset 140416 3445 total pages, dump succeeded rebooting... Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory | Type help for more information ok ok boot net Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 The system is coming up. Please wait. checking for crash dump...System went down at Thu Mar 4 13:42:20 1999 Saving 3445 pages of image in vmcore.8 3445 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.8 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: onlsun1[46]% !! rlogin frc7v-cl1 Password: No directory! Logging in with home=/ Last login: Thu Mar 4 13:39:52 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1% su Password: # mount frc8vt:/export/home/frc8vt /export/home/frc7v-cl1 # frc7v-cl1% logout Connection closed. onlsun1[47]% !! rlogin frc7v-cl1 Last login: Thu Mar 4 13:49:17 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1[33]% ls -l total 8 drwxr-xr-x 3 inoue staff 512 Feb 9 15:34 CAMAC/ drwxr-xr-x 3 inoue staff 512 Nov 6 11:07 FORCE/ drwxr-xr-x 2 inoue staff 512 Feb 18 10:29 Ktaka/ -rw------- 1 inoue staff 592 Feb 26 16:49 mbox frc7v-cl1[34]% 見やすくするためにトレースの文を変更 frc7v-cl1[34]% vi cc.c : /****************************************************** * cc_intr * ******************************************************/ static u_int cc_intr() { register struct cc_device *cc = &ccdevice[0]; register struct K_REG *k = cc->k; mutex_enter(&cc->mutex); /* start MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06. --- enter cc_intr()"); /* E.Inoue: end */ /* check K2917 register */ if ((k->csr & CC_LAM) != 0) cc->interrupt |= CC_INT_LAM; if ((k->csr & CC_DONE) != 0) cc->interrupt |= CC_INT_DONE; if ((k->empc & CC_INT_ENABLE) == 0) cc->interrupt |= CC_INT_EMPTY; if ((k->aboc & CC_INT_ENABLE) == 0) cc->interrupt |= CC_INT_ABORT; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06a. --- cc->interrupt=0x%x", cc->inter rupt); /* E.Inoue: end */ /* free DMA resources */ if (cc->executing_dma_flag != 0) { /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06b. --- cc->executing_dma_flag != 0"); /* E.Inoue: end */ /* change logichouse */ /* ddi_dma_free(cc->handle); */ ddi_dma_unbind_handle(cc->handle); /* end */ biodone(cc->bp); cc->executing_dma_flag = 0; } if (cc->interrupt == 0) { /* reject interrupt, then return */ mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06c. --- reject interrupt: return cc_in tr()"); /* E.Inoue: end */ return DDI_INTR_UNCLAIMED; } else { /* accept interrupt, then wake up waiting process, then return */ untimeout(cc->timeout_id); cv_signal(&cc->cv); mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06d. --- accept interrupt: return cc_in tr()"); /* E.Inoue: end */ return DDI_INTR_CLAIMED; } } : : static int cc_strategy(struct buf *bp) { register struct cc_device *cc = &ccdevice[0]; register struct K_REG *k = cc->k; register u_long dma_addr; register mode = cc->mode; register naf = cc->naf; register int wc = (mode & CC_BIT16) ? cc->len : cc->len * 2; register u_int flags; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step03. --- enter cc_strategy()"); /* E.Inoue: end */ /* check DMA mode and set flags */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step04. --- found the camac read"); /* E.Inoue: end */ flags = DDI_DMA_READ; break; case 0x0010: /* CAMAC write */ flags = DDI_DMA_WRITE; break; default: cc->status = CC_STA_BLOCK_INVFUNC; return 0; } /* change logichouse */ /* setup DMA bufer */ if((ddi_dma_buf_bind_handle(cc->handle, bp , flags | DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, (caddr_t)0, &cc->dma_cookie, &cc->ccount) != DDI_DMA_MAPPED)){ cmn_err(CE_WARN,"cc_strategy: ddi_dma_buf_bind_handle failed"); bp->b_flags |= B_ERROR; bp->b_error = EIO; return bp->b_flags; } /* if (ddi_dma_buf_setup(cc->dip, bp, flags, DDI_DMA_SLEEP, NULL, &dma_lim, &cc->handle) != DDI_DMA_MAPPED) { bp->b_error |= EIO; bp->b_flags |= B_ERROR; return bp->b_flags; } */ /* get a virtual address to hand to our device */ /* if (ddi_dma_htoc(cc->handle, NULL, &cc->dma_cookie) != DDI_SUCCESS) { bp->b_error |= EIO; bp->b_flags |= B_ERROR; return bp->b_flags; } */ /* end */ /* set up variables */ cc->bp = bp; dma_addr = cc->dma_cookie.dmac_address; /* count = cc->dma_cookie.dmac_size; */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step04-1. --- dma_addr = 0x%x", dma_add r); /* E.Inoue: end */ /* */ /* uprintf("count in 32bit=%d\n", cc->dma_cookie.dmac_size); */ cmn_err(CE_NOTE,"count in 32bit=%d", cc->dma_cookie.dmac_size); /* */ cc->retlen = 0; /* k->csr = CC_RST; */ /* K2917 Reset */ if (cc->klist == CC_KLIST_NO) { k->cma = CC_CMA_INIT; /* Initialize memory pointer */ k->cmr = mode | (cc->cur_crate << 8); k->cmr = naf; k->cmr = -(cc->len & 0xFFFF); /* Max len = 1MWord */ k->cmr = 0xFFFF; k->cmr = CC_HALT; k->cma = CC_CMA_INIT; /* Reset memory pointer */ k->maclo = dma_addr & 0xFFFF; /* Set DMA base address */ k->machi = dma_addr >> 16; k->amr = CC_AMR_INIT; /* Set VME AM code */ k->mtc = wc; k->cser = CC_DMA_RESET; /* DMA reset */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ k->docr = CC_DOCR_INIT | CC_DMA_READ; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr &= ~CC_WRITE; break; case 0x0010: /* CAMAC write */ k->docr = CC_DOCR_INIT | CC_DMA_WRITE; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr |= CC_WRITE; break; default: /* ERROR */ cc->status = CC_STA_BLOCK_INVFUNC; return 0; } } /* Kinetic list-processing */ else { k->cma = now_cma; /* Initialize memory pointer */ k->maclo = dma_addr & 0xFFFF; /* Set DMA base address */ k->machi = dma_addr >> 16; k->amr = CC_AMR_INIT; /* Set VME AM code */ k->mtc = now_wc; k->cser = CC_DMA_RESET; /* DMA reset */ k->docr = CC_DOCR_INIT | CC_DMA_READ; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr &= ~CC_WRITE; } /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step05. --- start DMA"); /* E.Inoue: end */ /* start DMA */ cc->executing_dma_flag = 1; cc->timeout_id = timeout(cc_timeout, NULL, CC_TIMEOUT_DMA * hz); k->csr |= CC_GO; /* Go! */ k->donc = CC_INT_AUTO_CLEAR | CC_INT_ENABLE | intrpri; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07. --- return DMA"); /* E.Inoue: end */ /* wait at physio() */ /* E.Inoue: from */ mutex_enter(&cc->mutex); /* start MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07a. --- call cv_wait_sig()"); /* E.Inoue: end */ cv_wait_sig(&cc->cv, &cc->mutex); /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07b. --- return cv_wait_sig()"); /* E.Inoue: end */ /* if (cv_wait_sig(&cc->cv, &cc->mutex) == 0) { */ /* untimeout(cc->timeout_id); */ /* mutex_exit(&cc->mutex); */ /* end MUTEX */ /* return EINTR; */ /* } */ mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: end */ return 0; } static int camac_b(struct cc_device *cc, u_short mode, u_short naf, int len, int *retlen) { register dev_t dev = cc->dev; register struct K_REG *k = cc->k; register struct uio *uio = cc->uio; /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step01. --- enter camac_b()"); /* E.Inoue: end */ cc->klist = CC_KLIST_NO; cc->mode = mode; cc->naf = naf; cc->len = len; /* set uio for DMA */ uio->uio_iov->iov_base = (caddr_t)cc->ptr_udata; uio->uio_iov->iov_len = (mode & CC_BIT16) ? len * 2: len * 4; uio->uio_iovcnt = 1; uio->uio_segflg = UIO_USERSPACE; uio->uio_offset = 0; /* */ /* uprintf(" in: 0x%x %d %d %d %d %d\n", uio->uio_iov->iov_base, uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); */ cmn_err(CE_NOTE," in: 0x%x %d %d %d %d %d", uio->uio_iov->iov_base, uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); /* */ /* execute DMA transfer */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step02. --- call physio()"); /* E.Inoue: end */ physio(cc_strategy, NULL, dev, B_READ, cc_minphys, uio); /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step07. --- return physio()"); /* E.Inoue: end */ break; case 0x0010: /* CAMAC write */ physio(cc_strategy, NULL, dev, B_WRITE, cc_minphys, uio); break; default: cc->status = CC_STA_BLOCK_INVFUNC; return 0; } k->donc = CC_INT_AUTO_CLEAR | intrpri; cc->camac_qx = k->csr; cc_sys_status = cc->bp->b_error; /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step08. --- cc_sys_status = 0x%x", cc_sys_s tatus); /* E.Inoue: end */ /* check timeout */ if (cc->interrupt & CC_INT_TIMEOUT ) { cc->interrupt &= ~CC_INT_TIMEOUT; cc->status = CC_STA_BLOCK_TIMEOUT; *retlen = 0; return cc->status; } /* */ /* uprintf("out: %d %d %d %d %d\n", uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); */ cmn_err(CE_NOTE,"out: %d %d %d %d %d", uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); /* */ /* Q-STOP mode or no error */ if ((mode & CC_QSCAN) == 0 || (k->csr & CC_ERR) == 0) { if ((mode & CC_BIT16) == 0) { cc->retlen = cc->len - k->mtc / 2; /* retlen=number of transfer */ if ((mode & CC_QSCAN) == 0 && (k->csr & CC_ERR) != 0) /* Q-STOP */ cc->retlen = cc->retlen - 2; /* delete the data of Q=0 */ cc->ptr_udata += cc->retlen * 2; /* ptr(2bytes),retlen(4bytes) */ cc->len_udata += cc->retlen * 2; } else { cc->retlen = cc->len - k->mtc; if ((mode & CC_QSCAN) == 0 && (k->csr & CC_ERR) != 0) /* Q-STOP */ cc->retlen--; /* delete the data of Q=0 */ cc->ptr_udata += cc->retlen; /* ptr(2bytes),retlen(2bytes) */ cc->len_udata += cc->retlen; } } /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step09. --- return"); /* E.Inoue: end */ /* return */ *retlen = cc->retlen; return cc->status; } "cc.c" 2784 lines, 69263 characters frc7v-cl1[51]% frc7v-cl1[54]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc7v-cl1[55]% frc8vt# pwd /usr/kernel/drv frc8vt# ls -l cc* -rw-r--r-- 1 root other 57048 Mar 4 13:44 cc -rw-r--r-- 1 root other 288 Mar 4 13:44 cc.conf frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc . frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc.conf . frc8vt# ls -l cc* -rw-r--r-- 1 root other 57284 Mar 4 14:45 cc -rw-r--r-- 1 root other 288 Mar 4 14:45 cc.conf frc8vt# frc7v-cl1# pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc7v-cl1# make load ./script/cc_load.sh [Installing CAMAC device driver] cp: cannot create /usr/kernel/drv/cc: Read-only file system cp: cannot create /usr/kernel/drv/cc.conf: Read-only file system [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc7v-cl1# ls -l /dev/cc lrwxrwxrwx 1 root other 69 Mar 4 1999 /dev/cc -> /devices/iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/cc@2d,ff00:cc frc7v-cl1# cam2プログラムを実行。 frc7v-cl1[44]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[45]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 0 ここでハングしてしっまった。 この時のコンソール上のメッセージは次のとおり。 NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: camac_b: debug step02. --- call physio() NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04. --- found the camac read NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step06. --- enter cc_intr() NOTICE: cc_intr: debug step06a. --- cc->interrupt=0xe NOTICE: cc_intr: debug step06b. --- cc->executing_dma_flag != 0 NOTICE: cc_intr: debug step06d. --- accept interrupt: return cc_intr() NOTICE: cc_strategy: debug step07. --- return DMA NOTICE: cc_strategy: debug step07a. --- call cv_wait_sig() アプリケーションのウインドウで ^C を押すと、システムはパニックを 起こしてリブートしてしまった。 この時のコンソール上のメッセージは次のとおり。 NOTyCE:p eam=c9b: ebug step07. r-- peturn phy=fo() c0a78e4 addr=f619cf5c mmu_fsr=326 rw=1 cam2: Data fault kernel read fault at addr=0xf619cf5c, pme=0x0 MMU sfsr=326: Invalid Address on supv data fetch at level 3 pte addr = 0xf6059570, level = 3 wrong ctx/as ctx 0, as 0xf5914510 wrong ctx/as 2 ctx 0, as 0x29 pid=439, pc=0xf60795f8, sp=0xfc0a7930, psr=0x44010c1, context=0 g1-g7: f026de48, 18aff, f5e46658, c00, 200, 1, f5d62040 Begin traceback... sp = fc0a7930 Called from f6071dd0, fp=fc0a79a0, args=0 2a 600 fc0a7ad8 f611cf00 f00000 Called from f00bd3ac, fp=fc0a7a70, args=f00000 5 600 2a fc0a7b08 f5f05b50 Called from f0068900, fp=fc0a7b80, args=f5b1de28 f5eb925c 22 3 22 3 Called from 11f30, fp=effff8c0, args=1 600 3f53c0 5 24a70 24a80 End traceback... panic: Data fault syncing file systems... 2 done 2882 static and sysmap kernel pages 84 dynamic kernel data pages 492 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 287 current user process pages 3745 total pages (3745 chunks) dumping to vp f59444dc, offset 138016 3745 total pages, dump succeeded rebooting... Resetting ... screen not found. Can't open input device. ok ok boot net Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Rebooting with command: net Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump...System went down at Thu Mar 4 15:35:09 1999 Saving 3745 pages of image in vmcore.9 3745 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.9 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: frc8vt、サーバ側で cam2 プログラムを実行してみる。 CPU-8VT を使用する。 frc8vt、サーバ・システムを camac のシステムにセットして立ち上げる。 ok xx Power-On Self Test IU Register File Test MMU Context Table Reg Test MMU Context Register Test MMU Sync Fault Stat Reg Test MMU Sync Fault Addr Reg Test D-Cache Tag Ram Test D-Cache Data Ram Test D-TLB CAM Test D-TLB RAM Test I-Cache Tag Ram Test I-Cache Data Ram Test E-Cache Addr Bus Test E-Cache Tag Bus Test E-Cache Data Ram Test E-Cache Tag Ram Test Snoop Ram Test IOMMU-TLB Test IOMMU Control Register Test IOMMU Base Addr Register Test IOMMU SBus Config Registers Test Set RAH to 3 Set WS to 3 DRAM Data Bus Test Probing Bank 0 -- 32 Megs Found Probing Bank 1 -- 32 Megs Found Probing Bank 2 -- 0 Megs Found Probing Bank 3 -- 0 Megs Found Probing Bank 4 -- 0 Megs Found Probing Bank 5 -- 0 Megs Found Probing Bank 6 -- 0 Megs Found Probing Bank 7 -- 0 Megs Found DRAM Address Bus Test Memory Address Pattern Test D-Cache Hit Miss Test D-TLB Hit Miss Test I-TLB Hit Miss Test I-Cache Hit Miss Test E-Cache Hit Miss Test, cache_size=0x00080000 bytes I-TLB Ram Test FPU Register File Test FPU Misaligned Reg Pair Test FPU Single-precision Tests FPU Double-precision Tests FPU SP Invalid CEXC Test FPU SP Overflow CEXC Test FPU SP Divide-by-0 CEXC Test FPU SP Inexact CEXC Test FPU SP Trap Priority > Test FPU SP Trap Priority < Test FPU DP Invalid CEXC Test FPU DP Overflow CEXC Test FPU DP Divide-by-0 CEXC Test FPU DP Inexact CEXC Test FPU DP Trap Priority > Test FPU DP Trap Priority < Test PROC0 Interrupt Regs Tests Soft Interrupts OFF Test Soft Interrupts ON Test PROC0 User Timer Test PROC0 Counter/Timer Test DMA2 E_CSR Register Test LANCE Address Port Tests LANCE Data Port Tests DMA2 D_CSR Register Test DMA2 D_ADDR Register Test DMA2 D_BCNT Register Test DMA2 D_NADDR Register Test ESP Registers Tests DMA2 P_CSR Register Test DMA2 P_ADDR Register Test DMA2 P_BCNT Register Test PPORT Registers Tests NVRAM Access Test TOD Registers Test screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-8VT, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9172389. Ethernet address 0:80:42:b:85:a5, Host ID: 808bf5a5. Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@3,0 File and args: | Type 'go' to resume Type help for more information ok boot -r Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-8VT, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9172389. Ethernet address 0:80:42:b:85:a5, Host ID: 808bf5a5. Rebooting with command: -r Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@3,0 File and args: - r SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc8vt Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking ufs filesystems /dev/rdsk/c0t3d0s5: is clean. /dev/rdsk/c0t3d0s4: is clean. /dev/rdsk/c0t3d0s7: is clean. /dev/rdsk/c0t3d0s3: is clean. add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc8vt syslog service starting. Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc8vt console login: ***************************************************************************** * * Starting Desktop Login on display :0... * * Wait for the Desktop Login screen before logging in. * ***************************************************************************** ***************************************************************************** * * The X-server can not be started on display :0... * ***************************************************************************** frc8vt console login: frc8vt、サーバ側で cam2プログラムを実行した時の、cc_intr()、 cc_strategy()、camac_b() の各ルーチン。 frc8vt[43]% pwd /export/home/frc8vt/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc8vt[44]% vi cc.c : /****************************************************** * cc_intr * ******************************************************/ static u_int cc_intr() { register struct cc_device *cc = &ccdevice[0]; register struct K_REG *k = cc->k; mutex_enter(&cc->mutex); /* start MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06. --- enter cc_intr()"); /* E.Inoue: end */ /* check K2917 register */ if ((k->csr & CC_LAM) != 0) cc->interrupt |= CC_INT_LAM; if ((k->csr & CC_DONE) != 0) cc->interrupt |= CC_INT_DONE; if ((k->empc & CC_INT_ENABLE) == 0) cc->interrupt |= CC_INT_EMPTY; if ((k->aboc & CC_INT_ENABLE) == 0) cc->interrupt |= CC_INT_ABORT; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06a. --- cc->interrupt=0x%x", cc->inter rupt); /* E.Inoue: end */ /* free DMA resources */ if (cc->executing_dma_flag != 0) { /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06b. --- cc->executing_dma_flag != 0"); /* E.Inoue: end */ /* change logichouse */ /* ddi_dma_free(cc->handle); */ ddi_dma_unbind_handle(cc->handle); /* end */ biodone(cc->bp); cc->executing_dma_flag = 0; } if (cc->interrupt == 0) { /* reject interrupt, then return */ mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06c. --- reject interrupt: return cc_in tr()"); /* E.Inoue: end */ return DDI_INTR_UNCLAIMED; } else { /* accept interrupt, then wake up waiting process, then return */ untimeout(cc->timeout_id); cv_signal(&cc->cv); mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_intr: debug step06d. --- accept interrupt: return cc_in tr()"); /* E.Inoue: end */ return DDI_INTR_CLAIMED; } } : : static int cc_strategy(struct buf *bp) { register struct cc_device *cc = &ccdevice[0]; register struct K_REG *k = cc->k; register u_long dma_addr; register mode = cc->mode; register naf = cc->naf; register int wc = (mode & CC_BIT16) ? cc->len : cc->len * 2; register u_int flags; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step03. --- enter cc_strategy()"); /* E.Inoue: end */ /* check DMA mode and set flags */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step04. --- found the camac read"); /* E.Inoue: end */ flags = DDI_DMA_READ; break; case 0x0010: /* CAMAC write */ flags = DDI_DMA_WRITE; break; default: cc->status = CC_STA_BLOCK_INVFUNC; return 0; } /* change logichouse */ /* setup DMA bufer */ if((ddi_dma_buf_bind_handle(cc->handle, bp , flags | DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, (caddr_t)0, &cc->dma_cookie, &cc->ccount) != DDI_DMA_MAPPED)){ cmn_err(CE_WARN,"cc_strategy: ddi_dma_buf_bind_handle failed"); bp->b_flags |= B_ERROR; bp->b_error = EIO; return bp->b_flags; } /* if (ddi_dma_buf_setup(cc->dip, bp, flags, DDI_DMA_SLEEP, NULL, &dma_lim, &cc->handle) != DDI_DMA_MAPPED) { bp->b_error |= EIO; bp->b_flags |= B_ERROR; return bp->b_flags; } */ /* get a virtual address to hand to our device */ /* if (ddi_dma_htoc(cc->handle, NULL, &cc->dma_cookie) != DDI_SUCCESS) { bp->b_error |= EIO; bp->b_flags |= B_ERROR; return bp->b_flags; } */ /* end */ /* set up variables */ cc->bp = bp; dma_addr = cc->dma_cookie.dmac_address; /* count = cc->dma_cookie.dmac_size; */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step04-1. --- dma_addr = 0x%x", dma_add r); /* E.Inoue: end */ /* */ /* uprintf("count in 32bit=%d\n", cc->dma_cookie.dmac_size); */ cmn_err(CE_NOTE,"count in 32bit=%d", cc->dma_cookie.dmac_size); /* */ cc->retlen = 0; /* k->csr = CC_RST; */ /* K2917 Reset */ if (cc->klist == CC_KLIST_NO) { k->cma = CC_CMA_INIT; /* Initialize memory pointer */ k->cmr = mode | (cc->cur_crate << 8); k->cmr = naf; k->cmr = -(cc->len & 0xFFFF); /* Max len = 1MWord */ k->cmr = 0xFFFF; k->cmr = CC_HALT; k->cma = CC_CMA_INIT; /* Reset memory pointer */ k->maclo = dma_addr & 0xFFFF; /* Set DMA base address */ k->machi = dma_addr >> 16; k->amr = CC_AMR_INIT; /* Set VME AM code */ k->mtc = wc; k->cser = CC_DMA_RESET; /* DMA reset */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ k->docr = CC_DOCR_INIT | CC_DMA_READ; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr &= ~CC_WRITE; break; case 0x0010: /* CAMAC write */ k->docr = CC_DOCR_INIT | CC_DMA_WRITE; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr |= CC_WRITE; break; default: /* ERROR */ cc->status = CC_STA_BLOCK_INVFUNC; return 0; } } /* Kinetic list-processing */ else { k->cma = now_cma; /* Initialize memory pointer */ k->maclo = dma_addr & 0xFFFF; /* Set DMA base address */ k->machi = dma_addr >> 16; k->amr = CC_AMR_INIT; /* Set VME AM code */ k->mtc = now_wc; k->cser = CC_DMA_RESET; /* DMA reset */ k->docr = CC_DOCR_INIT | CC_DMA_READ; k->sccr = CC_DMA_START; k->csr |= CC_DMA; /* DMA mode */ k->csr &= ~CC_WRITE; } /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step05. --- start DMA"); /* E.Inoue: end */ /* start DMA */ cc->executing_dma_flag = 1; cc->timeout_id = timeout(cc_timeout, NULL, CC_TIMEOUT_DMA * hz); k->csr |= CC_GO; /* Go! */ k->donc = CC_INT_AUTO_CLEAR | CC_INT_ENABLE | intrpri; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07. --- return DMA"); /* E.Inoue: end */ /* wait at physio() */ /* E.Inoue: from */ mutex_enter(&cc->mutex); /* start MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07a. --- call cv_wait_sig()"); /* E.Inoue: end */ cv_wait_sig(&cc->cv, &cc->mutex); /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07b. --- return cv_wait_sig()"); /* E.Inoue: end */ /* if (cv_wait_sig(&cc->cv, &cc->mutex) == 0) { */ /* untimeout(cc->timeout_id); */ /* mutex_exit(&cc->mutex); */ /* end MUTEX */ /* return EINTR; */ /* } */ mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: end */ return 0; } static int camac_b(struct cc_device *cc, u_short mode, u_short naf, int len, int *retlen) { register dev_t dev = cc->dev; register struct K_REG *k = cc->k; register struct uio *uio = cc->uio; /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step01. --- enter camac_b()"); /* E.Inoue: end */ cc->klist = CC_KLIST_NO; cc->mode = mode; cc->naf = naf; cc->len = len; /* set uio for DMA */ uio->uio_iov->iov_base = (caddr_t)cc->ptr_udata; uio->uio_iov->iov_len = (mode & CC_BIT16) ? len * 2: len * 4; uio->uio_iovcnt = 1; uio->uio_segflg = UIO_USERSPACE; uio->uio_offset = 0; /* */ /* uprintf(" in: 0x%x %d %d %d %d %d\n", uio->uio_iov->iov_base, uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); */ cmn_err(CE_NOTE," in: 0x%x %d %d %d %d %d", uio->uio_iov->iov_base, uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); /* */ /* execute DMA transfer */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step02. --- call physio()"); /* E.Inoue: end */ physio(cc_strategy, NULL, dev, B_READ, cc_minphys, uio); /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step07. --- return physio()"); /* E.Inoue: end */ break; case 0x0010: /* CAMAC write */ physio(cc_strategy, NULL, dev, B_WRITE, cc_minphys, uio); break; default: cc->status = CC_STA_BLOCK_INVFUNC; return 0; } k->donc = CC_INT_AUTO_CLEAR | intrpri; cc->camac_qx = k->csr; cc_sys_status = cc->bp->b_error; /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step08. --- cc_sys_status = 0x%x", cc_sys_s tatus); /* E.Inoue: end */ /* check timeout */ if (cc->interrupt & CC_INT_TIMEOUT ) { cc->interrupt &= ~CC_INT_TIMEOUT; cc->status = CC_STA_BLOCK_TIMEOUT; *retlen = 0; return cc->status; } /* */ /* uprintf("out: %d %d %d %d %d\n", uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); */ cmn_err(CE_NOTE,"out: %d %d %d %d %d", uio->uio_iov->iov_len, uio->uio_iovcnt, uio->uio_resid, uio->uio_segflg, uio->uio_offset); /* */ /* Q-STOP mode or no error */ if ((mode & CC_QSCAN) == 0 || (k->csr & CC_ERR) == 0) { if ((mode & CC_BIT16) == 0) { cc->retlen = cc->len - k->mtc / 2; /* retlen=number of transfer */ if ((mode & CC_QSCAN) == 0 && (k->csr & CC_ERR) != 0) /* Q-STOP */ cc->retlen = cc->retlen - 2; /* delete the data of Q=0 */ cc->ptr_udata += cc->retlen * 2; /* ptr(2bytes),retlen(4bytes) */ cc->len_udata += cc->retlen * 2; } else { cc->retlen = cc->len - k->mtc; if ((mode & CC_QSCAN) == 0 && (k->csr & CC_ERR) != 0) /* Q-STOP */ cc->retlen--; /* delete the data of Q=0 */ cc->ptr_udata += cc->retlen; /* ptr(2bytes),retlen(2bytes) */ cc->len_udata += cc->retlen; } } /* E.Inoue: from */ cmn_err(CE_NOTE," camac_b: debug step09. --- return"); /* E.Inoue: end */ /* return */ *retlen = cc->retlen; return cc->status; } "cc.c" 2784 lines, 69263 characters frc8vt[45]% frc8vt[46]% pwd /export/home/frc8vt/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc8vt[47]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc8vt[48]% ccドライバをアンロードおよびロードする。 frc8vt# pwd /export/home/frc8vt/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc8vt# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc8vt# make load ./script/cc_load.sh [Installing CAMAC device driver] [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc8vt# frc8vt上での cam2 の実行 frc8vt[49]% pwd /export/home/frc8vt/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc8vt[50]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 0 ここでハングしてしまった。 この時のコンソール上のメッセージは次のとおり。 NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: camac_b: debug step02. --- call physio() NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04. --- found the camac read NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step06. --- enter cc_intr() NOTICE: cc_intr: debug step06a. --- cc->interrupt=0xe NOTICE: cc_intr: debug step06b. --- cc->executing_dma_flag != 0 NOTICE: cc_intr: debug step06d. --- accept interrupt: return cc_intr() NOTICE: cc_strategy: debug step07. --- return DMA NOTICE: cc_strategy: debug step07a. --- call cv_wait_sig() ^C *** TERMINATING cam2 *** Received signal 2 SIGINT frc8vt[51]% CTL-C で中断した。 システムはパニックを起こすことなく中断できた。 NOTICE: camac_b: debug step08. --- cc_sys_status = 0x0 NOTICE: out: 1 0 24 0 10 NOTICE: camac_b: debug step09. --- return frc8vt console login: cv_wait_sig()の部分をはずしてみる。 frc8vt[53]% vi cc.c : /* wait at physio() */ /* E.Inoue: from */ /* mutex_enter(&cc->mutex); */ /* start MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07a. --- call cv_wait_sig()"); /* E.Inoue: end */ /* cv_wait_sig(&cc->cv, &cc->mutex); */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07b. --- return cv_wait_sig()"); /* E.Inoue: end */ /* if (cv_wait_sig(&cc->cv, &cc->mutex) == 0) { */ /* untimeout(cc->timeout_id); */ /* mutex_exit(&cc->mutex); */ /* end MUTEX */ /* return EINTR; */ /* } */ /* mutex_exit(&cc->mutex); */ /* end MUTEX */ /* E.Inoue: end */ "cc.c" 2784 lines, 69278 characters frc8vt[54]% frc8vt[54]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc8vt[55]% ccドライバをアンロードおよびロードする。 frc8vt# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc8vt# make load ./script/cc_load.sh [Installing CAMAC device driver] [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc8vt# ls -l /dev/cc lrwxrwxrwx 1 root other 69 Mar 5 14:23 /dev/cc -> /devices/iommu@ 0,10000000/sbus@0,10001000/VME@5,ffffe00/cc@2d,ff00:cc frc8vt# cv_wait_sig()をはずして、cam2 を再実行する。 frc8vt[56]% pwd /export/home/frc8vt/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc8vt[57]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 0 0x 0(Hex) Data( 2)= 0 0x 0(Hex) Data( 3)= 0 0x 0(Hex) Data( 4)= 0 0x 0(Hex) Data( 5)= 0 0x 0(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 16 Input data >555 MODE=1 N= 3 A= 0 F=16 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 555 0x 22B(Hex) Data( 2)= 555 0x 22B(Hex) Data( 3)= 555 0x 22B(Hex) Data( 4)= 555 0x 22B(Hex) Data( 5)= 555 0x 22B(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 555 0x 22B(Hex) Data( 2)= 555 0x 22B(Hex) Data( 3)= 555 0x 22B(Hex) Data( 4)= 555 0x 22B(Hex) Data( 5)= 555 0x 22B(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 16 0 Input data >0 MODE=1 N= 3 A= 0 F=16 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 0 0x 0(Hex) Data( 2)= 0 0x 0(Hex) Data( 3)= 0 0x 0(Hex) Data( 4)= 0 0x 0(Hex) Data( 5)= 0 0x 0(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 0 0x 0(Hex) Data( 2)= 0 0x 0(Hex) Data( 3)= 0 0x 0(Hex) Data( 4)= 0 0x 0(Hex) Data( 5)= 0 0x 0(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) frc8vt[58]% コンソール上のメッセージは次のとおり。 NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: camac_b: debug step02. --- call physio() NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04. --- found the camac read NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step06. --- enter cc_intr() NOTICE: cc_intr: debug step06a. --- cc->interrupt=0xe NOTICE: cc_intr: debug step06b. --- cc->executing_dma_flag != 0 NOTICE: cc_intr: debug step06d. --- accept interrupt: return cc_intr() NOTICE: cc_strategy: debug step07. --- return DMA NOTICE: cc_strategy: debug step07a. --- call cv_wait_sig() NOTICE: cc_strategy: debug step07b. --- return cv_wait_sig() NOTICE: camac_b: debug step07. --- return physio() NOTICE: camac_b: debug step08. --- cc_sys_status = 0x0 NOTICE: out: 1 0 24 0 10 NOTICE: camac_b: debug step09. --- return NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step06. --- enter cc_intr() NOTICE: cc_intr: debug step06a. --- cc->interrupt=0xe NOTICE: cc_intr: debug step06b. --- cc->executing_dma_flag != 0 NOTICE: cc_intr: debug step06d. --- accept interrupt: return cc_intr() NOTICE: cc_strategy: debug step07. --- return DMA NOTICE: cc_strategy: debug step07a. --- call cv_wait_sig() NOTICE: cc_strategy: debug step07b. --- return cv_wait_sig() NOTICE: camac_b: debug step08. --- cc_sys_status = 0x0 NOTICE: out: 1 0 24 0 10 NOTICE: camac_b: debug step09. --- return NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: camac_b: debug step02. --- call physio() NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04. --- found the camac read NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step06. --- enter cc_intr() NOTICE: cc_intr: debug step06a. --- cc->interrupt=0xe NOTICE: cc_intr: debug step06b. --- cc->executing_dma_flag != 0 NOTICE: cc_intr: debug step06d. --- accept interrupt: return cc_intr() NOTICE: cc_strategy: debug step07. --- return DMA NOTICE: cc_strategy: debug step07a. --- call cv_wait_sig() NOTICE: cc_strategy: debug step07b. --- return cv_wait_sig() NOTICE: camac_b: debug step07. --- return physio() NOTICE: camac_b: debug step08. --- cc_sys_status = 0x0 NOTICE: out: 1 0 24 0 10 NOTICE: camac_b: debug step09. --- return NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step06. --- enter cc_intr() NOTICE: cc_intr: debug step06a. --- cc->interrupt=0xe NOTICE: cc_intr: debug step06b. --- cc->executing_dma_flag != 0 NOTICE: cc_intr: debug step06d. --- accept interrupt: return cc_intr() NOTICE: cc_strategy: debug step07. --- return DMA NOTICE: cc_strategy: debug step07a. --- call cv_wait_sig() NOTICE: cc_strategy: debug step07b. --- return cv_wait_sig() NOTICE: camac_b: debug step08. --- cc_sys_status = 0x0 NOTICE: out: 1 0 24 0 10 NOTICE: camac_b: debug step09. --- return NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: camac_b: debug step02. --- call physio() NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04. --- found the camac read NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step06. --- enter cc_intr() NOTICE: cc_intr: debug step06a. --- cc->interrupt=0xe NOTICE: cc_intr: debug step06b. --- cc->executing_dma_flag != 0 NOTICE: cc_intr: debug step06d. --- accept interrupt: return cc_intr() NOTICE: cc_strategy: debug step07. --- return DMA NOTICE: cc_strategy: debug step07a. --- call cv_wait_sig() NOTICE: cc_strategy: debug step07b. --- return cv_wait_sig() NOTICE: camac_b: debug step07. --- return physio() NOTICE: camac_b: debug step08. --- cc_sys_status = 0x0 NOTICE: out: 1 0 24 0 10 NOTICE: camac_b: debug step09. --- return cv_wait_sig()をはずしたら、frc8vt のシステムでは以前と同じように cam2 は正常に実行できた。 この状態で frc7v-cl1 のシステムで cam2 を実行してみる。 frc8vt、サーバ・システムを立ち上げる。 ok E-Cache Tag Ram Test Snoop Ram Test IOMMU-TLB Test IOMMU Control Register Test IOMMU Base Addr Register Test IOMMU SBus Config Registers Test Set RAH to 3 Set WS to 3 DRAM Data Bus Test Probing Bank 0 -- 32 Megs Found Probing Bank 1 -- 32 Megs Found Probing Bank 2 -- 0 Megs Found Probing Bank 3 -- 0 Megs Found Probing Bank 4 -- 0 Megs Found Probing Bank 5 -- 0 Megs Found Probing Bank 6 -- 0 Megs Found Probing Bank 7 -- 0 Megs Found DRAM Address Bus Test Memory Address Pattern Test D-Cache Hit Miss Test D-TLB Hit Miss Test I-TLB Hit Miss Test I-Cache Hit Miss Test E-Cache Hit Miss Test, cache_size=0x00080000 bytes I-TLB Ram Test FPU Register File Test FPU Misaligned Reg Pair Test FPU Single-precision Tests FPU Double-precision Tests FPU SP Invalid CEXC Test FPU SP Overflow CEXC Test FPU SP Divide-by-0 CEXC Test FPU SP Inexact CEXC Test FPU SP Trap Priority > Test FPU SP Trap Priority < Test FPU DP Invalid CEXC Test FPU DP Overflow CEXC Test FPU DP Divide-by-0 CEXC Test FPU DP Inexact CEXC Test FPU DP Trap Priority > Test FPU DP Trap Priority < Test PROC0 Interrupt Regs Tests Soft Interrupts OFF Test Soft Interrupts ON Test PROC0 User Timer Test PROC0 Counter/Timer Test DMA2 E_CSR Register Test LANCE Address Port Tests LANCE Data Port Tests DMA2 D_CSR Register Test DMA2 D_ADDR Register Test DMA2 D_BCNT Register Test DMA2 D_NADDR Register Test ESP Registers Tests DMA2 P_CSR Register Test DMA2 P_ADDR Register Test DMA2 P_BCNT Register Test PPORT Registers Tests NVRAM Access Test TOD Registers Test screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-8VT, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9172389. Ethernet address 0:80:42:b:85:a5, Host ID: 808bf5a5. Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@3,0 File and args: SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc8vt Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 cc_probe: unable to find K2917 registers at 0xff00 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking ufs filesystems /dev/rdsk/c0t3d0s5: is clean. /dev/rdsk/c0t3d0s4: is clean. /dev/rdsk/c0t3d0s7: is clean. /dev/rdsk/c0t3d0s3: is clean. add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc8vt syslog service starting. Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc8vt console login: ***************************************************************************** * * Starting Desktop Login on display :0... * * Wait for the Desktop Login screen before logging in. * ***************************************************************************** ***************************************************************************** * * The X-server can not be started on display :0... * ***************************************************************************** frc8vt console login: ppp frc8vt、サーバシステムは正常に立ち上がった。 frc7v-cl1、クライアント・システムを立ち上げる。 Power-On Self Test IU Register File Test MMU Context Table Reg Test MMU Context Register Test MMU Sync Fault Stat Reg Test MMU Sync Fault Addr Reg Test D-Cache Tag Ram Test D-Cache Data Ram Test D-TLB CAM Test D-TLB RAM Test I-Cache Tag Ram Test I-Cache Data Ram Test No Secondary Cache Exists No Secondary Cache Exists No Secondary Cache Exists Snoop Ram Test IOMMU-TLB Test IOMMU Control Register Test IOMMU Base Addr Register Test IOMMU SBus Config Registers Test Set RAH to 3 Set WS to 3 DRAM Data Bus Test Probing Bank 0 -- 32 Megs Found Probing Bank 1 -- 32 Megs Found Probing Bank 2 -- 0 Megs Found Probing Bank 3 -- 0 Megs Found Probing Bank 4 -- 0 Megs Found Probing Bank 5 -- 0 Megs Found Probing Bank 6 -- 0 Megs Found Probing Bank 7 -- 0 Megs Found DRAM Address Bus Test Memory Address Pattern Test D-Cache Hit Miss Test D-TLB Hit Miss Test I-TLB Hit Miss Test I-Cache Hit Miss Test No Secondary Cache Exists I-TLB Ram Test FPU Register File Test FPU Misaligned Reg Pair Test FPU Single-precision Tests FPU Double-precision Tests FPU SP Invalid CEXC Test FPU SP Overflow CEXC Test FPU SP Divide-by-0 CEXC Test FPU SP Inexact CEXC Test FPU SP Trap Priority > Test FPU SP Trap Priority < Test FPU DP Invalid CEXC Test FPU DP Overflow CEXC Test FPU DP Divide-by-0 CEXC Test FPU DP Inexact CEXC Test FPU DP Trap Priority > Test FPU DP Trap Priority < Test PROC0 Interrupt Regs Tests Soft Interrupts OFF Test Soft Interrupts ON Test PROC0 User Timer Test PROC0 Counter/Timer Test DMA2 E_CSR Register Test LANCE Address Port Tests LANCE Data Port Tests DMA2 D_CSR Register Test DMA2 D_ADDR Register Test DMA2 D_BCNT Register Test DMA2 D_NADDR Register Test ESP Registers Tests DMA2 P_CSR Register Test DMA2 P_ADDR Register Test DMA2 P_BCNT Register Test PPORT Registers Tests NVRAM Access Test TOD Registers Test screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory | Type help for more information ok boot net Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 The system is coming up. Please wait. checking for crash dump... default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. ok. frc7v-cl1、クライアント・システムは、"boot net"で正常に立ち上がった。 frc7v-cl1、クライアント・システムにホーム・ディレクトリをマウントする。 frc7v-cl1 console login: root Password: ^CLogin incorrect frc7v-cl1 console login: root Password: Mar 5 14:46:08 frc7v-cl1 login: ROOT LOGIN /dev/console Last login: Thu Mar 4 16:25:54 on console Sun Microsystems Inc. SunOS 5.6 Generic August 1997 Starting OpenWindows in 5 seconds (type Control-C to interrupt) ^C# ls -l /dev/cc lrwxrwxrwx 1 root other 69 Mar 4 14:47 /dev/cc -> /devices/iommu@ 0,10000000/sbus@0,10001000/VME@5,ffffe00/cc@2d,ff00:cc # mount frc8vt:/export/home/frc8vt /export/home/frc7v-cl1 # ^D frc7v-cl1 console login: frc7v-cl1、クライアント上で ccドライバのアンマウントおよびマウントを 実行。 frc7v-cl1# pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc7v-cl1# make load ./script/cc_load.sh [Installing CAMAC device driver] cp: cannot create /usr/kernel/drv/cc: Read-only file system cp: cannot create /usr/kernel/drv/cc.conf: Read-only file system [Adding CAMAC device driver to system] ここで、システムはハングしてしまった。 CPUボードCPUボードの "RUN" LED 赤が点灯し、"BM" LED は赤が点滅している。 CPUボードの "RESET"スイッチを押して止めた。 frc7v-cl1 console login: frc7v-cl1 console login: Mar 5 14:47:42 frc7v-cl1 su: 'su root' failed for inou e on /dev/pts/0 Mar 5 14:48:22 frc7v-cl1 su: 'su root' succeeded for inoue on /dev/pts/0 FRCvme ^ | frc7v-cl1、クライアント上で ccドライバのマウントをしようとして システムがハングした時、コンソール上にはここまで表示されている。 VMEドライバをロードする時に表示されるメッセージが出力されていない。 Power-On Self Test IU Register File Test MMU Context Table Reg Test MMU Context Register Test MMU Sync Fault Stat Reg Test MMU Sync Fault Addr Reg Test D-Cache Tag Ram Test D-Cache Data Ram Test D-TLB CAM Test D-TLB RAM Test I-Cache Tag Ram Test I-Cache Data Ram Test No Secondary Cache Exists No Secondary Cache Exists No Secondary Cache Exists Snoop Ram Test IOMMU-TLB Test IOMMU Control Register Test IOMMU Base Addr Register Test IOMMU SBus Config Registers Test Set RAH to 3 Set WS to 3 DRAM Data Bus Test Probing Bank 0 -- 32 Megs Found Probing Bank 1 -- 32 Megs Found Probing Bank 2 -- 0 Megs Found Probing Bank 3 -- 0 Megs Found Probing Bank 4 -- 0 Megs Found Probing Bank 5 -- 0 Megs Found Probing Bank 6 -- 0 Megs Found Probing Bank 7 -- 0 Megs Found DRAM Address Bus Test Memory Address Pattern Test D-Cache Hit Miss Test D-TLB Hit Miss Test I-TLB Hit Miss Test I-Cache Hit Miss Test No Secondary Cache Exists I-TLB Ram Test FPU Register File Test FPU Misaligned Reg Pair Test FPU Single-precision Tests FPU Double-precision Tests FPU SP Invalid CEXC Test FPU SP Overflow CEXC Test FPU SP Divide-by-0 CEXC Test FPU SP Inexact CEXC Test FPU SP Trap Priority > Test FPU SP Trap Priority < Test FPU DP Invalid CEXC Test FPU DP Overflow CEXC Test FPU DP Divide-by-0 CEXC Test FPU DP Inexact CEXC Test FPU DP Trap Priority > Test FPU DP Trap Priority < Test PROC0 Interrupt Regs Tests Soft Interrupts OFF Test Soft Interrupts ON Test PROC0 User Timer Test PROC0 Counter/Timer Test DMA2 E_CSR Register Test LANCE Address Port Tests LANCE Data Port Tests DMA2 D_CSR Register Test DMA2 D_ADDR Register Test DMA2 D_BCNT Register Test DMA2 D_NADDR Register Test ESP Registers Tests DMA2 P_CSR Register Test DMA2 P_ADDR Register Test DMA2 P_BCNT Register Test PPORT Registers Tests NVRAM Access Test TOD Registers Test screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory | Type help for more information ok boot net -r Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: -r 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvm ^ | frc7v-cl1、クライアント・システムを立ち上げようとしたが、 ここでブートシーケンスはハングしてしまった。 この時、CPUボードの "RUN" LED 赤が点灯し、"BM" LED は赤が点滅している。 CPUボードの "RESET"スイッチを押して止めた。 Power-On Self Test IU Register File Test MMU Context Table Reg Test MMU Context Register Test MMU Sync Fault Stat Reg Test MMU Sync Fault Addr Reg Test D-Cache Tag Ram Test D-Cache Data Ram Test D-TLB CAM Test D-TLB RAM Test I-Cache Tag Ram Test I-Cache Data Ram Test ここでクレートのパワーを OFF した。 Power-On Self Test IU Register File Test MMU Context Table Reg Test MMU Context Register Test MMU Sync Fault Stat Reg Test MMU Sync Fault Addr Reg Test D-Cache Tag Ram Test D-Cache Data Ram Test D-TLB CAM Test D-TLB RAM Test I-Cache Tag Ram Test I-Cache Data Ram Test No Secondary Cache Exists No Secondary Cache Exists No Secondary Cache Exists Snoop Ram Test IOMMU-TLB Test IOMMU Control Register Test IOMMU Base Addr Register Test IOMMU SBus Config Registers Test Set RAH to 3 Set WS to 3 DRAM Data Bus Test Probing Bank 0 -- 32 Megs Found Probing Bank 1 -- 32 Megs Found Probing Bank 2 -- 0 Megs Found Probing Bank 3 -- 0 Megs Found Probing Bank 4 -- 0 Megs Found Probing Bank 5 -- 0 Megs Found Probing Bank 6 -- 0 Megs Found Probing Bank 7 -- 0 Megs Found DRAM Address Bus Test Memory Address Pattern Test D-Cache Hit Miss Test D-TLB Hit Miss Test I-TLB Hit Miss Test I-Cache Hit Miss Test No Secondary Cache Exists I-TLB Ram Test FPU Register File Test FPU Misaligned Reg Pair Test FPU Single-precision Tests FPU Double-precision Tests FPU SP Invalid CEXC Test FPU SP Overflow CEXC Test FPU SP Divide-by-0 CEXC Test FPU SP Inexact CEXC Test FPU SP Trap Priority > Test FPU SP Trap Priority < Test FPU DP Invalid CEXC Test FPU DP Overflow CEXC Test FPU DP Divide-by-0 CEXC Test FPU DP Inexact CEXC Test FPU DP Trap Priority > Test FPU DP Trap Priority < Test PROC0 Interrupt Regs Tests Soft Interrupts OFF Test Soft Interrupts ON Test PROC0 User Timer Test PROC0 Counter/Timer Test DMA2 E_CSR Register Test LANCE Address Port Tests LANCE Data Port Tests DMA2 D_CSR Register Test DMA2 D_ADDR Register Test DMA2 D_BCNT Register Test DMA2 D_NADDR Register Test ESP Registers Tests DMA2 P_CSR Register Test DMA2 P_ADDR Register Test DMA2 P_BCNT Register Test PPORT Registers Tests NVRAM Access Test TOD Registers Test screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory | Type help for more information ok ok boot net -r Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: -r 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump... default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: ok. frc7v-cl1、クライアント・システムは正常に立ち上がった。 ホーム・ディレクトリをマウントする。 onlsun1[63]% !! rlogin frc7v-cl1 Password: No directory! Logging in with home=/ Last login: Fri Mar 5 14:47:06 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1% su Password: # mount frc8vt:/export/home/frc8vt /export/home/frc7v-cl1 # frc7v-cl1% logout Connection closed. onlsun1[64]% !! rlogin frc7v-cl1 Last login: Fri Mar 5 16:29:05 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1[33]% ls -l total 8 drwxr-xr-x 3 inoue staff 512 Feb 9 15:34 CAMAC/ drwxr-xr-x 3 inoue staff 512 Nov 6 11:07 FORCE/ drwxr-xr-x 2 inoue staff 512 Feb 18 10:29 Ktaka/ -rw------- 1 inoue staff 592 Feb 26 16:49 mbox frc7v-cl1[34]% ccドライバをアンロードおよびロードする。 frc7v-cl1# pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc7v-cl1# make load ./script/cc_load.sh [Installing CAMAC device driver] cp: cannot create /usr/kernel/drv/cc: Read-only file system cp: cannot create /usr/kernel/drv/cc.conf: Read-only file system [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc7v-cl1# cam2プログラムを実行。 frc7v-cl1[47]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[48]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 0 ここでハング。 CTL-C を押したらシステムはパニックを起こしてリブート した。 この時のコンソール上のメッセージは次のとおり。 NOTICE: cBmacAD: debug step01. --T RntAP camac_b() NOTI:E: in:t0x3f53c0y1p 1 34e0 0= NOT9CE: camac_b: derugpstep02.=f-bfcalldphysi o() NOTICE: cc_etr8eegy: debu4 step03. --a dnter cc_strdter=(f 6O09CEd fcc5strategy: cebu step04. -m- foundmuhe camac rea_f sOTICEr =3c_s2rateg d: de6ug srepw4-1.=1-- cam2: Data fault kernel read fault at addr=0xf609df5c, pme=0x0 MMU sfsr=326: Invalid Address on supv data fetch at level 3 pte addr = 0xf5fda674, level = 3 wrong ctx/as ctx 0, as 0xf59146f0 wrong ctx/as 2 ctx 0, as 0xe2 pid=398, pc=0xf5fe95c0, sp=0xfbfde930, psr=0x44010c7, context=0 g1-g7: f026de48, 2d18, f5f06058, c00, 200, 1, f5e755e0 B_aegri= 0x3c0n NtTICE: rountaince2bbt=10 NOTacEk cc_str.t.gy: debug step05. --- . ast DMA NOTp E= c _intr: debug step0f. bf- endee cc9i3tr()0 I NO C: ca_intrlldedu fsrep06ao m - cc->interruft=05ef NOTICEe c1_dntr: ded0g step0 6b.,--- cc- exfcup=nf_dma_flag b= f NOdeCE9 acc_intr: debug 0tep06d, -- accept inrerrugt: resu=n cc0intr() N TI2E: acc_str te60:0debug step0 . --- retufb DfA NOTICE: cc_strdtegya debugdstep08a. - - call f6_0ait_sig(6 rObIfE: cc0strat0g : febug 00e007b.00-- turn cv_Cait_sia() lOlICed amac_b: dfrug step07. -om rfturn0physio() 0bd3ac, fp=fbfdea70, args=f00000 5 600 2a fbfdeb08 f5c8a6d0 Called from f0068900, fp=fbfdeb80, args=f5936dd8 f5f8125c 22 3 22 3 Called from 11f30, fp=effff8c0, args=1 600 3f53c0 5 24a70 24a80 End traceback... panic: Data fault syncing file systems... 2 done 2644 static and sysmap kernel pages 100 dynamic kernel data pages 496 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 295 current user process pages 3535 total pages (3535 chunks) dumping to vp f59444dc, offset 139696 3535 total pages, dump succeeded rebooting... Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory / Type help for more information ok ok boot net -r Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: -r 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump...System went down at Fri Mar 5 16:37:13 1999 Saving 3535 pages of image in vmcore.10 3535 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.10 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: ホーム・ディレクトリをマウントする。 onlsun1[66]% rlogin frc7v-cl1 Password: No directory! Logging in with home=/ Last login: Fri Mar 5 16:29:36 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1% su Password: # mount frc8vt:/export/home/frc8vt /export/home/frc7v-cl1 # frc7v-cl1% logout Connection closed. onlsun1[67]% !! rlogin frc7v-cl1 Last login: Fri Mar 5 16:53:17 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1[33]% ls -l total 8 drwxr-xr-x 3 inoue staff 512 Feb 9 15:34 CAMAC/ drwxr-xr-x 3 inoue staff 512 Nov 6 11:07 FORCE/ drwxr-xr-x 2 inoue staff 512 Feb 18 10:29 Ktaka/ -rw------- 1 inoue staff 592 Feb 26 16:49 mbox frc7v-cl1[34]% cv_wait_sig() を入れて cam2 を実行する。 frc7v-cl1[39]% vi cc.c : /* E.Inoue: from */ mutex_enter(&cc->mutex); /* start MUTEX */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07a. --- call cv_wait_sig()"); /* E.Inoue: end */ cv_wait_sig(&cc->cv, &cc->mutex); /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step07b. --- return cv_wait_sig()"); /* E.Inoue: end */ /* if (cv_wait_sig(&cc->cv, &cc->mutex) == 0) { */ /* untimeout(cc->timeout_id); */ /* mutex_exit(&cc->mutex); */ /* end MUTEX */ /* return EINTR; */ /* } */ mutex_exit(&cc->mutex); /* end MUTEX */ /* E.Inoue: end */ return 0; } : "cc.c" 2784 lines, 69265 characters frc7v-cl1[40]% frc7v-cl1[37]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc7v-cl1[38]% frc8vt# pwd /usr/kernel/drv frc8vt# ls -l cc* -rw-r--r-- 1 root other 57188 Mar 5 14:23 cc -rw-r--r-- 1 root other 288 Mar 5 14:23 cc.conf frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc . frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc.conf . frc8vt# ls -l cc* -rw-r--r-- 1 root other 57284 Mar 5 17:50 cc -rw-r--r-- 1 root other 288 Mar 5 17:50 cc.conf frc8vt# frc7v-cl1# pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc7v-cl1# make load ./script/cc_load.sh [Installing CAMAC device driver] cp: cannot create /usr/kernel/drv/cc: Read-only file system cp: cannot create /usr/kernel/drv/cc.conf: Read-only file system [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc7v-cl1# ls -l /dev/cc lrwxrwxrwx 1 root other 69 Mar 5 1999 /dev/cc -> /devices/iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/cc@2d,ff00:cc frc7v-cl1# frc7v-cl1[37]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[38]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 0 NOTICE: camac_b: debug step01. --- enter camac_b() NOTICE: in: 0x3f53c0 10 1 34 0 0 NOTICE: camac_b: debug step02. --- call physio() NOTICE: cc_strategy: debug step03. --- enter cc_strategy() NOTICE: cc_strategy: debug step04. --- found the camac read NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x3c0 NOTICE: count in 32bit=10 NOTICE: cc_strategy: debug step05. --- start DMA NOTICE: cc_intr: debug step06. --- enter cc_intr() NOTICE: cc_intr: debug step06a. --- cc->interrupt=0xe NOTICE: cc_intr: debug step06b. --- cc->executing_dma_flag != 0 NOTICE: cc_intr: debug step06d. --- accept interrupt: return cc_intr() NOTICE: cc_strategy: debug step07. --- return DMA NOTICE: cc_strategy: debug step07a. --- call cv_wait_sig() ^C NOTBCE: AccDstrat gT: Rebug stAP0: t y-- petue= cv_9ai _sigrp =OTICE: camac_f:bdebuf8step03.8--- return physio(e4 addr=f6143f5c mmu_fsr=326 r w=1 cam2: Data fault kernel read fault at addr=0xf6143f5c, pme=0x0 MMU sfsr=326: Invalid Address on supv data fetch at level 3 pte addr = 0xf603c50c, level = 3 wrong ctx/as ctx 0, as 0xf5914470 wrong ctx/as 2 ctx 0, as 0x44 pid=444, pc=0xf60795f8, sp=0xfbf83930, psr=0x44010c4, context=0 g1-g7: f026de48, 5404, f606dcf8, c00, 200, 1, f5f1e080 Begin traceback... sp = fbf83930 Called from f6071dd0, fp=fbf839a0, args=0 2a 600 fbf83ad8 f60fcf00 f00000 Called from f00bd3ac, fp=fbf83a70, args=f00000 5 600 2a fbf83b08 f5c846d0 Called from f0068900, fp=fbf83b80, args=f593ba90 f5c8372c 22 3 22 3 Called from 11f30, fp=effff8c0, args=1 600 3f53c0 5 24a70 24a80 End traceback... panic: Data fault syncing file systems... 2 done 2792 static and sysmap kernel pages 98 dynamic kernel data pages 490 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 287 current user process pages 3667 total pages (3667 chunks) dumping to vp f59444dc, offset 138640 3667 total pages, dump succeeded rebooting... Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory \ Type help for more information ok ok boot net -r Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: -r 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump...System went down at Fri Mar 5 17:48:17 1999 Saving 3667 pages of image in vmcore.11 3667 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.11 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: 高橋さんからのメール。 ---- ここから > (1). frc7v-cl1上でのトレース > (1-1). DMA は開始されている。 > (1-2). DMA の実行は完了、あるいは abort されている。 > cc->interrupt=e(hex) > (1-3). cam2 の実行は cv_wait_sig() で待ち状態のまま固まっている。 > cc_intr()ルーチンで cv_signal()をコールしているのに > cv_wait_sig() から抜けられない。 CTL-C でパニック。 mutex_enter()、mutex_exit()の位置を変えて試して頂けませんか? 添付ファイルは変更後のソースコードです。 ---- ここまで mutex_enter()コールをcc_strategy()ルーチンに入った直後に行うように 変更 frc7v-cl1[74]% diff cc.c-Mar-8-99 cc.c 2515a2516,2519 > /* E.Inoue: from */ > mutex_enter(&cc->mutex); /* start MUTEX */ > /* E.Inoue: from */ > 2564a2569,2573 > > while(cc->executing_dma_flag){ > cv_wait(&cc->cv,&cc->mutex); > } > 2644,2646c2653 < /* E.Inoue: from */ < mutex_enter(&cc->mutex); /* start MUTEX */ < /* E.Inoue: from */ --- > frc7v-cl1[75]% static int cc_strategy(struct buf *bp) { register struct cc_device *cc = &ccdevice[0]; register struct K_REG *k = cc->k; register u_long dma_addr; register mode = cc->mode; register naf = cc->naf; register int wc = (mode & CC_BIT16) ? cc->len : cc->len * 2; register u_int flags; /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step03. --- enter cc_strategy()"); /* E.Inoue: end */ /* E.Inoue: from */ mutex_enter(&cc->mutex); /* start MUTEX */ /* E.Inoue: from */ /* check DMA mode and set flags */ switch (cc->naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from */ cmn_err(CE_NOTE," cc_strategy: debug step04. --- found the camac read"); /* E.Inoue: end */ flags = DDI_DMA_READ; break; case 0x0010: /* CAMAC write */ flags = DDI_DMA_WRITE; break; default: cc->status = CC_STA_BLOCK_INVFUNC; return 0; } frc7v-cl1[77]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[78]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc7v-cl1[79]% frc8vt# pwd /usr/kernel/drv frc8vt# ls -l cc* -rw-r--r-- 1 root other 57284 Mar 5 17:50 cc -rw-r--r-- 1 root other 288 Mar 5 17:50 cc.conf frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc . frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc.conf . frc8vt# ls -l cc* -rw-r--r-- 1 root other 57384 Mar 8 16:47 cc -rw-r--r-- 1 root other 288 Mar 8 16:47 cc.conf frc8vt# frc7v-cl1# pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc7v-cl1# make load ./script/cc_load.sh [Installing CAMAC device driver] cp: cannot create /usr/kernel/drv/cc: Read-only file system cp: cannot create /usr/kernel/drv/cc.conf: Read-only file system [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc7v-cl1# ls -l /dev/cc lrwxrwxrwx 1 root other 69 Mar 8 1999 /dev/cc -> /devices/iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/cc@2d,ff00:cc frc7v-cl1# cam2プログラムを実行 frc7v-cl1[37]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[38]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 0 ここで固まる。 cam2プログラムの、"Input n a f >3 0 0" を実行した直後に、システムは パニックを起こしてリブートをしてしまった。 トレース用のメッセージは 乱れてしまって読めない。 NOTICE: BaAacDb: eTug sRAp0P. --- ente: cama _ty)p NOTIeE: in:=0x3f5390 10 1 3 4 0r0 NOTp=E: camac_b: febug btep02. -f- cael phc8ie() NOT4 E:a cd_strategy: debdg rtep=f. --- ent61 cc_s4ratagy() g step04-1rw_strate=y1 debg stef04s --- ro=nd 32e camac read cam2: Data fault kernel read fault at addr=0xf614af5c, pme=0x0 MMU sfsr=326: Invalid Address on supv data fetch at level 3 pte addr = 0xf6033228, level = 3 wrong ctx/as ctx 0, as 0xf5914510 wrong ctx/as 2 ctx 0, as 0xb7 pid=889, pc=0xf606f638, sp=0xfbfec930, psr=0x44010c6, context=0 g1-g7: f026de48, ef37, f6030ef8, c00, 200, 1, f5e47720 aNOTICE: ce_strabegy: debugastec0k. --- st.r. DMA. N sIp : cc_str= egf: debug s teb07. f-- recurn D9A cc_strat NOTICE: fc6i06r:7dedug s0ep0,. --- e tef ccpintr(= fObICE: cc_intfe cebug 9tap060. --- cc->interrupt=0xe NOTICE: cc,i tr:adebur stepg6bs --- cc=>e0ec ting_2ma_faag != 0 N60ICE0 cc_intrfbdfeug step06dc ad- acce8 fn6errupt0 refurn 2c_infr(0 _ TICE: cc_stratefy: 00bug step070. -0-0return c Cialsig() leTdCE: camac_ : defrgosmep 7.f--0 retu0n phybio() d3ac, fp=fbfeca70, args=f00000 5 600 2a fbfecb08 f59350c8 Called from f0068900, fp=fbfecb80, args=f593bce8 f5ccde9c 22 3 22 3 Called from 11f30, fp=effff8c0, args=1 600 3f53c0 5 24a70 24a80 End traceback... panic: Data fault syncing file systems... 2 done 2799 static and sysmap kernel pages 130 dynamic kernel data pages 488 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 287 current user process pages 3704 total pages (3704 chunks) dumping to vp f59444dc, offset 138344 3704 total pages, dump succeeded rebooting... Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Rebooting with command: Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@3,0 File and args: \ Type 'go' to resume Type help for more information ok ok boot net -r Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Rebooting with command: net -r Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: -r 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump...System went down at Mon Mar 8 16:45:27 1999 Saving 3704 pages of image in vmcore.12 3704 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.12 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: onlsun1[38]% !! rlogin frc7v-cl1 Password: No directory! Logging in with home=/ Last login: Mon Mar 8 16:44:45 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1% su Password: # csh frc7v-cl1# source /.cshrc frc7v-cl1# mount frc8vt:/export/home/frc8vt /export/home/frc7v-cl1 frc7v-cl1# # frc7v-cl1% logout Connection closed. onlsun1[39]% !! rlogin frc7v-cl1 Last login: Mon Mar 8 17:31:21 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1[33]% ls -l total 8 drwxr-xr-x 3 inoue staff 512 Feb 9 15:34 CAMAC/ drwxr-xr-x 3 inoue staff 512 Nov 6 11:07 FORCE/ drwxr-xr-x 2 inoue staff 512 Feb 18 10:29 Ktaka/ -rw------- 1 inoue staff 592 Feb 26 16:49 mbox frc7v-cl1[34]% --- (6). セクション (6-1). サブセクション (6-1-1). サブサブセクション