Questions tagged [kernel]
In computing, the kernel is a computer program that manages input/output requests from software, and translates them into data processing instructions for the central processing unit and other electronic components of a computer. The kernel is a fundamental part of a modern computer's operating system. This tag is for general questions regarding code that runs in the context of an operating system kernel.
kernel
9,401
questions
610
votes
28
answers
126k
views
What are some resources for getting started in operating system development? [closed]
One thing I've always wanted to do is develop my very own operating system (not necessarily fancy like Linux or Windows, but better than a simple boot loader which I've already done).
I'm having a ...
221
votes
10
answers
239k
views
What is the difference between Trap and Interrupt?
What is the difference between Trap and Interrupt?
If the terminology is different for different systems, then what do they mean on x86?
189
votes
12
answers
269k
views
How do I convert dmesg timestamp to custom date format?
I am trying to understand the dmesg timestamp and find it hard to convert that to change it to a Java date or custom date format.
Sample dmesg log entry:
[14614.647880] airo(eth1): link lost (missed ...
166
votes
16
answers
143k
views
What is the difference between the kernel space and the user space?
What is the difference between the kernel space and the user space? Do kernel space, kernel threads, kernel processes and kernel stack mean the same thing? Also, why do we need this differentiation?
156
votes
11
answers
208k
views
What is an OS kernel ? How does it differ from an operating system? [closed]
I am not able to understand the difference between a kernel and an operating system. I do not see any difference between them. Is the kernel an operating system?
148
votes
4
answers
79k
views
cscope or ctags why choose one over the other? [closed]
I primarily use vim / gvim as an editor and am looking at using a combination of lxr (the Linux Cross Reference) and either cscope or ctags for exploring the kernel source. However, I haven't ever ...
142
votes
6
answers
228k
views
What is difference between monolithic and micro kernel?
Could anyone please explain with examples difference between monolithic and micro kernel? Also other classifications of the kernel?
140
votes
3
answers
72k
views
kernel stack and user space stack
What's the difference between kernel stack and user stack? Why kernel stack is used? If a local variable is declared in an ISR, where it will be stored? Does each process has its own kernel stack? ...
133
votes
3
answers
118k
views
What is the difference between the operating system and the kernel? [closed]
I do not understand the difference between operating system and kernel. Can someone please explain it?
114
votes
6
answers
114k
views
What is __gxx_personality_v0 for?
This is a second-hand question from an OS development site, but it made me curious since I couldn't find a decent explanation anywhere.
When compiling and linking a free-standing C++ program using ...
109
votes
2
answers
49k
views
What are vdso and vsyscall?
I did sudo cat /proc/1/maps -vv
I am attempting to make sense of the output.I can see a lot of shared libraries being mapped to the memory mapping segment as expected.
7f3c00137000-7f3c00179000 r-xp ...
102
votes
4
answers
68k
views
The difference between initrd and initramfs
As far as I know, initrd acts as a block device, thus requiring a filesystem driver (such as ext2). The kernel must have at least one built-in module for detecting filesystem of initrd. In this ...
102
votes
3
answers
49k
views
Context switches much slower in new linux kernels
We are looking to upgrade the OS on our servers from Ubuntu 10.04 LTS to Ubuntu 12.04 LTS. Unfortunately, it seems that the latency to run a thread that has become runnable has significantly increased ...
102
votes
1
answer
3k
views
What does [ N ... M ] mean in C aggregate initializers?
From sys.c line 123:
void *sys_call_table[__NR_syscalls] =
{
[0 ... __NR_syscalls-1] = sys_ni_syscall,
#include <asm/unistd.h>
};
sys_call_table is a generic pointer to arrays, I can see ...
95
votes
8
answers
144k
views
Linux Process States
In Linux, what happens to the state of a process when it needs to read blocks from a disk? Is it blocked? If so, how is another process chosen to execute?
91
votes
4
answers
193k
views
Interpreting segfault messages
What is the correct interpretation of the following segfault messages?
segfault at 10 ip 00007f9bebcca90d sp 00007fffb62705f0 error 4 in libQtWebKit.so.4.5.2[7f9beb83a000+f6f000]
segfault at 10 ip ...
84
votes
3
answers
40k
views
Context switch internals
I want to learn and fill gaps in my knowledge with the help of this question.
So, a user is running a thread (kernel-level) and it now calls yield (a system call I presume).
The scheduler must now ...
82
votes
7
answers
67k
views
Is there a way to figure out what is using a Linux kernel module?
If I load a kernel module and list the loaded modules with lsmod, I can get the "use count" of the module (number of other modules with a reference to the module). Is there a way to figure out what is ...
80
votes
3
answers
25k
views
What are the implications of the linux __user macro?
I was hoping someone could explain the nuances of the __user macro used in the linux kernel source.
First of all, the macro:
# define __user __attribute__((noderef, address_space(1)))
Now, ...
72
votes
6
answers
83k
views
How closely are Mac OS X and BSD related?
I read that Mac OS X and bsd are related. How closely are they related. Can Mac OS X software be tweaked and installed on BSD?
71
votes
2
answers
19k
views
What does a dot before the variable name in struct mean?
looking at the linux kernel source, I found this:
static struct tty_operations serial_ops = {
.open = tiny_open,
.close = tiny_close,
.write = tiny_write,
.write_room = tiny_write_room,
....
67
votes
5
answers
50k
views
What is preemption / What is a preemtible kernel? What is it good for?
Explained in your own words, what is preemption and what does it mean to a (linux) kernel?
What are advantages and disadvantages in having a preemptible kernel?
67
votes
4
answers
21k
views
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 ...
62
votes
8
answers
59k
views
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
Getting this error while compiling the kernel version :5.7-rc4
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make: ***...
62
votes
6
answers
34k
views
Is Pthread library actually a user thread solution?
The title might not be clear enough because I don't know how to define my questions actually.
I understand Pthread is a thread library meeting POSIX standard (about POSIX, see wikipedia: http://en....
61
votes
11
answers
49k
views
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 ...
61
votes
3
answers
12k
views
Android Kernel Debugging
I have been experimenting with getting kgdb to work the Nexus One.
I have pulled the kernel from https://android.googlesource.com and enabled everything to do with kgdb including kgdbts testing using ...
60
votes
6
answers
90k
views
Cannot boot Windows guest in VirtualBox without kernel module error
I'm running Vagrant (1.8.1) + VirtualBox (5.0.12) on Windows 7 and trying to boot up a Windows 7 image (modernIE/w7-ie8). However, I get this error:
---------------------------
VirtualBox - Error In ...
60
votes
3
answers
48k
views
what is the use of SPL (secondary program loader)
I am confused in clearing my concepts regarding these three questions
why do we need a secondary program loader ?
in which memory it gets loaded and relocated ?
what is the difference between ...
57
votes
7
answers
24k
views
Learning Kernel Programming [closed]
I want to learn lLinux Kernel programming.
What would be the starting points for that? What could be some of the simpler problems to target?
56
votes
4
answers
141k
views
How do I configure modprobe to find my module?
I'm trying to get a kernel module to load at boot.
If I run insmod /path/to/module.ko, it works fine. But this has to be repeated every time I reboot.
If I run modprobe /path/to/module.ko, it can't ...
54
votes
4
answers
24k
views
How does Linux determine the next PID?
How does Linux determine the next PID it will use for a process? The purpose of this question is to better understand the Linux kernel. Don't be afraid to post kernel source code. If PIDs are ...
52
votes
5
answers
15k
views
How does the linux kernel manage less than 1GB physical memory?
I'm learning the linux kernel internals and while reading "Understanding Linux Kernel", quite a few memory related questions struck me. One of them is, how the Linux kernel handles the memory mapping ...
50
votes
6
answers
23k
views
Getting iOS system uptime, that doesn't pause when asleep
I'm looking for a way to get an absolute, always-incrementing system uptime on iOS.
It should return the time since the device was last rebooted, and not be affected by changes to the system date.
...
50
votes
1
answer
25k
views
What's in include/uapi of kernel source project
Can someone please give me a document to describe the kernel source folders about their structure, functionality and how they are organized?
Specifically, what's the use of of the folder include/uapi/...
50
votes
1
answer
17k
views
How does Docker for Windows run Linux containers?
In the old versions of Docker for Windows, I remember it explicitly said it used a linux VM for the kernel.
But since the new stable version (released in July 2016 I think), it says
Docker for ...
50
votes
1
answer
59k
views
What is kthreadd process and children and how it is different from init and children
I wanted to know what is kthread and why it does not take any memory and has no open files. I wrote some code which will simply print the PID of the currently running processes in a parent child tree ...
49
votes
5
answers
39k
views
Relationship between a kernel and a user thread
Is there a relationship between a kernel and a user thread?
Some operating system textbooks said that "maps one (many) user thread to one (many) kernel thread". What does map means here?
48
votes
9
answers
6k
views
What kind of C is an operating system written in?
It makes sense that something like an operating system would be written in C. But how much of it, and what kind of C? I mean, in C, if you needed some heap memory, you would call malloc. But, does an ...
47
votes
9
answers
56k
views
How can I programmatically manage iptables rules on the fly?
I need to query existing rules, as well as being able to easily add and delete rules. I haven't found any API's for doing this. Is there something that I'm missing?
The closest I've come to a ...
47
votes
1
answer
43k
views
What does "proto kernel" means in Unix Routing Table?
I've been searching this in linux-ip.net and the whole internet but does appears nothing.
What does the "proto kernel" part means in a Routing Table?
Just an example:
[root@tristan]# ip route show ...
46
votes
8
answers
68k
views
Install Python 3.8 kernel in Google Colaboratory
I try to install a new Python version (3.8) using conda.
!wget -O mini.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.2-Linux-x86_64.sh
!chmod +x mini.sh
!bash ./mini.sh -b -f -p /usr/...
46
votes
4
answers
20k
views
How do I programmatically disable hardware prefetching?
I would like to programmatically disable hardware prefetching.
From Optimizing Application Performance on Intel® Core™ Microarchitecture Using Hardware-Implemented Prefetchers and
How to Choose ...
45
votes
7
answers
92k
views
Reset ipython kernel
I was wondering if there is a way to restart the ipython kernel without closing it, like the kernel restart function that exists in the notebook. I tried %reset but that doesn't seem to clear the ...
41
votes
3
answers
45k
views
Mac OS X virtual audio driver
I want to create a virtual audio device that gets audio data from the default output (which is an output IOAudioStream) and converts it to an input IOAudioStream.
I went through most of the examples ...
39
votes
4
answers
183k
views
How can I display the version of my Jupyter notebook and run cells in Jupyter notebooks? I get an error: bad interpreter
I have installed Anaconda and I use the conda environments and the conda command to install software.
When I type:
jupyter notebook --version
I get the following error:
zsh: /Users/cr517/.local/bin/...
39
votes
12
answers
9k
views
What parts of Linux kernel can I read for fun? [closed]
Programming isn't my main job, though I enjoy it and sometimes get paid for it. For many years now I've been hearing about Linux and my friends have shown to me many *nixes (or *nici?), though I stick ...
39
votes
3
answers
150k
views
why is u8 u16 u32 u64 used instead of unsigned int in kernel programming
I see u8 u16 u32 u64 data types being used in kernel code. And I am wondering why is there need to use u8 or u16 or u32 or u64 and not unsigned int?
39
votes
1
answer
17k
views
How / Where to find Linux Kernel Bugs to Fix?
I'm trying to find bugs that needs to be fixed in the Linux Kernel but I don't know where to look. I watched the video "How to Submit Your First Linux Kernel Patch" by Greg Kroah-Hartman on Youtube, ...
38
votes
2
answers
17k
views
Does linux schedule a process or a thread?
After reading this SO question I got a few doubts. Please help in understanding.
Scheduling involves deciding when to run a process and for what quantum of time.
Does linux kernel schedule a thread ...