DEV Community

Oni Toluwalope
Oni Toluwalope

Posted on

Brief Intro to Operating Systems for Devops

An operating system provides a base for application software and act as an intermediary between the hardware, applications and the human user.

Some examples of operating systems used in modern day(2024): Android - developed by, iOS, MacOS, Windows, and Linux.

To understand what an Operating System does we need to understand the basic structure of a computer.

From bottom up, the computer consist of:

| Human user | - You
| Application Software | - Web browser, Word processors, Games
| Operating Systems /System Software | - iOS, Linux, Windows...
| Hardware | - CPU, Memory, Input Output devices

Hardware: Resources like CPU, Memory: RAM and ROM, Motherboard, Input-Output devices: Mouse, display, keyboard.

Application Softwares: They are softwares that are used to perfom specific tasks eg. Web browser, Word processors, Games

Imagine a world without OS where the user is to use the application software to interact with the computer hardware,
the user will have to tell the computer what to do in a step by step fashion using code.
For example the user wants to use a web browser called firefox,
the user will tell the hardware to load firefox to memory,
after loading it,
tell it to prepare the application to receive input,
display each character that is being typed on the monitor,
after displaying all characters, after displaying all characters,
you tell it you are done typing,
then you tell it again to convert it to packets,
after the data is being split into packet,

the user will request that the hardware open up the network ports,
then tell it to allow data outflow . . .

So, without the OS you have to manually dictate every step of what to do in form of code, and it will be very difficult to work with the computer if there is no operating system. And so this is the ease operating system brings.

If an Operating system was available all the user will do is to click on the program then type the address on the address bar then click enter, and the operating system takes the job of telling the hardware the step by step process on what to do. This makes the computer easier to use

So now it is safe to say an operating system manages computer hardware, provides a base for application software and act as an intermediary between the hardware, applications and the human user.

Main Functions of an operating system

Process management/ Task scheduling:
Memory Management: Handles running applications (processes), multitasking, and scheduling.
File System Management: Organizes and controls data storage and access
Input/Output management: Input/Output connection and flow

Other functions

Security management
Network management
Interfaces between hardware and software

Types of Operating Systems

Batch OS
Real Time OS (RTOS)
Time Sharing OS
Distributed OS
Network OS

Goals of an operating system

Ease of use
Allocation of resources
Efficiency

Why Operating Systems Matter in DevOps

  1. Hosting Applications
    Every application needs an OS to run. DevOps professionals often work with servers running Linux or Windows to host web applications, databases, and other services.
    Linux is preferred for its stability, open-source nature, and extensive toolset. Windows Server is also common in enterprise environments requiring compatibility with Microsoft tools.

  2. Containerization and Virtualization
    Containers (e.g., Docker) and virtual machines (e.g., VMware, VirtualBox) rely heavily on OS-level features for isolation and resource management. Tools like Kubernetes orchestrate these containers, making OS knowledge indispensable.

  3. Automation and Scripting
    Automation in DevOps involves writing scripts and using configuration management tools. These often interact directly with the OS to:
    Manage system users and permissions
    Install software packages
    Configure network settings

  4. Monitoring and Troubleshooting
    Understanding the OS helps in monitoring performance and diagnosing issues using tools like:
    Linux: top, htop, dstat, journalctl
    Windows: Task Manager, Event Viewer, PowerShell

Some Key Operating System Concepts for DevOps

  1. Processes and Services
    Processes: Running applications or tasks. Use tools like ps (Linux) or Task Manager (Windows) to monitor them.
    Services: Background processes that perform specific functions, e.g., web servers (Nginx, Apache), loggers.

  2. File Systems
    Linux: Follows a hierarchical structure with directories like /home, /var, /etc.
    Windows: Follows a flat directory structure that uses drive letters (e.g., C:) and organizes files accordingly.

Learn commands like ls, cd, cp, rm (Linux) or PowerShell equivalents for file management.

  1. Networking
    Operating systems manage network interfaces and routing. Key tasks include:
    Configuring IP addresses
    Managing firewalls (e.g., iptables, Windows Defender Firewall)
    Troubleshooting with tools like ping, netstat, traceroute

  2. User Management and Permissions
    Linux: Uses file permission systems (chmod, chown) and role-based access.
    Windows: Manages users through Computer Management, Control Panel or PowerShell.
    Secure environments by limiting user access and enforcing best practices.

  3. Package Management
    Linux: Tools like apt (Ubuntu/Debian), yum (CentOS), handle software installation and updates.

Windows: Use the Windows Package Manager (winget) or Chocolatey.

Practical Applications of OS Knowledge in DevOps

  1. Setting Up a Server
    Example: Deploying a web application on Linux.
    Install necessary packages (e.g., nginx, python3)
    Configure the web server to serve the application.
    Secure the server using firewalls and SSH keys.

  2. Containerizing Applications
    Example: Using Docker.
    Understand base images (e.g., ubuntu:24.04 or alpine:latest).
    Write Dockerfiles that leverage OS commands for setup.

  3. Automating Tasks
    Example: Scheduling backups with Cron (Linux) or Task Scheduler (Windows).
    Write scripts to automate repetitive tasks.
    Schedule them to run at specific intervals.

  4. Monitoring and Logging
    Example: Using system logs for troubleshooting.
    Access logs in /var/log (Linux) or Event Viewer (Windows).
    Use monitoring tools like Prometheus and Grafana for system metrics.

How to Start Learning Operating Systems for DevOps

  1. Choose a specific OS (Linux Distribution is preferred)
    Start with beginner-friendly distros like Ubuntu or CentOS.
    Practice basic commands and explore the directory structure.

  2. Set Up a Virtual Lab
    Use VirtualBox or VMware to create virtual machines.
    Experiment with Linux and Windows Server environments.

  3. Learn Command-Line Basics
    Master essential commands for file management, process monitoring, and networking.

  4. Write Simple Scripts
    Automate tasks using Bash (Linux) or PowerShell (Windows).
    Gradually incorporate tools like Git, Ansible or Terraform.

  5. Experiment with Containers
    Install Docker and create basic containers.
    Understand the relationship between the host OS and containerized applications.

OS knowledge empowers DevOps practitioners to work more effectively. By mastering basic OS concepts and gradually exploring advanced topics, you can build a solid foundation for your DevOps journey.

Top comments (0)