Docsity

Introduction to the Linux kernel: challenges and case studies, Monografías, Ensayos de Informática

Toggle sidebar
bg1
Introduction to the Linux kernel:
challenges and case studies
Juan Carlos Sáez Alcaide
Department of Computer Architecture and Automation
ArTeCS Group
Complutense University of Madrid
IV Semana de la Informática 2018
Feb 8, 2018
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33

Vista previa parcial del texto

¡Descarga Introduction to the Linux kernel: challenges and case studies y más Monografías, Ensayos en PDF de Informática solo en Docsity!

Introduction to the Linux kernel:

challenges and case studies

Juan Carlos Sáez Alcaide

Department of Computer Architecture and Automation

ArTeCS Group

Complutense University of Madrid

IV Semana de la Informática 2018

Feb 8, 2018

About Me

Juan Carlos Sáez Alcaide ([email protected])

 Interim Associate Professor, UCM

 Department of Computer Architecture and Automation

Teaching: Operating Systems , Linux and Android Internals , …

Member of the ArTeCS Research Group

 High Performance Computing

 Computer Architecture

 Interaction between system software and architecture

UCM Campus Representative of the USENIX Int’l Association

 Login (USENIX Magazine)

Outline

1 Introduction

2 Main Features

3 Kernel Control Paths and Concurrency

4 Common Kernel abstractions

5 A case study: PMCTrack tool

Unix (I)

Unics – Unix (1969)

 Created by Ken Thompson and rewrit-

ten in “C” by Dennis Ritchie (1973)

 V6 (1975): Public source code

(AT&T license)

 BSD distributions (Billy Joy)

 John Lion’s book on UNIX V

Keys to success

1 Inexpensive license

2 Source code available

3 Code was simple and easy to modify

4 Ran on modest HW

Unix (III)

Proyecto GNU (1983) - Richard Stallman

 SO GNU: Emacs, GNU compiler collection

(GCC), GNU Hurd (kernel)

Minix v1 (1987) - Andrew Tanenbaum

 Minimal Unix-like OS (Unix clone)

 Teaching purposes. Modular structure

 Compatible with Unix V7 (user level) evolved

towards the POSIX standard

 1987 (Minix1 - i8088), 1997 (Minix2 - i386)

Richard Stallman

Andrew Tanembaum

Conflicts in the Unix world

Unix Wars (1987-1996)

Unix International (USL - AT&T) vs. Open Software Founda-

tion

 Unix System V Release 4 (SVR4)

War of specifications

War ends in 1996 → Open Group (Unix Trademark)

Lawsuit brought by USL-AT&T against BSDI (1991-1994)

Issue: attempt to make BSD free of any UNIX code

Agreement is reached in 1994: Novell acquires USL

And Linux comes out… (1991)

Keys to success

 Unix Wars

 BSD Lawsuit

 Competition with Windows NT (common enemy)

 GPL License

 Internet

And Linux comes out… (1991)

But Linux is just a kernel…

 GNU/Linux…, IBM/RedHat/HP/….Linux..

Distros (kernel + selection of pre-compiled tools)

 MCC Interim Linux 1992,

 Slackware (Patrick Volkerding) , Debian (Ian Murdock) 1993

 S.U.S.E, Red Hat (Marc Erwing, Bob Young) 1994

Desktop Environments

 Xfree86 – Thomas Roel 1991

 KDE – Matthias Ettrich 1996

 Gnome – Miguel de Icaza 1997

Linux kernel: evolution since 1991

Lines of code per kernel version

Lines of code per Kernel version

Click and drag in the plot area to zoom in

Version

Lines of code

Lines of Code

2.1.113^ 2.2.18^ 2.3.29^ 2.4.16^ 2.5.16^ 2.5.54^ 2.6.16^ 3.0.14^ 3.0.52^ 3.0.90^ 3.2.15^ 3.2.53^ 3.4.28^ 3.4.

3.12.11^ 3.13.5 3.18.

4.4.4 4.8.9^ 4.11 4.14.

5M

10M

15M

20M

25M

Highcharts.com

Funny Statistics for the Linux Kernel - Lines of Code, Bad words,... https://www.linuxcounter.net/statistics/kernel

Source: https://www.linuxcounter.net

Android: a Linux-based OS

Home Contacts Phone Browser …

APPLICATIONS

Package Manager

Telephony Manager

Resource Manager

Location Manager

Notification Manager

Activity Manager

Window Manager

Content Providers

View System

APPLICATION FRAMEWORK

SGL SSL Bionic (libc)

OpenGL | ES FreeType (^) WebKit

Surface Manager Media Framework SQLite

LIBRARIES

Core Libraries

Dalvik Virtual Machine / ART

ANDROID RUNTIME

Keypad Driver Wifi Driver Audio Drivers

Power FreeType Management

Display Driver Camera Driver Flash Memory Driver

Binder (IPC) Driver

LINUX KERNEL

Outline

1 Introduction

2 Main Features

3 Kernel Control Paths and Concurrency

4 Common Kernel abstractions

5 A case study: PMCTrack tool

Monolithic design

Application

Application

libc (API)

System call interface

Memory Management

Process Management

Architecture specific code (arch)

Network stack

Device Drivers

VFS

Filesystem support

user mode

kernel mode

Hardware

Kernel Components

Features

All kernel components share

the same address space

Everything runs in kernel (privi-

leged) mode

Good performance

No isolation between compo-

nents

Interactive map of the Linux kernel

http://www.makelinux.net/kernel_map/

Main challenges

A beast of a different nature

Development process is labor-intensive

 Testing new features or bugfixes requires

1 (Re)Build the kernel (it may take a while!)

2 Install the new kernel

3 Reboot the machine

No memory protection (no SIGSEGV)

User-space like debugging tools are not available

Documentation becomes outdated quickly

 Developers must really understand the kernel code

No standard C library

Limited size of the kernel stack