Questions tagged [linux-kernel]

This tag is for questions about the internals of the Linux kernel itself - particularly about writing code that runs within the context of the kernel (like kernel modules or drivers). Questions about writing userspace code in Linux should generally be tagged [linux] instead. Since the internals of the Linux kernel are constantly changing, it is helpful to include the precise kernel version(s) that you are interested in.

This tag is for questions about the internals of the Linux kernel itself - particularly about writing code that runs within the context of the kernel (like kernel modules or drivers).

Questions about writing userspace code in Linux should generally be tagged instead. Since the internals of the Linux kernel are constantly changing, it is helpful to include the precise kernel version(s) that you are interested in.

The kernel is a UNIX-like kernel initially created by Linus Torvalds in 1991 and now is maintained by developers around the world.

Frequently Asked Questions

Online resources

Books

Kernel source code and source code browsers

Further reading

Mailing lists

17371 questions
69
votes
1 answer

Difference between arm-eabi arm-gnueabi and gnueabi-hf compilers

What is the difference between arm-eabi, gnueabi and gnueabi-hf cross compilers?
preetam
  • 1,451
  • 1
  • 17
  • 43
67
votes
2 answers

What is the difference between a Linux platform driver and normal device driver?

Earlier I had assumed that : Platform driver is for those devices that are on chip. Normal device driver are for those that are interfaced to the processor chip. Before coming across one i2c driver... But here, I am reading through multi function…
kzs
  • 1,793
  • 3
  • 24
  • 44
66
votes
13 answers

How to get function's name from function's pointer in Linux kernel?

How to get function's name from function's pointer in C? Edit: The real case is: I'm writing a linux kernel module and I'm calling kernel functions. Some of these functions are pointers and I want to inspect the code of that function in the kernel…
Daniel Silveira
  • 41,125
  • 36
  • 100
  • 121
66
votes
4 answers

Linux kernel "historical" git repository with full history

I think many developers like to investigate sources with the help of git gui blame. As explained in the commit for Linux-2.6.12-rc2 (also mirrored at Github), it needs to have special historical Linux repository for this…
ashrugger
  • 711
  • 1
  • 6
  • 5
63
votes
6 answers

What is the function of "(void) (&_min1 == &_min2)" in the min macro in kernel.h?

In kernel.h min is defined as: #define min(x, y) ({ \ typeof(x) _min1 = (x); \ typeof(y) _min2 = (y); \ (void) (&_min1 == &_min2); \ _min1 < _min2 ? _min1 : _min2; }) I don't understand what the…
Robert S. Barnes
  • 39,711
  • 30
  • 131
  • 179
62
votes
2 answers

How do I delete virtual interface in Linux?

ip link shows this: [root@0-25-90-68-79-4a log]# ip link 1: lo: mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth0: mtu 1500 qdisc…
vikas
  • 901
  • 3
  • 10
  • 13
61
votes
4 answers

What is the need of empty braces '{ }' at the end of array of structs?

I hit some c code in Linux kernel: static struct ctl_table ip_ct_sysctl_table[] = { { .procname = "ip_conntrack_max", .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec, }, //…
NK-cell
  • 1,145
  • 6
  • 19
61
votes
2 answers

Running docker on Android

With Android 4.4 KitKat, Google is upgrading linux kernel to version 3.8 which is the required kernel version for Docker. I don't know the AUFS part but will there be a way to run docker containers on android with this update?
Xelom
  • 1,615
  • 1
  • 13
  • 23
60
votes
11 answers

How is Linux kernel live debugging done and what tools are used?

What are the most common and why are uncommon methods and tools used not to do live debugging on the Linux kernel? I know that Linus, for example, is against this kind of debugging for the Linux Kernel or it least was and thus nothing much has been…
Shinnok
  • 6,279
  • 6
  • 31
  • 44
59
votes
5 answers

How to recompile just a single kernel module?

Usually kernel source are stored in /usr/src/linux-2.6.x/. To avoid to recompile the entire kernel if I modify a module's source, how can I recompile just that module?
user1056635
  • 785
  • 2
  • 9
  • 12
59
votes
7 answers

Why is the probe method needed in Linux device drivers in addition to init?

In the linux kernel, what does the probe() method, that the driver provides, do? How different is it from the driver's init function, i.e. why can't the probe() functions actions be performed in the driver's init function ?
Bandicoot
  • 3,811
  • 7
  • 35
  • 39
57
votes
10 answers

How to determine if a specific module is loaded in linux kernel

I am just curious is there any way to determine if a particular module is loaded/installed. $ lsmod lists all modules (device driver loaded). Is there any way to check or a command that returns true/false boolean output if a module name is polled.…
Dennis Ninj
  • 829
  • 2
  • 8
  • 15
57
votes
4 answers

How does Linux Kernel know where to look for driver firmware?

I'm compiling a custom kernel under Ubuntu and I'm running into the problem that my kernel doesn't seem to know where to look for firmware. Under Ubuntu 8.04, firmware is tied to kernel version the same way driver modules are. For example, kernel…
Robert S. Barnes
  • 39,711
  • 30
  • 131
  • 179
57
votes
3 answers

Qt Creator, ptrace: Operation not permitted. What is the permanent solution?

While debugging C++ code in Qt creator I get the following error ptrace: Operation not permitted. Could not attach to the process. Make sure no other debugger traces this process. Check the settings of /proc/sys/kernel/yama/ptrace_scope For more…
Indra
  • 1,308
  • 3
  • 18
  • 24
56
votes
3 answers

What's meaning of "EXPORT_SYMBOL" in Linux kernel code?

from here 48 struct snd_card *snd_cards[SNDRV_CARDS]; 49 EXPORT_SYMBOL(snd_cards); I am not getting whats the meaning of it and why that is used. I tried to search about it but not understanding the meaning of that.
Jeegar Patel
  • 26,264
  • 51
  • 149
  • 222