Linux Kernel Workshop Summer 2010

Linux Kernel Workshop – Summer 2010

Staff

Time and place

Plan

1 Aug

Configuring, compiling, and running the Kernel

  1. Explain the different ways and shortcuts to configure a kernel
  2. Querying the shell for computer specific config data
  3. menuconfig
  4. Overview of booting, basic boot concepts (initrd, grub, menu.lst, bootable image, etc.) and useful boot information (where to find the bootable image, where to copy it, how to config menu.lst, etc.)
    Intro
    Configure and compile
A. Israeli and D. G. Feitelson, “The Linux kernel as a case study in software evolution”. J. Syst. & Softw. 83(3), pp. 485-501, Mar 2010
  1. Kernel compilation
  2. Setting up a bootable image and running the kernel
  3. Configuring a kernel with some minimal configuration file.
2 Aug

Introduction to the Linux kernel and KLogger

  1. Short refresher on kernels in general
  2. Brief history of Linux kernel and its significance
  3. Overview of kernel source (directory structure)
  4. Overview of KLogger and KLogger howto (schematas, low watermark, dump file, perlmods, etc.)
    A short refresher on kernels
    The Linux kernel
    Linux Kernel source review
    Introduction to KLogger
download KLogger for Linux 2.6.31.4
Y. Etsion, D. Tsafrir, S. Kirkpatrick, and D. G. Feitelson, “Fine grained kernel logging with KLogger: experience and insights”. In 2nd EuroSys Conf., pp. 259-272, Mar 2007
  1. KLogger toggling
  2. Trace analysis
    Ex2
3 Aug

The Linux scheduler

  1. Short refresher on scheduling
  2. Overview of main scheduling methods, concepts, code, etc.
  3. Overview of KLogger scheduler schema
    Short refresher on kernel scheduling
Y. Etsion, D. Tsafrir, and D. G. Feitelson, “Effects of clock resolution on the scheduling of interactive and soft real-time processes”. In SIGMETRICS Conf. Measurement & Modeling of Comput. Syst., pp. 172-183, Jun 2003
  1. The scheduler in different Linux versions (2.2, early 2.6, now)
    Keywords: O(1) scheduler, interactivity enhancements, completely fair scheduler
  2. Read books and code and figure it out!
  3. Resources:
    Chapter on scheduling from Understanding the Linux Kernel (1st edition)
    Linux code cross reference (LXR)
    Linux code cross reference (LXR) II
    Kernel Trap summary of scheduler development
5 Aug

Hacking and patching the kernel

  1. Overview of patching, patch files, patch file formats, commands, etc.
  2. Introductory kernel hacking: "Hello world" printk
    Patching
D. Tsafrir, Y. Etsion, D. G. Feitelson, and S. Kirkpatrick, “System noise, OS clock ticks, and fine-grained parallel applications”. In 19th Intl. Conf. Supercomputing, pp. 303-312, Jun 2005
  1. Build some printk hooks that print messages when going in and out of some well known process. *
  2. Build a simple schema.
  3. Code the relevant hooks.
  4. Compile, boot, and run.
8 Aug

Practical work with the Linux kernel

debugging, kernel complexity
Debugging tools by Muli Ben-Yehuda
Kernel debugging techniques by Christopher Hallinan
  1. Known issues and stumbling blocks
  2. Message printing and logging
  3. Dealing with system hangs
    Kernel Debugging
    x86 Assembly Guide
D. Tsafrir, Y. Etsion, and D. G. Feitelson, “Secretly monopolizing the CPU without superuser privileges”. In 16th USENIX Security Symp., pp. 239-256, Aug 2007
  1. Speed-assessment of high complexity functions I
  2. Discussion of Linux schedulers
9 Aug

Understanding syscalls

  1. Syscall overview (what is a system call)
  2. Syscall uses and format requirements (registering a syscall, building separate drives for different uses of the same syscall)
    SysCalls
    Linux system calls - Linux man page
Y. Etsion, D. Tsafrir, and D. G. Feitelson, “Process prioritization using output production: scheduling for multimedia”. ACM Trans. Multimedia Comput., Commun. & Appl. 2(4), pp. 318-342, Nov 2006
  1. Create a simple system call (suggest one that calls up KLogger)
  2. Register it
  3. Build a driver and run it
10 Aug

Using the VFS for kernel programing and dynamic kernel interaction

  1. Overview of VFS
  2. Creating KObjects in order to manipulate the kernel from the /sys vfs
  3. Interacting with programs that contain embedded KObjects
    The Virtual Filesystem
    Kobjects
    Kobject example
Y. Etsion, T. Ben-Nun, and D. G. Feitelson, “A global scheduling framework for virtualization environments”. In 5th Intl. Workshop System Management Techniques, Processes, and Services, May 2009
T. Ben-Nun, Y. Etsion, and D. G. Feitelson, “Design and implementation of a generic resource sharing virtual time dispatcher”. In 3rd Ann. Haifa Experimental Systems Conf., May 2010
  1. Speed-assessment of high complexity functions II
  2. Take syscall that was build in previous exercise and convert the interface from syscall and driver to VFS oriented (sys/fs)
12 Aug

Kernel modules

Howto from LinuxChix
  1. What is a kernel module
  2. Advantages
  3. How to get my kernel to support them
  4. Loading and unloading
    Kernel module
E. Shmueli and D. G. Feitelson, “On simulation and design of parallel-systems schedulers: are we doing the right thing?”. IEEE Trans. Parallel & Distributed Syst. 20(7), pp. 983-996, Jul 2009
  1. Build, compile, load and run a simple kernel module

Projects

These are various ideas that were raised during discussions