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
24
votes
6 answers

What does "do { ... } while (0)" do exactly in kernel code?

Possible Duplicates: What’s the use of do while(0) when we define a macro? Why are there sometimes meaningless do/while and if/else statements in C/C++ macros? C multi-line macro: do/while(0) vs scope block I have seen a lot of usages like this,…
grokus
  • 18,046
  • 9
  • 29
  • 35
24
votes
1 answer

What is EXPORT_SYMBOL_GPL in Linux kernel code?

What is EXPORT_SYMBOL_GPL in Linux kernel code? Below is a piece of code, which contains EXPORT_SYMBOL_GPL 62 struct resource *platform_get_resource(struct platform_device *dev, 63 unsigned int type, unsigned…
Sagar Jain
  • 7,475
  • 12
  • 47
  • 83
24
votes
2 answers

what is the meaning of this macro _IOR(MY_MACIG, 0, int)?

i was going through ioctl sample programs to check how it communicates with kernel space. in program WRITE_IOCTL is used as command #define WRITE_IOCTL _IOW(MY_MACIG, 1, int) ioctl(fd, WRITE_IOCTL, "hello world") I am not able to understand what…
Rafal
  • 1,120
  • 3
  • 15
  • 23
24
votes
1 answer

Simple kernel won't boot in GRUB

I'm learning a bit of OS development from OSDev.org. I have a kernel and I'm trying to boot in GRUB Legacy (0.97) using qemu. However, when I type kernel 200+9, I get the message [Multiboot-elf, <0x100000:0x80:0x4008>(bad), entry=0x10000c] This is…
gsgx
  • 12,020
  • 25
  • 98
  • 149
24
votes
3 answers

Which linux system call is used by ls command in linux to display the folder/file name?

I wanted to know which system call is used in linux by the ls command to display the folder's (or file's name)? Especially the files/folders starting with "." (dot) I executed the strace ls -a command to look at the system calls.There is a lot of…
footy
  • 5,803
  • 13
  • 48
  • 96
24
votes
4 answers

call a kernel module function from program at user space

I developed a kernel module and some functions on it. Now i need to develop a program in the user space and call some functions which are in the kernel module. I also need to access some global variable that are in the kernel module on my program at…
Ricardo
  • 612
  • 2
  • 9
  • 16
23
votes
2 answers

How to read ring buffer within linux kernel space?

I'm writing a Linux character driver which can print system logs in user space. Just as the command 'dmesg' does. I've learned that all the log that we print with 'printk' will be sent to a space named ring buffer. So I have the questions: Is ring…
Yingyi Xu
  • 387
  • 1
  • 3
  • 15
23
votes
6 answers

How convert a char[] string to int in the Linux kernel?

How convert char[] to int in linux kernel with validation that the text entered is actually an int? int procfile_write(struct file *file, const char *buffer, unsigned long count, void *data) { char procfs_buffer[PROCFS_MAX_SIZE]; /*…
caeycae
  • 1,137
  • 3
  • 12
  • 28
23
votes
3 answers

How to stop Linux kernel threads on rmmod?

I wrote the following code to create a kernel thread: #include #include #include #include #include struct task_struct *task; int data; int ret; int thread_function(void…
pradeepchhetri
  • 2,899
  • 6
  • 28
  • 50
23
votes
1 answer

What is a kernel in Jupyter Notebook and how it is different/similar to actual kernel (related to Operating System)?

I hear and see a lot of this word "kernel" as I'm using Jupyter Notebook a bit. I just want to know what "kernel" represents in Jupyter Notebook. Is it the same meaning that we use in Operating System? If it is similar/different, how exactly? Do…
maninekkalapudi
  • 958
  • 2
  • 10
  • 23
22
votes
4 answers

kernel stack for linux process

Is the kernel stack for all process shared or there is a seperate kernel stack for each process? If it is seperate for each process where is this stack pointer stored? In task_struct ?
suresh
  • 4,084
  • 10
  • 44
  • 59
22
votes
2 answers

DMA cache coherence management

My question is this: how can I determine when it is safe to disable cache snooping when I am correctly using [pci_]dma_sync_single_for_{cpu,device} in my device driver? I'm working on a device driver for a device which writes directly to RAM over…
Michael
  • 241
  • 1
  • 2
  • 4
22
votes
5 answers

Install RT Linux patch for Ubuntu

Trying to make my generic Ubuntu to real time Ubuntu by modifying the kernel by patching / installing RT Linux but couldn't find a straight setup. Can someone help with the steps?
Abhay Nayak
  • 1,069
  • 1
  • 11
  • 25
22
votes
3 answers

Docker loading kernel modules

I tried to install a kernel module, xfsprogs. It was successfully installed inside a container. It is really surprising, but lsmod doesn't list this module inside container or in the host system. How can a new kernel module loaded in a…
user4725754
22
votes
2 answers

Details of /proc/net/ip_conntrack and /proc/net/nf_conntrack

I'm looking for a detailed documentation about content of files /proc/net/nf_conntrack and/or /proc/net/ip_contrack on Linux systems. Yes, I know, there are many utilities which can show me the content of these files in human readable format, but...…
user2286002