***************** * Preliminary * ***************** Installation Guide of CAMAC Device Driver/Library on SPARC 7-Jun-1993 Version 1.22 Yasuo TAKEUCHI Dept. of Physics, Tokyo Institute of Technology (T.I.T.) Copyright reserved. 0. Overview This CAMAC driver/library has following features. 1. It can work on SPARC/SunOS 4.1.X with SBus-VME adapter. (Solflower SF-VME, etc.) 2. All CAMAC functions are callable from C and FORTRAN programs. 3. These functions (camlib) are compatible with those on VAX/VMS, DEC station/ULTRIX developed by KEK. 4. Provide the CAMAC list processing in the UNIX kernel mode. 5. All driver source is written in C language. This document describes following topics briefly. 1. How to get the CAMAC driver source. 2. Setup of hardware (K2917, SF-VME) 3. Installation of software (Solflower's driver, CAMAC driver) 4. How to test the SPARC-VME-CAMAC system. 5. E-mail address, etc. 1. Getting Driver Source You can get the driver source by using "anonymous FTP". FTP host: onlnews.kek.jp (130.87.97.1) bangkok.ssc.gov (134.3.30.11) PROMPT% ftp onlnews.kek.jp Name(onlnews.kek.jp:xxxx): anonymous Password: ftp> cd pub/kek/camac ftp> get Install-guide.sparc.txt <= this document ftp> get camexe_camasm.txt <= documents ftp> binary ftp> get camac.sparc-1.22b.tar.Z <= driver source ftp> get camlib.docs-0.81.tar.Z <= documents ftp> bye In above example, "PROMPT%" represents your prompt. Next, you should extract these archives. PROMPT% zcat camac.sparc-1.22b.tar.Z | tar xvf - PROMPT% cd vme PROMPT% zcat ../camlib.docs-0.81.tar.Z | tar xvf - 2. Setup of Hardware 1. Perform shutdown of your SPARCstation, then turn off the power. PROMPT% su PROMPT# shoutdown -h now 2. Install Solflower's SBus board to suitable SBus slot except SBus slot 3. The SBus board is used as default setting. 3. Set jumper switch of K2917. Change the DMA LO/HI setting(default) to DMA HI/LO. Please refer K2917's manual. 4. Insert the K2917 VME board into SF-VME's VME rack. You can use any slot of VME. Before insertion, You must remove the 5 jumper pins at left side of upper 96pin connector in the VME backplane. 5. Connect VME with SPARC by using SF-VME's cable. 6. Turn on the power. (VME rack, CPU) Up to here, you can install the driver, so you can leave following steps later. 7. Setup K3922 according to the K3922's manual. 8. Connect K3922 with K2917 by the suitable cable. This cable isn't included K2917 or K3922 products, so you may have to assemble it by yourself. 9. Insert K3922 into the CAMAC crate, then turn power on. 3. Installing of CAMAC Device Driver and Library 1. Load SF-VME's driver from the floppy disk to work directory. PROMPT% cd ~/vme/sfvme (Insert FD) PROMPT% tar xvf /dev/rfd0 PROMPT% eject 2. Copy SFVME's files according to SFVME's manual. Before copying you should make backup of original files. PROMPT% cat install.sh <= check! PROMPT% cat Makefile <= check! PROMPT% su PROMPT# make backup PROMPT# sh install.sh PROMPT# exit 3. Make symbolic link of the header files of SFVME. PROMPT% su PROMPT# make header PROMPT# exit 4. Make the device entry points of SF-VME. Please refer SF-VME's manual and examples of modification. (~/vme/camac/titech/*) PROMPT% more /sys/sun/conf.c.original <= check last number of devices PROMPT% vi SFVME.MAKEDEV <= modify "sfvmemajor=104" if needed PROMPT% su PROMPT# cd /dev PROMPT# sh /home/xxxxxxxx/vme/sfvme/SFVME.MAKEDEV PROMPT# chmod 666 sfvme* PROMPT# ls -al sfvme* <- check! PROMPT# exit 5. Next, install CAMAC driver files, then recompile the kernel. PROMPT% cd ~/vme/camac/dev 6. Copy original files to the current directory. PROMPT% make newfiles 7. Modify ./CAMAC ./conf.c ./files. Please refer our modification examples and SF-VME's manual. PROMPT% diff CAMAC ../titech/4.1.1/org/CAMAC PROMPT% diff CAMAC ../titech/4.1.1/mod/CAMAC PROMPT% diff conf.c ../titech/4.1.1/org/conf.c PROMPT% diff files ../titech/4.1.1/org/files (etc..) PROMPT% vi CAMAC <= modify 1 point PROMPT% vi conf.c <= modify 2 points PROMPT% vi files <= modify last several lines 8. Make the CAMAC driver entry point. The device number of CAMAC is next to "sfvmemajor". PROMPT% vi Makefile <- modify "105" at last line PROMPT% su PROMPT# make node PROMPT# exit 9. Keep current kernel, then recompile new kernel with CAMAC driver. Then reboot the system. PROMPT% su PROMPT# df <- check capacity of / PROMPT# mv /vmunix /vmunix.original PROMPT# make kernel PROMPT# fastboot 10. Check boot messages. Are there following messages? vme0 at SBus slot 1 0x7ff000 ... cc0 at vme16d16 0xff00 vec 0xff ... CAMAC device driver V1.22b, 1991-1993 by Y.TAKEUCHI (T.I.T.) 11. Compile the CAMAC library(camlib), then install them. PROMPT% cd ~/vme/camac PROMPT% vi Makefile <- modify DISTDIR, if needed PROMPT% make library PROMPT% su PROMPT# make install PROMPT# exit 12. Compile test programs. PROMPT% make sample 4. Test CAMAC action etc. In this section, an example of examination step is described. The programs used for the test are included in ~/vme/tools or ~/vme/camac/examples. 4.1. Test of reading SF-VME's register. (~/vme/tools/sreg1.c) This program consists from only SunOS's function. So this test proves which SF-VME is successfully installed or not. From the boot message, it is known which slot is used by Solflower's SBus board. (1 at above example message) You should modify the access privilege of that slot. PROMPT% su PROMPT# chmod 666 /dev/sbus1 PROMPT# exit Next, modify sbus_slot.h, then compile sreg1.c. PROMPT% cd ~/vme/tools PROMPT% vi sbus_slot.h <- comment out proper line PROMPT% make sreg1 Then execute sreg1. PROMPT% sreg1 4.2. Test of reading K2917's register. (~/vme/tools/kreg1.c) This program consists from only SunOS's and SF-VME's function. This test proves which SF-VME's driver and K2917 is successfully installed or not. PROMPT% cd ~/vme/tools PROMPT% make kreg1 PROMPT% kreg1 4.3. Test of CAMAC single action. (~/vme/camac/examples/cam1.c) This program consists from SunOS's and CAMAC's function. Before this test, connect K3922 with K2917, then turn CAMAC crate's power on. PROMPT% cd ~/vme/camac/examples PROMPT% make cam1 PROMPT% cam1 4.4. Test of CAMAC block transfer. (~/vme/camac/fortran/cam2.f) This program consists from SunOS's and CAMAC's function. From this examination, it is proved which the DMA works well or not. PROMPT% cd ~/vme/camac/fortran PROMPT% make cam2 PROMPT% cam2 4.5. Test of LAM interruption. (~/vme/camac/examples/cam3.c) This program consists from SunOS's and CAMAC's function, and uses SF-VME's interrupt handling function internally. The program assumes CAMAC LAM source at N=11. Please modify for your environment. PROMPT% cd ~/vme/camac/examples PROMPT% make cam3 PROMPT% cam3 4.6. Test of CAMAC list processing. (~/vme/camac/examples/cam4.c) This test check the action of CAMAC list processing. Please modify cam4.asm, if you needed. (please refer camexe_camasm.txt) PROMPT% cd ~/vme/camac/examples PROMPT% make cam4 PROMPT% cam4 5. References 1. Y.Takeuchi et al., Development of Data Acquisition System using RISC/UNIX(TM) Workstation, Nucl. Instrum. Meth. A328(1993)526-534 2. Y.YASU and M.NOMACHI, CAMAC Device Driver on VAX/VMS version 1.0, KEK Internal 90-2, 1990 3. M.Nomachi, CAMEXE (a virtual machine which execute CAMAC operations) and CAMASM (a macro assembler for CAMEXE machine code), KEK on-line group, 1987 (camasm_camexe.txt) 6. Address for bug-reports etc. Please send bug-reports, requests, impression and so on to following address. ******************************************************************************* Yasuo TAKEUCHI Watanabe-Tanimori group, Dept. of Physics, Tokyo Inst. of Technology, 2-12-1 O-okayama, Meguro-ku, Tokyo 152, JAPAN FAX -81-3-3720-9083 E-mail take@kekvax.kek.jp KEKVAX::TAKE TAKE@JPNKEKVX *******************************************************************************