5102 - Foundations of Comp Sys
← 5102 - Foundations of Comp Sys
session: "5102-foundations-of-comp-sys/2026-08-29 0000 FCS 29 Aug"
title: "FCS 29 Aug"
date: "2026-08-29 00:00"
duration: "2h 35m"
language: "en"
model: "deepseek-ai/DeepSeek-V3.2"
parts: 4
transcript_chars: 84936
generated: "2026-11-23T15:13:48+05:30"
This class focused on practical system observation in a Linux environment, establishing the operating system's role as the manager of hardware resources (CPU, memory, disk, network) on behalf of applications. Students used a Python web application (systemlab) to generate specific loads and observed the resulting hardware utilization via command-line tools (ps, top, htop, mpstat, /proc). The session connected high-level cloud concepts (compute, storage) to low-level OS modules (scheduler, virtual memory, file system) and demonstrated how the OS abstracts physical hardware for applications.
ps, top, htop, mpstat, curl, watch) to monitor CPU, memory, and disk utilization of a running process./proc/[PID]/status and pmap.The OS acts as a middleman between application software and physical hardware. It provides abstractions (processes, virtual memory, files) and manages resources via dedicated modules: the scheduler for CPU time, virtual memory for RAM and swap, the file system for disk I/O, and the network stack for communication. This management is observable through system monitoring tools.
A process is a program loaded into memory. Tools like ps and top reveal its state (e.g., sleeping, running), resource consumption (%CPU, %MEM), and relationships (PPID). Understanding the difference between CPU time (actual processor cycles used) and elapsed time (total wall-clock time) is crucial for performance analysis. The OS scheduler decides which process runs on which CPU core.
The OS creates virtual abstractions (virtual CPUs, virtual memory addresses) for processes, but these are bounded by physical resources. Virtual CPU and memory cannot exceed the actual, physical CPU and RAM capacity. The /proc filesystem provides a window into how the kernel manages these virtual resources for each process.
The system employs a storage hierarchy: fast, volatile RAM (temporary) and slower, persistent disk (permanent). Swap memory extends RAM onto disk via paging. Performance demonstrations (writing to /tmp vs. allocating memory) show that memory access is orders of magnitude faster than disk access. Cache (L1, L2, L3) sits between CPU and RAM for even faster access (covered in a previous session).
Disk partitioning splits a physical disk into logical sections (sda1, sda2) for purposes like isolating the /boot partition or controlling data placement. Logical Volume Manager (LVM) allows flexible management of space within a partition, enabling dynamic resizing of logical volumes, which is a common practice in server and cloud environments.
No formulas were presented in this session.
sda) was partitioned into:sda1: 1 MB (type unknown).sda2: 2 GB, type extended, mounted at /boot.sda3: 58 GB, type LVM.sda3), 29 GB was allocated to a volume named ubuntu--vg-ubuntu--lv. The remaining 29 GB was unallocated.ps and /procsystemlab.py script had PID 1740, using 0.5% of 4 GB RAM.python3 (PID 1662), using 0.1% memory.python3 was the Unix shell (PID 1660).python3), /proc/1750/status showed:python3sleepingcurl localhost:8080/cpu?seconds=5top: Process CPU utilization spiked to 41.3% (user time).mpstat showed one CPU core reaching 100% user + 0% idle during load, causing the OS scheduler to start utilizing a second core.curl localhost:8080/memory?mb=512htop: System memory usage increased from 356 MB to ~868 MB.curl localhost:8080/memory?mb=1024Using systemlab.py to write data:
/tmp): 0.14 seconds (14 ms)./tmp failed due to insufficient space; the allocated temporary space was only 1.6 GB.loop device and the purpose of partitioning?loop device is created by the OS during installation to manage its own files. Partitioning (sda1, sda2, sda3) is for controlling data storage location, limiting application resource usage, and security (e.g., restricting access to /boot).t2.micro instance (1 vCPU, 1 GB RAM)? Do commands differ for other Linux variants?curl commands and outcomes will be the same. Learning Linux commands is beneficial but not strictly mandatory.ps, top, htop, and mpstat to monitor real-time process activity and system resource utilization (CPU, memory)./proc filesystem is a virtual interface to kernel and process data; /proc/[PID]/status contains vital process details like state and memory usage (VmSize, VmData)./boot partition).curl can generate specific loads (CPU, memory, disk) on a web server endpoint for observation and testing.systemd, PID 1) is the ancestor of all other processes and manages system services.1. Scenario: You run curl localhost:8080/cpu?seconds=10 and observe in top that the process uses 95% CPU. However, mpstat shows overall CPU idle time is 50%. Explain this apparent contradiction.
top percentage is per-core utilization. The process is likely pinned to a single core, using 95% of that core's capacity. mpstat shows an average across all cores. If the system has two cores, one core at 95% busy and the other mostly idle would average to ~47.5% busy, or 52.5% idle, matching the observation.2. A system has 8 GB of physical RAM. A process has a VmSize of 10 GB as reported in /proc/[PID]/status. Is this possible? Explain.
3. Describe the purpose of having a separate /boot partition on a Linux system's hard disk.
/boot partition contains the bootloader and kernel images. Keeping it separate isolates critical boot files from the main OS filesystem. This can prevent the main filesystem from becoming full and corrupting boot files, simplify recovery, and allow for different filesystem types optimized for booting./boot) - A small disk partition containing bootloader and kernel files, accessed first during system startup.systemd).mixed workload parameter for the systemlab.py server was not demonstrated due to a command error; the lecturer stated this would be covered in the next session.systemlab.py and prerequisite installation steps will be shared as a PDF via the course portal.
One line per segment, [hh:mm:ss] timestamp first.
loading…