kernel

kernel software trap handling

I'm reading a book on Windows Internals and there's something I don't understand: "The kernel handles software interrupts either as part of hardware interrupt handling or synchronously when a thread invokes kernel functions related to the software interrupt." So does this mean that software interrupts or exceptions will only be handled...

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 documentation. The same goes for the linux kernel. Thanks ...

difference between kernel objects and C# objects?

In C# or C++ we have objects, instances of classes that are live in memory. The kernel also has objects, like interrupt objects. I wondered if these kernel objects can be thought of as we C# or C++ programmers objects? ...

what kind of loop is for (;;)?

found in torvalds/linux-2.6.git -> kernel/mutex.c line 171 i have tried to find it on google and such to no avail. what does "for (;;)" instruct? ...

kernel timer objects and synchronization

I wondered if anyone can tell me simply (I know this is not a simple subject) how kernel timer objects are used to synchronize access to data structures in the kernel? EDIT: A kernel timer object is part of the kernel's dispatcher objects, which are the kernel's group of synchronization objects. I wanted to also know if the timer obje...

How do 2 or more threads get synchronized using a timer in the Windows kernel?

I have been reading about the kernel using timers for thread synchronization. I haven't been able to find a decent explanation on how thread sync with timers works, I wondered if anyone can help me? MSDN: Kernel Dispatcher objects DPCs and timer objects <-- here it talks about 'synchronization timers' Also reading book Windows Intern...

Loading Preferences in to a Mac Kernel Extension

Greetings! I am working on a kernel extension driver for OSX. It is a simple keyboard filter. I have preferences that are set through a preference pane regarding how this filter will act. I need to take the preferences from this preference pane and load them in to the kernel extension. I have googled all over and haven't found anything...

What is an OS kernel ? How does it differ from an operating system?

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? ...

Safety nets in complex multi-threaded code?

As a developer who has just finished writing thousands of lines of complex multi-threaded 'C' code in a project, and which is going to be enhanced, modified etc. by several other developers unfamiliar with this code in the future, I wanted to find out what kind of safety nets do you guys try to put in such code? As an example I could do ...

Can I set the Linux SIGUSR1 from within the kernel?

Hi All, I might be approaching this all wrong but... I have a linux kernel device driver that handles an external interrupt and currently performs a printk() when it occurs. What I would like to do is tell a user space app that this event has occurred so it can wake up and do some stuff. Is it possible (/simple /good practice) to s...

Who is refreshing hardware watchdog in Linux?

Processor AT91SAM9G20 kernel 2.6 Watchdog is enabled at bootstrap level and configured for 16 seconds. Watchdog mode register can be configured only once. When code hangs either in bootstrap or bootloader or kernel board is taking reboot. But once kernel comes up even though watchdog is not refreshed in any of the application board is no...

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? ...

Tool to Debug Guest OS in Virtual Box

I'm just cross posting the same question I did on virtualbox.org. http://forums.virtualbox.org/viewtopic.php?f=9&amp;t=26702&amp;p=119139#p119139 If not breaking any rule, I'd appreciate to kwon more about it since stackoverflow promisses to be more dynamic! "Hi, I did some search and could not find any tool to debug a guest system fro...

Network Packet Inspector in Mac OSX

I'm trying to create a network packet inspector. I know you can do this with libpcap, but it's not a sniffer, i need to forge network packet, before it was sent on network. (sending via socks server) I found 2 ways to do this : Using an NKE. (Network Kernel Extension) Using a DYLD_INSERT_LIBRARIES to insert a library to hook network...

Program stack and heap, how it works?

Hi, 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 questions. Is stack also part of some page in main memory? What happens when the program is...

counting clock ticks linux 2.4.14

hello I am trying to count the total number of clock ticks for each process (only when its actually running). I inserted the following code in schedule() (sched.h): ... switch_tasks: prefetch(next); clear_tsk_need_resched(prev); if (likely(prev != next)) { rq->nr_switches++; rq->curr = next; ...

why not just plain files instead of initramfs or initrd?

The linux kernel uses a kind of ram disk to access modules at an early boot stage. Out of curiosity I want to understand I have a question: The file containing the initramfs/initrd must be accessible for the kernel at this stage. This means the kernel must have support for the appropriate filesystem. So why couldn't the content of the in...

What causes Audio output to stutter?

There is a very common software bug that causes about 1 second of audio to be played a few times in succession, creating a kind of stutter. I notice this most often when playing video games. I know this is not architecture specific, I have seen it happen in consoles, in old PC's and it just happened 5 minutes ago when I booted wi...

A Thread Scheduler for an Real Time Embeded Operating System.

I have been given the task to fix an Embedded Operating System which is written in C/C++. The Current thread scheduler being used is very similar to Round Robin Scheduling, except it lacks one very important feature, the ability to interrupt threads and then return executing thus creating a dependable "slice" of execution time. My Qu...

libc.so has four segments mapped in a process, why?

To see what memory map regions a running program contains, I write a simple C program to read data from /proc/self/maps: #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <unistd.h> #include <fcntl.h> int main() { char buf[1024]; int fd; ssize_t n; fd = open("/proc/self/maps", O_RDONLY); if (fd ...