Return to Training Programs

ADVANCED TRAINING & RESEARCH LABS

Course-Number: ATR-001

Course-Description: Linux Kernel Internals

Duration of course: 3 days


Course Description:

This 3-day course introduces key concepts and functions of the Linux Kernel. This is an absolutely necessary course for Systems Engineers, Architects and Programmers working in the areas of porting applications from any environment into Linux, device driver writers, and engineers working to extend the linux kernel in areas like Virtual File Systems, Advanced I/O and System Calls.

Starting from absolute basics such as an introduction to the Linux Kernel and its components, the course describes how to compile a new kernel and install it. It describes in detail the booting process, the root file system and system & device initialization.

The course then looks at the development environment under linux - The GNU compiler collection, the GNU 'C' compiler, the assembler, inter-mixing 'C' & assembly, creating static & dynamic libraries and the concept of SONAMEs, the GNU linker/loader, and tools like ldd, ldconfig, objdump, nm and strip.

The course then covers Process Management and the important data structures maintained by the kernel for the creation, management and deletion of processes. It looks at how System Calls are implemented and how to create a new System Call.

The course looks at Memory Management in great detail. It describes Real-Mode to Protected Mode transition and the Intel 32-bit Protected Mode Architecture. The course teaches the different memory addresses available such as Physical Memory, Virtual Memory, Bus-addresses, DMA etc.

The course then looks at a detailed description of File Systems. It looks into the Virtual File System Switch, Registering new file systems, mounting/unmounting, Superblocks and inodes. It also describes modern File System architectures such as Distributed File System and journaling file systems.

The course then covers writing Loadable Kernel Modules in detail since this is necessary to write Kernel Extensions. Starting from basic concepts like writing/compiling LKMs to passing arguments to LKMs and exporting/suppressing-the-export of symbols into the Kernel Symbol tree, it then goes on into advanced concepts like writing stackable modules, Inter-Module communication mechanisms and writing modules to support Kernel Versioning.

The course covers Kernel Programming Mechanisms like Kernel Timers, Wait-queues, Task-Queues, writing Interrupt Service Routines using Tasklets etc. It covers core concepts like managing deadlock resolutions using kernel semaphores, circular buffers and bit operations. It also looks at Symmetric Multi-processing architectures and the usage of spin-locks to handle access to critical regions. Finally the course covers Device Management & Interfacing and an overview of Peripheral Bus Interfaces. The last part of the course gives an overview of the various kernel debugging tools available and their scope & limitations.

Target Audience:

The course is ideal for Systems Software programmers and device driver writers wanting to know more about how the Linux Kernel functions. The course will also be appreciated by Application Programmers and Systems Administrators having a good knowledge of ‘C’ programming, who wish to know more about how things work "under the hood".

Pre-requisites:

The course expects a reasonably good knowledge of ‘C’ programming. Knowledge of basic Unix/Linux commands to navigate, write source-code, search for files, compile, execute etc. is expected.


Day

Topic

Duration

Contents

1

Introduction to the Linux Kernel

1.5 hrs

Kernel structure, components, modules, organization/architecture


Development tools under linux

1.5 hrs

The 'C' compiler, assembler, linker, static and dynamic libraries, objdump, ldd, ldconfig, nm and strip.


Compiling a new kernel & the booting process

1.5 hrs

Sources, headers, compiling, boot and root directories, /boot and the 8.4 GB limit for disk partitions, Linux Loaders, Chain boot-loaders.


Kernel Loadable Modules

1.5 hrs

Writing LKMs, passing arguments, exporting symbols, suppressing the export of symbols, module cascading, Inter-module communication, versioning support.





2

Linux Process Management

1.5 hrs

Scheduler, the task structure, process-states, ELF & COFF, mode-switching, fork, exec and clone system calls, copy-on-write mechanism, threads vs processes


Memory Management

1.5 hrs

The 32-bit Protected Mode Architecture, Hardware support for common memory management functions, demand paging, virtual memory, swapping, daemons. Page allocation tables, user memory versus kernel memory, kmalloc and kfree, atomic calls, DMA, Bus-memory, High-memory, memory mapped I/O and Interface functions.


File System

1.5 hrs

Hierarchy, registering a new file system, mounting/unmounting, superblock, root block, inodes, directory handling, data indirection, journaling filesystems.


Interrupts and Interrupt Service Routines

1.5 hrs

Interrupt strategies, writing fast interrupt handlers, shared interrupts, tasklets, methods of avoiding deadlocks – circular buffers, bitops.





3

Kernel Programming Mechanisms

1.5 hrs

Kernel timers, task queues, predefined and custom task queues, tasklets, kernel semaphores, wait queues, kernel support for linked lists & wait queues.


Device Management

1.5 hrs

How devices interact with the kernel, I/O and memory-mapped devices, character, block and network devices, Introduction to Peripheral Buses – ISA, PCI, SCSI, USB, PCMCIA & Firewire.


Kernel Debugging

1.5 hrs

printk, proc-fs, sysrq, ioctl, kdb, kgdb, lkcd, dprobes.


Miscellaneous

1.5 hrs

Open house session + Varous other topics not covered in the above.

(C) 2005 -  www.atr-labs.com   All Rights Reserved.

Return to Training Programs