linux-kernel

how does kernel handle new file creation

hi, I wish to understand the way kernel works when a user/app tries to create a file in a directorty. The background - We have a java applicaiton which consumes messages over JMS, processes it and then writes the XML to an outbound queue+a local directory. Yesterday we obeserved unsual delays in writing to the directory. On 'ls|wc -l' ...

Error while compiling the Linux kernel 2.6.35

I am trying to compile the Linux kernel on my Ubuntu machine But I am getting the following error. I've searched on Google but have not been able to find any error related to this. drivers/platform/x86/intel_scu_ipc.c: In function ‘pwr_reg_rdwr’: drivers/platform/x86/intel_scu_ipc.c:175: error: ‘MRST_CPU_CHIP_PENWELL’ undeclared (firs...

How are same virtual address for different processes mapped to different physical addresses

I have taken a course about Operating System design and concept and now I am trying to study Linux kernel thoroughly. I have a question that I cannot get rid of. In modern operating systems each process has own virtual address space(VAS) (eg, 0 to 2^32-1 in 32-bit systems). This provides many advantages. But in the implementation I am co...

Write request flow in Linux from user space to the device?

I'm confused as to what happens when I issue a write from user space in Linux. What is the full flow, down to the storage device? Supposing I use CFQ and a kernel that still uses pdflush. CFQ is said to place requests into sync and a-sync queues. Writes are a-sync, for example, so they go into an a-sync queue based on the io priority. T...

How close are Mac OS X and BSD related?

I read that Mac OS X and bsd are related. How close are they related. Can Mac OS X software be tweaked and installed on BSD? ...

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 allocated sequentially how does Linux fill in the gaps? What happens when it hits the end? For example if I run a PHP script from Apache that ...

non-blocking file openat()

I would like to implement a multi-threaded, non-blocking file open. Ideally, the desired solution would be to make a call to open() & have it return immediately, and do something like register a callback to be called (or handle a signal, or conditional variable) when the open() operation is actually complete. To that end, I wrote a lit...

What will happen if two kernel module export same symbol

If two kernel module contain EXPORT_SYMBOL(a), a is defined as: int a, what will happen if two module was inserted? which "a" will be used? ...

How to use mpc8xxx_gpio.c device driver

Hi, I am new to device driver development. I am trying to access the GPIO of MPC837xERDB eval board. I have upgraded its kernel to linux-2.6.28.9 and enable support for mpc8xxx_gpio.c. On boot up, it successfully detect two gpio controllers. Now my question is how I am going to use it to communicate with the gpio pins? Do I have to modi...

Learning from Linux log files

Hello, I was wondering about the utility of storing metadata (Abbreviation Expansion, Brief Message, links to online resources) associated with messages, in /var/log/syslog, /var/log/kern.log etc. For instance, for a message like ACPI: Processor [CPU1] (supports 8 throttling states) I would search online about CPU throttling, and sto...

Why spinlocks are used in interrupt handlers

Hi, I would like to know why spin locks are used instead of semaphores inside an interrupt handler. Thanks & Regards, Mousey ...

modinfo srcversion: How do I generate this from my source?

I have a compiled version of a linux module, and then I have about 20+ variations of its source. Through various foolish mistakes, I've lost track of which version of the source was the actual one I used to make the module. I noticed that modinfo <module name> gives srcversion: <hash>, and I found some explanation somewhere that says i...

Why the move from O(1) scheduler to CFS which is O(log N)?

I might be a little late on this but I was going through how various production schedulers work recently and I came across the O(1) scheduler which was replaced by the Completely Fair Scheduler, or CFS, both by Ingo Molnár. As the name suggests the O(1) scheduler takes constant time but CFS is O(log N). Then why was such a move made? Ob...

the concept about linux kernel

sir please help me to gain knowledge on linux kernel. ...

Where the Ubuntu’s source can be gotten?

Where can I get Ubuntu's source code? Actually I want It's kernel's code. I know I can get the kernel from kernel.org but as I found out that Ubuntu does some patching on the kernel I want to know what are those patches. And yes I know Ubuntu's kernel code can be found in an installed Ubuntu in the file system but thats just the code! I ...

How to copy struct file?

I'm porting old linux kernel code for newer version 2.6.32. There is a part that copies a file descriptor. The idea was to allocate a new file descriptor and a new struct file and use them with another f_op and , leaving all other fields of struct file equivalent to original's. How do I do this in a modern kernel? I've written an appro...

distro for linux kernel development

Which is the best light weight distro for learning linux kernel development. It should have lot of debugging and profiling tools available along with it :) ...

modprobe module error

hi I encounterd the problem when i try to modprobe the module. this module is modified. but the module is for the kernel 2.6.33.4, also the kernel is 2.6.33.4. When i tried to modprobe module, the error happned:"disagrees about version of symbol module_layout". i don't know how it happened and how to solve it. i'm very confused. ...

Increasing CONSISTENT_DMA_SIZE to 16MB crashes linux kernel

Hi, I am trying to increase the DMA size to 16MB from current 10MB in my arm linux kernel 2.6.29 running on android phone. But my kernel crashes with following error. Phone has total 256MB RAM. I modified following line in file arch/arm/mach-pxa/include/mach/memory.h #define CONSISTENT_DMA_SIZE 16 * 1024 * 1024 But kernel crashed wit...

Why spinlock in linux kernel is in the ".subsection 1" (or ".text.lock.smth")?

Hello In linux kernel in the implementation of spinlocks, e.g. http://lxr.linux.no/#linux+v2.6.18/include/asm-i386/semaphore.h#L97 97static inline void down(struct semaphore * sem) 98{ 99 might_sleep(); 100 __asm__ __volatile__( 101 "# atomic down operation\n\t" 102 LOCK_PREFIX "decl...