[ SRE_ARENA ]
OPERATING SYSTEM CONCEPTS

Operating System Concepts: The Ultimate Abstraction

System Architecture Visualization
DOWNLOADING CONCEPT: WHAT IS AN OPERATING SYSTEM?...
  • ↳An Operating System (OS) is a massive abstraction layer.
  • ↳It sits between the physical hardware (CPU, RAM, Disk, NIC) and your applications.
  • ↳Without an OS, your code would have to manually send electrical pulses to the hard drive to read a file.
  • ↳The core of the OS is the Kernel, running in a highly privileged hardware mode (Ring 0).
  • ↳Your applications run in unprivileged User Space (Ring 3).
  • ↳When an app needs to touch hardware (like writing to a network socket), it cannot do it directly.
  • ↳It must politely ask the kernel via a System Call (e.g., write(), read(), socket()).
  • ↳If an application tries to access hardware directly, the CPU hardware catches the illegal instruction and the kernel kills the process with a Segmentation Fault.
Command
  • ↳strace -c -p <PID> strace intercepts and records system calls called by a process.
  • ↳The -c flag summarizes them.
  • ↳It shows you exactly what the application is asking the kernel to do.
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 50.12    0.004112          12       342           epoll_wait
 24.31    0.001994           8       249           read
 18.00    0.001476           9       164           write
Command
  • ↳dmesg -T Reads the kernel ring buffer.
  • ↳This is where the kernel logs critical hardware events, driver crashes, and the dreaded OOM (Out of Memory) killer executions.
[Tue Sep 26 14:32:11 2026] Out of memory: Killed process 8891 (java) total-vm:4096kB, anon-rss:2097152kB
▲ LIVE INCIDENTA Java application stops accepting connections after running for 3 days.
sre@arena:~/os-concepts
sre@arena:~$ ls /proc/$(pgrep java)/fd | wc -l && ulimit -n && lsof -p $(pgrep java) | grep 'CLOSE_WAIT' | wc -l