π Lecture 38 β Data Manipulation: Communication media and communication rates
π Overview: This lecture explores how computing devices communicate through parallel and serial communication paths, examines the rates at which data is transferred, and introduces the concept of pipelining as a technique to improve processing speed. Understanding these communication methods and speed limitations is crucial for grasping modern computer architecture performance.
ποΈ Topics Covered
This lecture covers Direct Memory Access (DMA) and its impact on CPU efficiency and bus complexity, the von Neumann bottleneck, parallel vs serial communication methods, communication rates measured in bps, Kbps, Mbps, and Gbps, and the concept of pipelining including its five-stage instruction execution process and speed improvements.
π Lecture Summary
Direct Memory Access (DMA)
When reading a sector of a disk, the CPU can send requests encoded as bit patterns to the disk controller, asking it to read the sector and place the data in a specified area of main memory. The CPU can then continue with other tasks while the controller performs the read operation and deposits the data in main memory via DMA. Two activities happen simultaneously: the CPU executes a program while the controller oversees data transfer between disk and main memory. This prevents wasting CPU resources during the relatively slow data transfer.
π‘ Why this matters: DMA allows the CPU to work on other tasks instead of waiting for slow I/O operations, significantly improving system efficiency.
The use of DMA complicates communication over a computer's bus. Bit patterns must move between the CPU and main memory, between the CPU and each controller, and between each controller and main memory. Coordinating all this activity on the bus is a major design issue. Even with excellent designs, the central bus can become an impediment as the CPU and controllers compete for bus access. This impediment is known as the von Neumann bottleneck because it is a consequence of the underlying von Neumann architecture where a CPU fetches instructions from memory over a central bus.
π Definition β von Neumann bottleneck: The limitation on processing speed caused by the competition between CPU and controllers for access to the central bus in a von Neumann architecture.
43.1 Parallel Communication
In parallel communication, several signals are transferred at the same time, each on a separate line. This provides good data transfer but requires complex architecture.
π Definition β Parallel communication: A data transfer method where multiple signals are sent simultaneously over separate lines.
43.2 Serial Communication
In serial communication, data is transferred one bit after another. This requires a simple data path, but the data transfer rate is relatively slower than parallel communication. USB and FireWire are examples of high-speed data transfer over a short distance. Ethernet connections are used for slightly longer distances. Traditional voice lines dominated the PC arena for many years, using Modem (Modulator-demodulator) to convert bit patterns to audible tones. For faster long-distance communication, DSL (Digital Subscriber Line) and Cable Modems are used. Fiber Optics and Coaxial cables are used for high definition TV and computer networks.
π Definition β Serial communication: A data transfer method where bits are transmitted one at a time over a single communication line.
π Definition β Modem: A modulator-demodulator device that converts digital bit patterns to audible tones for transmission over voice telephone lines and vice versa.
Communication Rates
The rate at which bits are transferred from one computing component to another is measured in bits per second (bps). Common units include:
- Kbps (Kilo bits per second)
- Mbps (Million bits per second)
- Gbps (Billion bits per second)
- 8 kbps = 1 KB per second
- USB and FireWire provide several hundred Mbps.
π Formula: 8 kbps = 1 KB per second β To convert bits per second to bytes per second, divide by 8.
44. Pipelining
Electric pulses travel through a wire no faster than the speed of light. Since light travels approximately 1 foot in a nanosecond (one billionth of a second), it requires at least 2 nanoseconds for the CPU to fetch an instruction from a memory cell that is 1 foot away. (The read request must be sent to memory, requiring at least 1 nanosecond, and the instruction must be sent back to the CPU, requiring at least another nanosecond.) Consequently, to fetch and execute an instruction requires several nanoseconds, meaning that increasing execution speed is limited by physical constraints.
The key to speeding up execution is pipelining, which breaks an instruction into smaller steps that can be performed by separate units. Machine cycle steps are performed by independent units, each devoted to a specific task. The pipelining technique allows multiple instructions to be in different stages of execution simultaneously.
Pipelining divides instruction processing into five stages:
- F β Fetch instruction from memory
- D β Decode the instruction
- OP β Fetch operands from registers or memory
- E β Execute the operation
- OS β Store the result back in memory
In a non-pipelined architecture, only one instruction is processed at a time. With pipelining, while one instruction is being decoded, the next instruction is being fetched. This overlapping of operations increases throughput. The speed improvement is roughly equal to the number of stages in the pipeline, though various hazards can reduce this theoretical maximum.
π Definition β Pipelining: A technique where instruction processing is divided into independent stages performed by separate units, allowing multiple instructions to be in different stages of execution simultaneously.
π Example: With a five-stage pipeline, while instruction A is being executed (Stage E), instruction B can be fetching operands (Stage OP), instruction C can be decoding (Stage D), and instruction D can be fetching (Stage F). This allows up to 5 instructions to be in various stages of processing at the same time, significantly increasing throughput.
β Key Takeaways
The von Neumann bottleneck is a fundamental limitation where CPU and device controllers compete for bus access, reducing system performance. DMA addresses this by allowing controllers to transfer data directly to memory, freeing the CPU for other tasks. Parallel communication offers faster data transfer but requires more complex architecture, while serial communication is simpler but slower. Communication rates are measured in bps with modern connections like USB providing several hundred Mbps. Pipelining is the primary technique for increasing processing speed by breaking instruction execution into five stages (Fetch, Decode, Operand fetch, Execute, Operand store) that operate on different instructions simultaneously, with speed improvement roughly proportional to the number of pipeline stages.
π§ Quick Revision Questions
- What is the von Neumann bottleneck and how does it affect system performance?
- Explain the difference between parallel and serial communication in terms of architecture complexity and data transfer rate.
- How many nanoseconds are required for the CPU to fetch an instruction from a memory cell 1 foot away?
- What are the five stages of instruction processing in a pipelined architecture?
- How many bits per second equal 1 Kilobyte per second?
π Lecture 39 β Module 45. Operating Systems: History
π Overview: This lecture explores the historical evolution of operating systems from the inefficient, manually-operated computers of the 1940sβ1950s to the development of batch processing systems. It explains how early operating systems solved problems of resource sharing and job management, and introduces key concepts like job queues, FIFO ordering, and job control languages that remain foundational to modern computing.
ποΈ Topics Covered
The lecture covers the inefficiencies of early computing environments and the transition from isolated job execution to shared machines managed by operators. It explains the origins of batch processing and the role of the operating system in streamlining job transitions. Key concepts include job queues with FIFO (first-in, first-out) structure, job priorities, and job control languages (JCL) used to communicate setup instructions. The section on pipelining as a technique for increasing throughput is also introduced briefly.
π Lecture Summary
Pipelining and Throughput
Increasing execution speed is not the only way to improve a computerβs performance. The real goal is to improve the machineβs throughput, which refers to the total amount of work the machine can accomplish in a given amount of time.
An example of how throughput can be increased without increasing execution speed involves pipelining, which is the technique of allowing the steps in the machine cycle to overlap. In particular, while one instruction is being executed, the next instruction can be fetched, meaning more than one instruction can be in βthe pipeβ at any one time, each at a different stage of being processed. This increases total throughput even though the time required to fetch and execute each individual instruction remains the same.
π‘ Why this matters: When a JUMP instruction is reached, any gain from prefetching is not realized because the instructions in βthe pipeβ are not the ones needed after all.
π Definition β Throughput: The total amount of work a machine can accomplish in a given amount of time. π Concept: Pipelining β Allowing steps in the machine cycle to overlap, so while one instruction is executed, the next can be fetched. π Example: If a machine takes 5 nanoseconds to fetch an instruction and 5 nanoseconds to execute it, pipelining does not reduce the 10-nanosecond total per instruction, but it allows a new instruction to start every 5 nanoseconds, effectively doubling throughput.
Operating Systems: History
Todayβs operating systems are large, complex software packages that have grown from humble beginnings. The computers of the 1940s and 1950s were not very flexible or efficient. Machines occupied entire rooms. Program execution required significant preparation of equipment in terms of mounting magnetic tapes, placing punched cards in card readers, setting switches, and so on.
The execution of each program, called a job, was handled as an isolated activityβthe machine was prepared for executing the program, the program was executed, and then all the tapes, punched cards, etc. had to be retrieved before the next program preparation could begin. When several users needed to share a machine, sign-up sheets were provided so that users could reserve the machine for blocks of time. During the time period allocated to a user, the machine was totally under that userβs control.
π Definition β Job: A single program execution handled as an isolated activity in early computing.
Batch Processing
In such an environment, operating systems began as systems for simplifying program setup and for streamlining the transition between jobs. One early development was the separation of users and equipment, which eliminated the physical transition of people in and out of the computer room. A computer operator was hired to operate the machine. Anyone wanting a program run was required to submit it, along with any required data and special directions about the programβs requirements, to the operator and return later for the results.
The operator loaded these materials into the machineβs mass storage where a program called the operating system could read and execute them one at a time. This was the beginning of batch processingβthe execution of jobs by collecting them in a single batch, then executing them without further interaction with the user.
π Definition β Batch Processing: The execution of jobs by collecting them in a single batch, then executing them without further interaction with the user.
Job Queues and FIFO
In batch processing systems, the jobs residing in mass storage wait for execution in a job queue. A queue is a storage organization in which objects (in this case, jobs) are ordered in first-in, first-out (FIFO) fashion. That is, the objects are removed from the queue in the order in which they arrived. In reality, most job queues do not rigorously follow the FIFO structure, since most operating systems provide for consideration of job priorities. As a result, a job waiting in the job queue can be bumped by a higher-priority job.
π Definition β Queue: A storage organization in which objects are ordered in first-in, first-out (FIFO) fashion. π Definition β FIFO (First-In, First-Out): The principle that objects are removed from a queue in the order in which they arrived.
Job Control Language (JCL)
In early batch-processing systems, each job was accompanied by a set of instructions explaining the steps required to prepare the machine for that particular job. These instructions were encoded, using a system known as a job control language (JCL), and stored with the job in the job queue. When the job was selected for execution, the operating system printed these instructions at a printer where they could be read and followed by the computer operator. This communication between the operating system and the computer operator is still seen today, as witnessed by PC operating systems that report such errors as "network not available" and "printer not responding."
π Definition β Job Control Language (JCL): A system for encoding instructions that explain the steps required to prepare the machine for a particular job.
β Key Takeaways
Pipelining improves computer throughput by overlapping instruction fetch and execute cycles, even though individual instruction speed remains unchanged; however, JUMP instructions can negate this gain by invalidating prefetched instructions. Early computers (1940sβ1950s) required manual setup for each job and used sign-up sheets for time-sharing, leading to inefficient isolated execution. Batch processing emerged with a hired computer operator and an operating system to streamline job transitions, collecting jobs into a queue for sequential execution without user interaction. Job queues use FIFO ordering, but priority systems allow higher-priority jobs to bypass lower-priority ones. Job control languages (JCL) encoded setup instructions that were printed for the operator to follow, foreshadowing modern OS error messages.
π§ Quick Revision Questions
- What is throughput, and how does pipelining improve it without increasing execution speed?
- Why does a JUMP instruction negate the benefits of pipelining?
- What problem did early batch processing solve compared to the sign-up sheet approach of the 1940sβ1950s computers?
- How does a job queue differ from strict FIFO ordering in practice?
- What was the purpose of job control language (JCL) in early batch-processing systems?
π Lecture 40 β Operating Systems: Basic Concepts (I)
π Overview: This lecture explains the evolution from batch processing to interactive processing in operating systems, driven by user needs for real-time interaction. It covers key concepts like real-time processing, time-sharing, multi-programming, and multitasking, which are foundational for understanding modern OS design.
ποΈ Topics Covered
The lecture begins by discussing the drawbacks of using a computer operator as an intermediary, leading to the need for interactive processing. It then covers coordination with the user, the need for fast response times, and the concept of real-time processing. Finally, it explains time-sharing, multi-programming, and multitasking as solutions to service multiple users and tasks efficiently.
π Lecture Summary
Coordination with User
A major drawback of using a computer operator as an intermediary is that users have no interaction with their jobs once submitted. This approach is acceptable for applications like payroll processing, where data and decisions are established in advance. However, it is not acceptable for interactive applications such as reservation systems, word processing, and computer games. To address this, new operating systems were developed to allow a program to carry on a dialogue with the user through remote terminalsβa feature known as interactive processing. A terminal originally consisted of an electronic typewriter, but today terminals have evolved into workstations or complete PCs.
π‘ Why this matters: Interactive processing transformed computing from a batch-oriented service to a responsive, user-driven experience.
π Definition β Interactive Processing: A feature of operating systems that allows a program being executed to carry on a dialogue with the user through remote terminals. π Formula: N/A π Example: In a word processing system, users can dynamically write and rewrite documents, interacting with the program in real-time.
Successfully interactive processing requires responding to users with sufficiently fast time. Different tasks have different time requirements; for example, printing a record of all students at VU versus typing characters in word processing. Execution of tasks may also be under a deadline.
Real-time Processing
Real-time processing is when a computer performs tasks in accordance with the deadlines in its external real-world environment. This is critical for systems that must respond within strict time constraints.
π Definition β Real-time Processing: A mode of computer operation where tasks are performed to meet deadlines set by the external real-world environment. π Formula: N/A π Example: A Cruise Missile or Radar system must process sensor data and respond within milliseconds to avoid failure.
Interactive system and Real-time Processing
If a system is servicing only one user, real-time processing was relatively easier to implement. However, computers in the 1960s and 1970s were expensive, so each machine had to serve more than one user at remote terminals. This led to the need for operating systems that could handle multiple interactive users simultaneously.
Time Sharing
Based on the problem of servicing multiple users, operating systems were designed to service multiple users at the same timeβcalled time-sharing. A time-sharing system manages jobs in states such as Active, Ready, and Waiting, as illustrated in Figure 52. The system rapidly switches between jobs to give each user the illusion of dedicated access.
π Definition β Time-Sharing: An operating system technique that services multiple users at the same time, typically using small time intervals to ensure each user gets a fair share of CPU time.
Multi-programming
Multi-programming is one way of implementing time-sharing. It uses small time intervals, and each job is executed for such a small interval that it appears all jobs run simultaneously. Early time-sharing systems were able to service 30 users simultaneously using multi-programming.
π Definition β Multi-programming: A technique for implementing time-sharing where the CPU executes each job for a very small time interval, rapidly switching between jobs. π Formula: N/A π Example: An early time-sharing system could service 30 users simultaneously by giving each user a tiny slice of CPU time in rapid succession.
Multitasking
Multitasking refers to a single user executing several tasks simultaneously on their own workstation or PC. Unlike time-sharing, which focuses on multiple users, multitasking focuses on a single user running multiple applications or processes at once.
π Definition β Multitasking: The ability of an operating system to allow a single user to execute several tasks simultaneously. π Formula: N/A π Example: A user can run a web browser, a word processor, and a music player at the same time on a PC.
β Key Takeaways
The evolution from batch processing to interactive processing was driven by the need for real-time user interaction, such as in reservation systems and word processing. Real-time processing requires the system to meet strict deadlines from the external environment, as seen in cruise missiles or radar systems. Time-sharing was developed to service multiple interactive users simultaneously, using multi-programming to switch between jobs in small time intervals. Multi-programming is a key implementation method for time-sharing, allowing earlier systems to support up to 30 users. Finally, multitasking extends this concept to a single user running multiple tasks simultaneously on a modern PC.
π§ Quick Revision Questions
- What is the main drawback of using a computer operator as an intermediary, and for which applications is it still acceptable?
- Define interactive processing and give two examples of applications that require it.
- What is real-time processing, and provide one example from the lecture?
- How does time-sharing solve the problem of expensive computers in the 1960s and 1970s?
- What is the difference between multi-programming and multitasking?
π Lecture 41 β Operating Systems: Basic Concepts (II) / Operating Systems: Software Classification
π Overview: This lecture continues the discussion on operating systems by examining their historical evolution from simple program executors to complex systems managing time-sharing, multiprocessor machines, and embedded systems. It then introduces a fundamental software classification, dividing software into application software and system software, with the latter comprising the operating system and utility software.
ποΈ Topics Covered
The lecture covers the evolution of operating systems from multiuser, time-sharing systems to modern multiprocessor systems with load balancing and scaling, and the rise of embedded operating systems for dedicated devices. It then presents a classification of software into application software (task-specific programs) and system software (common infrastructure), further dividing system software into the operating system itself and utility software that extends its capabilities.
π Lecture Summary
Module 47: Operating Systems: Basic Concepts (II)
With the development of multiuser, time-sharing operating systems, a typical computer installation was configured as a large central computer connected to numerous workstations. Users could communicate directly with the computer from outside the computer room, rather than submitting requests to a computer operator. Commonly used programs were stored in the machine's mass storage devices, and operating systems were designed to execute these programs as requested from the workstations. The role of a computer operator as an intermediary between users and the computer began to fade.
Today, the existence of a computer operator has essentially disappeared, especially in the arena of personal computers where the user assumes all responsibilities of computer operation. Even most large computer installations run essentially unattended. The job of computer operator has given way to that of a system administrator who manages the computer systemβobtaining and overseeing the installation of new equipment and software, enforcing local regulations (issuing new accounts, establishing mass storage space limits for various users), and coordinating efforts to resolve problemsβrather than operating the machines in a hands-on manner.
π‘ Why this matters: This shift from operator to system administrator reflects the automation and user-friendliness of modern operating systems, making computers accessible to non-experts.
In short, operating systems have grown from simple programs that retrieved and executed programs one at a time into complex systems that coordinate time-sharing, maintain programs and data files in the machine's mass storage devices, and respond directly to user requests. The evolution continues. The development of multiprocessor machines has led to operating systems that provide time-sharing/multitasking capabilities by assigning different tasks to different processors as well as by sharing the time of each single processor. These operating systems must handle problems such as load balancing (dynamically allocating tasks to various processors so that all processors are used efficiently) and scaling (breaking tasks into a number of subtasks compatible with the number of processors available).
π Definition β Load balancing: Dynamically allocating tasks to various processors so that all processors are used efficiently. π Definition β Scaling: Breaking tasks into a number of subtasks compatible with the number of processors available.
Another direction of research focuses on devices dedicated to specific tasks such as medical devices, vehicle electronics, home appliances, cell phones, or other hand-held computers. The computer systems found in these devices are known as embedded systems. Embedded operating systems are often expected to conserve battery power, meet demanding real-time deadlines, or operate continuously with little or no human oversight. Examples include VxWORKS (developed by Wind River Systems, used in the Mars Exploration Rovers named Spirit and Opportunity), Windows CE (also known as Pocket PC, developed by Microsoft), and Palm OS (developed by PalmSource, Inc., for hand-held devices).
π Definition β Embedded systems: Computer systems found in dedicated devices such as medical devices, vehicle electronics, home appliances, cell phones, or other hand-held computers. π Definition β Embedded operating systems: Operating systems for embedded systems, often expected to conserve battery power, meet demanding real-time deadlines, or operate continuously with little or no human oversight.
Module 48: Operating Systems: Software Classification
Let us divide a machine's software into two broad categories: application software and system software (see Figure 53). Application software consists of the programs for performing tasks particular to the machine's utilization. A machine used to maintain inventory for a manufacturing company will contain different application software from that on a machine used by an electrical engineer. Examples of application software include spreadsheets, database systems, desktop publishing systems, accounting systems, program development software, and games.
π Definition β Application software: The programs for performing tasks particular to the machine's utilization.
In contrast to application software, system software performs those tasks that are common to computer systems in general. In a sense, the system software provides the infrastructure that the application software requires, in much the same manner as a nation's infrastructure (government, roads, utilities, financial institutions, etc.) provides the foundation on which its citizens rely for their individual lifestyles.
π Definition β System software: Software that performs tasks common to computer systems in general, providing the infrastructure required by application software.
Within the class of system software are two categories: one is the operating system itself and the other consists of software units collectively known as utility software. The majority of an installation's utility software consists of programs for performing activities that are fundamental to computer installations but not included in the operating system. In a sense, utility software consists of software units that extend (or perhaps customize) the capabilities of the operating system. For example, the ability to format a magnetic disk or to copy a file from a magnetic disk to a CD is often not implemented within the operating system itself but is provided by means of a utility program. Other instances of utility software include software to compress and decompress data, software for playing multimedia presentations, and software for handling network communication.
π Definition β Utility software: Software units within system software that perform fundamental activities not included in the operating system, extending or customizing the operating system's capabilities.
Implementing certain activities as utility software allows system software to be customized to the needs of a particular installation more easily than if they were included in the operating system. Indeed, it is common to find companies or individuals who have modified, or added to, the utility software that was originally provided with their machine's operating system.
π‘ Why this matters: This modular approach (operating system + utility software) allows flexibility and customization without altering the core operating system.
β Key Takeaways
The evolution of operating systems has moved from simple program executors to complex systems managing time-sharing on multiprocessor machines, requiring solutions for load balancing and scaling, and specialized embedded operating systems for dedicated devices like medical equipment and hand-held computers. Software is classified into application software (task-specific, e.g., spreadsheets, games) and system software (common infrastructure), with system software further divided into the operating system (core coordination) and utility software (extending capabilities, e.g., disk formatting, data compression). The role of the computer operator has been replaced by the system administrator, who manages the system rather than hands-on operation.
π§ Quick Revision Questions
- What replaced the role of the traditional computer operator, and what are this person's main responsibilities?
- Define load balancing and scaling in the context of multiprocessor operating systems.
- What are embedded systems and embedded operating systems? Name two examples of embedded operating systems.
- What is the difference between application software and system software? Provide two examples of each.
- What is utility software, and why is it beneficial to implement certain activities as utility programs rather than within the operating system itself?
π Lecture 42 β Module 49: Operating Systems: Components (I)
π Overview: This lecture introduces the fundamental components of an operating system, beginning with the user interface. It explains the evolution from text-based shells to modern graphical user interfaces (GUIs) and highlights the distinction between the user interface and the internal operating system core. The window manager is presented as a critical component within modern GUI shells.
ποΈ Topics Covered
The lecture covers the role of the user interface in an operating system, comparing older shells (text-based communication) with modern graphical user interfaces (GUIs) that use icons and pointing devices. It discusses how some operating systems allow users to choose between different interfaces (e.g., UNIX shells, Windows cmd.exe, Apple Terminal). Finally, it introduces the window manager as a key component within GUI shells, responsible for managing screen space and application windows.
π Lecture Summary
49. Operating Systems: Components (I)
To perform user requests, an operating system must communicate with its users. The portion handling this communication is the user interface. Older interfaces, called shells, communicated via text messages on a keyboard and monitor. Modern systems use a graphical user interface (GUI) where objects like files and programs are represented as icons on the display. Users can issue commands via devices like a mouse (clicking or dragging icons), styluses (used by graphic artists or on handheld devices), or touch screens (allowing finger manipulation). Current research explores three-dimensional interfaces using 3D projection, tactile sensory devices, and surround sound.
π Definition β Shell: An older type of user interface that communicates with users through textual messages using a keyboard and monitor screen. π Definition β Graphical User Interface (GUI): A modern user interface where objects to be manipulated (e.g., files and programs) are represented pictorially on the display as icons, allowing commands via input devices like a mouse, stylus, or touch screen. π‘ Why this matters: The choice of user interface directly affects how efficiently a user can interact with the computer. The evolution from shells to GUIs and now to 3D interfaces reflects the goal of making computers more intuitive and accessible.
The user interface is only an intermediary; the real heart of the operating system is internal. This distinction is emphasized because some OSes allow users to select among different interfaces. For example, UNIX users can choose from shells like the Bourne shell, C shell, or Korn shell, as well as a GUI called X11. Early Microsoft Windows was a GUI loaded from the MS-DOS command shell; the DOS cmd.exe shell still exists in modern Windows as a utility. Apple's OS X retains a Terminal utility shell from its UNIX ancestors.
π Definition β Bourne shell / C shell / Korn shell: Examples of textual shells available in the UNIX operating system. π Definition β X11: A graphical user interface (GUI) available for the UNIX operating system. π Example: A user running the UNIX operating system can decide to use the C shell for command-line tasks and switch to the X11 GUI for graphical applications, demonstrating the flexibility of choosing between different user interfaces.
A critical component within modern GUI shells is the window manager. It allocates blocks of space on the screen called windows and tracks which application is associated with each window. When an application wants to display something, it notifies the window manager, which places the image in the correct window. When a mouse button is clicked, the window manager computes the mouse's location and notifies the appropriate application. Window managers define the "style" of a GUI and offer configurable choices. Linux users can choose from multiple window managers, such as KDE and Gnome.
π Definition β Window manager: A component within a GUI shell that allocates screen space into windows, keeps track of which application is associated with each window, and routes display requests and mouse actions to the correct application. π Definition β KDE / Gnome: Popular window manager choices available for Linux users, each defining a distinct GUI style. π Example: When a user opens a web browser on a Linux system, the window manager (e.g., Gnome) creates a new window on the screen. If the user clicks inside that window, the window manager calculates the click location (e.g., over a "Close" button) and sends the mouse action to the web browser application for processing.
β Key Takeaways
The user interface is the visible part of an OS, but it is separate from the operating system's internal core. Students must remember the evolution from text-based shells (like the Bourne shell in UNIX or cmd.exe in Windows) to modern GUIs (like Windows or X11). The window manager is a crucial component within a GUI, allocating screen windows and routing inputs to the correct application. Some operating systems, like UNIX and Linux, allow users to choose between different shells and window managers (e.g., KDE, Gnome), demonstrating the modularity of OS design.
π§ Quick Revision Questions
- What is the difference between a "shell" and a "graphical user interface (GUI)" in the context of operating systems?
- Name two different user interfaces that a UNIX user can select from.
- What is the primary function of a window manager within a GUI shell?
- How does a window manager handle a mouse click on the screen?
- Give two examples of window managers available for Linux users.
π Lecture 43 β Operating Systems: Components (II)
π Overview: This lecture explores the internal components of an operating system's kernel, detailing how the file manager, device drivers, memory manager, scheduler, and dispatcher work together to manage computer resources. Understanding these kernel components is crucial for comprehending how operating systems handle file storage, peripheral communication, memory allocation, and multitasking.
ποΈ Topics Covered
The lecture covers the kernel as the internal part of an OS, including the file manager's role in mass storage and directory hierarchies, device drivers for peripheral communication, the memory manager's coordination of main memory including paging and virtual memory, and an introduction to the scheduler and dispatcher for multiprogramming.
π Lecture Summary
Operating Systems: Components (II)
In contrast to an operating system's user interface, the internal part of an operating system is called the kernel. An operating system's kernel contains those software components that perform the very basic functions required by the computer installation.
The File Manager
One such unit is the file manager, whose job is to coordinate the use of the machine's mass storage facilities. More precisely, the file manager maintains records of all the files stored in mass storage, including where each file is located, which users are allowed to access the various files, and which portions of mass storage are available for new files or extensions to existing files. These records are kept on the individual storage medium containing the related files so that each time the medium is placed online, the file manager can retrieve them and thus know what is stored on that particular medium.
For the convenience of the machine's users, most file managers allow files to be grouped into a bundle called a directory or folder. This approach allows a user to organize his or her files according to their purposes by placing related files in the same directory. Moreover, by allowing directories to contain other directories, called subdirectories, a hierarchical organization can be constructed. For example, a user may create a directory called MyRecords that contains sub-directories called FinancialRecords, MedicalRecords, and HouseHoldRecords. Within each of these subdirectories could be files that fall within that particular category.
A chain of directories within directories is called a directory path. Paths are often expressed by listing the directories along the path separated by slashes. For instance, animals/prehistoric/dinosaurs would represent the path starting at the directory named animals, passing through its subdirectory named prehistoric, and terminating in the sub-subdirectory dinosaurs. (For Windows users the slashes in such a path expression are reversed as in animals\prehistoric\dinosaurs.)
Any access to a file by other software units is obtained at the discretion of the file manager. The procedure begins by requesting that the file manager grant access to the file through a procedure known as opening the file. If the file manager approves the requested access, it provides the information needed to find and to manipulate the file.
π Definition β Directory/Folder: A bundle of files grouped together for organizational purposes. π Definition β Subdirectory: A directory contained within another directory, enabling hierarchical organization. π Definition β Directory Path: A chain of directories within directories, expressed by listing them separated by slashes. π Definition β Opening the File: The procedure of requesting the file manager to grant access to a file.
π Example: A user creates a directory called MyRecords containing subdirectories FinancialRecords, MedicalRecords, and HouseHoldRecords. The path animals/prehistoric/dinosaurs represents a chain from the animals directory through prehistoric to dinosaurs.
Device Drivers
Another component of the kernel consists of a collection of device drivers, which are the software units that communicate with the controllers (or at times, directly with peripheral devices) to carry out operations on the peripheral devices attached to the machine. Each device driver is uniquely designed for its particular type of device (such as a printer, disk drive, or monitor) and translates generic requests into the more technical steps required by the device assigned to that driver.
For example, a device driver for a printer contains the software for reading and decoding that particular printer's status word as well as all the other handshaking details. Thus, other software components do not have to deal with those technicalities in order to print a file. Instead, the other components can merely rely on the device driver software to print the file and let the device driver take care of the details. In this manner, the design of the other software units can be independent of the unique characteristics of particular devices. The result is a generic operating system that can be customized for particular peripheral devices by merely installing the appropriate device drivers.
π Definition β Device Driver: Software units that communicate with controllers or peripheral devices to carry out operations on attached peripherals.
π‘ Why this matters: Device drivers ensure that operating systems can work with any peripheral device without requiring changes to the core OS, making the system generic and customizable.
The Memory Manager
Still another component of an operating system's kernel is the memory manager, which is charged with the task of coordinating the machine's use of main memory. Such duties are minimal in an environment in which a computer is asked to perform only one task at a time. In these cases, the program for performing the current task is placed at a predetermined location in main memory, executed, and then replaced by the program for performing the next task.
However, in multiuser or multitasking environments in which the computer is asked to address many needs at the same time, the duties of the memory manager are extensive. In these cases, many programs and blocks of data must reside in main memory concurrently. Thus, the memory manager must find and assign memory space for these needs and ensure that the actions of each program are restricted to the program's allotted space. Moreover, as the needs of different activities come and go, the memory manager must keep track of those memory areas no longer occupied.
The task of the memory manager is complicated further when the total main memory space required exceeds the space actually available in the computer. In this case the memory manager may create the illusion of additional memory space by rotating programs and data back and forth between main memory and mass storage (a technique called paging). Suppose, for example, that a main memory of 8GB is required but the computer only has 4GB. To create the illusion of the larger memory space, the memory manager reserves 4GB of storage space on a magnetic disk. There it records the bit patterns that would be stored in main memory if main memory had an actual capacity of 8GB. This data is divided into uniform sized units called pages, which are typically a few KB in size. Then the memory manager shuffles these pages back and forth between main memory and mass storage so that the pages that are needed at any given time are actually present in the 4GB of main memory. The result is that the computer is able to function as though it actually had 8GB of main memory. This large "fictional" memory space created by paging is called virtual memory.
π Definition β Memory Manager: The kernel component that coordinates the use of main memory, including allocation and deallocation. π Definition β Paging: A technique where data is divided into uniform pages and rotated between main memory and mass storage to create the illusion of more memory. π Definition β Page: Uniform sized units of data (typically a few KB) used in paging. π Definition β Virtual Memory: The large "fictional" memory space created by paging that allows a computer to function as though it had more main memory than physically available.
π Example: With 4GB physical memory but 8GB required, the memory manager reserves 4GB on disk, divides data into pages, and shuffles pages between main memory and disk so needed pages are always in the 4GB physical memory, creating the illusion of 8GB virtual memory.
Scheduler and Dispatcher
Two additional components within the kernel of an operating system are the scheduler and dispatcher, which will be studied in the next section. For now, it is noted that in a multiprogramming system the scheduler determines which activities are to be considered for execution, and the dispatcher controls the allocation of time to these activities.
π‘ Why this matters: The scheduler and dispatcher are essential for managing multiple programs sharing the CPU, enabling efficient multitasking and fair resource allocation.
β Key Takeaways
Students must remember that the kernel is the internal core of an OS containing essential components: the file manager coordinates mass storage and file access through directories, subdirectories, and directory paths; device drivers act as translators between generic OS requests and specific peripheral hardware; the memory manager handles main memory allocation in multitasking environments and uses paging to create virtual memory when physical memory is insufficient; and the scheduler determines which activities to execute while the dispatcher allocates CPU time. Understanding these components is fundamental for grasping how operating systems manage resources and enable multitasking.
π§ Quick Revision Questions
- What is the difference between a directory and a subdirectory in a file system?
- How does a device driver enable a generic operating system to work with various peripherals?
- What problem does paging solve, and how does it create virtual memory?
- What are the roles of the scheduler and dispatcher in a multiprogramming system?
- Describe the process of opening a file and the file manager's role in this procedure.