EEC Logo

Linux Operating System Internals (RHEL6)

Duration: 5 days

Audience

This course delves deep into the implementation details of the Linux kernel.

This course is targeted at system administrators and performance specialists who want a better understanding of kernel operation, system and application programmers who need background knowledge on Linux kernel design, and individuals who intend to write device drivers or kernel modules.

This course is available for the Red Hat distribution, but differences between Red Hat and other distributions are covered as they occur (such as for SUSE or Debian/Ubuntu Linux).

Course Contents

  1. Overview of the Linux Kernel

  2. Linux Kernel Flow (interrupts, synchronization, preemption)

  3. Process Management

  4. The Linux System Call Subsystem

  5. Virtual Memory Management

  6. Disk-based Filesystems

  7. Kernel File System Structures

  8. Linux Signals

  9. Linux Socket Layer

  10. Device I/O

  11. Process Scheduling (optional)

Course Objectives

Upon completion of this course, the student will be able to describe the various functions of the Linux kernel and discuss in detail the concepts which govern its operation. In addition, the hands-on exercises will reinforce the issues involved in kernel code development.

Instructional Technique

Students are invited to bring their current ideas and questions to the classroom for discussion. Case studies, lecture, group problem solving, and online laboratories will be used. Students will be encouraged to enhance their skills utilizing the techniques presented through classroom problem solving and controlled online workshops.

Prerequisites

The only prerequisite is that students should be familiar with the Unix/Linux command line interface. The students will be expected to execute commands, edit files, and navigate around system directories. Many of the labs require shell command lines.

Preferred Student Background

Students with the following experience will find the more detailed descriptions helpful, but these are not prerequisites since the course covers any required knowledge needed to understand the topics.

Detailed Course Outline

  1. Welcome to the Linux Kernel

    1. THE LINUX OPERATING SYSTEM

    2. IS LINUX UNIX?

    3. THE ORIGINS OF LINUX

    4. LINUX TODAY

    5. LINUX PLATFORMS

    6. LINUX ISSUES

    7. USEFUL LINUX WEB SITES

    8. OPERATING SYSTEMS

    9. THE UNIX OPERATING SYSTEM

    10. THE LINUX OPERATING SYSTEM

    11. ARRAYS AND LINKED LISTS

    12. LINUX SUBSYSTEMS

    13. KERNEL EXTENSIONS

    14. STUDYING THE KERNEL

    15. LINUX KERNEL VERSION NUMBERS

    16. THE LINUX KERNEL SOURCE CODE

    17. LINUX HEADER FILES

    18. LINUX CODE STYLE

    19. "THIS IS YOUR KERNEL SPEAKING" -- THE printk() FUNCTION

    20. PROGRAMS AND PROCESSES

    21. MULTITASKING

    22. SINGLE THREADED PROCESSES

    23. MULTITHREADED PROCESSES

    24. THREAD CONCEPTS

    25. HOW LINUX REALIZES THREADS

    26. COFF AND ELF

    27. THE PROCESS IMAGE

    28. CONTROLLING RESOURCE CONCUMPTION

  2. Linux Kernel Flow

    1. LINUX NOTIFIERS

    2. AN INTRODUCTION TO HARDWARE INTERRUPTS

    3. REGISTERING AN INTERRUPT HANDLER

    4. HARDWARE INTERRUPT EVENT FLOW

    5. UNDERSTANDING PROCESSOR ENVIRONMENTS

    6. KERNEL SYNCHRONIZATION

    7. KERNEL PREEMPTION

  3. Linux Process Management

    1. CLASSES OF PROCESSES

    2. PROCESSES, THREADS, AND TASKS -- THE KERNEL'S VIEW

    3. THE task_struct STRUCTURE

    4. THE KERNEL'S TASK LIST

    5. TRACKING THREADS

    6. USERS, PROCESSES AND TASKS

    7. PROCESS CREDENTIALS

    8. THE user_struct STRUCTURE

    9. THE signal_struct STRUCTURE

    10. RESOURCE LIMITS

    11. THE FAMILY TREE

    12. PARENT PROCESSES

    13. ADDITIONAL TASK MANAGEMENT STRUCTURES

    14. PROCESS ID NUMBERS

    15. THE LIFE CYCLE OF A TASK

    16. THE PER-TASK KERNEL STACK

    17. THE thread_info STRUCTURE

    18. ACCESSING THE CURRENT TASK'S task_struct STRUCTURE

    19. CLOCK TICKS, JIFFIES AND TIME SLICES

    20. DOES ANYBODY REALLY KNOW WHAT TIME IT IS?

    21. THE fork() SYSTEM CALL

    22. CREATING THREADS

    23. THE REAL TRUTH ABOUT fork()

    24. THE exec SYSTEM CALL FAMILY

    25. THE exit() SYSTEM CALL

    26. THE wait SYSTEM CALL FAMILY

    27. THE waitid() SYSTEM CALL

    28. THE SHELL AS AN EXAMPLE

    29. THOSE PESKY ZOMBIES

  4. The Linux Kernel API Subsystem

    1. WHAT IS A SYSTEM CALL?

    2. A MODE SWITCH

    3. RETURNING FROM A SYSTEM CALL

    4. SYSTEM CALL WRAPPERS

    5. MODE SWITCH MECHANISMS

    6. SYSTEM CALL NUMBERS

    7. THE syscall_table[]

    8. PUTTING IT ALL TOGETHER

    9. THE VDSO

    10. ADDING A NEW SYSTEM CALL TO THE LINUX KERNEL

  5. Linux Memory Management

    1. LINUX MEMORY MANAGEMENT OVERVIEW

    2. MEMORY MANAGEMENT BASICS

    3. 32-BIT PROCESSOR VIRTUAL ADDRESS SPACE

    4. PHYSICAL MEMORY AND THE KERNEL

    5. UMA AND NUMA

    6. PHYSICAL MEMORY ZONES

    7. kmalloc() AND FRIENDS -- HOW THE KERNEL ALLOCATES MEMORY

    8. RECLAIMING PAGES

    9. NODE AND ZONE MANAGEMENT STRUCTURES

    10. THE zone STRUCTURE

    11. THE page STRUCTURE

    12. REVIEW OF THE PROCESS IMAGE

    13. SHARED LIBRARIES

    14. HEAP MANAGEMENT

    15. THREADS AND STACKS

    16. 64-BIT PROCESSES

    17. VIEWING THE MEMORY REGIONS OF A PROCESS

    18. VMM DATA STRUCTURES

    19. VIRTUAL MEMORY AREAS (VMAS)

    20. ADDRESS TRANSLATION -- 32 BIT

    21. LINUX PAGE TABLES

    22. ADDRESS TRANSLATION FOR PHYSICAL ADDRESS EXTENSIONS (PAE)

    23. ADDRESS TRANSLATION -- 64 BIT

    24. PAGE FAULT HANDLING

  6. Inside Disk-Based File Systems

    1. UNIX FILE TYPES

    2. REGULAR FILES

    3. LINUX DISK-BASED FILE SYSTEMS

    4. DISK INODES

    5. DIRECTORIES

    6. THE LOGICAL FILE SYSTEM

    7. THE PHYSICAL FILE SYSTEM

    8. BASIC FILE SYSTEM STRUCTURE

    9. THE SUPER BLOCK

    10. JOURNALING FILE SYSTEMS

    11. THE DESIGN OF THE ext4 FILE SYSTEM

    12. BLOCK GROUP DESCRIPTORS

    13. MODERN DIRECTORY STRUCTURE

    14. ext4 RESERVED INODES

    15. BLOCK-BASED VS. EXTENT-BASED FILE SYSTEMS

  7. Kernel File System Structures

    1. FILE I/O OVERVIEW

    2. FILE DESCRIPTORS

    3. THE FILE LIST

    4. STDIN, STDOUT AND STDERR

    5. THE DIRECTORY CACHE

    6. THE MOUNT LIST

    7. IN-CORE INODES

    8. FILE AND INODE OPERATIONS -- THE LINUX VIRTUAL FILE

    9. SYSTEM

    10. PER-TASK FILE SYSTEM INFORMATION

    11. FILE AND RECORD LOCKS

    12. BASIC FILE I/O SYSTEM CALLS

    13. EXPLICIT FILE MAPPING

  8. Linux Signal Management

    1. THE LINUX SIGNAL LIST

    2. THE kill() SYSTEM CALL

    3. SIGNAL DELIVERY

    4. THE signal() SYSTEM CALL

    5. THE sigaction() SYSTEM CALL

    6. SIGNAL HANDLING AND THREADS

    7. INTERNALS OF SIGNAL DELIVERY

  9. Linux Sockets

    1. WHAT ARE SOCKETS?

    2. THE TCP/IP PROTOCOL STACK

    3. SOCKET APPLICATIONS

    4. SOCKET SYSTEM CALLS

    5. SOCKET INTERNALS

  10. Linux Device I/O

    1. COMPONENTS OF DEVICE I/O

    2. ANATOMY OF A LINUX DEVICE DRIVER

    3. DEVICE REGISTRATION TABLES

    4. THE DEVICE DRIVER JUMP TABLE

    5. CREATING A DEVICE SPECIAL FILE -- THE mknod COMMAND

    6. ONE MORE WORD ABOUT DEVICE NUMBERS

    7. OPENING A DEVICE FILE

    8. READING FROM A DEVICE

    9. WRITING TO A DEVICE

    10. LINUX KERNEL MODULES

    11. WRITING AND COMPILING A LINUX MODULE

    12. SETTING UP THE JUMP TABLE

    13. REGISTERING A DEVICE DRIVER

    14. A SAMPLE MODULE

  11. Linux Process Scheduling

    1. BASIC SCHEDULING CONCEPTS AND GOALS

    2. SCHEDULING TERMINOLOGY

    3. UNDERSTANDING REAL-TIME

    4. POSIX SCHEDULING POLICIES

    5. REAL-TIME SCHEDULING POLICIES

    6. THE SCHEDULING API

    7. THE HISTORY OF LINUX SCHEDUELRS

    8. THE COMPLETELY FAIR SCHEDULER

    9. RUN QUEUES AND R/B/TREES

    10. TRUE TIME VS. VIRTUAL TIME

    11. TASK SCHEDULER FIELDS

    12. CPU AFFINITY (PROCESSOR BONDAGE)

    13. SCHEDULER CLASSES

    14. THE NICE VALUE

    15. PROCESS PRIORITIES

    16. REAL-TIME PRIORITIES

    17. CALCULATING PRIORITIES

    18. RUN QUEUES

    19. SCHEDULING ENTITIES

    20. CALCULATING LOAD WEIGHT

    21. THE SCHEDULERS