[root@localhost galil]# cd PCIDriver [root@localhost PCIDriver]# ls galilpci.c main.c Makefile term.c [root@localhost PCIDriver]# make #build the pci driver make -C /lib/modules/2.6.11-1.1369_FC4/build SUBDIRS=/root/galilpci modules make[1]: Entering directory `/usr/src/kernels/2.6.11-1.1369_FC4-i686' CC [M] /root/galilpci/galilpci.o Building modules, stage 2. MODPOST CC /root/galilpci/galilpci.mod.o LD [M] /root/galilpci/galilpci.ko make[1]: Leaving directory `/usr/src/kernels/2.6.11-1.1369_FC4-i686' [root@localhost PCIDriver]# insmod galilpci.ko #load the module into the kernel [root@localhost PCIDriver]# lsmod | grep galilpci #the galilpci kernel module should show up here galilpci 5416 0 [root@localhost PCIDriver]# ls /dev/g* #the device file of the same name should show up here /dev/galilpci0 /dev/gpmctl [root@localhost PCIDriver]# g=/dev/galilpci0 #set an environment variable so we type less [root@localhost PCIDriver]# echo -en ER0\\r > $g #send a command to the board. The red LED should turn on [root@localhost PCIDriver]# cat $g #get the colon response :[root@localhost PCIDriver]# [root@localhost PCIDriver]# echo -en ER-1\\r > $g && cat $g && echo #send a command and get the response. The red LED should turn off : [root@localhost PCIDriver]# cat > test.dmc #create a small program to download to the controller #AUTO ER0 WT1000 ER-1 WT1000 JP#AUTO [root@localhost PCIDriver]# cat test.dmc #AUTO ER0 WT1000 ER-1 WT1000 JP#AUTO [root@localhost PCIDriver]# #now download the file we just created [root@localhost PCIDriver]# echo -en DL\\r > $g && cat test.dmc | tr \\n \\r > $g && echo -en \\ > $g && cat $g [root@localhost PCIDriver]# echo -en LS\\r > $g && cat $g && echo #list the program 0 #AUTO 1 ER0 2 WT1000 3 ER-1 4 WT1000 5 JP#AUTO 6 7 : [root@localhost PCIDriver]# echo -en XQ\\r > $g && cat $g && echo #run the program (the red LED should blink every second) : [root@localhost PCIDriver]# #now upload the program to a file [root@localhost PCIDriver]# echo -en UL\\r > $g && cat $g | tr -d \\r:\\032 > ul.dmc [root@localhost PCIDriver]# cat ul.dmc #AUTO ER0 WT1000 ER-1 WT1000 JP#AUTO [root@localhost PCIDriver]# gcc main.c #now build the sample application program [root@localhost PCIDriver]# ./a.out #run the program Connected to DMC1886 Rev 1.0 :Serial number 125.0000 :Sent 1000 commands. Average time per command: 0.070000 ms Uploaded program #AUTO ER0 WT100 ER-1 WT100 JP#AUTO EN : :Uploaded array 0.0000, 1.0000, 2.0000, 3.0000, 4.0000 [root@localhost PCIDriver]# #the light should now be blinking every 100 ms [root@localhost PCIDriver]# gcc term.c #now build the terminal [root@localhost PCIDriver]# ./a.out #and run it Ctrl-C exits. Connected to DMC1886 Rev 1.0 :MG_BN 125.0000 :TP 0, 0, 0, 0, 0, 0, 0, 0 : [root@localhost PCIDriver]#