kernel-module

How to Link static or shared library to Kernel Module?

喜夏-厌秋 提交于 2021-01-27 18:51:16
问题 There is a function in aaa.c int myadd(int a, int b){ return a+b; } and aaa.c was built into a static library using gcc -c aaa.c -o aaa.o && ar -cr libaaa.a aaa.o and a shared library using gcc -c aaa.c -o aaa.o && gcc -shared -fPCI -o libaaa.so aaa.o Then I wrote a file call.c, and try to call function myadd() in libaaa.so, but failed. Please give me some advice, test.c: #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> MODULE_LICENSE("Dual BSD/GPL"); extern int

Does pci driver functions represented as function number in PCI's driver_data object

风格不统一 提交于 2021-01-07 01:26:20
问题 Does Each PCI peripheral function (from Linux Device Driver -- Book Each PCI periphel is identified by a bus number, a device number, and a function number. ) specified as a pci driver data? (Question: is net_device a driver function in pci_dev as a network function ) as assigning in net_device dev pci_dev pdev .... .... pci_set_drvdata (pdev, dev); the above code is present in Linux's RealTek Ethernet driver's pci device driver's probe function from https://github.com/torvalds/linux/blob

What is the difference between T and t in /proc/kallsyms

早过忘川 提交于 2020-12-31 10:51:05
问题 This is a part of text file from System.map and /proc/kallsyms . ffffffff8106c260 T leave_mm ffffffff8106c340 t do_flush_tlb_all ffffffff8106c390 t flush_tlb_func ffffffff8106c510 T native_flush_tlb_others ffffffff8106c540 T flush_tlb_current_task ffffffff8106c600 T flush_tlb_mm_range ffffffff8106c770 T flush_tlb_page ffffffff8106c820 T flush_tlb_all ffffffff8106c840 T flush_tlb_kernel_range What is the difference between T and t ? I know that T or t is for text (code) section. I guessed T

What is the difference between T and t in /proc/kallsyms

岁酱吖の 提交于 2020-12-31 10:50:12
问题 This is a part of text file from System.map and /proc/kallsyms . ffffffff8106c260 T leave_mm ffffffff8106c340 t do_flush_tlb_all ffffffff8106c390 t flush_tlb_func ffffffff8106c510 T native_flush_tlb_others ffffffff8106c540 T flush_tlb_current_task ffffffff8106c600 T flush_tlb_mm_range ffffffff8106c770 T flush_tlb_page ffffffff8106c820 T flush_tlb_all ffffffff8106c840 T flush_tlb_kernel_range What is the difference between T and t ? I know that T or t is for text (code) section. I guessed T

Different package present in /usr/lib/x86_64-linux-gnu/

℡╲_俬逩灬. 提交于 2020-12-31 06:48:11
问题 I'm running this command nl-qdisc-add --dev=veth-host --parent=root plug --limit=32768 It throws an error of Error: Unable to load module "/usr/lib/x86_64-linux-gnu/libnl/cli/qdisc/plug.so": /usr/lib/x86_64-linux-gnu/libnl/cli/qdisc/plug.so: cannot open shared object file: No such file or directory I looked into the folder and found that there was another folder present named libnl-3 with same files. I can't even rename it to run the command. How can i resolve this? Even if i successfully

Different package present in /usr/lib/x86_64-linux-gnu/

时光总嘲笑我的痴心妄想 提交于 2020-12-31 06:47:08
问题 I'm running this command nl-qdisc-add --dev=veth-host --parent=root plug --limit=32768 It throws an error of Error: Unable to load module "/usr/lib/x86_64-linux-gnu/libnl/cli/qdisc/plug.so": /usr/lib/x86_64-linux-gnu/libnl/cli/qdisc/plug.so: cannot open shared object file: No such file or directory I looked into the folder and found that there was another folder present named libnl-3 with same files. I can't even rename it to run the command. How can i resolve this? Even if i successfully