Kickoff

Linux crash course

What is Linux

  • Free and open source operating system
    • Licensed under the GNU GPL v2.0
  • The focus of this class

Where is Linux

  • All top performing supercomputers
  • Most embedded systems
  • Android phones
  • Almost all of the computers powering the internet
  • Not many home computers
    • Unless you count chromebooks or the steam deck
  • On kernel.org, freely available

Who is Linux

  • Linus Torvalds
    • Created the Linux Kernel in 1991 while studying CS at the University of Helsinki as a personal project
    • Originally he supported only his own hardware.
    • "it probably never will support anything other than AT-harddisks, as that's all I have" [0]
    • Also eventually created git to act as the VCS for the kernel
  • Open source community project
    • Thousands of individual contributors
    • Corporate sponsors (including Red Hat)
    • The Linux Foundation

Why use Linux

  • Free software (free as in free speech)
    • No spying, telemetry, adware etc in most mainstream distributions
    • Can inspect and change the code as you please
  • Fully customizable
    • Different choices for things like desktop environments, GUI programs, etc
  • Can run on less powerful computers

Modularity

  • An OS made from many interchangeable components
  • Kernel a (relatively) small piece
  • Distribution (Distro) comes with choices for some of these pieces
    • Desktop environment
    • Package manager
    • Default Applications

Distro vs Distro

  • Differences in package naming conventions
    • libfoo-dev (apt) vs libfoo-devel (dnf)
  • Differences in target audience
    • Servers vs desktop computers
    • Gaming vs Software development
  • Differences in philosophy
    • Easy to use with sane defaults vs configure it all yourself
    • FOSS only vs access to proprietary software

Exclusively Open Source

fedora logo
source

Beginner-friendlyish

ubuntu logo
source

Do anything, but by hand

archlinux logo
source

Open Source Software as a Service

rhel logo
source

System Stack Overview

system stack diagram

Bootloader

  • Grub
    grub menu

Kernel

$ cat /home/rms/interjection.txt
I'd just like to interject for a moment.  What you're referring to as Linux,
is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux.
Linux is not an operating system unto itself, but rather another free component
of a fully functioning GNU system made useful by the GNU corelibs, shell
utilities and vital system components comprising a full OS as defined by POSIX.

Many computer users run a modified version of the GNU system every day,
without realizing it.  Through a peculiar turn of events, the version of GNU
which is widely used today is often called "Linux", and many of its users are
not aware that it is basically the GNU system, developed by the GNU Project.

There really is a Linux, and these people are using it, but it is just a
part of the system they use.  Linux is the kernel: the program in the system
that allocates the machine's resources to the other programs that you run.
The kernel is an essential part of an operating system, but useless by itself;
it can only function in the context of a complete operating system.  Linux is
normally used in combination with the GNU operating system: the whole system
is basically GNU with Linux added, or GNU/Linux.  All the so-called "Linux"
distributions are really distributions of GNU/Linux.

C Standard Library

  • Syscall wrappers
    • man 2 vs man 3
$ cat /proc/$$/maps
561fa56c6000-561fa56f5000 r--p 00000000 00:1f 669281                     /usr/bin/bash
...
561fa6d44000-561fa705c000 rw-p 00000000 00:00 0                          [heap]
...
7f0275133000-7f0275135000 rw-p 001d1000 00:1f 669212                     /usr/lib64/libc.so.6
...
7fffe0211000-7fffe0232000 rw-p 00000000 00:00 0                          [stack]

Shared Libraries

  • Some examples
$ cat /proc/$$/maps
...
7f027513d000-7f027514b000 r--p 00000000 00:1f 669207                     /usr/lib64/libtinfo.so.6.3
...
7f02751ba000-7f02751bc000 rw-p 00033000 00:1f 669209                     /usr/lib64/ld-linux-x86-64.so.2
...

Storage Layout

$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sr0     11:0    1 1024M  0 rom
zram0  251:0    0  7.7G  0 disk [SWAP]
vda    252:0    0   10G  0 disk
├─vda1 252:1    0    1M  0 part
├─vda2 252:2    0    1G  0 part /boot
└─vda3 252:3    0    9G  0 part /home
                                /

File system layout (See FHS)

  • / → root of file system
  • /root → home folder for root account
  • /bin → command binaries
  • /boot → boot loader files
  • /dev → device files
  • /proc → information about running processes
  • /etc → configuration files
  • /home → location of users' home folders
  • /lib → libraries

System Stack Overview

system stack diagram

The future

Where will linux go from here?