The computer has hardware: the processor (CPU), the memory, the disks, the network card. Programs need the hardware. But programs do not touch it themselves. One program controls all of it: the kernel.
Processesbash, cat, grep, ps …
Kernelruns the processes, controls the hardware
HardwareCPU, memory, disks, network
What the kernel does
| Job | Example |
|---|---|
| Start and stop processes | It gives each process its PID |
| Share the processor | Many processes run at the same time. The kernel gives each one turns |
| Give out memory | Each process gets its own part of the memory |
| Read and write the disks | cat notes.txt asks the kernel for the file |
| Send and receive on the network | A web page comes in through the kernel |
When cat reads a file, it asks the kernel: "give me the data of notes.txt". The kernel reads the disk and gives the data to cat.
The kernel starts first, when the computer starts. It runs until the computer stops.
uname: ask the kernel about itself
text
learner@tidepool:~$ uname -s
Linux
learner@tidepool:~$ uname -r
6.8.0-45-generic| Line | Writes |
|---|---|
uname -s | The name of the kernel |
uname -r | The version of the kernel |
uname -a | All of the information on one line |
The name of this kernel is Linux. That is where the name of the course comes from.