LinuxSecurity.com
Share your story
The central voice for Linux and Open Source security news
Home News Topics Advisories HOWTOs Features Newsletters About Register

Welcome!
Sign up!
EnGarde Community
Login
Polls
What is the most important Linux security technology?
 
Advisories
Community
Linux Events
Linux User Groups
Link to Us
Security Center
Book Reviews
Security Dictionary
Security Tips
SELinux
White Papers
Featured Blogs
All About Linux
DanWalsh LiveJournal
Securitydistro
Latest Newsletters
Linux Advisory Watch: July 25th, 2014
Linux Advisory Watch: July 18th, 2014
Subscribe
LinuxSecurity Newsletters
E-mail:
Choose Lists:
About our Newsletters
RSS Feeds
Get the LinuxSecurity news you want faster with RSS
Powered By

  
Book Review: Linux Kernel Programming Print E-mail
User Rating:      How can I rate this item?
Source: Dave Wreski - Posted by Dave Wreski   
Book Reviews As Linux is implemented on increasingly wider number of devices, the number of people responsible for developing and maintaining Linux on those platforms have increased. As the level of maturity of the kernel increases, so does the complexity, capabilities, and size. This book provides the Linux programmer the tools necessary to understand the core aspects of the kernel and how to interface with it.

Title: Review: Linux Kernel Development, Third Edition
Author: Robert Love
ISBN: ISBN-13: 978-0-672-32946-3
Reviewer: Dave Wreski <dwreski@guardiandigital.com>
Review Score: 5 of 5 Penguins
Publisher: Prentice Hall Professional
Verified By: Doug Ledford
Sample Chapter: Chapter Two: Getting Started with the Linux Kernel

Written by seasoned kernel programmer and one of the architects of the Linux implementation for Google Android, Robert Love details every aspect of the current version of the Linux kernel, and helps the reader not only understand how it works, but also provides the programmer with the foundation to modify and adapt it as necessary.

The kernel is the key piece of software of an operating system that controls every other piece of software. It directly interfaces with the hardware device on which it is running to manage memory, accept input from the keyboard, access the video display or hard disk, keep accurate time, and so on. The ability to interface with these functions to support a new hardware device, such as a new ethernet controller, requires an understanding of how the kernel works.

This book is incredibly easy to read for such an immensely complex topic. Certainly a firm understanding of the C programming language and a solid understanding of how an operating system works is also really necessary. If you meet those qualifications though, this book is clearly the definitive source for those interested in hacking on the kernel.

The first few chapters talk about how to access the kernel source, some history behind the initial design and its Unix heritage, as well as how kernel versions are numbered.

It then quickly gets serious with a great overview of process management. By page 33 the author is already talking about page table entries, the fork()/exec() procedure for creating new processes, and how Linux has never had a concept of threads. Instead, all threads are processes that share resources with other processes.

Process scheduling, multitasking, and kernel preemption are covered in chapter four. Determining the most efficient means to provide access for a process to a particular resource, particularly when there are scalability and other factors involved, is always a challenge. This chapter provides a great explanation of how it all works together.

With still very little actual kernel code included thus far, chapter five outlines system calls, how they are implemented and relate to library calls.

Chapter six outlines the kernel data structures, including link lists and how to traverse them, queues and associative arrays, binary trees, and how each should be used.

Hardware devices, such as keyboards or network controllers, communicate with the operating system through the use of interrupts. These hardware devices can send an electrical signal to the processor when it needs to be serviced (the keyboard has received user input, for example). An example using the real-time clock is used to describe how to build an interrupt handler to manage these events.

What happens when two programs are accessing and modifying the same resource at the same time? Race conditions are explored in chapter nine. Synchronization of processes requires that the developer understand and causes of concurrency such as multiple processors, kernel preemption, and interrupts need to be understood and managed by the kernel developer, and know how to deal with these issues. Chapter nine and ten detail how this process is done.

Chapter eleven outlines how the kernel manages timing events. Have you ever heard of BogoMIPS? During the boot process on your Linux PC, you may have seen a message like:

Detected 2000.482 MHz processor.

Calibrating delay loop (skipped), value calculated using timer frequency.. 4000.96 BogoMIPS (lpj=2000482)

This is really the number of busy loop iterations the processor can perform in a given period. Effectively, BogoMIPS is a representation of how fast a processor can do nothing!

Timing is critical in many areas of the kernel, including device drivers as the author describes.

For those of you who are really courageous, there's a discussion of memory management in chapter twelve. Despite being only thirty pages long, this chapter details how to manage kernel memory and why managing it is more difficult than working with memory from user-space. There's a later chapter devoted exclusively to managing memory in process address space.

Managing the filesystem is another major area of responsibility for the kernel. With more than 60 different filesystems in the default kernel, a sophisticated abstraction layer that makes it possible to support so many filesystems with a consistent interface is required and clearly explained in later chapters.

Every device on a Linux system is represented as a file, and it is uniquely identified in the filesystem. Chapter thirteen outlines the data structures that are used to store filesystem information and the functions that are used to access that information. A clear description of the functions are briefly detailed. There's also a structure that keeps track of the individual capabilities and behavior of each filesystem and running processes.

One of the features that differentiates Linux from other Unix systems is the concept of dynamically loadable modules. These modules provide "pluggable" capability to support new devices as necessary. Typically these are in the form of a network or USB controller, or even a new filesystem or encryption mechanism. Chapter Seventeen details the process of interfacing with this device model, and provides the programmer with the knowledge of how to interface his new driver with the kernel.

The remaining few chapters detail information on debugging kernel problems, an outline of issues a programmer should know about, portability concerns and how they're managed, as well as how to communicate with the kernel community, such as through the Linux kernel mailing list.

This book is an incredible introduction for those beginning with kernel programming. It's suprisingly easy to read, focused, and provides critical organization to the millions of lines of code that comprise the kernel. For the experienced kernel programmer, this guide provides a great reference for how the various systems within the kernel operate, making it easier to understand the proper ways to write kernel code.

Only registered users can write comments.
Please login or register.

Powered by AkoComment!

 
Next >
    
Partner

 

Latest Features
Peter Smith Releases Linux Network Security Online
Securing a Linux Web Server
Password guessing with Medusa 2.0
Password guessing as an attack vector
Squid and Digest Authentication
Squid and Basic Authentication
Demystifying the Chinese Hacking Industry: Earning 6 Million a Night
Free Online security course (LearnSIA) - A Call for Help
What You Need to Know About Linux Rootkits
Review: A Practical Guide to Fedora and Red Hat Enterprise Linux - Fifth Edition
Weekend Edition
Four fake Google haxbots hit YOUR WEBSITE every day
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
The Barnaby Jack Few Knew: Celebrated Hacker Saw Spotlight as 'Necessary Evil'
What I Learned from Edward Snowden at the Hacker Conference
Partner Sponsor

Community | HOWTOs | Blogs | Features | Book Reviews | Networking
 Security Projects |  Latest News |  Newsletters |  SELinux |  Privacy |  Home
 Hardening |   About Us |   Advertise |   Legal Notice |   RSS |   Guardian Digital
(c)Copyright 2014 Guardian Digital, Inc. All rights reserved.