10 Differences between Sales Cloud and CPQ, Blanka Doktorová
The ABC of Linux (Linux for Beginners)
1. The ABC of LinuxThe ABC of Linux
By Peter Larsen
plarsen@famlarsen.homelinux.com
2. May 26th 2012 The ABC of Linux 2
AgendaAgenda
● Linux Everywhere
● Upcoming subjects
● How Linux runs on a computer
3. May 26th 2012 The ABC of Linux 3
The ABC of LinuxThe ABC of Linux
4. May 26th 2012 The ABC of Linux 4
Proposed SubjectsProposed Subjects
●Boot process
● Bios
● Grub / lilo
● Kernel
● initrd / initramfs
● init script
●Basic Linux Commands
Storage
● File systems
● LVM
● NFS
● FUSE mounts
● Loop Devices – loopback mounts
●Security
● Security Applications (??)
● User Management
● LDAP
● Authentication
5. May 26th 2012 The ABC of Linux 5
Proposed SubjectsProposed Subjects
●Processes
●What is a process?
●What is a thread?
●Signals
●Priority
●setuid/setgid
●Software repositories
●Yum
●apt
●RPM / DEP
●How to create/setup your own yum
repo mirror
(Fedora/RHEL/Centos)
●Graphical Subsystem
●Networking
●Virtualization
– Libvirt
– KVM
– QEMU
– Virt Manager
– RHEV?
6. May 26th 2012 The ABC of Linux 6
Speakers / Ideas?Speakers / Ideas?
● Set schedule
● Speakers
● Other topics / changes
7. May 26th 2012 The ABC of Linux 7
Let's BeginLet's Begin
8. May 26th 2012 The ABC of Linux 8
What is a Computer?What is a Computer?
● Hardware
– CPU
– RAM
– Devices
● Software
– Operating System
– Applications
9. May 26th 2012 The ABC of Linux 9
Hardware - MainboardHardware - Mainboard
● Bus
● RAM
● PCI-e devices
● BIOS chip
● Embedded devices
● CPU sockets
10. May 26th 2012 The ABC of Linux 10
Hardware - CPUHardware - CPU
● Core
● ALU (Arithmatic Logic Unit)
● Registers
● Cache L1/L2
● Instruction Set
● Flags
● Pipelining
● Microcode
11. May 26th 2012 The ABC of Linux 11
MemoryMemory
● ROM (Read Only)
– Flash (EEPROM)
● RAM (Random Access)
– Static RAM (SRAM)
– Dynamic RAM (DRAM)
– Sync DRAM (SDRAM)
– Double Data Rate SDRAM
– DDR2 RAM
12. May 26th 2012 The ABC of Linux 12
Putting it all togetherPutting it all together
13. May 26th 2012 The ABC of Linux 13
How to make it all workHow to make it all work
● Hardware by itself doesn't do anything
● CPU needs instructions
● Instructions = Software
● Programming Languages
– Assembler
– C / C++
– Java
– Perl, Python, Ruby .....
14. May 26th 2012 The ABC of Linux 14
Operating SystemsOperating Systems
● Layer between hardware and your software
● Contains instructions on how to manage
hardware
● Process definition
● Security
● Device definitions / interfaces
● Memory Management
15. May 26th 2012 The ABC of Linux 15
To the RESCUE - LinuxTo the RESCUE - Linux
● Linux is a Kernel and nothing but a kernel
● Some prefer to call it GNU/Linux
● Just a kernel isn't useful – GNU provides
the utilities (commands) that allow us to
use Linux
● Everything Open Source
● Many variants (distributions) of Linux
(Ubuntu, Fedora, Mint, ArchLinux etc.)
16. May 26th 2012 The ABC of Linux 16
How to Boot into LinuxHow to Boot into Linux
● Boot process
● Bios
● Master Boot Record
● Grub
● Loading the Kernel
● Initrd/initramfs
● Init-script
● runlevels
17. May 26th 2012 The ABC of Linux 17
Boot ProcessBoot Process
18. May 26th 2012 The ABC of Linux 18
The BIOSThe BIOS
1. Executes a series of tests on the computer hardware, in order to
establish which devices are present and whether they are working
properly. This phase is often called POST (Power-On Self-Test).
2. Initializes the hardware devices. This phase is crucial in modern PCI-
based architectures, since it guarantees that all hardware devices
operate without conflicts on the IRQ lines and I/O ports.
3. Searches for an operating system to boot. Actually, depending on the
BIOS setting, the procedure may try to access (in a predefined,
customizable order) the first sector (boot sector) of any floppy disk, any
hard disk, and any CD-ROM in the system.
4. As soon as a valid device is found, copies the contents of its first
sector into RAM, starting from physical address 0x7c00, then jumps into
that address and executes the code just loaded.
19. May 26th 2012 The ABC of Linux 19
Master Boot Record (MBR)Master Boot Record (MBR)
● The master boot record is always located at cylinder 0,
head 0, and sector 1, the first sector on the disk.
The master boot record contains the following structures:
● Partition Table: This small table contains the descriptions
of the partitions that are contained on the hard disk. There
is only room in the partition table for the information
describing four partitions.
● Master Boot Code: The master boot record contains the
small initial boot program that the BIOS loads and
executes to start the boot process. This program
eventually transfers control to the boot program stored on
whichever partition is used for booting the PC.
20. May 26th 2012 The ABC of Linux 20
GRUBGRUB
● A Boot Loader comes after the BIOS. It is the code,
which sits in the MBR & is responsible for loading
and transferring control to an operating system
kernel.
● Rather than consisting of a single program which
loads the operating system directly, multi-stage boot
loaders divide their functionality into a number of
smaller programs that each successively load one
another. This architecture allows a fairly primitive
boot loader, located in the MBR, to load and execute
the next stage of the boot loader, a larger and more
sophisticated boot loader.
21. May 26th 2012 The ABC of Linux 21
The KernelThe Kernel
● Challenge: How to
fit a several MB
kernel into a 1MB
space
● Load enough kernel
to switch to
protected mode,
then load the rest
22. May 26th 2012 The ABC of Linux 22
Initrd / initramfsInitrd / initramfs
● To avoid having custom kernel compiles for
every machine, initramfs contains specific
modules needed for the particular
hardware used.
● Mkinitfs / dracut creates initramfs based on
detected hardware.
23. May 26th 2012 The ABC of Linux 23
Init ScriptInit Script
● The program /sbin/init is the parent of all
user processes, process with the PID as 1.
Init’s job is to create other user processes
by following the instructions found in the
file /etc/inittab.
24. May 26th 2012 The ABC of Linux 24
RunlevelsRunlevels
● 0 = Halt
● 6 = Reboot
● 5 = Start X
● 1 = Single user mode
● 2 = Full system without X and network
● 3 = Full system without X
● 4 = Not used
25. May 26th 2012 The ABC of Linux 25
File systemsFile systems
● Persistent storage where kernel and other
code is loaded from during boot
● Can be on many devices: SCSI, IDE,
USB ...
● Partitions, LVM, Software Raid
● Popular file systems: ext4, xfs, bttrfs
● i-nodes and other file system internals
26. May 26th 2012 The ABC of Linux 26
Questions?Questions?
27. May 26th 2012 The ABC of Linux 27
FredLUGFredLUG
● Find us here: http://fredlug.info
● Meeting Schedule (Google Calendar):
http://tinyurl.com/c5cx7ku
● Mainling List:
http://calypso.tux.org/mailman/listinfo/fredlug
● MeetUp: http://www.meetup.com/fredlug/
● Meetings: Every Last Saturday of the
month – 9am to 11am
● COME JOIN US!
Editor's Notes
The address [0xFFFFFFF0] is mapped by the hardware to some read-only, persistent memory chip[ROM/FLASH]. The set of programs stored in ROM is traditionally called BIOS (Basic Input/Output System), since it includes several interrupt-driven low-level procedures used by some operating systems, including Microsoft’s MS-DOS, to handle the hardware devices that make up the computer. Once initialized, Linux does not make any use of BIOS but provides its own device driver for every hardware device on the computer.
The BIOS plays an important role in system boot up process.