linux-kernel

Replace kernel builtin module with a loadable one

给你一囗甜甜゛ 提交于 2021-02-08 18:40:12
问题 I have developped a kernel module to manage a nf4 tag as a char device. I have developped this module outside of the kernel and tested it compiled as a loadable kernel module (i.e. .ko) during the development phase. Once the driver has been functional and stable enough I have inserted it into linux kernel source (v4.9.30) using patches so it's built as part of the kernel. Here I'm in the situation where the module is loaded probed at boot by kernel as it's builtin and it appears into the

Replace kernel builtin module with a loadable one

谁都会走 提交于 2021-02-08 18:38:20
问题 I have developped a kernel module to manage a nf4 tag as a char device. I have developped this module outside of the kernel and tested it compiled as a loadable kernel module (i.e. .ko) during the development phase. Once the driver has been functional and stable enough I have inserted it into linux kernel source (v4.9.30) using patches so it's built as part of the kernel. Here I'm in the situation where the module is loaded probed at boot by kernel as it's builtin and it appears into the

Replace kernel builtin module with a loadable one

左心房为你撑大大i 提交于 2021-02-08 18:35:45
问题 I have developped a kernel module to manage a nf4 tag as a char device. I have developped this module outside of the kernel and tested it compiled as a loadable kernel module (i.e. .ko) during the development phase. Once the driver has been functional and stable enough I have inserted it into linux kernel source (v4.9.30) using patches so it's built as part of the kernel. Here I'm in the situation where the module is loaded probed at boot by kernel as it's builtin and it appears into the

Replace kernel builtin module with a loadable one

余生长醉 提交于 2021-02-08 18:32:46
问题 I have developped a kernel module to manage a nf4 tag as a char device. I have developped this module outside of the kernel and tested it compiled as a loadable kernel module (i.e. .ko) during the development phase. Once the driver has been functional and stable enough I have inserted it into linux kernel source (v4.9.30) using patches so it's built as part of the kernel. Here I'm in the situation where the module is loaded probed at boot by kernel as it's builtin and it appears into the

How to enable SIGINT signal for system() call in a pthread in C?

我的梦境 提交于 2021-02-08 11:55:25
问题 The below manual on system() says it blocks SIGINT and SIGQUIT signal for any binary program run through system() call. https://man7.org/linux/man-pages/man3/system.3.html#:~:text=The%20system()%20library%20function,the%20command%20has%20been%20completed. Psedo Code: thread_1() { ... system("binary application"); } main() { ... pid = pthread_create(thread_1); pthread_cancel(pid); } pthread_cancel issues SIGINT to thread 1 which kill the thread 1, but not the binary application. How to make

How to interpret address_space struct in `# define __percpu __attribute__((noderef, address_space(3)))`

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-08 10:50:38
问题 I am looking scheduling algorithm in static void __sched notrace __schedule(bool preempt) (__schedule) Along the way, I find # define __percpu __attribute__((noderef, address_space(3))) (address_space) However, I cannot understand why struct address_space can be initialized by using round brackets ( ) since I look through struct syntax in c language. How to initialize a struct in accordance with C programming language standards. struct should be initialized by { } for each filed. So, what

Get all mount points in kernel module

老子叫甜甜 提交于 2021-02-08 07:23:30
问题 I'm trying to get all the mount points in a kernel module. Below is what I've come up with. It segfaults because of the strcat. Is this the correct way to get the mount points? Will this work? if so how do i fix the segfault? If not, how does one go about getting the mount points in a linux kernel module? I've tried cycle the whole namespace looking for mountpoint roots that match but its from 2003 and the kernel has changed so much so its basically useless. Also tried get filesystem mount

Get all mount points in kernel module

*爱你&永不变心* 提交于 2021-02-08 07:20:33
问题 I'm trying to get all the mount points in a kernel module. Below is what I've come up with. It segfaults because of the strcat. Is this the correct way to get the mount points? Will this work? if so how do i fix the segfault? If not, how does one go about getting the mount points in a linux kernel module? I've tried cycle the whole namespace looking for mountpoint roots that match but its from 2003 and the kernel has changed so much so its basically useless. Also tried get filesystem mount

Is mode switch occur switching from user thread to kernel thread?

寵の児 提交于 2021-02-08 06:14:15
问题 I'm confused of user/kernel thread and mode/context switch (Platform: Linux) I have two linked questions. (1) Is the below sentence right? If I make a system call, then mode switch (user mode to kernel mode) will occur and eventually switching from user thread to kernel thread happens. Since system call can only be executed in kernel thread, I think mode switch must occur the switching from the user thread to kernel thread. (2) Then, what we call the overhead of mode switching is that

Is mode switch occur switching from user thread to kernel thread?

五迷三道 提交于 2021-02-08 06:09:21
问题 I'm confused of user/kernel thread and mode/context switch (Platform: Linux) I have two linked questions. (1) Is the below sentence right? If I make a system call, then mode switch (user mode to kernel mode) will occur and eventually switching from user thread to kernel thread happens. Since system call can only be executed in kernel thread, I think mode switch must occur the switching from the user thread to kernel thread. (2) Then, what we call the overhead of mode switching is that