Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagetext
titleKernel Module on LinuxRT
collapsetrue
root@cpu-b34-sp02]$ ls
adq.ko
[ root@cpu-b34-sp02]$ ls /dev > dev_before_insmod.txt
[ root@cpu-b34-sp02]$ dmesg   > dmesg_before_insmod.txt
[ root@cpu-b34-sp02]$ insmod adq.ko 
[102834.973910] adq: loading out-of-tree module taints kernel.
[102834.979952] adq: SPD ADQ PCI Device driver v1.21 loaded.
[102834.985819] spd_adq_pci 0000:da:00.0: Found Signal Processing Devices ADQ14, device PCIe/PXIe/uTCA bus 218 slot 0 function 0
[ root@cpu-b34-sp02]$ ls /dev > dev_after_insmod.txt
[ root@cpu-b34-sp02]$ dmesg   > dmesg_after_insmod.txt
[ root@cpu-b34-sp02]$ 
[ root@cpu-b34-sp02]$ ls -l
total 229
-rw-------    1 laci     lcls         32048 Nov 30 16:42 adq.ko
-rw-r--r--    1 root     root          3857 Nov 30 16:45 dev_after_insmod.txt
-rw-r--r--    1 root     root          3840 Nov 30 16:44 dev_before_insmod.txt
-rw-r--r--    1 root     root         95069 Nov 30 16:46 dmesg_after_insmod.txt
-rw-r--r--    1 root     root         94816 Nov 30 16:45 dmesg_before_insmod.txt
[ root@cpu-b34-sp02]$ diff dev_before_insmod.txt dev_after_insmod.txt 
--- dev_before_insmod.txt
+++ dev_after_insmod.txt
@@ -1,3 +1,4 @@
+adq_pcie_218_0_0
 bus
 console
 cpu
[ root@cpu-b34-sp02]$ diff dmesg_before_insmod.txt dmesg_after_insmod.txt 
--- dmesg_before_insmod.txt
+++ dmesg_after_insmod.txt
@@ -1347,3 +1347,6 @@
 [   23.257900] random: dropbear: uninitialized urandom read (32 bytes read)
 [   24.553478] ipmi device interface
 [   24.768942] IPv6: ADDRCONF(NETDEV_UP): eth5: link is not ready
+[102834.973910] adq: loading out-of-tree module taints kernel.
+[102834.979952] adq: SPD ADQ PCI Device driver v1.21 loaded.
+[102834.985819] spd_adq_pci 0000:da:00.0: Found Signal Processing Devices ADQ14, device PCIe/PXIe/uTCA bus 218 slot 0 function 0
[ root@cpu-b34-sp02]$ 

Demo: build Teledyne kernel module in LinuxRT sandbox directory

Code Block
languagetext
titlelcls-dev3 demo
collapsetrue
lcls-dev3$ pwd
/u/ey/caf/digitizer/sandbox2/linuxKernel_Modules/adqDriver/R1.29.0/build/buildroot-2019.08-x86_6
lcls-dev3$ make clean
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.symvers  *.order *.c *.h module_* original.*
lcls-dev3$ ls
Makefile
lcls-dev3$ make
### copy the sources to make a directory for building
cp -r ../../src/* .
make compile
make[1]: Entering directory `/afs/slac.stanford.edu/g/controls/development/users/caf/digitizer/sandbox2/linuxKernel_Modules/adqDriver/R1.29.0/build/buildroot-2019.08-x86_64'
make ARCH=x86_64 CROSS_COMPILE=/afs/slac/package/linuxRT/buildroot-2019.08/host/linux-x86_64/x86_64/usr/bin/x86_64-buildroot-linux-gnu- -C /afs/slac/package/linuxRT/buildroot-2019.08/buildroot-2019.08-x86_64/output/build/linux-4.14.139 M=/u/ey/caf/digitizer/sandbox2/linuxKernel_Modules/adqDriver/R1.29.0/build/buildroot-2019.08-x86_64 modules
make[2]: Entering directory `/afs/slac.stanford.edu/package/linuxRT/vol7/buildroot-2019.08/buildroot-2019.08-x86_64/output/build/linux-4.14.139'
  CC [M]  /u/ey/caf/digitizer/sandbox2/linuxKernel_Modules/adqDriver/R1.29.0/build/buildroot-2019.08-x86_64/spd_adq_pci.o
  LD [M]  /u/ey/caf/digitizer/sandbox2/linuxKernel_Modules/adqDriver/R1.29.0/build/buildroot-2019.08-x86_64/adq.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /u/ey/caf/digitizer/sandbox2/linuxKernel_Modules/adqDriver/R1.29.0/build/buildroot-2019.08-x86_64/adq.mod.o
  LD [M]  /u/ey/caf/digitizer/sandbox2/linuxKernel_Modules/adqDriver/R1.29.0/build/buildroot-2019.08-x86_64/adq.ko
make[2]: Leaving directory `/afs/slac.stanford.edu/package/linuxRT/vol7/buildroot-2019.08/buildroot-2019.08-x86_64/output/build/linux-4.14.139'
make[1]: Leaving directory `/afs/slac.stanford.edu/g/controls/development/users/caf/digitizer/sandbox2/linuxKernel_Modules/adqDriver/R1.29.0/build/buildroot-2019.08-x86_64'
lcls-dev3$ make install
mkdir -p ../../buildroot-2019.08-x86_64/include/
cp  spd_adq_pci_ioctl.h ../../buildroot-2019.08-x86_64/include/.
cp  *.ko ../../buildroot-2019.08-x86_64/.
lcls-dev3$
lcls-dev3$ ls -l ../../buildroot-2019.08-x86_64/
total 34
-rw-rw-r-- 1 caf ey 32048 Dec  2 13:26 adq.ko
drwxrwxr-x 2 caf ey  2048 Dec  2 13:26 include lcls-dev3$  lcls-dev3$ ls -l ../../buildroot-2019.08-x86_64/include 
total 5
-rw-rw-r-- 1 caf ey 4466 Dec  2 13:26 spd_adq_pci_ioctl.h lcls-dev3$