Nov 5, 1999 onl8v1: Solaris 7 cc ドライバのテスト. cc ドライバのインストール ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (http://www-online.kek.jp/~inoue/CAMAC/ onl8v1-sol7/camac-step01-1.txt) 高エネルギー加速器研究機構 素粒子原子核研究所 物理、オンライングループ 井上 栄二 (1). 現状確認 (A). SPARC CPU-8VT、Solaris7、VMEドライバが届いた。 (B). CPU-8VT に Solaris7 のシステムをインストールした。 (C). /etc の下の各設定、および /export/home の作成をやった。 (D). CPU-8VT に Solaris7用の VMEドライバ、FRCdrv-2.7(FRCvme v2.4.1) をインストールした。 (E). CPU-8VT(onl8v1) に ccドライバをインストールした。 "make load" を実行すると attach 時にエラーを起こす。 (F). attach 時にエラーを起こす件は直った。 (G). "make" 時に warning が出る件について調べて直した。 (2). ここでやるべきこと 正しくコンパイルできるようになった ccドライバを onl8v1 にインストール する。 (3). ccドライバのキットを入手、インストールする (3-1). キットの入手 オンライン・グループの anonymous ftp サイトから入手したキットを onl8v1 上で一部修正した(debug-step01.txt および debug-step02.txt 参照)。 これら のファイルを使ってコンパイル、ロードする。 (3-2). 展開したキットをコンパイルする (3-2-1). コンパイラのバージョンをチェック onl8v1[56]% which cc /kek/compilers/ws5.0/SUNWspro/bin/cc onl8v1[57]% which f77 /kek/compilers/ws5.0/SUNWspro/bin/f77 onl8v1[58]% cc -V cc: WorkShop Compilers 5.0 98/12/15 C 5.0 usage: cc [ options] files. Use 'cc -flags' for details onl8v1[59]% f77 -V f77: WorkShop Compilers 5.0 98/12/15 FORTRAN 77 5.0 Usage: f77 [ options ] files. Use 'f77 -flags' for details onl8v1[60]% (3-2-2). CAMACドライバをコンパイルする onl8v1[63]% pwd /export/home/onl8v1/inoue/CAMAC/Driver/FORCE-50T-sol2.6 onl8v1[64]% make clean \rm -f cc *.o libcamac.a cam1 cam2 cam3 *~ core onl8v1[65]% ls -l total 530 -rw-r--r-- 1 inoue kek 2041 Jul 19 15:30 Makefile -rw-r--r-- 1 inoue kek 3624 Jul 26 14:10 README -rw-r--r-- 1 inoue kek 1170 Jul 16 10:47 cam1.c -rw-r--r-- 1 inoue kek 2295 Jul 16 10:47 cam2.f -rw-r--r-- 1 inoue kek 2055 Jul 16 10:47 cam3.c -rw-r--r-- 1 inoue kek 9740 Jul 16 10:47 camlib.c -rw-r--r-- 1 inoue kek 1415 Jul 16 10:47 camlib.h -rw-r--r-- 1 inoue kek 75716 Nov 2 14:16 cc.c -rw-r--r-- 1 inoue kek 75695 Nov 2 14:02 cc.c-Nov-2.99 -rw-r--r-- 1 inoue kek 74943 Jul 26 15:32 cc.c-org -rw-r--r-- 1 inoue kek 288 Jul 16 10:47 cc.conf -rw-r--r-- 1 inoue kek 2931 Jul 26 16:45 cc.h -rw-r--r-- 1 inoue kek 2288 Jul 16 10:47 cc_common.h -rw-r--r-- 1 inoue kek 876 Jul 16 10:47 cc_config.h -rw-r--r-- 1 inoue kek 3289 Jul 16 10:47 forlib.c -rw-r--r-- 1 inoue kek 4058 Jul 16 10:47 k2917.h drwxr-xr-x 2 inoue kek 512 Oct 22 09:38 script/ onl8v1[66]% onl8v1[66]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o cc -O -c camlib.c -o camlib.o -I. cc -O -c forlib.c -o forlib.o -I. rm -f libcamac.a ar rcv libcamac.a camlib.o forlib.o a - camlib.o a - forlib.o ar: writing libcamac.a cc -O cam1.c -o cam1 -I. -L. -lcamac f77 -fast -O3 -u cam2.f -o cam2 -I. -L. -lcamac cam2.f: MAIN: cc -O cam3.c -o cam3 -I. -L. -lcamac onl8v1[67]% (3-4). "make install" をやる onl8v1# pwd /export/home/onl8v1/inoue/CAMAC/Driver/FORCE-50T-sol2.6 onl8v1# ls -l total 950 -rw-r--r-- 1 inoue kek 2041 Jul 19 15:30 Makefile -rw-r--r-- 1 inoue kek 3624 Jul 26 14:10 README -rwxr-xr-x 1 inoue kek 14236 Nov 2 15:58 cam1 -rw-r--r-- 1 inoue kek 1170 Jul 16 10:47 cam1.c -rwxr-xr-x 1 inoue kek 104904 Nov 2 15:58 cam2 -rw-r--r-- 1 inoue kek 2295 Jul 16 10:47 cam2.f -rwxr-xr-x 1 inoue kek 14624 Nov 2 15:58 cam3 -rw-r--r-- 1 inoue kek 2055 Jul 16 10:47 cam3.c -rw-r--r-- 1 inoue kek 9740 Jul 16 10:47 camlib.c -rw-r--r-- 1 inoue kek 1415 Jul 16 10:47 camlib.h -rw-r--r-- 1 inoue kek 9648 Nov 2 15:58 camlib.o -rw-r--r-- 1 inoue kek 41736 Nov 2 15:58 cc -rw-r--r-- 1 inoue kek 75716 Nov 2 14:16 cc.c -rw-r--r-- 1 inoue kek 75695 Nov 2 14:02 cc.c-Nov-2.99 -rw-r--r-- 1 inoue kek 74943 Jul 26 15:32 cc.c-org -rw-r--r-- 1 inoue kek 288 Jul 16 10:47 cc.conf -rw-r--r-- 1 inoue kek 2931 Jul 26 16:45 cc.h -rw-r--r-- 1 inoue kek 2288 Jul 16 10:47 cc_common.h -rw-r--r-- 1 inoue kek 876 Jul 16 10:47 cc_config.h -rw-r--r-- 1 inoue kek 3289 Jul 16 10:47 forlib.c -rw-r--r-- 1 inoue kek 3500 Nov 2 15:58 forlib.o -rw-r--r-- 1 inoue kek 4058 Jul 16 10:47 k2917.h -rw-r--r-- 1 inoue kek 14008 Nov 2 15:58 libcamac.a drwxr-xr-x 2 inoue kek 512 Oct 22 09:38 script onl8v1# make install /usr/ucb/install -d /usr/local/vme/camac/include /usr/ucb/install -d /usr/local/vme/camac/lib /usr/ucb/install -m 644 camlib.h cc_config.h cc_common.h cc.h \ k2917.h /usr/local/vme/camac/include /usr/ucb/install -m 644 libcamac.a /usr/local/vme/camac/lib onl8v1# ls -lLR /usr/local /usr/local: total 2 drwxr-xr-x 3 root other 512 Oct 14 14:23 vme /usr/local/vme: total 2 drwxr-xr-x 4 root other 512 Oct 14 14:23 camac /usr/local/vme/camac: total 4 drwxr-xr-x 2 root other 512 Nov 2 16:01 include drwxr-xr-x 2 root other 512 Nov 2 16:01 lib /usr/local/vme/camac/include: total 26 -rw-r--r-- 1 root staff 1415 Nov 2 16:01 camlib.h -rw-r--r-- 1 root staff 2931 Nov 2 16:01 cc.h -rw-r--r-- 1 root staff 2288 Nov 2 16:01 cc_common.h -rw-r--r-- 1 root staff 876 Nov 2 16:01 cc_config.h -rw-r--r-- 1 root staff 4058 Nov 2 16:01 k2917.h /usr/local/vme/camac/lib: total 28 -rw-r--r-- 1 root staff 14008 Nov 2 16:01 libcamac.a onl8v1# (3-5). ここで、システムを立ち上げ直す # /usr/sbin/shutdown -i0 -g0 Shutdown started. Tue Nov 2 16:05:53 JST 1999 Do you want to continue? (y or n): y Changing to init state 0 - please wait Broadcast Message from root (console) on onl8v1 Tue Nov 2 16:05:55... THE SYSTEM onl8v1 IS BEING SHUT DOWN NOW ! ! ! Log off now or risk your files being damaged showmount: onl8v1: RPC: Program not registered # INIT: New run level: 0 The system is coming down. Please wait. System services are now being stopped. Print services stopped. syslogd: going down on signal 15 umount: /net/onlsun1/home3 busy umount: /net/onlsun1/export busy umount: /net/onlsun1/home1 busy umount: /net/onlsun1/home4 busy umount: /net/onlsun1/home3/local busy umount: /net busy umount: /net/onlsun1/home3/local busy umount: /net/onlsun1/home3 busy umount: /net/onlsun1/home1 busy umount: /net/onlsun1/home4 busy umount: /net/onlsun1/usr busy umount: /net/onlsun1/export busy umount: /net busy The system is down. INIT: failed write of utmpx entry:"s0" INIT: failed write of utmpx entry:"fw" syncing file systems... done Program terminated Type help for more information ok 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.7 Version Generic_106541-06 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1999, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: onl8v1 Configuring the /devices directory CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) WARNING: cc_probe: inoue -- enter cc_attach routine Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking ufs filesystems /dev/rdsk/c0t3d0s7: is clean. NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.248.0 Setting default interface for multicast: add net 224.0.0.0: gateway onl8v1 syslog service starting. Print services started. volume management starting. The system is ready. onl8v1 console login: (3-6). ccドライバのロード、アンロード ccドライバのロード、アンロードが正しく実行できることを確認する。 onl8v1# pwd /export/home/onl8v1/inoue/CAMAC/Driver/FORCE-50T-sol2.6 onl8v1# ls -l /dev/cc lrwxrwxrwx 1 root other 69 Nov 2 16:03 /dev/cc -> /devices/iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/cc@2d,ff00:cc onl8v1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] onl8v1# ls -l /dev/cc /dev/cc: No such file or directory onl8v1# make load ./script/cc_load.sh [Installing CAMAC device driver] [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] sun4m onl8v1# ls -l /dev/cc lrwxrwxrwx 1 root other 69 Nov 2 16:19 /dev/cc -> /devices/iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/cc@2d,ff00:cc onl8v1# onl8v1# modinfo | grep CAMAC 149 f5b61324 6544 106 1 cc (CAMAC driver v1.4x by Y.Takeuch) onl8v1# ok. camac ドライバは正常にロード、アンロードできた。 /var/adm/messagesファイル中の情報 : Nov 2 16:19:22 onl8v1 unix: devinfo0 is /pseudo/devinfo@0 Nov 2 16:19:23 onl8v1 unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) Nov 2 16:19:23 onl8v1 unix: WARNING: cc_probe: inoue -- enter cc_attach routine Nov 2 16:19:23 onl8v1 unix: cc0 at VME0: vme16d16,0xff00 VME level 4 vector 0xf f sparc ipl 7 Nov 2 16:19:23 onl8v1 unix: cc0 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffff e00/cc@2d,ff00 Nov 2 16:19:34 onl8v1 unix: sysconfig0: LCA is XC4003 compatible : (4). VME スレーブ・ウインドウの設定 onl8v1 のカーネル・アーキテクチャをチェック。 onl8v1[37]% arch -k sun4m onl8v1[38]% (4-1). VME.conf ファイルを修正する onl8v1[48]% pwd /platform/sun4m/kernel/drv onl8v1[49]% ls -l total 1534 -rw-r----- 1 root other 200348 Oct 13 11:33 VME -rw-r----- 1 root other 2850 Oct 13 11:33 VME.conf -rwxr-xr-x 1 root sys 18492 Sep 1 1998 bwtwo* -rwxr-xr-x 1 root sys 32056 Sep 1 1998 cgeight* -rwxr-xr-x 1 root sys 44580 Jun 29 23:19 cgfourteen* -rwxr-xr-x 1 root sys 24596 Sep 1 1998 cgsix* -rwxr-xr-x 1 root sys 19936 Sep 1 1998 cgthree* -rwxr-xr-x 1 root sys 6592 Sep 1 1998 dma* -rwxr-xr-x 1 root sys 68288 Sep 1 1998 fd* -rwxr-xr-x 1 root sys 52616 Jan 14 1999 flash-memory* -rw-r--r-- 1 root other 2008 Oct 13 11:30 flash-memory.conf -rwxr-xr-x 1 root sys 13728 Sep 1 1998 iommu* -rwxr-xr-x 1 root sys 5512 Sep 1 1998 ledma* -rwxr-xr-x 1 root sys 15776 Sep 1 1998 mic* -rwxr-xr-x 1 root sys 5264 Sep 1 1998 obio* -rwxr-xr-x 1 root sys 8216 Sep 1 1998 pmc* -rw-r--r-- 1 root sys 146 Sep 1 1998 profile.conf -rwxr-xr-x 1 root sys 8136 Sep 1 1998 rootnex* -rwxr-xr-x 1 root sys 8524 Sep 1 1998 sbus* -rwxr-xr-x 1 root sys 6320 Sep 1 1998 sbusmem* -rw-r--r-- 1 root sys 678 Sep 1 1998 sbusmem.conf -rwxr-xr-x 1 root sys 62436 Sep 1 1998 stc* -rw-r--r-- 1 root sys 1244 Sep 1 1998 stc.conf -rwxr-xr-x 1 root sys 26920 Sep 1 1998 sx* -rwxr-xr-x 1 root sys 16212 Sep 1 1998 sx_cmem* -rw-r--r-- 1 root sys 800 Oct 5 15:33 sx_cmem.conf -rwxr-xr-x 1 root sys 19300 Aug 12 1998 tcx* -rwxr-xr-x 1 root sys 58840 Jun 3 22:32 zs* -rwxr-xr-x 1 root sys 25760 Sep 1 1998 zsh* -rw-r--r-- 1 root sys 131 Sep 1 1998 zsh.conf onl8v1[50]% ls -l V* -rw-r----- 1 root other 200348 Oct 13 11:33 VME -rw-r----- 1 root other 2850 Oct 13 11:33 VME.conf onl8v1[51]% onl8v1# mv VME.conf VME.conf.org onl8v1# cp VME.conf.org VME.conf onl8v1# ls -l V* -rw-r----- 1 root other 200348 Oct 13 11:33 VME -rw-r----- 1 root other 2850 Nov 4 16:52 VME.conf -rw-r----- 1 root other 2850 Oct 13 11:33 VME.conf.org onl8v1# chmod o+r VME.conf onl8v1# ls -l V* -rw-r----- 1 root other 200348 Oct 13 11:33 VME -rw-r--r-- 1 root other 2850 Nov 4 16:52 VME.conf -rw-r----- 1 root other 2850 Oct 13 11:33 VME.conf.org onl8v1# onl8v1# vi VME.conf # %Z%$RCSfile: VME.conf,v $ $Revision: 1.7 $ %D% FRC # ############################################################################### # The "pamc" property declares the AM-code values for the two programmable AM # codes (if supported by the hardware). Drivers that want to use these have to # use the values configured here in the bustype value(s) of their reg property. # ############################################################################### # "vmewin" properties may be defined to set up static local-to-VMEbus # mappings (usually not necessary, since mappings are set up on demand). # # The format is # vmewin=,, # # can be omitted for the first vmewin property. For subsequent properties, # set it to 1,2,3,4... The limit is the number of hardware ranges, # e.g. 16 on FGA-5000. # defines the requested VMEbus address. # defines the size of the mapping in bytes. # encodes the properties of the VME window. It's a bit set of # VME_BT_xxx values as defined in sys/vme_types.h. # # Example to set up a VME window for VMEbus address 0x0 - 0x10000 in A24 # space for D32 privileged data accesses, write posting enabled: # # vmewin=0x0, 0x10000, 0x01020004 # ############################################################################### # The "slavewin" property defines a VMEbus-to-local mapping. It's necessary for # device drivers that want to set up DMA via the standard DDI DMA interface # calls, so that the VME nexus can provide a VMEbus address where the device # can perform DMA to. # Don't define this if you do not need it, as it will eat up a VME slave # range. Note also that the VME bridge will decode these addresses once the # slavewin property has been set and report VME Bus Errors if no driver # uses it! So if you get strange bus errors, check this file for the # slavewin property. # The format is: # # slavewin , , # # and must be aligned exactly to hardware requirements: # S4: vme_start must be aligned to 1MB, size must be 1MB # FGA-5x00: vme_start must be aligned to size. size can be # 8K, 16K, 32K, ..., 16MB for A24 # 2MB, 4MB, 8MB, 16MB for A32 # Universe: vme_start and size must be aligned to 64K # is a bitset of the VME_BT_xxx values as defined # in sys/vme_types. Standard values are: # 0x00020000 for a slave window in A24 space # 0x00040000 for a slave window in A32 space # # Add 0x01000000 to enable write posting for higher performance (FGA-5x00, # Universe). # # Refer to the manual for possible values for different hardware. # Example for a slave window of 1MB in A24 space at address 0: # # slavewin=0x000000,0x100000,0x00020000 ############################################################################### # slavewin=0x000000,0x100000,0x00020000 pamc=0x10, 0x11 ; "VME.conf" 64 lines, 2888 characters onl8v1# (4-2). システムをリブートする # /usr/sbin/shutdown -i0 -g0 Shutdown started. Fri Nov 5 14:20:39 JST 1999 Do you want to continue? (y or n): y Changing to init state 0 - please wait Broadcast Message from root (console) on onl8v1 Fri Nov 5 14:20:41... THE SYSTEM onl8v1 IS BEING SHUT DOWN NOW ! ! ! Log off now or risk your files being damaged # INIT: New run level: 0 The system is coming down. Please wait. System services are now being stopped. Print services stopped. syslogd: going down on signal 15 The system is down. INIT: failed write of utmpx entry:"s0" INIT: failed write of utmpx entry:"fw" syncing file systems... done Program terminated Type help for more information ok 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.7 Version Generic_106541-06 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1999, Sun Microsystems, Inc. NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2c020017 configuring network interfaces: le0. Hostname: onl8v1 Configuring the /devices directory CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) WARNING: cc_probe: inoue -- enter cc_attach routine Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking ufs filesystems /dev/rdsk/c0t3d0s7: is clean. NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.248.0 Setting default interface for multicast: add net 224.0.0.0: gateway onl8v1 syslog service starting. Print services started. volume management starting. The system is ready. onl8v1 console login: ok. slavewin は正しく設定できた。 ---xxxx ( ここまでやった 継続中) --- (6). セクション (6-1). サブセクション (6-1-1). サブサブセクション