I tried to write Linux kernel module with cryptoapi. I found some examples like this: https://codedream.me/2014/04/cryptoapi-linux-kernel/ This example is working for me. Then I made some changes. Now my system crashes, when I try to load module. Can you help me with this? When variable len = 1000, module is loaded normal. But if I change it on len =
Tag: linux-kernel
Many-to-one mapping of user threads to a kernel thread
As I understand it, in many-to-one mapping, one kernel thread manages many user threads. This kernel thread helps the user threads make system calls etc. What I don’t understand is: Why do we have many-to-one mapping if a single blocking call would block all user threads managed by the kernel thread ? In many-to-one mapping of user threads to a
check if a memory page is loaded into memory
Given a virtual address, I want to know if the memory page mapped into this virtual address has been loaded into memory or in disck. Is there anyway to do check that in user level program? I am using CentOS 7. Answer You can use the mincore system call for this. mincore – determine whether pages are resident in memory
Usage of lstat / stat from the linux kernel?
I’m hoping someone can fact check my assumptions on the question “Can lstat and/or stat be called form the Linux kernel 3.10.0 in Centos 7. I’ve been searching and reading as much as I can find and have only been able to confuse myself. I can’t tell if the examples I am finding are available to kernel space or user
kernel submit checklist “Any new or modified CONFIG options don’t muck up the config menu”?
In kernel submit checklist rule “Any new or modified CONFIG options don’t muck up the config menu” does this mean we should not add new or modify exiting config options that appear in make menuconfig options ? Please correct my understanding ? Answer It means that you should be careful when adding a configuration option. Sometimes it is not straightforward
lookup the lock statistic in linux kernel
I study Linux lock mechanism recently, and want to see the lock holding and waiting time. So I turn on CONFIG_LOCK_STAT flag in the .config file via make menuconfig and after recompiling the kernel run the command: I got the following message: Just don’t know why, since I’ve turn on all the flags in the kernel hack->lock session. P.S. The
Just like IN_ADDRANY can we creat any macro for port number, such that we can bind to any port insteed of a particular port??
I want to receive the data from different ip addr with different port numbers and the reading the data is in infinite loop? Answer Can’t be done. It would conflict with all other bound sockets on the system. If what you really want to do is read any traffic coming in through the network interface, you need a packet capture
Which header file do I have to include to get printk() within a kernel source file?
Let’s say I want to use printk() within arch/x86/boot/string.c before compiling the kernel. Which header file do I have to include so that the linker knows where to find printk()? I tried #include <linux/kernel.h> and #include <linux/printk.h> but I always get errors during make bzImage telling me the linker does not find printk: Answer You are trying to instrument the
could not to setup crash dump on centos7 for debug kernel
I am trying to setup kdump to generate the vmcore for kernel-3.10.0-123.el7. For the perf kernel kernel-3.10.0-123.el7.x86_64.rpm i setup kdump and kdump is working fine too, generating vmcore. Then i installed kernel-debug-3.10.0-123.el7.x86_64.rpm using yum install kernel-debug-3.10.0-123.el7.x86_64.rpm and kdump worked fine. But then i didnt have vmlinux to read vmcore of debug kernel. Then I build source using rpmbuild from the
How does the kernel handle a read operation on proc files when several instances of the same driver are running simultaneously
I have a question regarding the way proc files are handled when several instances of the same driver are running simultaneously. lets assume that a my system runs a couple of instances of the same driver simultaneously, but only one of them (according to some inner decision making) created a proc file and maintains the information that should be written