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. [linux-kernel], [windows-kernel], [xnu]). This tag is ...
279
votes
23answers
57k views
What are some resources for getting started in operating system development?
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 ...
83
votes
1answer
2k views
What is this style of syntax in C?
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 ...
65
votes
3answers
26k views
cscope or ctags why choose one over the other?
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 ...
54
votes
2answers
3k views
Android Kernel Debugging
I have been experimenting with getting kgdb to work the Nexus One.
I have pulled the kernel from android.git.kernel.org and enabled everything to do with KGDB including kgdbts testing using ...
42
votes
9answers
3k 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 ...
36
votes
5answers
28k views
What is the difference between vmalloc and kmalloc?
I've googled around and found most people advocating the use of kmalloc, as you're guaranteed to get contiguous physical blocks of memory. However, it also seems as though kmalloc can fail if a ...
34
votes
6answers
2k views
What are good and bad things in the design of the Linux kernel?
I am not a master of the kernel code, but have some basic idea of its code structure. In this post we can discuss what are the good and bad things in the design of the kernel.
Update: No, this is not ...
33
votes
6answers
5k views
Learning kernel hacking and embedded development at home?
I was always attracted to the world of kernel hacking and embedded systems.
Has anyone got good tutorials (+easily available hardware) on starting to mess with such stuff?
Something like kits for ...
30
votes
5answers
24k 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 ...
29
votes
1answer
874 views
What changes in a jailbroken kernel?
Having seen this question on protecting your app from being cracked, I saw that the top answerer mentioned something about being able to see if a device was jailbroken by some internal imbalance in ...
27
votes
7answers
27k 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?
26
votes
3answers
18k views
Linux Kernel: System call hooking example
I'm trying to write some simple test code as a demonstration of hooking the system call table.
"sys_call_table" is no longer exported in 2.6, so I'm just grabbing the address from the System.map ...
25
votes
11answers
16k views
What IDE would be good for linux kernel driver development
I am using ubuntu 8.04.1 and i am trying to write a character driver in kernel mode.
What would be a good ide, ideally with code completion, to do that ?
25
votes
3answers
3k 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 ...
24
votes
9answers
3k views
When should I write a Linux kernel module?
Some people want to move code from user space to kernel space in Linux for some reason. A lot of times the reason seems to be that the code should have particularly high priority or simply "kernel ...