Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [linux-kernel]

Questions about Linux kernel and Linux kernel related topics eg. implementation details such as system calls, kernel customization, etc. For Linux user space topics which do not involve kernel details, [linux] or distribution tag are more suitable.

371
votes
7answers
41k views

How can I find the implementations of Linux kernel system calls?

I am trying to understand how a function, say mkdir, works by looking at the kernel source. This is an attempt to understand the kernel internals and navigate between various functions. I know mkdir ...
126
votes
6answers
26k views

Why isn't Linux embraced as the official GNU kernel?

While I knew for quite some time the existence of Hurd, and its mission as the official GNU Operating System kernel, I was wondering how come Linux is not embraced as the official GNU kernel over the ...
123
votes
3answers
9k views

What does the Windows flag in the Linux logo of kernel 3.11 mean?

I've just installed kernel-3.11.0-1.fc20 for my Fedora 19 installation. During the rebooting progress, I saw the Linux logo with a Windows flag in it, what does it mean? The Fedora 19 is installed in ...
114
votes
6answers
20k views

If Linux is only a kernel, then how were its first versions used (without distribution)?

Linux is only a kernel, and if users want to use it, then they need a complete distribution. That being said, how were the first versions of Linux used when there were no Linux distributions?
106
votes
6answers
42k views

Why is the Linux kernel 15+ million lines of code? [closed]

What are the contents of this monolithic code base? I understand processor architecture support, security, and virtualization, but I can't imagine that being more than 600,000 lines or so. What are ...
86
votes
1answer
96k views

What is a tainted kernel in Linux?

Under certain conditions, the Linux kernel may become tainted. For example, loading a proprietary video driver into the kernel taints the kernel. This condition may be visible in system logs, kernel ...
75
votes
2answers
23k views

“WannaCry” on Linux systems: How do you protect yourself?

According to a rapid7 article there are some vulnerable Samba versions allowing a remote code execution on Linux systems: While the WannaCry ransomworm impacted Windows systems and was easily ...
71
votes
3answers
17k views

What does an idle CPU process do?

Looking at the source of strace I found the use of the clone flag CLONE_IDLETASK which is described there as: #define CLONE_IDLETASK 0x00001000 /* kernel-only flag */ After looking deeper into it I ...
66
votes
1answer
6k views

Why is 'bc' required to build the Linux kernel?

The Linux kernel minimal building requirements specifies that the calculator bc is required to build kernel v4.10, the minimal version of the tool being 1.06.95. What use is made of bc in this ...
65
votes
2answers
84k views

How to display the Linux kernel command line parameters given for the current boot?

In the grub.conf configuration file I can specify command line parameters that the kernel will use, i.e.: kernel /boot/kernel-3-2-1-gentoo root=/dev/sda1 vga=791 After booting a given kernel, is ...
61
votes
5answers
20k views

Why is the Linux kernel called an “image”?

I often hear people refer to the Linux kernel as the Linux kernel image and I can't seem to find an answers on any search engines as to why its called an image. When I think of an image I can only ...
60
votes
7answers
16k views

Are threads implemented as processes on Linux?

I'm going through this book, Advanced Linux Programming by Mark Mitchell, Jeffrey Oldham, and Alex Samuel. It's from 2001, so a bit old. But I find it quite good anyhow. However, I got to a point ...
60
votes
4answers
93k views

How to list all loadable kernel modules?

I'm looking for a few kernel modules to load i2c-dev and i2c-bcm2708. But the modprobe command returns: sudo modprobe i2c-dev modprobe: module i2c-dev not found in modules.dep How can I list all the ...
55
votes
6answers
188k views

Linux: How to find the device driver used for a device?

If my target has one device connected and many drivers for that device loaded, how can I understand what device is using which driver?
52
votes
7answers
16k views

Why does mount require root privileges?

Why does Linux require that a user be root/using sudo/specifically authorized per mount in order to mount something? It seems like the decision as to whether to allow a user to mount something should ...
52
votes
7answers
40k views

Linux Kernel: Good beginners' tutorial [closed]

I'm interested in modifying the kernel internals, applying patches, handling device drivers and modules, for my own personal fun. Is there a comprehensive resource for kernel hacking, intended for ...
51
votes
2answers
51k views

Understand logging in Linux

As I understand, Linux kernel logs to /proc/kmsg file(mostly hardware-related messages) and /dev/log socket? Anywhere else? Are other applications also able to send messages to /proc/kmsg or /dev/log? ...
51
votes
3answers
16k views

Does the kernel have a main() function? [closed]

I am learning device drivers and Kernel programming. According to Jonathan Corbet's book, there is no main() function in device drivers. So I two questions: Why don't we need a main() function in ...
50
votes
3answers
10k views

On Linux, when does “uptime” start counting from?

My computer says: $ uptime 10:20:35 up 1:46, 3 users, load average: 0,03, 0,10, 0,13 And if I check last I see: reboot system boot 3.19.0-51-generi Tue Apr 12 08:34 - 10:20 (01:45) And ...
41
votes
7answers
37k views

Is it possible to install the Linux kernel alone?

I'm just curious if it's possible to install the Linux kernel alone, or if you need to use one of the flavours. If it were possible, how would you do it? I don't need a detailed tutorial. I just want ...
39
votes
7answers
20k views

Can ps display only non kernel processes on Linux?

How can I ask ps to display only user processes and not kernel threads? See this question to see what I mean...
38
votes
1answer
22k views

Configuring, compiling and installing a custom Linux kernel

I'd like to try using a kernel other than the one provided by my distro -- either from somewhere else, or as customized by me. Is this difficult or dangerous? Where do I start?
37
votes
3answers
6k views

Why is there a Linux kernel policy to never break user space?

I started thinking about this issue in the context of etiquette on the Linux Kernel Mailing list. As the world's best known and arguably most successful and important free software project, the Linux ...
35
votes
1answer
5k views

What is a “subreaper” process?

The word "subreaper" is used in some answers. Searching Google also turn up entries where the word is "just used". How can I understand what a "subreaper" is?
31
votes
2answers
2k views

Why did powering down my machine after a bad `rm` save my files?

Classical situation: I ran a bad rm and realized immediately afterwards that I had removed the wrong files. (Nothing critical and I had tolerably recent backups, but still annoying.) Knowing that ...
30
votes
1answer
60k views

Setting CPU governor to on demand or conservative

I'm struggling with cpupower on ArchLinux. I want to set governor to ondemand or even to conservative. First if I do $ sudo cpupower frequency-info --governors, I only get performance powersave. So ...
27
votes
2answers
2k views

ip vs ifconfig commands pros and cons

At some point, in some teaching material (from Linux Foundation) on Linux that I came across, the following is mentioned: ip command is more versatile and more efficient than ifconfig because it ...
27
votes
2answers
10k views

When do I need to specify add_efi_memmap as kernel argument in UEFI/EFI boot?

I am reading some tutorials how to EFI stub (efistub) load the Linux kernel. These instructions often use kernel boot parameter add_efi_memmap. The intended hardware is Intel x64 having 8GB of RAM. My ...
26
votes
5answers
24k views

Are FIFO, pipe & Unix domain socket the same thing in Linux kernel?

I heard that FIFOs are named pipes. And they have exactly the same semantics. On the other hand, I think Unix domain socket is quite similar to pipe (although I've never made use of it). So I wonder ...
26
votes
1answer
978 views

What would be the best way to work around this glibc problem?

I administer a Gentoo Hardened box that uses file capabilities to eliminate most of the need for setuid-root binaries (e.g. /bin/ping has CAP_NET_RAW, etc). Infact, the only binary I have left is ...
25
votes
4answers
15k views

Does Android really use the same kernel as Linux?

I read from somewhere that Android uses the Linux Kernel. Is it really true? I thought the Linux Kernel was meant for desktop operating systems.
25
votes
2answers
3k views

Linux: is it possible to see only kernel space threads/process?

I know there are two "levels" of programs: User space and kernel space. My question is: I want to see only kernel programs,or better: programs on kernel space. Is this approach correct? ps -ef|grep ...
25
votes
1answer
7k views

In what sense does SATA “talk” SCSI? How much is shared between SCSI and ATA?

This is nothing new to me at least, that SATA actually "talks" SCSI, hence why these SATA devices show up as SCSI devices in Linux. A related question has been asked before, e.g. Why do my SATA ...
25
votes
1answer
18k views

What happens in each step of the Linux kernel-building process?

I've read many tutorials about how to build custom kernels and boot Ubuntu using those kernels, and successfully followed the guides and booted custom kernels, but I have no understanding about what ...
25
votes
1answer
4k views

High CPU usage with CFS?

I asked a previous question to try and isolate the source of an increase in CPU usage when moving an application from RHEL 5 to RHEL 6. The analysis that I did for that seems to indicate that it is ...
24
votes
4answers
2k views

Updating the Linux kernel, while leaving rest of system as is

I'm an OpenBSD user. In the OpenBSD FAQ it says: OpenBSD is a complete system, intended to be kept in sync. It is not a kernel plus utilities that can be upgraded separately from each other. When ...
24
votes
2answers
39k views

Why does Linux have poor battery life by default compared to Windows?

Is there something inherent to Linux operating systems that makes them poor managers of battery power by default? I would have thought a light distro like Lubuntu would have a clear battery life ...
24
votes
4answers
48k views

Can I create a virtual ethernet interface named eth0?

I am running Arch based on the Linux 3.10.5-1 kernel. The system uses the new de-facto naming conventions of ethernet interfaces enp*s* and wlp* etc. This is a problem however, as my educational ...
24
votes
1answer
33k views

using devtmpfs for /dev

I have noticed the following option in the kernel: CONFIG_DEVTMPFS Device Drivers -> Generic Driver Options -> Maintain devtmpfs to mount at /dev And I see that it is enabled by default in the ...
23
votes
2answers
25k views

How does the system shutdown of a linux kernel work internally?

I have somehow an rough idea of how the userspace and init-system (be it classic init sysV /upstart/ systemd) work at system shutdown. (Essentially there is an order succession of "Stop!", "Please ...
22
votes
3answers
3k views

Why does Debian Linux allow up to 128TiB virtual address space per process but just 64TiB physical memory?

I just read here: up to 128TiB virtual address space per process (instead of 2GiB) 64TiB physical memory support instead of 4GiB (or 64GiB with the PAE extension) Why is that? I mean, ...
21
votes
2answers
3k views

Is the PID of a child process always greater than the PID of its parent on Linux?

Let say, from kernel 2.6 onwards. I watch all the running processes on the system. Are the PID of the children always greater than their parents' PIDs? Is it possible to have special cases of "...
21
votes
3answers
57k views

What exactly are Linux kernel headers? [duplicate]

Possible Duplicate: What does a kernel source tree contain? Is this related to Linux kernel headers? I know that if I want to compile my own Linux kernel I need the Linux kernel headers, but what ...
21
votes
4answers
13k views

How to tell Linux Kernel > 3.0 to completely ignore a failing disk?

I have a Samsung laptop (Chronos s7) with one SATA hard disk on bus ata:1, which is detected as /dev/sda, an 8G SSD on ata:2, /dev/sdb, and various other devices on the rest of SATA interface. The ...
21
votes
2answers
4k views

What is the purpose of patches of the linux kernel?

For each Linux kernel version, there is a patch file available for download. For instance, linux-3.12.22 has a corresponding patch-3.12.22. What is the purpose of that patch? To always patch the ...
21
votes
4answers
9k views

Given a git commit hash, how to find out which kernel release contains it?

Assume I have some issue that was fixed by a recent patch to the official Linux git repository. I have a work around, but I’d like to undo it when a release happens that contains my the fix. I know ...
21
votes
1answer
601 views

How to get started writing drivers?

I have a throw-away cheap laptop I'd like to twiddle around, a Thinkpad SL 500. What bothers me are two leds, the one for wireless connectivity, and the one for hibernation, which don't light up at ...
20
votes
3answers
2k views

What happens if you delete a device file?

I roughly know about the files located under /dev. I know there are two types (character/block), accessing these files communicates with a driver in the kernel. I want to know what happens if I ...
20
votes
4answers
45k views

Where to download Linux Kernel source code of a specific version?

Is there a resource to download a specific kernel version source? For example, I want to get 2.6.36.2 sources to compare with this package and see what changes were introduced?
20
votes
5answers
21k views

enabling numa for Intel Core i7

In Linux kernel, the documentation for CONFIG_NUMA says: Enable NUMA (Non Uniform Memory Access) support. he kernel will try to allocate memory used by a CPU on the local memory controller of the ...