linux-kernel

Apache worker MPM and Linux threads

Apache's worker MPM creates multiple threads per process, where each thread handles a request. As of 2.6, the Linux kernel uses Native POSIX Threading Library, which has a 1:1 threading model. Given this, I would expect to see 100 apache processes if there are 100 simultaneous requests being serviced (one request -> one thread -> one pr...

How to Diff Files Directly from the Linux Kernel GIT Repository?

I'd like to be able to diff files / directories directly from the Linux Kernel GIT repository without having to download full source. Specifically, I'm interested in two potential solutions: The ability to do diff's via a web browser ( firefox ) A GUI utility for Ubuntu that can do remote diffs. A tutorial how to setup option #2 Edi...

Linux Kernel Modules: When to use try_module_get / module_put

I was reading the LKMPG ( See Section 4.1.4. Unregistering A Device ) and it wasn't clear to me when to use the try_module_get / module_put functions. Some of the LKMPG examples use them, some don't. To add to the confusion, try_module_get appears 282 times in 193 files in the 2.6.24 source, yet in Linux Device Drivers ( LDD3 ) and Ess...

In a linux kernel module, how can I get inode of a known path

In a linux kernel module (i.e. working in kernel space), I have a path of a file. Which function(s) can be used to get the inode of that file. Specifically I need to get the "inode *" pointing to the file's inode. ...

CPU Numbering on a hypertheading enabled system

Hi, I am trying to find out how an OS (Windows, linux) assigns numbers to logical cpus in a Hyper threading enabled environment. ? Does both the OSs first serially assign numbers to the Physical CPUs and then start numbering the logical cpus or is there some other rule followed.. ? e.g. in 2 physical cpu system with hyper threading , d...

Current Linux Kernel debugging techniques

A linux machine freezes few hours after booting and running software (including custom drivers). I'm looking a method to debug such problem. Recently, there has been significant progress in Linux Kernel debugging techniques, hasn't it? I kindly ask to share some experience on the topic. ...

accessing internal memory of the ARM from a user process on GNU/Linux

Due to some requirements on speed, we need to some computation in-place on internal memory and then DMA the results of the computation to a external memory. The application runs on a TI DM355 processor which is based on ARM926EJ-S core and a set of TI periferals (EDMA, video accelerators etc). How cleanly can this be done from the appli...

About compiling Linux kernel in Debian Live

Hi all, This is my first time compiling Linux kernel. I am using Debian Live. I used kernel-package to compile and I also added a new system call to return an arbitrary integer value greater than zero. Everything went fine and I got both headers and image .deb files. When I tried to install them with dpkg, there was a warning that sai...

How does linux-kernel read proc/pid file?

How and Where does linux-kernel read proc/pid file which shows all processes in the system. I found linux-source-2.6.31/fs/proc/ Here there are files, but it is hard to understand because it is really complicated. Can someone knows, how it works? ...

How can the physical RAM size be determined in Linux programatically ?

On the command line this can be found out using the 'free' utility and 'cat /proc/meminfo'. What would be the different ways to find out the physical RAM size in Linux programatically from a : Userspace Application Kernel Module What API calls are available ? ...

Where can I find the first version of linux operating system?

Can someone tell me where I can find the initial code, Linus Torvalds shared with hackers. I was thinking it will be a great place to learn about operating systems. Thanks. ...

Kernel page request-related OOPS

Hello all; I'm working on modifying a Linux 2.6.22-5 kernel driver in order to add threading, and I'm running into a problem I can't seem to figure out. I have set up the module so that there is a single function which is called, which invokes one or more worker threads to do the actual work. The worker threads contain only existing f...

Git global tags--- evidently bad, but why?

In his 2005 email to the Linux Kernel mailing list, Linus Torvalds is very emphatic that tags in git should be private and not be automatically included when fetching from others: Pulling a regular head cannot and must not update tags. Tags are not associated with the tree, and they cannot and must not be so, exactly because that...

Checking Linux Kernel Debugging option

How can I know if the standard kernel provided in my linux flavour has got DEBUG KERNEL ENABLED flags selected or not ?? I think DEBUG option should be enabled inorder to use tools like kprobe, systemtap ?? ...

Why linux is called monolithic kernel

I read that Linux is a monolithic kernel. Does monolithic kernel means compiling the linking the complete kernel code into an executable? If Linux is able to support modules, why not break all the subsystems into modules and load them when necessary. In that case, kernel doesn't have to load all modules initially and maintain index of th...

Linux device node accessible to only certain process groups.

Hello, I have a device driver module which does a register_chardev(). In the driver open() function I wish to be able to determine the pid or pgid of the process which is attempting to open the device node. Is this possible? Does anyone have any ideas of where to begin? I am assuming this should somewhat secure my device node to only a...

Sending UDP packet in Linux Kernel

Hi Guys, For a project, I'm trying to send UDP packets from Linux kernel-space. I'm currently 'hard-coding' my code into the kernel (which I appreciate isn't the best/neatest way) but I'm trying to get a simple test to work (sending "TEST"). It should be mentioned I'm a newbie to kernel hacking - I'm not that clued up on many principles...

How do I get the inode number of the current process's executable inside kernel module?

In Linux v0.11 task_struct had an executable member of type m_inode *. I am looking for something similar. Does the exec/execve system call store this information anywhere or is it lost upon loading into memory? ...

What is the proper way of including linux kernel config?

I'm porting an old version of a software that is partly a linux kernel module to EL5, after doing the relevant hacks, the horrible GNU autotools mess that is used to compile the thing (no, it does not compile the kernel module via kbuild :( ) I keep getting lots of warnings 'Including config.h is deprecated' - I am told by google search...

How to know when users login linux machine?

Hi, I am pretty much new to linux programming. I want to create a log file with some info when a user just logs in. so where can I find an event or something when a user logs in? is there any structure that has some flag when user logs in? Thanks ...