Ground Zero: Computer Hardware, Kernel Space, User Space & Syscalls
පිටුව 01: පරිගණක මූලිකාංග, Linux Kernel එක, User Space සහ Syscalls
Hardware (CPU, RAM, Disk), Linux Kernel එකේ කාර්යභාරය, CPU Protection Rings (Ring 0 vs Ring 3), සහ System Calls (Syscalls) ක්රියාත්මක වන ආකාරය සරලව ඉගෙන ගනිමු.
Lab 01 of 20 · Ground Zero Basics · 5 hands-on activities · bilingual (English + සිංහල)
පිටුව 01: පරිගණක මූලිකාංග, Linux Kernel එක, User Space සහ Syscalls
Hardware (CPU, RAM, Disk), Linux Kernel එකේ කාර්යභාරය, CPU Protection Rings (Ring 0 vs Ring 3), සහ System Calls (Syscalls) ක්රියාත්මක වන ආකාරය සරලව ඉගෙන ගනිමු.
💡 සරල සිංහලෙන්: පරිගණකයක්, Kernel එකක් සහ Syscalls කියන්නේ මොකක්ද?
පාර්ලිමේන්තුව, ආරක්ෂකයින් සහ සාමාන්ය ජනතාවගේ උපමාව:
- User Space (Ring 3 - සාමාන්ය ජනතාව): අපි ලියන Code, Nginx, Python, Docker වගේ දේවල් ඉන්නේ මෙතනයි. මේ අයට කෙලින්ම පරිගණකයේ Hard disk එකට හරි Network කාඩ් එකට හරි අත තියන්න බෑ. මොකද වැරදීමකින් හරි මුළු මැෂින් එකම Crash වෙන්න පුළුවන් නිසා!
- Kernel Space (Ring 0 - පාර්ලිමේන්තුව / ජනාධිපති): මෙහෙයුම් පද්ධතියේ (OS) හදවත. Hardware එක සම්පූර්ණයෙන්ම පාලනය කරන්නේ Kernel එකෙන් විතරයි.
- System Call (Syscall - ආරක්ෂක දොරටුවෙන් කරන ඉල්ලීම): සාමාන්ය App එකකට Hard disk එකක File එකක් Save කරන්න හරි Internet එකෙන් දත්තයක් යවන්න හරි ඕන වුණාම, ඒක Kernel එකට Syscall එකක් මඟින් කියනවා: "කරුණාකරලා මගේ මේ File එක Disk එකේ ලියලා දෙන්න" කියලා. Kernel එක ඒක පරීක්ෂා කරලා ආරක්ෂිතව කරලා දෙනවා.
Architectural Foundation & Systems Diagram
Every journey in Site Reliability Engineering and DevOps begins at the hardware and operating system layer. Before containers or clouds exist, code runs on physical silicon managed by the Linux kernel.
-
🖥️ CPU, RAM & Disk — The CPU calculates instructions at gigahertz speed. RAM provides ultra-fast temporary working memory. Disk provides permanent persistent storage. The OS coordinates all three.
-
🛡️ Why Ring 0 vs Ring 3? — Hardware protection rings ensure that if a user application (like a web browser or Python script) crashes or has a memory leak, it cannot corrupt physical memory or crash the entire machine.
-
🚪 System Calls (Syscalls) — Whenever a program wants to read a file from disk, allocate memory, or send a network packet over the Internet, it MUST make a system call asking the Linux kernel to perform the action safely on its behalf.
Step-by-step practical lab
Step 01: Verify Local Loopback Network Interface
සිංහලෙන් — පරිගණකයේ internal networking stack එක නිවැරදිව ක්රියාත්මක වේදැයි පරීක්ෂා කිරීම.
Send 4 ICMP network echo requests to localhost (127.0.0.1) to confirm your network protocol stack is initialized.
ping -c 4 localhost-c 4: Count: Packets 4ක් පමණක් යවා ස්වයංක්රීයව නවත්වයි.
Expected output
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost: icmp_seq=1 ttl=64 time=0.038 ms
4 packets transmitted, 4 received, 0% packet lossSRE Tip: If ping localhost fails, your server's loopback interface (lo) is down, meaning local processes cannot communicate over TCP sockets.
Step 02: Probe HTTP Web Response Headers via Curl
සිංහලෙන් — Web Server එකක් වෙත HTTP GET request එකක් යවා එහි Headers කියවීම.
Fetch only the HTTP response status code and headers from port 8080 without downloading the HTML payload body.
curl -I http://localhost:8080-I: Headers පමණක් ලබාගැනීම: Server එකේ වර්ගය සහ HTTP 200 OK තත්ත්වය පරීක්ෂා කරයි.
Expected output
HTTP/1.1 200 OK
Server: nginx/1.24.0 (Ubuntu)
Date: Wed, 16 Sep 2026 12:50:00 GMT
Content-Type: text/htmlSRE Tip: Always use curl -I first during outages to check if the server returns 200 OK, 502 Bad Gateway, or 504 Gateway Timeout.
Step 03: Inspect Machine Network Hostname
සිංහලෙන් — Server එකේ ජාල නාමය (Hostname) පරීක්ෂා කර තහවුරු කර ගැනීම.
Query the assigned network hostname of the current operating system instance.
hostnamehostname: /etc/hostname ගොනුවේ ඇති server එකේ නම පෙන්වයි.
Expected output
prod-app-srv-01.internal.cloudSRE Tip: In high-scale fleets, hostnames follow strict naming standards (e.g. env-service-region-node) to instantly identify failure domains.
Hands-on practice activities
Work through these yourself — tick them off as you go.
- Activity 01: Inspect Linux Monolithic Kernel Architecture (Drill) — Query the running monolithic Linux kernel version, machine hardware name, and kernel build architecture (x86_64).
- Activity 02: Read Kernel Release Metadata (Drill) — Inspect the GCC compiler version and Linux kernel build timestamp directly from the /proc virtual filesystem.
- Activity 03: Test Local Network Loopback Stack (Drill) — Send 4 ICMP echo request packets to 127.0.0.1 to verify your kernel TCP/IP network stack is initialized.
- Activity 04: Inspect Host Machine Name (Drill) — Query the assigned network hostname of the current operating system instance.
- Activity 05: CPU Rings & Privilege Level Check (Quiz) — In which CPU protection ring does the Linux kernel run with unrestricted hardware access? Answer: Ring 0.
Keep going: ← Series overview · Lab 02 → · Track your progress in the Self Guide
ExerciseKnowledge check
In which CPU protection ring does the core monolithic Linux kernel execute? / Linux Kernel එක ක්රියාත්මක වන්නේ කුමන CPU Ring එක තුළද?
Finished this one?
Part of Self Guide · Stage 10: SRE Labs I — the machine underneath. Progress is saved in this browser.


