classnotes RTX 4070 Ti SUPER · faster-whisper · DeepSeek

5102 - Foundations of Comp Sys

← 5102 - Foundations of Comp Sys

FCS_04 Oct

Date 2026-10-04 Length 3h 07m Words 20,180 Segments 2,158
⤓ Download transcript (.txt with timestamps) ⤓ Plain transcript (.txt) ⤓ Transcript (.md)

Summary


session: "5102-foundations-of-comp-sys/2026-10-04 0000 FCS 04 Oct"

title: "FCS 04 Oct"

date: "2026-10-04 00:00"

duration: "3h 07m"

language: "en"

model: "deepseek-ai/DeepSeek-V3.2"

parts: 5

transcript_chars: 111430

generated: "2026-11-23T15:42:50+05:30"


FCS 04 Oct

Overview

This class introduced the operating system's role as the manager between applications and physical hardware. It covered the complete chain from hardware to kernel to processes, establishing core OS pillars: the kernel, system calls, processes, scheduling, and context switching. The session distinguished between a passive program and an active process, detailed the process lifecycle and identification via PID, and explained the scheduler's role. It also explored the privilege boundary between user mode and kernel mode, the anatomy of a process, and categories of system calls. The discussion concluded with the kernel's role in managing specialized hardware like GPUs.

Learning outcomes

Core concepts

Operating System as Manager

The OS is the mandatory manager between applications (e.g., Word, PowerPoint) and the physical computer hardware (CPU, RAM, disk). No application can access hardware directly; all requests must be mediated by the OS kernel. This management ensures controlled, secure, and efficient resource sharing among multiple running programs.

Kernel

The kernel is the core, privileged part of the operating system that controls access to all computer resources (CPU, memory, devices). It is not the entire OS but its central manager. The kernel itself runs on the hardware and receives requests from applications, which it fulfills by managing hardware availability and initiating actions via system calls.

System Call

A system call is the controlled interface for a user-mode application to request services from the kernel. It is the mandatory entry point for performing privileged operations like opening files or creating processes. Crossing from user mode to kernel mode via a system call changes the CPU's privilege level. System calls are categorized (e.g., process control, file management, communication).

Process vs. Program

A program is a passive set of stored instructions (e.g., PowerPoint.exe on disk). A process is an active, executing instance of a program, with its own dedicated memory space and state. The OS creates a process via a system call (e.g., fork) and assigns it a unique Process ID (PID). Resource allocation (memory, CPU time) is granted to the process, not directly to the application.

Thread

A thread is a lightweight unit of execution within a process. Threads share the memory and resources (code, data, heap) of their parent process, making them faster and cheaper to create and terminate than independent processes. Context switching between threads is faster because they belong to the same process already in memory.

User Mode vs. Kernel Mode

This is a privilege boundary enforced by the CPU and OS. User mode is where applications and most utilities run, restricted from direct hardware access. Kernel mode is where the kernel executes, with full privilege to access hardware and system resources. A system call triggers the transition from user to kernel mode.

Process Anatomy

The OS maintains a distributed set of information to manage a single running process. Key components include: Process ID (PID), Program Counter (PC), CPU registers, stack (for function calls), heap (for dynamic memory), code/text, data, file descriptors, scheduling information, credentials, and parent-child links. This information is not stored in one contiguous block but across kernel data structures.

Scheduler

The scheduler is a component of the kernel (not a process itself) that monitors resource utilization and decides which ready process gets access to the CPU and for how long. It maps processes to available CPU cores. Scheduling priority typically follows: system processes > application processes, with further prioritization within system calls (e.g., write operations may get priority over reads).

Context Switching

The act of saving the execution state (PC, registers, etc.) of a currently running process and restoring the state of another process so it can run. This enables multitasking. Switching between processes has high overhead due to swapping the memory context, while switching between threads within the same process is faster.

Kernel Bypass

In specific high-performance scenarios (e.g., networking), applications can communicate directly with hardware like a Network Interface Card (NIC) to achieve lower latency and higher throughput, using techniques like RDMA (Remote Direct Memory Access). The kernel still allocates the resource initially, but control remains with the application. This is an exception, not a general rule for application-kernel interaction.

Formulas and maths

(No formulas were covered in this session.)

Worked examples

1. Concurrent Programs: The lecturer's laptop was running at least 4-5 programs in parallel: PowerPoint, a browser, Microsoft Teams, VMware, and other training-related applications.

2. System Call Flow for Opening a File: Opening resume.doc in Microsoft Word involves the application (in RAM) requesting the kernel via the fopen system call. The kernel coordinates reading the file from the hard disk and displaying its content.

3. Print Request Process Lifecycle: A print request gets a parent process ID (e.g., 5273). It creates a child process (e.g., 5279) to handle moving data from memory to printer memory. The parent (5273) waits. The child (5279) gets resources, transfers data, exits, and releases its resources. The parent then gets resources to confirm completion to the user, then also exits.

4. Process ID Examples: Different instances/tabs of the same application have different PIDs. Chrome tab 1 (Gmail) might have PID 101, Chrome tab 2 (AI tool) might have PID 102, a terminal PID 103.

5. File Descriptor Numbers: Standard descriptors are 0 for stdin (keyboard/mouse), 1 for stdout (monitor/printer), 2 for stderr. User-opened files start at descriptor 3.

6. Resource Allocation Policy: If a system has 64 MB free RAM and a policy reserves 32 MB for emergency system calls, a process may wait even with "free" memory available.

7. CPU Affinity: An application can be configured so that all its processes run only on the first three cores of the CPU.

8. Word Document Paging: The entire document is not loaded into RAM at once. Scrolling triggers system calls that create short-lived processes to fetch more data from disk to RAM via paging, after which the processes exit. The main winword.exe process runs continuously.

9. GPU Capability: A CPU might create 22 processes for an application, but a GPU with a higher capability might support 222 processes in parallel. The kernel needs to know this number to submit work appropriately.

Questions asked in class

1. Sorrow: Could not connect individual concepts (process, kernel, process state) in the flowchart. Asked for a description of the flow when opening an application like Microsoft Word.

2. Varun: Asked about thread vs. process, priority processes, and whether the scheduler is a process.

3. Sanjeev: How does the OS decide which process gets the CPU when 100 processes are running?

4. Mohit: Are fork, execute functions in a C program part of the OS/kernel?

5. Brajesh: How does kernel bypass work for devices like network cards?

6. Multiple Students: Are the system calls in the user-kernel diagram and the earlier chain diagram the same? Is the interaction bi-directional when more resources are needed? Does editing a Word doc require more processes? How does a process ID persist during context switches? What if required RAM exceeds available RAM? Can we see if a process is in user or kernel mode?

7. Anuj: Asked about GPU kernel alignment and optimizing distributed training via kernel programming.

8. Unnamed Student: Asked about loading a model and where optimizations ("optimization state") and data structure updates happen when data is loaded between GPU data structures.

Key takeaways

Exam-style questions

1. Describe the complete sequence of events, naming all OS components involved, when a user double-clicks a Word document icon to open it.

2. Compare and contrast processes and threads. List two advantages of using threads within a single application.

3. A system is running many applications and becomes sluggish. Using OS concepts, explain two possible reasons related to process management and resource allocation.

4. What is the difference between a C library function like fork() and the actual system call? Explain the role of the kernel in this scenario.

Glossary

Follow-ups

Transcript

One line per segment, [hh:mm:ss] timestamp first.

loading…