Linux Basics

Transcription

Linux Basics
Linux Basics
Linux Basics
Michael Faath, Martin Lowinski
TumFUG
10. November 2011
1 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Outline
1 Linux history
2 Linux distributions
3 Linux insight
2 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Skill-Level
• Ever used linux?
• Installed Linux?
• What is a distribution?
• XUbuntu? Debian? Red Hat? Fedora? Gentoo? Arch Linux?
• cat my movie collection | grep Hackers
• chmod 777 *
• ./configure && make && make install
• make && make modules install
• sed -i ’s/teh/the/g’ thesis.tex
• LPIC?
3 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Skill-Level
• What do you want to know?
4 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux history
Outline
1 Linux history
2 Linux distributions
3 Linux insight
5 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux history
Unix / GNU
UNIX / GNU
• 1960s-1970: UNIX
• 1983: Richard Stallman started GNU
(Free UNIX-like OS)
• 1987: MINIX by Andrew S.
Tanenbaum
• 1991: GNU nearly complete // Kernel
missing
6 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux history
Linux
Linux
• MINIX only for 16Bit-Systems
• Linus Torvalds programmed a terminal
emulator to access the UNIX-Server of
his university
• wanted to take advantage of his new
PC with an 80386 processor
• therefore OS independant
• used GNU C compiler on MINIX
7 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux history
Linux
Torvalds on comp.os.minix
Hello everybody out there using minix I’m doing a (free) operating system (just a hobby, won’t be big and
professional like gnu) for 386(486) AT clones. Th is has been brewing since
april, and is starting to get ready. I’d like any feedback on things people
like/dislike in minix, as my OS resembles it somewhat (same physical layout of
the file-system (due to practical reasons) among othe r things).
I’ve currently ported bash(1.08) and gcc(1.40), and things seem to work. This
implies that I’ll get something practic al within a few months, and I’d like to
know what features most people would want. Any suggestions are welcome, but
I won’t promise I’ll implement them :-)
Linus ([email protected])
PS. Yes it’s free of any minix code, and it has a multi-threaded fs. It is NOT
portable (uses 386 task switching etc), and it probably never will support
anything other than AT-harddisks, as that’s all I have :-(.
8 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux history
Linux
Open Source
• Free as in freedom, not as in free-beer
• Sourcecode available
• Free to copy
• Free to change / redistribute
• Free Software Foundation and Open Source Initiative (OSI)
• Licenses: GPL, BSD, Apache, Beerware
9 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux history
Linux
Unix timeline
10 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux distributions
Outline
1 Linux history
2 Linux distributions
3 Linux insight
11 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux distributions
What’s a distribution?
What’s a distribution?
Important
Linux is just the kernel, nothing more.
12 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux distributions
What’s a distribution?
What’s a distribution?
Distribution
(z. B. zur Konfiguration,
Installation wie Yast, mcc)
Distributionseigene
Programme
z. B. Debian, Red Hat, SUSE, Mandriva
(z. B. Adobe Reader, Grafikkartentreiber)
Handbücher
Linux-Kernel
Support
Proprietäre Programme
Freie Programme
(per Telefon,
E-Mail o. ä.)
(z. B. KDE, OpenOffice, Apache)
To build a distribution you need... (in general)
• the linux kernel,
• some GNU stuff,
• a package management system
• and applications
13 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux distributions
What’s a distribution?
Overview
14 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux distributions
Distro Guide
Where are the differences?
Guide to your favourite Linux distro:
• Installtools (LFS vs. Ubuntu)
• Hardware compatibility (x86, devices, ...)
• Documentation / Support (active community, books)
• Principles (live, free software, KISS)
• License (GPL, DFSG)
• Package Layout (meta vs. binary)
• Help: Linux distribution chooser
15 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux distributions
Package Management Systems
Package Management Systems
• Software repository
• Verify checksums / signatures of packages
• Updating
• Uninstalling
• Dependencies
16 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux distributions
Package Management Systems
Types and Examples
• Binary packages
deb Debian package - dpkg, apt, aptitude, ..
RPM RPM Package Manager - rpm, yum, ...
• Source packages
ebuild How to retrieve, compile, and install a package
in Gentoo’s Portage system - emerge
17 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux insight
Outline
1 Linux history
2 Linux distributions
3 Linux insight
18 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux insight
Boot
Boot
Typical boot sequence:
19 of 33
1
BIOS
2
MBR
3
Boot Loader
4
Kernel (+initrd)
5
init
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux insight
Shell
Shell
• {Shell, Bash, zsh, screen, ksh}
• Command line interface
• Powerful tool
20 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux insight
Filesystem Hierarchy Standard (FHS)
Filesystem Hierarchy Standard (FHS)
• defines main directories and contents
• version 2.3 (2004)
• /
• virtual file system
21 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux insight
Filesystem Hierarchy Standard (FHS)
Filesystem Hierarchy Standard (FHS)
• static files
• variable files
• shareable files
• unshareable files
22 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux insight
Filesystem Hierarchy Standard (FHS)
Directory structure I
• /bin
• /boot
• /dev
• /etc
• /home
• /lib
• /media
23 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux insight
Filesystem Hierarchy Standard (FHS)
Directory structure I
• /bin (essential command binaries)
• /boot (bootloader files)
• /dev (devices)
• /etc (host-specific system-wide configuration files)
• /home (optional, user directories)
• /lib (kernel modules and dynamic librarys for /bin and /sbin)
• /media (optional, mount points for removable media)
24 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux insight
Filesystem Hierarchy Standard (FHS)
Directory structure II
• /mnt
• /opt
• /root
• /sbin
• /srv
• /tmp
• /usr
• /var
25 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux insight
Filesystem Hierarchy Standard (FHS)
Directory structure II
• /mnt (optional, temporarily mounted filesystems)
• /opt (optional software packages)
• /root (optional, “home“-directory for the root user)
• /sbin (essential system binaries, for root user only)
• /srv (service-data)
• /tmp (temporary files)
• /usr (secondary hierarchy for read-only user data)
• /var (variable data)
26 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux insight
Linux Kernel
Linux Kernel Layout
Applications
Kernel
CPU
27 of 33
Memory
Michael Faath, Martin Lowinski
Linux Basics
Devices
Linux Basics
Linux insight
Linux Kernel
BenutzerModus
Linux Kernel Structure
Anwendungen Anwendungen Anwendungen Anwendungen Anwendungen Anwendungen
Systemdienste
Systemaufrufe
Systemdienste
Systemdienste
Speicherzugriff
Dateisystemzugriff
Netzwerkzugriff
Threads
virtueller
Speicher
virtuelles
Dateisystem
Netzwerkprotokolle
Zeitabstimmung
Hard- Linuxware Kernel
Systemdienste
Prozesse
GeräteVerwaltung
28 of 33
Systemdienste
CacheSpeicher- Seitenverwalt.
planung
SpeicherAuslagerung
Netzwerkzwischenspeicher
Benutzerschnittstelle
SystemSicherheit
Moduls
+
Ereignisse
Zeitscheiben
logischer
Speicher
logisches
Dateisystem
virtuelles
Netzwerk
HISubsystem
allgemeiner
Hardwarezugriff
Interrupts
SpeicherseitenVerwaltung
blockorientierte
Geräte
virtuelles
Netzwerk
abstrakte
HI-Treiber
Bus-Treiber
Prozessorarchitektur
spezifischer
Code
Speicheroperationen
Disk-ControllerTreiber
NetzwerkkartenTreiber
BenutzerschnittstellenTreiber
CPU
Speicher
I/O
USB,PCI…
Register
Interrupts
MMU,RAM
Michael Faath, Martin Lowinski
Datenträger Netzwerk Peripherie
IDE,SATA
SCSI
Linux Basics
Ethernet
WiFi
GPU,Audio
Tastatur,Maus
Linux Basics
Linux insight
Linux Kernel
Linux Kernel Map
29 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Linux insight
Linux Kernel
Linux Kernel
• version: 3.1 (“Wet Seal“ / “Divemaster Edition“)
• december: 3.2 (“Saber-toothed Squirrel“)
• license: GPL 2 / proprietary (BLOBs)
• monolithic kernel
• c / assembler
• 14.856.072 loc in 37.098 files
30 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
LPIC
• Linux Professional Institude
• Non-profit organization
• Vendor-independent certification for Linux system
administrators and programmers
• Five year recertification policy
31 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
LPIC Levels
• LPIC-1 (“Junior Level Linux Professional“)
• Exam 101 - Systemarchitectures, Partitioning, Devices, Drivers,
LFH, Package-Management, GNU-/Unix-Commands, ...
• Exam 102 - Shell, Scripts, SQL, UI, Desktop, Network basics,
Security, ...
• LPIC-2 (“Advanced Level Linux Professional“)
• Exam 201 - Kernel, Filesystem, Hardware, System
administration, Scripting, ...
• Exam 202 - Network configuration, Mail/News, DNS, System
security, ...
• LPIC-3 (“Senior Level Linux Professional“)
• Six exams
32 of 33
Michael Faath, Martin Lowinski
Linux Basics
Linux Basics
Thanks for your attention.
[email protected] – gpg: 0xA2586B21
[email protected] – gpg: 0x35CDCCC4
33 of 33
Michael Faath, Martin Lowinski
Linux Basics