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.

This tag is for general questions regarding code that runs in the context of an operating system kernel (kernelspace, as opposed to userspace), including writing custom kernels. Questions about specific kernels should use a relevant tag (eg. , , ).

This tag is not about other uses of the word "kernel" - for example, questions about CUDA kernels should use the tag.

SOURCE

Wikipedia

9344 questions
31
votes
5 answers

System Calls in Windows & Native API?

Recently I've been using lot of assembly language in *NIX operating systems. I was wondering about the Windows domain. Calling convention in Linux: mov $SYS_Call_NUM, %eax mov $param1 , %ebx mov $param2 , %ecx int $0x80 Thats it. That is how we…
claws
  • 52,236
  • 58
  • 146
  • 195
31
votes
6 answers

Where can I browse the sourcecode for libc online (like doxygen)

Sometimes I want to look up the implementations of functions in the stdlib, I've downloaded the sourcecode, but it's quite messy. Just greping is not really suitable because of the many hits. Does anyone know a webpage doxygen style that has the…
monkeyking
  • 6,670
  • 24
  • 61
  • 81
30
votes
1 answer

What is kernel section mismatch?

When compiling a kernel module, I got a WARNING with a note to add a compile option, CONFIG_DEBUG_SECTION_MISMATCH=y. It give me more detailed info about issue: WARNING: \**\*path to module\***(.text+0x8d2): Section mismatch in reference from the…
GoTTimw
  • 2,330
  • 6
  • 26
  • 34
30
votes
5 answers

Program stack and heap, how do they work?

I know that every running process has pages associated with it in virtual memory and few of them will be loaded into main memory as required. I also know that program will have a stack and also a heap to allocate dynamic memory. Here are my…
Boolean
  • 14,266
  • 30
  • 88
  • 129
30
votes
9 answers

Kernel development and C++

From what I know, even though the common OS have parts written in other languages, the kernel is entirely written in C. I want to know if it's feasible to write a Kernel in C++ and if not, what would be the drawbacks.
coredump
  • 3,017
  • 6
  • 35
  • 53
30
votes
5 answers

How do I know if my server has NUMA?

Hopping from Java Garbage Collection, I came across JVM settings for NUMA. Curiously I wanted to check if my CentOS server has NUMA capabilities or not. Is there a *ix command or utility that could grab this info?
pr4n
  • 2,918
  • 3
  • 30
  • 42
29
votes
3 answers

addr2line on kernel module

I'm trying to debug kernel module. I suspect to have there some memory leaks. To check it I have prepared build with enabled Memory leak debugging for kernel and modules. And I got some warning from that: [11839.429168] slab error in…
Adam
  • 2,254
  • 3
  • 24
  • 42
29
votes
4 answers

How to include C backtrace in a kernel module code?

So I am trying to find out what kernel processes are calling some functions in a block driver. I thought including backtrace() in the C library would make it easy. But I am having trouble to load the backtrace. I copied this example function to…
ndasusers
  • 1,131
  • 2
  • 10
  • 6
29
votes
3 answers

Forcing driver to device match

I have a piece of usb hardware, for which I know the driver. However, the vendor id and product id do not match the VID, PID pair registered in the driver. Is there a way in linux to force a driver to be associated with a known device, that do not…
shodanex
  • 14,975
  • 11
  • 57
  • 91
29
votes
4 answers

What is the difference between Shell, Kernel and API

I want to understand how this applies to an operating system and also to those things that are not infact operating systems. I can't understand the difference between the three and their essence. API is the functions we can call but what is Shell?…
quantum231
  • 2,420
  • 3
  • 31
  • 53
28
votes
3 answers

How to clean caches used by the Linux kernel

I want to force the Linux kernel to allocate more memory to applications after the cache starts taking up too much memory (as can be seen by the output of 'free'). I've run sudo sync; sudo sysctl -w vm.drop_caches=3; free (to free both disc…
Guss
  • 30,470
  • 17
  • 104
  • 128
28
votes
6 answers

Debugging an Operating System

I was going through some general stuff about operating systems and struck on a question. How will a developer debug when developing an operating system i.e. debug the OS itself? What tools are available to debug for the OS developer?
Light_handle
  • 3,947
  • 7
  • 29
  • 25
28
votes
3 answers

How to call exported kernel module functions from another module?

I'm writing an API as a kernel module that provides device drivers with various functions. I wrote three functions in mycode.c. I then built and loaded the module, then copied mycode.h into < kernel >/include/linux. In a device driver, I have a…
jacobsowles
  • 2,863
  • 6
  • 35
  • 54
27
votes
6 answers

enable linux kernel driver dev_dbg debug messages

is there a simplest possible way to enable linux kernel driver dev_dbg debug messages (actually it's a trace style messages) hopefully without messing up with the kernel patching/recompiling or the driver implementing something extra like debugfs?…
Oleg Kokorin
  • 2,288
  • 2
  • 16
  • 28
27
votes
2 answers

What are the first operations that the Linux Kernel executes on boot?

After the boot loader hands execution over to the kernel, what happens? I know assembler, so what are the first few instructions that a kernel must make? Or is there a C function that does this? What is the startup sequence before the kernel…
rook
  • 66,304
  • 38
  • 162
  • 239