This document outlines many of the key aspects of operating systems, and provides resources to learn more about each part. There are a lot of things missing (i'm on human), but these are enough to get you up and running. The intention is to be able to understand how you go from electricity entering your PC to being at a login screen you can see.
Most of this is relevent to linux primarily because it's open source, so there's much more information available about it, but these principles are the same across systems they just may have different names for things.
-
You know how to use a terminal
-
You know what file paths are and how to read absolute and relative paths
Some of these concepts can be found here: Terminal Basics
These are optional things you can look into, some of the resources mention them so I figured I would put in some reasources to look at them
Generally speaking there are a few peices of hardware you need, and will be found in basically every machine
-
CPU; The "brain" of the computer. This is what essentially
-
Instruction size; This is essentially the amount of space each instruction in a CPU has to work with. 32 bit programs will run on 32 bit and 64 bit systems, but 64 bit programs will ONLY run on 64 bit systems
-
32Bit
-
64Bit
-
-
It's important to note 3 common architectures that are used
-
x86; Most intel and AMD chips are x86 (often called by 86)
-
ARM; A lower-power architecture used in many phones and also new M series macbooks
-
RISC & RISC 5; An open source alternative used by some companies like IBM with the intention of simplicity of system
-
-
Level Caches; This is a system that allows a CPU to store small bits of information to process them quickly. The lower the "level", the less storage space, but the faster it is. These are typically denoted as something like L3 (level 3) 32MB, L2 (level 2) 8MB, L1 (level 1) 3.5MB. This system is a form of Volatile storage, this implies that it requires electricity to store it's data, this means when the electricity stops runing through it all the data is lost
-
Resources
-
-
GPU (often optional or integrated into CPU); What actually renders frames to the monitor that you see. This can be a "discrete gpu" (one you buy and install), or integrated GPU where the GPU is built into the CPU
-
Motherboard; This is essentially what connects all of your components. There are tons of specs to talk about with motherboards but generally speaking you will want to select motherboards based on the fact you are going to be limited to the chipset the CPU you are using is compatible with.
-
RAM (primary Volatile storage); This is where your system will store temporary data, such as data that apps need to run
-
Volatile implies that it requires electricity to store it's data, this means when the electricity stops runing through it all the data is lost. This is handy because it means that if you get an error and shutdown your PC you know your RAM will be cleared
-
The capacity of RAM determines how much multitasking you can do. Generally speaking if you run out of RAM you will be unable to run new processes (not always true [check out page files])
-
Frequency, this is measured in MHz and is how many bits/s can be sent on one line. This is not a catch-all for speed however and should be balanced with channels and timings
-
Memory Timing; This describes a number of different measurements available, see the video below for details
-
Channels (single, dual, quad); Generally speaking your motherboard will determine if your RAM should be single, dual or quad channel. It is recommended to just go with what it says, however keep in mind going with a different config can effect performance
-
resources
-
-
Non-volatile or persistant storage (HDD or SSD); This is what is used to store your files persistantly (when the PC is turned off and on)
-
Network Card[NIC; Network interface card] (Ethernet or wifi); This is what is used to connect to networks (such as the internet). It can be a wifi card to communicate wirelessly, or ethernet based. Typically this is included in your motherboard now, but you can have multiple NIC's
-
Soundcard (usually integrated in motherboard); This is what generates audio for you to listen to. Generally speaking this is integrated into the motherboard, and often not required to buy seperately
-
USB chipset; This is part of your motherboard, but often these are seperate chips that can break independent of the rest of the motherboard so I figured I would mention it:
-
PSU (power supply unit); This is what actually powers all the parts of your PC
Non volatile (slowest, but persistant, most space) --> RAM (Faster, volatile, less space)
--> Level caches (Fastest, very volatile, least space)
When starting a computer your bios will run after POSTing (basically a check that happens before the bios to make sure hardware is running). This is what is called firmware. Essentially it's code that is written directly onto the hardware that lets it start up. From there it then passes on to the bootloader:
-
PC BIOS Settings - YouTube <-- Explains some basic settings
-
BIOS, CMOS, UEFI - What's the difference? - YouTube (useful to know about CMOS if you need to troubleshoot hardware)
This then is what starts the kernel. Most importantly this is the system that when the bios talks to it can actually provide the memory location of where to start the kernel. This is important because it allows you to setup multiboot systems where more than 1 OS, and even OS's with different kernels can be loaded:
-
GRUB: GNU GRUB - Wikipedia, GNU GRUB - GNU Project - Free Software Foundation (FSF)
-
Windows 10 boot manager Windows 10 Boot Manager - YouTube
The kernel is what allows your operating system to talk to hardware. Generally speaking this is high-level interfaces, while all the complicated portions of the communication are handled by the drivers:
-
What is a Kernel and what does it do? Explore the Kernels of Linux, Windows, and MacOS. - YouTube
-
Write Your Own 64-bit Operating System Kernel #1 - Boot code and multiboot header - YouTube
This is where the magic happens. Typically drivers are talked about as seperate from the kernel because they are installed seperately, though they are typically kernal "modules". Some drivers are part of userspace, but people often think of it as blurring the lines between kernel and userspace, not to mention some implementations actually skip the kernel entirely and just access drivers directly.
Generally speaking each device is going to be different, and therefore will need a different driver. Some will just work with generic drivers, but it's usually best to run a device with it's specific driver.
To start a system it looks like:
Hardware --> Talks to Firmware/bios --> talks to bootloader --> talks to kernel
--> Starts operating system
once started the flow looks more like:
Hardware --> Kernel --> Userspace (what you see and all the processes you see running including windows managers, desktop environments, user management, etc.)
So for example if you have a frame from a video game first the hardware would generate the frame, it would then send it via the graphics driver to the display server, which would then render it through the Desktop environment/window manager
This is the good old operating system you know and love. This is where applications, your desktop, and %90 of computing is done.
- (5) The Layman's Guide to Linux: User Space - YouTube (Covers most things at once, but I would recommend doing other sections first then come back to this video)
These systems are designed to help a user manage packages (applications and services that run on an OS). These are common on linux systems, but less common on windows. They give advantages over just normally just installing applications because you can manage versions, updates, and uninstalling more easliy:
-
apt, dpkg, git, Python PiP (Linux Package Management) // Linux for Hackers // EP 5 - YouTube
-
Chocolatey Software | Chocolatey - The package manager for Windows
There is an alternative to package managers that are essentially containerized forms of package managers:
Distro's or distributions is the name given to different "flavours" of operating systems (really only applies to linux since there's 1 version of macos and 1 version of windows). A distro is what you actually install to your computer and includes a kernel, and all the default userspace packages and configurations.
There are many different distro's, but generally there are some groups of "similar" ones that do thing in a similar way and have similar setups. Packages can have a wide range of formats and which ones are supported is often tied to the type of distro you use
The most popular type of linux distro. Can use raw binaries or .deb files for packages. Typically uses apt as a package manager:
-
Cutefish: CuteFishOS - A Clean Mac-Like Linux Desktop - YouTube
-
Parrot: Parrot Security
-
Kali: Kali Linux | Penetration Testing and Ethical Hacking Linux Distribution
-
POP!: Pop!_OS by System76
-
Elementary: The thoughtful, capable, and ethical replacement for Windows and macOS ⋅ elementary OS
Considered to be the bleeding edge, and also typically the hardest learning curve. Tends to use pacman in conjunction with AUR (Arch user repository) to get it's packages:
-
Manjaro: Manjaro
-
Endeavour: EndeavourOS – A terminal-centric distro with a vibrant and friendly community at its core
-
Reborn: Homepage rebornos - RebornOS
Often considered the more "corporate" type of distro:
Linux from scratch is exactly what it sounds like. You build your system from nothing and basically create "your own distro"
A running program. They are essentially enclosed processes that have a bunch of state. When a process is made it will have a PID you can use to identify the process. While each process is seperate you can technically "pipe" the contents of processes between each other, typically using STDIN and STDOUT:
The shell is the name given to the system that lets you start and stop processes. The terminal is just the visualization of the shell that you interact with. When you start processes via clicking on a shortcut this still goes through the shell, but you likely won't see the terminal representation.
Shells:
-
Bash; Bash (Unix shell) - Wikipedia, Bash - GNU Project - Free Software Foundation
-
ZSH; Z shell - Wikipedia, Zsh
-
Fish: fish shell
Terminals
-
Termux; Termux | Terminal emulator and Linux environment for Android.
-
Cmder; cmderdev/cmder: Lovely console emulator package for Windows (github.com)
-
Alacritty: alacritty/alacritty: A cross-platform, OpenGL terminal emulator. (github.com)
Additional references
-
Bash Shell Scripting Tutorial For Beginners - Bash Basics in 20 Minutes - YouTube
-
Microsoft PowerShell for Beginners - Video 1 Learn PowerShell - YouTube
Streams is the name given to the system used to communicate with processes through the shell. There are 2 main types (and also STDERR you can look into yourself)
The INput stream that the terminal and commands use
The OUTput stream that is what you as a user often read when a command is finished
You can PIPE the output (stdout) of one command (command1), or some text to the input (stdin) of another command (command2):
command1 | command2
This means command2 will run using the output of command1 as input
Some folders and files are locked to "admins", on linux you need to use the command sudo
to allow access. On windows you need to use the gui prompt.
This is the system that is used to keep track of your files. People use this term to refer to multiple things (including both the way things are stored, and the file structure itself), but this just simply refers to the actual process of how your files are stored.
Further on we will talk about the file system structures that are common on operating systems, and that is not about how something is stored, but where things are commonly stored (though sometimes people still just call it the file system)
This is the standard used to describe where you should look in a file system for certain things (i.e. installed apps, default configurations etc.)
-
(5) Linux vs Windows File System Structure Compared! - YouTube
-
[Environment variables](Terminal Basics (kieranwood.ca)) (These often get used to make finding certain paths easier)
This is the way in which the file system actually stores it's data. This can impose limitations (like 4Gb file size limits for FAT32) and enable features (rolling backups/snapshots for BTRFS for some setups) depending on which you chose:
-
NTFS vs FAT32 vs exFAT - Everything You Need To Know - YouTube
-
(5) File Systems | Which One is the Best? ZFS, BTRFS, or EXT4 - YouTube (Bit opinionated, particularly about raid)
-
(5) Introduction to the Ext4 File System for Linux - YouTube
Controls what you actually see, without this nothing will render to the screen (examples are x server and wayland). In order for a GUI to appear whatever application is running will need to run through the display server
The name given to the collection of systems that run to give a linux distribution it's "look and feel". This includes things like a start menu (or not), a search bar (or not), desktop icons (or not), taskbar/app dock (or not), the file explorer and many other features that make a distribution look and feel different. Note that sometimes distro's with the same desktop environment will look different because they can often be styled with custom themes using CSS.
-
GNOME, a very popular DE: GNOME – Simple, beautiful, elegant.
-
KDE Plasma: Plasma - KDE Community
-
Cinnamon: Cinnamon (desktop environment) - Wikipedia, video
-
XFCE: Xfce Desktop Environment
-
Cutefish: CutefishOS – Cutefish OS Built on Ubuntu (cutefish-ubuntu.github.io), How to install Cutefish Desktop in Ubuntu and derivatives (linuxcool.net)
Controls the borders of GUI windows [the minimize, maximize and close buttons], as well as their positions and dimensions. These are usually part of desktop environments but you can install custom ones:
- Window manager used by GNOME: Enlightenment Main
- A fun tiling window manager I used to use in my edgy arch linux days: https://github.com/qtile/qtile
- Another Tiling window manager: https://i3wm.org/
- Awesome: https://awesomewm.org/
What allows you to visually traverse your file system
-
Dolphin: Dolphin - KDE Applications
-
Nautilus (GNOME): GNOME / Files · GitLab