CresignSys Learn — Lesson 015

Written by

in

Course: From Basic Science to Web Hosting

Module 04 — Operating Systems

What Is an Operating System?

Difficulty: Beginner → Intermediate
Prerequisites: Lesson 014 — What Is a Computer?
Estimated time: 30 minutes


1. The Big Question

We now have:

Transistors
 ↓
Digital circuits
 ↓
CPU
 ↓
Memory
 ↓
Storage
 ↓
Computer

But there is a problem.

The hardware itself does not know what you mean when you say:

ls

or:

cd /storage/websites/

or:

sudo systemctl restart nginx

Something must translate software requests into controlled operations on hardware.

That major layer is the:

Operating System


2. What Is an Operating System?

An operating system, or OS, is system software that manages computer hardware and provides services and abstractions that applications use.

Examples:

Linux
Windows
macOS
Android

For your web server:

Ubuntu Linux

is the important operating-system environment.


3. The Computer Stack

Think of a computer as layers:

┌─────────────────────────────┐
│ Applications                │
│ WordPress, Nginx, PHP, etc. │
├─────────────────────────────┤
│ Libraries / Runtime         │
├─────────────────────────────┤
│ System Calls                │
├─────────────────────────────┤
│ Operating System / Kernel   │
├─────────────────────────────┤
│ Device Drivers              │
├─────────────────────────────┤
│ Hardware                    │
│ CPU / RAM / SSD / NIC       │
└─────────────────────────────┘

Each layer hides some complexity from the layer above it.


4. Why Do We Need an Operating System?

Imagine you want to save:

hello.txt

Without an operating system, software would need to understand enormous amounts of hardware detail:

SSD controller
 ↓
PCIe
 ↓
storage commands
 ↓
flash memory
 ↓
error correction
 ↓
physical storage locations

Instead, your application can ask the OS to create/write a file.

Application
    ↓
Operating System
    ↓
Filesystem
    ↓
Storage driver
    ↓
SSD

The OS provides the abstraction.


5. Hardware Is Physical

Your server has physical resources such as:

CPU
RAM
SSD
Network interface

The OS manages them.

For example:

CPU
 ↓
Processes

RAM
 ↓
Memory allocation

SSD
 ↓
Files

Network interface
 ↓
Network communication

6. The Kernel

The most important component of a traditional operating system is the:

Kernel

The kernel operates with high privileges and manages critical hardware and system resources.

Conceptually:

Applications
     ↓
System calls
     ↓
Kernel
     ↓
Hardware

Linux is fundamentally the name of the kernel.


7. Linux vs Ubuntu

This distinction is important.

Linux

Primarily refers to the Linux kernel.

Ubuntu

A Linux distribution.

It combines:

Linux kernel
+
System utilities
+
Package management
+
Libraries
+
Applications
+
Configuration

So:

Ubuntu
   ↓
uses
   ↓
Linux kernel

8. What Is a Linux Distribution?

A distribution packages the Linux kernel with many other components.

Examples:

Ubuntu
Debian
Fedora
Rocky Linux
Arch Linux

Your server uses Ubuntu.

Therefore:

Your server
 ↓
Ubuntu
 ↓
Linux kernel

9. Booting a Computer

What happens when a computer starts?

Very simplified:

Power ON
   ↓
Firmware
   ↓
Bootloader
   ↓
Linux kernel
   ↓
Initial userspace
   ↓
System services
   ↓
Login / applications

Let’s examine this carefully.


10. Firmware

When the machine starts, firmware initializes hardware and prepares the system to boot.

On modern PCs, this is commonly:

UEFI

The exact boot architecture can differ, especially in cloud environments.


11. Bootloader

The bootloader helps load the operating system kernel.

A common Linux bootloader is:

GRUB

Conceptually:

Firmware
   ↓
GRUB
   ↓
Linux kernel

Cloud environments may use different boot arrangements, so this is a general model rather than a universal sequence.


12. Linux Kernel Starts

The kernel is loaded into memory.

Then it begins initializing the system.

Conceptually:

Linux kernel
    ↓
CPU management
Memory management
Device initialization
Networking
Filesystem support
Process management

13. What Is a Process?

A process is a running instance of a program managed by the operating system.

For example:

Program:
nginx

Running instance:
nginx process

Another example:

Program:
php-fpm

Running instance:
php-fpm worker process

14. Program vs Process

This distinction is important.

Program

A stored set of instructions.

Example:

/usr/sbin/nginx

Process

That program currently executing.

nginx
   ↓
Process
   ↓
CPU + memory + OS resources

So:

Program = stored instructions

Process = executing instance

15. Multiple Processes

A server can run many processes simultaneously.

For example:

Linux
 │
 ├── nginx
 ├── php-fpm
 ├── mysqld
 ├── sshd
 └── system services

The kernel schedules CPU time among runnable processes.


16. CPU Scheduling

Suppose your CPU has work from:

Nginx
PHP
MySQL
SSH
System services

The kernel manages access to the CPU.

Simplified:

Process A
   ↓
CPU
   ↓
Process B
   ↓
CPU
   ↓
Process C
   ↓
CPU

Modern systems have multiple CPU cores, so multiple threads can execute simultaneously across cores.


17. Threads

A process can contain one or more threads of execution.

Conceptually:

Process
 ├── Thread 1
 ├── Thread 2
 └── Thread 3

Threads share much of the process’s memory and resources.

This becomes important for:

Web servers
Databases
Operating systems
Parallel computing

18. RAM and Virtual Memory

A process needs memory.

The operating system provides each process with a virtual address space.

Conceptually:

Process
 ↓
Virtual memory
 ↓
Physical memory
 ↓
RAM

This is a major abstraction.

A program generally doesn’t need to know the exact physical RAM location where every byte resides.

The OS and CPU’s memory-management hardware handle the mapping.


19. Memory Protection

One process should not normally be able to freely modify another process’s memory.

For example:

Nginx
   X
PHP memory

and:

PHP
   X
MySQL memory

The hardware and OS cooperate to provide memory isolation.

This is a major part of system security and stability.


20. Files

The OS provides a filesystem interface.

For example:

ls

asks the system to list directory contents.

Conceptually:

ls
 ↓
Shell
 ↓
System interface
 ↓
Filesystem
 ↓
Storage

21. Directories

Linux organizes files into a hierarchical directory structure.

For example:

/
├── etc
├── home
├── var
├── usr
├── tmp
└── storage

The root directory is:

/

Everything branches from it.


22. Your Website Path

You have used paths similar to:

/storage/websites/templates.cresignsys.com/public/

Break it down:

/
└── storage
    └── websites
        └── templates.cresignsys.com
            └── public

This is simply a directory hierarchy managed by the Linux filesystem.


23. Permissions

Linux controls who can access files and resources.

A file can have permissions for:

Owner
Group
Others

with permissions such as:

Read
Write
Execute

For example:

rwx

means:

r = read
w = write
x = execute

24. Users

Linux supports multiple user identities.

For example:

root
ubuntu
www-data

A process runs under a particular user identity.

For example, web-server processes often run with restricted privileges such as:

www-data

rather than full root privileges.

This reduces the impact of some security problems.


25. Root

The Linux root user has extremely powerful privileges.

For example:

sudo systemctl restart nginx

may execute the requested operation with elevated privileges.

Conceptually:

Normal user
    ↓
sudo
    ↓
root privileges
    ↓
Privileged operation

Because root access is powerful, commands should be used carefully.


26. What Is a Service?

A service is a program or group of processes managed to provide a continuing system function.

Examples:

nginx
mysql
ssh
php-fpm

On modern Ubuntu systems, systemd commonly manages services.


27. systemd

systemd is the primary system and service manager used by Ubuntu.

For example:

systemctl status nginx

asks systemd for the current state of the Nginx service.

Conceptually:

systemctl
   ↓
systemd
   ↓
Service
   ↓
Process

28. Starting a Service

For example:

sudo systemctl start nginx

Conceptually:

Command
 ↓
systemctl
 ↓
systemd
 ↓
Nginx
 ↓
Process starts

29. Restarting a Service

When you execute:

sudo systemctl restart nginx

the system roughly performs:

Stop/reconfigure service
        ↓
Start service
        ↓
New/reloaded process state

The exact internal sequence depends on the service and its unit configuration.


30. Networking

The operating system also manages network interfaces and networking functionality.

Conceptually:

Application
    ↓
Socket
    ↓
TCP/IP stack
    ↓
Network driver
    ↓
Network interface
    ↓
Cable / fiber / radio

This is the beginning of the path from your Linux server to the Internet.


31. What Is a Socket?

A socket is an operating-system interface that applications use for network communication.

Conceptually:

Nginx
 ↓
Socket
 ↓
TCP
 ↓
IP
 ↓
Network interface

A server can listen on a network address and port.

For example:

HTTP  → 80
HTTPS → 443

32. What Is a Port?

A port identifies a logical endpoint for network communication on a host.

For example:

Server IP
   +
TCP port 443
   ↓
HTTPS service

Therefore:

IP address
   ↓
Which machine/interface?

Port
   ↓
Which network service?

This distinction is fundamental to web hosting.


33. Operating System and Web Hosting

Now we can connect everything:

Physical server
      ↓
CPU / RAM / Storage / NIC
      ↓
Firmware
      ↓
Bootloader
      ↓
Linux kernel
      ↓
Ubuntu
      ↓
systemd
      ↓
Nginx
      ↓
PHP-FPM
      ↓
WordPress
      ↓
MySQL

And externally:

Browser
   ↓
Internet
   ↓
Server IP
   ↓
Port 443
   ↓
Nginx
   ↓
TLS
   ↓
HTTP
   ↓
WordPress

34. Your SSL Certificate Fits Here

You recently installed:

templates.cresignsys.com

with Let’s Encrypt.

The architecture is:

Browser
   ↓
HTTPS
   ↓
Port 443
   ↓
Nginx
   ↓
TLS certificate
   ↓
Encrypted connection
   ↓
HTTP request
   ↓
WordPress

Notice the important distinction:

TLS is not the operating system.

It operates at the networking/security layer above the basic OS networking facilities.


35. The Complete Stack

Your learning path is now:

PHYSICS
 ↓
Electrons
 ↓
Electricity
 ↓
Electronics
 ↓
Semiconductors
 ↓
Transistors
 ↓
Digital logic
 ↓
Binary
 ↓
CPU
 ↓
COMPUTER
 ↓
Operating System
 ↓
Linux
 ↓
Processes
 ↓
Memory
 ↓
Filesystem
 ↓
Networking
 ↓
TCP/IP
 ↓
TLS
 ↓
HTTP
 ↓
Nginx
 ↓
PHP
 ↓
WordPress
 ↓
Web Hosting

36. Quick Check

What is an operating system?

Software that manages hardware resources and provides services/abstractions for applications.

What is the kernel?

The privileged core of the operating system that manages fundamental system resources.

What is a process?

A running execution instance managed by the OS.

What is RAM?

Working memory used by running programs.

What is a filesystem?

A system for organizing and managing persistent files and directories.

What is systemd?

A system and service manager commonly used by Linux distributions such as Ubuntu.

What does Nginx do?

It can accept and process HTTP/HTTPS connections and serve or proxy web requests.


Next Lesson — 016

What Happens When You Type a Linux Command?

We will take a real command:

sudo systemctl restart nginx

and trace it from your keyboard all the way down to the CPU and back:

Keyboard
 ↓
Terminal
 ↓
Shell
 ↓
Command parsing
 ↓
sudo
 ↓
system call
 ↓
Linux kernel
 ↓
systemd
 ↓
Nginx
 ↓
CPU
 ↓
RAM
 ↓
Filesystem
 ↓
Network

This will be the foundation for understanding every Linux command you use while managing your web-hosting server.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *