Summary
Highlights
The lecture introduces the second chapter, focusing on the structures of computing systems. Key topics include system functionality, input/output elements, memory structure and hierarchy, protection architectures, and network structures. The system bus, a crucial communication channel, is explained, detailing how components like the CPU and memory interact through it. The role of controllers as interfaces for devices with varying speeds is also discussed.
The concept of concurrency is introduced, distinguishing it from parallelism. Concurrency involves devices competing for limited resources, requiring formalisms to manage access and prevent conflicts. Each controller has a local buffer to temporarily store data, compensating for speed differences between devices like hard disks and printers. The CPU moves data between main memory and these buffers, and controllers use 'interrupts' – electrical signals – to notify the CPU of data transfer start and end, indicating events that require CPU attention.
The management of interrupts is detailed, emphasizing the operating system's role in storing return addresses for interrupted processes. The video differentiates between polling, a cyclical interrogation of devices, and interrupts, where devices signal the CPU when they need attention. Polling is simpler but resource-intensive in low-traffic scenarios, while interrupts are more efficient for low traffic but involve processing overhead. A modern operating system is largely 'interrupt-driven'.
A graphical representation illustrates how the CPU and I/O devices interact during data transfer, specifically focusing on process execution and data transfer activity. Vertical dashed lines symbolize interrupts. The CPU pauses its process execution upon an I/O request, the device prepares for data transfer (latency), performs the transfer, and then signals completion via another interrupt, allowing the CPU to resume or continue its work.
Data transfer methods are categorized into synchronous and asynchronous. Synchronous transfer requires both communicating devices to be actively involved simultaneously, causing the requesting process to suspend until completion. Asynchronous transfer, conversely, allows the requesting process to continue working after initiating the data transfer, with the device handling the data independently and notifying completion later. The operating system uses device status tables to manage and monitor I/O operations.
Direct Memory Access (DMA) is introduced as a mechanism that allows high-speed I/O devices to transfer data directly to and from main memory without involving the CPU. This frees up the CPU to perform other tasks, preventing it from being bogged down by simple data copying operations, especially beneficial for fast devices like hard disks.
The lecture explains memory classification, including primary memory (RAM) and secondary memory (hard disks). Hard disks store data persistently on magnetic surfaces, organized into tracks, cylinders, and sectors. A graphical depiction of an hard disk's internal structure with plates and read/write heads is provided. The concept of memory hierarchy is introduced, classifying memories based on speed, cost, and volatility, forming a pyramid structure from fastest (registers) to slowest (magnetic tapes).
The memory hierarchy is detailed: registers (fastest, inside CPU), cache (CPU cache for high-speed data access), main memory (RAM), RAM disk (RAM configured as a virtual disk for speed), magnetic disks, optical disks (CD-ROM), and magnetic tapes (slowest, highest capacity). The discussion also addresses the cache coherency problem, where the same data can exist in multiple memory locations (e.g., hard disk, RAM, cache, registers), posing a challenge for consistency, especially during power failures.
Protection architectures are introduced to safeguard the CPU, I/O devices, and memory from misuse. The 'dual-mode operation' allows the CPU to operate in two modes: user mode (for user programs) and kernel/system mode (for the operating system). A mode bit (0 for system, 1 for user) indicates the current operating mode. System calls are used by user programs to transition to kernel mode for privileged operations, ensuring the operating system's integrity.
All I/O instructions are privileged, meaning they can only be executed in kernel mode, preventing user programs from directly manipulating hardware. A diagram illustrates the flow of a system call, where a user program requests an I/O operation, temporarily transfers control to the operating system's kernel, and then resumes execution upon completion. Memory protection is achieved using base and limit registers, which define the legal memory address range for each program, preventing unauthorized access.
Hardware protection ensures that user processes cannot directly access devices like printers or hard disks. Instead, all device access is mediated by the operating system, which uses system mode to control and prevent conflicts among multiple processes. CPU protection is primarily achieved through timers, which set an execution time limit for each process. If a process exceeds its allotted time, it is interrupted, preventing any single process (e.g., a buggy program or virus) from monopolizing the CPU. This mechanism is fundamental to time-sharing systems.
An overview of network structures categorizes them into local area networks (LANs) and wide area networks (WANs), with metropolitan area networks (MANs) as an intermediate category. These classifications depend on geographical distribution and management. A local network's structure includes processing units (like small computers), printers, and network devices such as gateways, which connect different sub-networks.