Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm interested in modifying the kernel internals, applying patches, handling device drivers and modules, for my own personal fun.

Is there a comprehensive resource for kernel hacking, intended for experienced programmers?

share|improve this question
add comment

7 Answers 7

up vote 10 down vote accepted

Linux Kernel Newbies is a great resource.

share|improve this answer
add comment

I suggest you read "Linux Kernel in a Nutshell", by Greg Kroah-Hartman and "Understanding the Linux Kernel", by Robert Love. Must reads :)

share|improve this answer
1  
kroah.com/lkn - Free Online –  Joshua Enfield Oct 3 '10 at 21:41
    
@Josh These books were written 5-6 years ago, are they still topical? –  Alex Bolotov Feb 27 '12 at 21:00
    
I can't answer that with any reasonable credibility :( Other responsibilities consumed my time, and I never got around to reading it. Hopefully wzzrd sees these comments and can comment. –  Joshua Enfield Feb 27 '12 at 21:40
    
Yes, the books are still relevant. Many, many details have changed beyond recognition. Look at the kernel newbies page mentioned above (or lwn.net's kernel page for in-depth discussion and breaking news). –  vonbrand Jan 15 '13 at 23:15
add comment

Linux Device Drivers is another good resource. It would give you another way to get into the inner workings. From the preface:

This is, on the surface, a book about writing device drivers for the Linux system. That is a worthy goal, of course; the flow of new hardware products is not likely to slow down anytime soon, and somebody is going to have to make all those new gadgets work with Linux. But this book is also about how the Linux kernel works and how to adapt its workings to your needs or interests. Linux is an open system; with this book, we hope, it is more open and accessible to a larger community of developers.

share|improve this answer
    
I always find goal oriented learning more productive than abstract learning for me. The LDD book gave me a chance to bite off a small enough chunk to make progress. –  Larry Smithmier Aug 23 '10 at 16:12
add comment

See The Linux Documentation Project. Particularly the "Linux Kernel module guide".

share|improve this answer
add comment

Linux Kernel 2.4 Internals is another online resource to look at. It appears to take a pretty 'ground up' approach, starting with booting. Here the the TOC:

  1. Booting
    • 1.1 Building the Linux Kernel Image
    • 1.2 Booting: Overview
    • 1.3 Booting: BIOS POST
    • 1.4 Booting: bootsector and setup
    • 1.5 Using LILO as a bootloader
    • 1.6 High level initialisation
    • 1.7 SMP Bootup on x86
    • 1.8 Freeing initialisation data and code
    • 1.9 Processing kernel command line
  2. Process and Interrupt Management
    • 2.1 Task Structure and Process Table
    • 2.2 Creation and termination of tasks and kernel threads
    • 2.3 Linux Scheduler
    • 2.4 Linux linked list implementation
    • 2.5 Wait Queues
    • 2.6 Kernel Timers
    • 2.7 Bottom Halves
    • 2.8 Task Queues
    • 2.9 Tasklets
    • 2.10 Softirqs
    • 2.11 How System Calls Are Implemented on i386 Architecture?
    • 2.12 Atomic Operations
    • 2.13 Spinlocks, Read-write Spinlocks and Big-Reader Spinlocks
    • 2.14 Semaphores and read/write Semaphores
    • 2.15 Kernel Support for Loading Modules
  3. Virtual Filesystem (VFS)
    • 3.1 Inode Caches and Interaction with Dcache
    • 3.2 Filesystem Registration/Unregistration
    • 3.3 File Descriptor Management
    • 3.4 File Structure Management
    • 3.5 Superblock and Mountpoint Management
    • 3.6 Example Virtual Filesystem: pipefs
    • 3.7 Example Disk Filesystem: BFS
    • 3.8 Execution Domains and Binary Formats
  4. Linux Page Cache
  5. IPC mechanisms
    • 5.1 Semaphores
    • 5.2 Message queues
    • 5.3 Shared Memory
    • 5.4 Linux IPC Primitives

And, to make it even sweeter, there is a new Linux Kernel Development Third Edition by Robert Love out and Slashdot has a review.

share|improve this answer
add comment

Start with Linux Kernel Primer by Claudia Salzberg et al. Good one to start with for beginners. Robert Love's book is definitely not the book that beginners should start with. Latter book is above intermediate level.

share|improve this answer
add comment

You may explore Linux Tutorial for beginner

This is having 4 sub chapter and good coverage for beginner to start with

share|improve this answer
2  
Welcome to Unix & Linux! Generally we like answers on the site to be able to stand on their own - Links are great, but if that link ever breaks the answer should have enough information to still be helpful. Please consider editing your answer to include more detail. See the FAQ for more info. –  slm Apr 29 '13 at 1:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.