Top Banner Ad

BCS401 — Unit 1: Introduction

Table of Contents (19 sections)

BCS401 · Operating system · Unit 1

Introduction

Unit Scope & Exam Weightage: This unit covers Operating system and functions, classification into Batch / Interactive / Time sharing / Real Time / Multiprocessor / Multiuser / Multiprocess / Multithreaded systems, layered OS structure and system components, OS services, reentrant kernels, and monolithic vs. microkernel design. In AKTU's 70-mark even-semester paper, expect 2–7 marks from Section A (definitions such as batch system, layered advantage) and one 7-mark Section B/C question on classification, services, or kernel architecture.


Importance-Wise Roadmap (BCS401 Unit 1)

Priority Exact Syllabus Topic PYQ Evidence Marks Pattern Preparation Tag
1 Classification of Operating Systems (Batch, Interactive, Time Sharing, Real Time, Multi-user, Multiprocessor) 2023-24, 2024-25, 2025-26 7m + 2m Highest yield
2 OS Structure — Layered architecture & System components 2023-24, 2025-26 7m + 2m Diagram question
3 OS Services and Functions (two categories) 2023-24, 2025-26 7m + 2m Repeat cluster
4 Monolithic and Microkernel systems 2025-26 7m Comparison
5 Time sharing vs. Multiprogramming; Multiuser vs. Multiprocessing 2023-24 7m + 7m Contrast
6 Special numerical: processor–program assignment 2024-25 2m Counting
7 Reentrant kernels, Multiprocess / Multithreaded systems Not directly asked Predicted 2–7m Backup theory

OS-specific examiner guidance: For every 7-mark classification answer, write the definition → distinguishing parameter → one real system example for each type. A bare list of names scores poorly; naming MS-DOS (batch/single-user), UNIX (time-sharing/multiuser), VxWorks (real-time), and Linux on a multicore laptop (multiprocessor, multithreaded) converts a list into a full answer.


1. What an Operating System Is and What It Does

Operating System (OS): A system program that acts as an intermediary between the user and the computer hardware. It manages hardware resources (CPU, memory, devices, files) and provides a convenient, safe, efficient environment for application programs.

1.1 Two Views of the OS

View Meaning Typical 2-mark wording
Resource allocator Decides which process gets CPU time, memory frames, I/O devices, and for how long "The OS allocates resources fairly and efficiently."
Control program Monitors execution, prevents errors and unauthorized access, controls I/O devices "The OS controls the execution of user programs."
User interface CLI / GUI / touch interface through which the user communicates "The OS provides a convenient interface."

1.2 Primary Functions (2-mark and 7-mark anchor)

  1. Process management: create/delete processes, schedule the CPU, suspend/resume, synchronize and provide deadlock handling.
  2. Memory management: keep track of main memory, allocate/deallocate space, protect address spaces, support virtual memory.
  3. File management: create/delete files and directories, map logical file names to physical blocks, protect data.
  4. Device management: device drivers, buffering, spooling, interrupt handling, DMA control.
  5. Storage / secondary management: free-space management, disk scheduling, RAID.
  6. Protection and security: user authentication, access control, auditing.
  7. System protection & networking (in distributed OS): communication between nodes, remote access.
  8. User interface and system calls: command interpreter, GUI, API for programs.

PYQ (2023-24 & 2024-25, 2 marks): "What are the primary functions of an operating system?" Answer any four functions with one line each: process, memory, file, device management; add protection and user interface for a full 2 marks. Begin with the intermediary definition.


2. Classification of Operating Systems

2.1 Batch, Interactive, and Time-Sharing Systems

Type Working principle Strength Weakness Real example
Batch Similar jobs are grouped into a batch and executed without user interaction; a resident monitor reads the next job card High CPU utilization for repetitive jobs No user feedback; long turnaround for a small job Early IBM 1401 card readers; payroll runs
Interactive User issues a command and gets an immediate response; request–reply cycle Short response time; user controls execution CPU idle while user thinks, if only one user MS-DOS shell, early microcomputers
Time-sharing CPU is switched rapidly among many users/processes using time slices (quanta) Many users appear to have their own machine; high interactivity Needs scheduling and security; overhead of context switches UNIX, Linux multi-user shells
Real-time Correctness depends on meeting a strict deadline; hard RT may never miss, soft RT may occasionally miss Predictable timing Throughput may be lower; costly design VxWorks in avionics, robot controllers
Multiprogrammed Several jobs reside in memory; when one waits for I/O, CPU switches to another Keeps CPU busy Not inherently interactive; no fairness guarantee Typical mainframe OS

Batch processing system (PYQ 2023-24, 2 marks): An OS that collects similar jobs into a group (batch), loads them one after another through a resident monitor, and executes them without any direct interaction between the user and the running job. Jobs are usually submitted on cards or as spooled files; output is returned after the whole batch finishes.

PYQ (2024-25, 7 marks): "Discuss the differences between Operating Systems with Batch, Interactive, and Time Sharing real-world applications." Write the three rows of the table above and add the application column explicitly: batch → monthly salary/payroll processing; interactive → single-user editor/compiler session; time-sharing → university server with 100 terminal users. Conclude that time-sharing is a natural extension of multiprogramming with a timer interrupt.

2.2 Multiuser, Multiprocessor, Multiprocess, and Multithreaded

Term Key idea Distinguishing test Example
Single user One user at a time No login separation Early MS-DOS
Multiuser Many users share one computer simultaneously with separate accounts, files, and protection Count of users, not CPUs Linux server with many SSH sessions
Multiprocessor Two or more CPUs share memory and coordinate work (SMP or asymmetric) Count of CPUs Dual-socket Xeon, multicore laptop
Multiprocessing Simultaneous execution of several processes, possibly on several CPUs Count of executing processes A PC compiling while playing audio
Multithreaded Multiple threads within one process share code/data but have separate registers and stack Count of threads per process Java program with a GUI thread and a worker thread

PYQ (2023-24, 7 marks): "How does a multiuser operating system differ from a multiprocessing system?" Multiuser is about who uses the machine (many accounts, protection, quotas, terminals); multiprocessing is about how many processes execute (concurrency, CPU scheduling). A single-CPU UNIX box is multiuser but not multiprocessor hardware; a single-user laptop is multiprocessing because browser, compiler and music player run together. These axes are independent.

PYQ (2024-25, 2 marks): "A system has 3 processors and 5 programs ready for execution. In how many ways can the processors be assigned to the programs assuming each processor executes one program at a time?" Processors are distinct and programs are distinct. Choose an ordered assignment without repetition: 5P3=5×4×3=605P3 = 5 \times 4 \times 3 = \mathbf{60}. (If the question only asked which three programs run, ignoring processor identity, it would be 5C3=105C3 = 10; the phrase "assigned to the processors" demands 60.)

2.3 Real-Time and Embedded Classification

Hard real time: missing a deadline = total system failure (airbag controller). Soft real time: missing a deadline reduces quality but is tolerable (video streaming). A real-time OS must provide bounded latency, priority scheduling, and predictable interrupt handling — not merely "fast" response.


3. OS Structure, System Components, and Kernel Designs

3.1 Layered Architecture

In a layered OS, the system is divided into levels; layer kk uses only services of layer k−1k-1 and provides services to layer k+1k+1. A change in one layer does not require rewriting the layers above it.

Layer Name Typical contents
5 User programs / command interpreter Shell, applications, utilities
4 File system Directories, file descriptors, access rights
3 Device drivers / I/O Buffers, interrupts, disk and terminal drivers
2 Memory management Allocation, paging, protection
1 Process scheduling & synchronization PCBs, queues, semaphores
0 Hardware CPU, registers, memory, devices
        +-----------------------------------+
  L5    |  User processes / shell           |
        +-----------------------------------+
  L4    |  File system                      |
        +-----------------------------------+
  L3    |  I/O device drivers               |
        +-----------------------------------+
  L2    |  Memory management                |
        +-----------------------------------+
  L1    |  CPU scheduling + synchronization |
        +-----------------------------------+
  L0    |  Hardware                         |
        +-----------------------------------+

PYQ (2023-24, 7 marks): "Explain the structure and components of an operating system with a layered architecture." Draw the stack above, define the "uses-only-the-layer-below" rule, then list the components: process manager, memory manager, file manager, device manager, protection subsystem, shell/UI, and system-call interface. Give one advantage (modularity/debugging) and one disadvantage (extra parameter-passing overhead; a lower layer must be carefully designed because upper layers depend on it).

PYQ (2025-26, 2 marks): "What is the main advantage of the layered approach to system design?" Modularity: each layer can be changed or debugged independently because it interacts only with adjacent layers, so errors are localized.

3.2 Monolithic Kernel vs. Microkernel

Feature Monolithic kernel Microkernel
Services in kernel space Process, memory, file, device, networking all in kernel Only scheduling, IPC, minimal memory and interrupts
User-space servers Few or none File server, device server, network server run as user processes
Size / complexity Large (millions of lines) Small and auditable
Performance Fewer mode switches → faster system calls More IPC/message passing → slower
Reliability A buggy driver can crash the whole kernel A failed user server can be restarted
Extensibility Must recompile/load kernel modules Add a new user server
Examples Linux, UNIX, MS-DOS Mach, L4, QNX, MINIX

PYQ (2025-26, 7 marks): "What is the main advantage of the microkernel approach to system design? How do user programs and system services interact in a microkernel architecture?" Main advantage: reliability and extensibility because most OS services run outside kernel space. Interaction: a user program sends a message via kernel IPC to a user-space server (e.g., file server); the kernel copies the message, the server performs the operation and replies with another message. The kernel only validates and transfers messages, never executes file logic itself. Mention that this costs extra context/mode switches.

3.3 Reentrant Kernels

Reentrant kernel: A kernel whose code can be safely entered by more than one process (or CPU) at the same time. It keeps no mutable global state between calls; all changing data is stored in the calling process's stack or kernel-control block. This property is essential for multiprocessing and interrupt handling.

3.4 OS Services — The Two Categories (PYQ 2025-26)

PYQ (2025-26, 7 marks): "The services and functions provided by an operating system can be divided into two main categories. Briefly describe the two categories and discuss how they differ."

Category 1 — User-facing services (help the user/application):

  • Program execution: load a program into memory and run it.
  • I/O operations: read/write files and devices through system calls.
  • File-system manipulation: create, delete, rename, list, protect files.
  • Communications: IPC, pipes, sockets, shared memory.
  • Error reporting and protection: messages, dumps, access control, authentication.

Category 2 — System-oriented services (efficient multiuser operation):

  • Resource allocation: CPU cycles, memory, files, devices with priorities and quotas.
  • Accounting: track resource usage per user for billing/statistics.
  • Protection and security: prevent unauthorized access and detect intrusion.
  • System calls and internal tables: maintain PCBs, page tables, open-file tables.
Basis User-facing System-oriented
Visible to application Yes, via API/system calls Mostly invisible
Main goal Convenience Fairness, efficiency, safety
Example open(), read(), fork() Round-robin scheduling, disk quota accounting

Difference summary: user services are invoked by a process to get work done; system services operate on processes to keep the machine usable and fair. Many services (e.g., protection) belong to both views, which is why the answer must explain the viewpoint rather than merely split a list.


4. Exam-Ready Solved Questions (BCS401 Unit 1)

Q1 — Time-sharing vs. Multiprogramming (2023-24, 7 marks)

Parameter Multiprogramming Time-sharing
Objective Keep CPU busy while a job waits for I/O Give each user a fast interactive response
Unit of work Job Process/time slice
Switching trigger I/O wait or job completion Timer interrupt (quantum expiry)
User interaction None during execution Continuous command–response
Number of users Usually one or more, but batch oriented Many simultaneous users
Response time Not guaranteed Guaranteed to be short (e.g., < 1 s)
Example Batch monitor with 3 resident jobs UNIX with 50 terminals

Conclusion: time-sharing is multiprogramming plus a timer and a fair scheduler. Both keep several jobs in memory; only time-sharing optimizes response time.

Q2 — Define principle/concept (2-mark drills)

  • Batch system: jobs collected and run without user interaction (see §2.1).
  • Layered advantage: localized debugging due to adjacent-layer dependency only.
  • I/O subsystem: the collection of device controllers, drivers, buffers and interrupt/DMA logic that mediates between CPU and peripheral devices.
  • Real-time system: a system whose correctness requires results before a specified deadline.

Q3 — Predicted question (label: predicted, not a real PYQ)

Predicted: "Discuss the classification of operating systems and provide real-world examples for each type." Write five rows: batch (payroll card batch), interactive (MS-DOS editor), time-sharing (university UNIX server), real-time (VxWorks anti-lock braking), multiprocessor (Linux on 8-core laptop), multiuser (SSH server), multithreaded (Java web server). Add one sentence on distributed and embedded systems to complete a 7-mark answer.


5. Practice Questions (self-test)

  1. Distinguish multiuser, multiprocessor and multithreaded systems with one example each.
  2. Why does a microkernel need message passing, and what price is paid for it?
  3. Draw the layered OS diagram and state which layer a disk driver belongs to.
  4. Name two user-facing and two system-oriented OS services; explain the difference in viewpoint.
  5. A machine has 4 CPUs and 6 programs. How many distinct processor→program assignments are possible with one program per CPU? (Answer: 6P4=3606P4 = 360.)

6. Last-Night Survival Checklist (Unit 1 only)

  1. Memorise the two views (resource allocator + control program) and the eight functions; they answer both 2-mark definition questions.
  2. Draw the six-layer stack and the monolithic/microkernel comparison table from memory — these are the two most repeated 7-mark diagrams.
  3. Keep three contrasts ready: batch vs. interactive vs. time-sharing; time-sharing vs. multiprogramming; multiuser vs. multiprocessing.
  4. Quote one real system per OS type (MS-DOS, UNIX, VxWorks, Linux/QNX) in every classification answer.
  5. For counting questions, check whether the entities are distinct: processors and programs are distinct → permutation nPknPk, not combination.

Final OS-specific reminder: Marks in Unit 1 are lost when a student writes only definitions. Every 7-mark answer here should contain a definition, a comparison axis table, and one concrete system example; that pattern is what the AKTU evaluator rewards for this unit.