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
47
votes
5 answers

Is there any API for determining the physical address from virtual address in Linux?

Is there any API for determining the physical address from virtual address in Linux operating system?
47
votes
3 answers

What is tagged structure initialization syntax?

struct file_operations scull_fops = { .owner = THIS_MODULE, .llseek = scull_llseek, .read = scull_read, .write = scull_write, .ioctl = scull_ioctl, .open = scull_open, .release = scull_release, }; This declaration uses the standard C tagged…
httpinterpret
  • 6,409
  • 9
  • 33
  • 37
46
votes
5 answers

Direct Memory Access in Linux

I'm trying to access physical memory directly for an embedded Linux project, but I'm not sure how I can best designate memory for my use. If I boot my device regularly, and access /dev/mem, I can easily read and write to just about anywhere I want.…
Mikeage
  • 6,424
  • 4
  • 36
  • 54
46
votes
3 answers

Difference between vm.dirty_ratio and vm.dirty_background_ratio?

I'm currently experimenting with the kernel parameters found in /proc/sys/vm, especially dirty_ratio and dirty_background_ratio. The kernel doc has the following explanations for both: dirty_background_ratio Contains, as a percentage of total…
happyMOOyear
  • 1,255
  • 1
  • 11
  • 14
45
votes
6 answers

Linux headers are consuming a lot of disk space on the EC2 machine. Is it safe to manually delete the headers with rm command?

EC2 machine on aws is filled with multiple linux headers and currently / is 100% full on disk space. I ran commands like apt-get autoremove but it is throwing an error saying No apport report written because the error message indicates a disk full…
hithyshi
  • 713
  • 1
  • 5
  • 11
45
votes
5 answers

Don't add "+" to linux kernel version

I am building linux kernel, if my kernel under git, then kernel version every time is: Image Name: Linux-2.6.39+ If I am not using git, then everything is OK without any plus at the end. I know that this done by scripts/setlocalversion script: if…
Yuri
  • 1,179
  • 4
  • 13
  • 27
44
votes
3 answers

What does m mean in kernel configuration file?

CONFIG_UNIX=m I know what y and n stand for,but what about m?
compile-fan
  • 16,885
  • 22
  • 59
  • 73
43
votes
3 answers

I want to contribute to the Linux kernel

I want to work with the Linux kernel, but I have no idea where to start. Is there a sort of ticketing system somewhere where bugs and such are distributed? Where can I get ideas for potentially useful contributions? EDIT: Yes I know what I'm doing.…
alexgolec
  • 26,898
  • 33
  • 107
  • 159
43
votes
3 answers

Why doesn't Linux use the hardware context switch via the TSS?

I read the following statement: The x86 architecture includes a specific segment type called the Task State Segment (TSS), to store hardware contexts. Although Linux doesn't use hardware context switches, it is nonetheless forced to set…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
43
votes
3 answers

Linux perf events: cpu-clock and task-clock - what is the difference

Linux perf tools (some time ago named perf_events) has several builtin universal software events. Two most basic of them are: task-clock and cpu_clock (internally called PERF_COUNT_SW_CPU_CLOCK and PERF_COUNT_SW_TASK_CLOCK). But what is wrong with…
osgx
  • 90,338
  • 53
  • 357
  • 513
42
votes
7 answers

Who calls the probe() of driver

How does probe() call gets called? Who calls it? As per my understanding, __init() registers driver and then somehow probe() is called to register the device data and irq etc. How exactly it happens? I am working on touchscreen driver and its…
iSegFault
  • 947
  • 2
  • 9
  • 18
42
votes
3 answers

Linux Stack Sizes

I'm looking for a good description of stacks within the linux kernel, but I'm finding it surprisingly difficult to find anything useful. I know that stacks are limited to 4k for most systems, and 8k for others. I'm assuming that each kernel thread…
John Ulvr
  • 636
  • 1
  • 8
  • 8
42
votes
5 answers

What is the difference between DMA and memory-mapped IO?

What is the difference between DMA and memory-mapped IO? They both look similar to me.
brett
  • 5,379
  • 12
  • 43
  • 48
42
votes
8 answers

How to solve "Kernel panic - not syncing - Attempted to kill init" -- without erasing any user data

I was trying to update libc in our Ubuntu server but it failed and now when I reboot the server I get a error message: Kernel panic - not syncing - Attempted to kill init! and it just hangs. What is the solution to this problem? The server is…
Slayer
  • 2,391
  • 4
  • 21
  • 18
41
votes
3 answers

What are memory mapped page and anonymous page?

I am not able to understand memory mapped page and anonymous page in linux. Can someone please explain it with an example? What are the kernel data structures related to them?
bornfree
  • 2,308
  • 1
  • 23
  • 33