notes blog about

To study complex (software) systems we use abstraction - a fancy way to say that we don’t care about details of the components (subsystems, modules, packages).

Levels of abstraction in a Linux system

We need to organize the components somehow, however. In this case we create groupings going from hardware to user:

Hardware

Kernel

User processes

Difference between running kernel and user processes:

Main memory (RAM)

Just a big storage area for a bunch of 0s and 1s (bits).

The running kernel and all user processes reside here. Also all I/O from peripheral devices flows through RAM. They are all just big collections of bits.

A CPU is just an operator on memory:

CPU <-- reads instructions and data --- RAM
CPU ---         writes data         --> RAM

State

Devices

/dev

/sys/devices

Block device (b)

Character device (c)

Pipe device (p)

Socket device (s)

Kernel

Nearly all kernel’s tasks revolve around main memory:

Memory mngt.

Process mngt.

System calls a.k.a. syscalls - man 2

(C library functions a.k.a. library calls - man 3)

Userspace and users

All user processes (except for init) start as a result of fork() usually followed by exec(), ex. - running ls command in shell:

shell ---> fork() ---> shell
                   |
                   +-> copy of shell ---> exec(ls) ---> ls

Resources