UNIT 1 – OPERATING SYSTEM CONCEPTS
1.1 History of operating system – generations of operating system
1st Generation (1940s–50s):
• there were no operating systems.
• Programs were run manually using punch
• machines were very slow and large.
• Example: ENIAC.
2nd generation (1950s–1960s) :
• Simple batch processing systems were introduced.
• Jobs were collected and processed one after another without user interaction.
• Faster than 1st generation.
• Example: IBM 1401
3rd generation (1960s–1970s) :
• introduced multiprogramming and time-sharing.
• Multiple programs could run at the same time
• users could interact with the system.
• Better CPU usage.
• Example: UNIX, IBM 360.
4th generation (1970s–1990s) :
• personal computers (PCs) became popular
• Operating systems like MS-DOS and Windows were developed with graphical user
interfaces.
• User-friendly systems.
• Examples : MS-DOS , Mac OS, windows
5th generation (1990s–Present) :
• includes modern operating systems with support for networking, cloud computing, mobile
devices, and high-level user interfaces like Android and iOS.
• Support for internet, multimedia.
• Examples: Windows 10, Linux, Android.
1.2 Different Types of Operating system
🔹 Simple Batch System
➢ A Batch Operating System groups similar jobs together into a batch and runs them one by
one without user interaction.
➢ For example, if there are 10 programs written in different languages like C, C++, and Java,
the system can group them into batches and load each compiler only once for the respective
batch.
➢ The jobs are submitted to the computer and then executed in the First Come, First Serve
manner.
➢ A small program called the Resident Monitor stays in memory to manage the execution and
switch between jobs.
✅ Advantages of Batch OS:
• The system takes less time to execute jobs because similar jobs are grouped and executed
together.
• Multiple users can share the system.
• The CPU is better utilized as switching between jobs is smooth and reduces idle time.
• It can handle large or complex jobs easily without interruption.
• Manual effort is reduced since jobs are grouped, and less setup is needed.
• Errors are logged and shown after the batch is processed, so the system doesn’t stop due to
errors.
❌ Disadvantages of Batch OS:
• Starvation can occur if a long job delays other jobs.
• It is not interactive, so jobs that need user input cannot be executed properly.
• Output is delayed, which is not suitable for urgent tasks.
• Debugging is difficult because errors are found only after the whole batch is processed.
• It requires knowledge of job scheduling, which can be complex.
• If the batch has a large job, all other jobs get delayed, affecting performance.
🔹 Multiprogramming Operating System
➢ A Multiprogramming Operating System allows multiple programs to stay in memory at
the same time and share the CPU.
➢ The CPU switches between programs when one is waiting for input/output, so the CPU is
always doing useful work.
➢ It helps in increasing system efficiency by reducing CPU idle time.
➢ It uses memory management and scheduling to keep track of active programs.
✅ Advantages of Multiprogramming OS:
• It gives better CPU utilization, as the CPU is always busy.
• Multiple jobs are executed together, increasing system performance.
• It reduces waiting time for jobs by switching between them.
• The system becomes more responsive and faster.
❌ Disadvantages of Multiprogramming OS:
• It needs complex memory management to handle many programs.
• There is a risk of deadlock, where two jobs wait for each other.
• Proper CPU scheduling is required, which is difficult to manage.
• If overloaded, the system can slow down or overheat.
🔹 Time-Sharing Operating System
➢ A Time-Sharing Operating System (TSOS) allows multiple users or tasks to use the
CPU at the same time by giving each task a fixed time slot called a time quantum.
➢ Each process runs for its time quantum, and then the CPU switches to the next process. This
continues in a round-robin fashion.
➢ The CPU switches between processes so fast that all users feel their programs are running at
the same time.
➢ It uses scheduling, multiprogramming, and context switching to manage processes.
➢ It is commonly used in systems where multiple users need quick access to the system, like
in university servers or business environments.
✅ Advantages of Time-Sharing OS:
• All tasks get equal opportunity to execute, as time is shared equally.
• It ensures better CPU utilization and reduces idle time.
• Multiple users can interact with their programs at the same time, increasing productivity.
• Memory management is improved, as programs are swapped in and out efficiently.
• Users experience a real-time, interactive environment.
❌ Disadvantages of Time-Sharing OS:
• High data transmission speed is required to manage multiple users.
• It is complex to implement due to advanced scheduling and memory management.
• There may be security risks, as many users access the system at once.
• If many users connect, the system may slow down due to resource sharing.
• Frequent context switching can reduce system performance over time.
🔹 Multiprocessing Operating System
➢ A Multiprocessing Operating System uses two or more CPUs working together to
complete tasks faster.
➢ All processors share the same memory, buses, and peripheral devices, so they can cooperate
on the same job.
➢ The main goal is to increase system speed, throughput, and reliability by running many
processes in parallel.
➢ If one processor fails, others can take over its work, so the system keeps running without
stopping.
➢ Popular operating systems that support multiprocessing include Solaris, Linux, and
modern UNIX variants.
✅ Advantages of Multiprocessing OS
• Higher reliability: If one CPU fails, others keep the system running.
• Greater throughput: More jobs are finished in less time because several CPUs work
simultaneously.
• Efficient resource use: CPUs, memory, and I/O devices are shared and used productively.
• True parallelism: Many processes run at the same moment, giving a big speed boost.
• Easy scalability: Extra processors can be added to handle larger workloads.
❌ Disadvantages of Multiprocessing OS
• System complexity increases because tasks must be divided and synchronized among many
CPUs.
• Higher cost due to extra hardware needed for multiple processors.
• Communication overhead occurs when processors must coordinate, slightly reducing
efficiency.
• Software compatibility issues may appear because some programs are not designed for
multiple CPUs
🔹 Multitasking Operating System
1. A Multitasking Operating System allows a single CPU to run many tasks at the same
time by quickly switching between them.
2. The OS shares CPU time, memory, and I/O devices so that each task gets a small slice of
resources.
3. Multitasking is common in multi-user and desktop systems, where users need several
programs open together.
4. The CPU changes from one task to another in milliseconds, so users feel their applications
run concurrently and smoothly.
✅ Advantages of Multitasking OS
• It can handle multiple users or applications at once, ideal for busy environments.
• Memory and CPU are used efficiently because resources are shared dynamically.
• Running many programs together increases productivity for users.
• Fast switching between tasks gives quick response time.
• Overall system resources are utilized better, reducing idle time.
❌ Disadvantages of Multitasking OS
• Continuous switching can make the CPU heat up and use more power.
• More complex scheduling algorithms are needed, increasing OS complexity.
• Too many running tasks may slow the system if resources are overused.
• Tasks often compete for the same resources, causing delays.
• Multitasking systems usually need stronger hardware (more RAM and CPU power) to run
smoothly.
🔹 Real-Time Operating System
1. A Real-Time Operating System (RTOS) is used in systems where tasks must be
completed within strict time limits.
2. Missing a deadline in these systems can cause the output to be useless or even lead to
dangerous failures, depending on the application.
3. RTOS is used in critical fields like medical devices, defense, robotics, automotive
systems, and industrial control.
4. For example, in an anti-lock braking system (ABS) or a missile control system, responses
must happen in real-time (within milliseconds).
✅ Advantages of Real-Time OS
• Tasks respond quickly to events, ensuring better performance in time-sensitive systems.
• Reliable for critical operations where timing is very important.
• Helps in maximum usage of system resources.
• Tasks are run based on strict scheduling, so their execution is predictable.
• Ideal for systems that require precision and timing accuracy.
❌ Disadvantages of Real-Time OS
• RTOS can be very expensive to design and maintain.
• It needs high CPU power, making it more resource-intensive.
• Limited support for multitasking compared to general-purpose OS.
• Less flexible; adding new functions is harder.
• Sometimes requires special hardware to work properly.
🔹 Distributed Operating System
1. A Distributed Operating System runs on more than one computer at the same time.
2. Each computer has a part of the operating system installed so they can work together and
share tasks.
3. The user feels like they are using one single system, even though many computers are
working in the background.
4. These types of systems are used when we need to do big tasks faster by sharing work
across machines.
✅ Advantages of Distributed OS
• It allows different computers to share resources like files, printers, and programs.
• If one computer fails, the others can still keep working.
• It is easy to add new computers to the system when needed.
• Tasks are shared, so the work gets done faster.
• More work can be done at the same time using multiple computers.
❌ Disadvantages of Distributed OS
• It is hard to manage because many computers are connected.
• It needs a good internet or network to work properly.
• Keeping the system safe and secure is more difficult.
• Extra communication between computers can slow down the work sometimes.
🔹 Cluster Operating System
1. A Cluster Operating System connects many computers (nodes) to work as a single
system.
2. These computers are linked closely using a high-speed network.
3. The main goal of a cluster OS is to improve performance, availability, and reliability.
4. If one computer in the cluster fails, the others can take over its job, so the system keeps
running.
5. These systems are often used in research, banks, and big data centers.
✅ Advantages of Cluster OS
• High availability – if one computer fails, others keep the system running.
• Faster performance by doing tasks in parallel.
• Easy to add more computers to increase power.
• Work is divided among computers, so big jobs finish faster.
• It is reliable and supports fault tolerance.
❌ Disadvantages of Cluster OS
• It needs a fast and strong network connection.
• Set up and management is harder than a single computer system.
• If communication fails between computers, work may stop.
• Sometimes, it can be expensive due to the number of machines needed.
• Software needs to be specially designed to run on cluster systems.
1.3 System components
🔹 Main Memory Management
➢ Main memory is the part of the computer where programs and data are kept while they are
being used.
➢ It is also called RAM.
➢ The CPU reads and writes data from this memory using memory addresses.
➢ It works very fast but is costly, so it has less space.
➢ A program must be in main memory before it can run.
➢ The method used to manage memory depends on the hardware of the system.
⚙️Functions of Memory Management
1. The operating system keeps a record of which part of memory is used and which part is
free.
2. It decides which program gets how much memory and for how long.
3. In systems with many programs, it shares memory between them.
4. When a program starts, the OS gives memory to it.
5. When the program ends, the OS frees that memory.
6. This helps to use memory properly and keeps the system running smoothly.
🔹 File Management
1. A file is a group of related information created by a user.
2. It can store programs (like source code or compiled files) or data.
3. Data in a file can be text, numbers, or both.
4. Files help in organizing data so that it can be saved and used later.
⚙️Functions of File Management
The operating system manages files by doing the following:
1. Creating and deleting files when needed.
2. Creating and deleting folders (directories) to organize files.
3. Opening, closing, reading, and writing files.
4. Saving files on the hard disk or other storage devices.
5. Taking backups of files to prevent data loss.
6. Keeping track of file locations, names, sizes, and types.
🔹 I/O Device Management
1. I/O Device Management is a function of the Operating System that handles all input and
output devices.
2. It hides the differences between various hardware devices from the user.
3. The OS controls how data is sent to or received from devices like keyboard, mouse,
printer, scanner, etc.
4. It ensures smooth communication between the CPU and all input/output devices.
⚙️Functions of I/O Device Management
1. It provides a buffering and caching system to improve speed and efficiency.
2. It includes general device driver code to manage all devices.
3. It gives special drivers for specific hardware (e.g., printer driver).
4. It helps the system understand and manage the unique features of each device.
🔹 Secondary-Storage Management
1. Secondary-Storage Management handles long-term storage of data and programs.
2. Since main memory is limited, the OS uses secondary storage (like HDDs, SSDs, USB
drives) to store data permanently.
3. It manages how data is stored, accessed, and organized on disks.
4. The OS ensures efficient use of storage space and keeps track of free and used areas.
5. It helps the system load programs and save files even after the computer is turned off.
⚙️Functions of Secondary-Storage Management
1. Storage Allocation - The OS decides where and how files and programs will be stored on
the disk.
2. Free Space Management - It keeps track of empty space on the disk and allocates it when
needed.
3. Disk Scheduling - The OS uses algorithms to decide the order of read/write requests for
faster performance.
4. Data Access & Retrieval - Helps in quickly locating and retrieving data when needed by
programs or users.
5. Data Protection - Ensures stored data is safe from unauthorized access or loss
1.4 Simple structure, Layered, Monolithic,
Microkernel
🔸 Simple Structure
➢ A Simple Structure is the most basic design of an Operating System — used mainly in
small or limited systems.
➢ It has very few layers and less separation between system parts.
➢ Example: MS-DOS uses a simple structure with 4 basic layers:
ROM BIOS Device Drivers
MS-DOS Device Drivers
System Programs
Application Programs
➢ Since everything is closely connected, it's fast but also less secure.
➢ One major drawback: If one program crashes, the whole OS can crash.
✅ Advantages of Simple Structure
• Easy to develop – Fewer layers and components.
• Fast performance – Less overhead due to direct hardware access.
• Low resource usage – Lightweight and minimal.
• Ideal for small/embedded systems – Simple and efficient.
❌ Disadvantages of Simple Structure
• Hard to update or modify – All parts are interlinked.
• Difficult to debug – Errors can be hard to find.
• Low security – Direct hardware access can be risky.
• Poor scalability – Not suitable for larger or modern systems.
• System crash risk – One failure may crash the whole OS.
🔸Layered Structure
➢ In a layered OS, the system is divided into different levels or layers, each handling a
specific task.
➢ Layer 0 is the lowest layer (hardware), and the top layer is where users interact.
➢ Each layer only talks to the one just below it, making the system organized and easy to
manage.
➢ If there's a problem, it's easier to find and fix because you can test one layer at a time.
➢ This method makes the OS more secure, flexible, and easy to update.
✅ Advantages:
• Easy to develop, fix, and update.
• Problems can be isolated to one layer.
• Improves security and organization.
• One layer can be updated without affecting others.
❌Disadvantages:
• Can be slower, since data passes through many layers.
• Needs careful planning to design properly.
• Sometimes less flexible, as you can't skip layers.
• If a lower layer is slow or broken, the whole system can suffer.
🔸Monolithic Structure
➢ A monolithic OS has everything (file handling, memory, I/O, etc.) packed together in one
large program called the kernel.
➢ The kernel directly controls all hardware like keyboard, mouse, memory, and CPU.
➢ All system functions run in the same memory space, making it fast but less secure.
➢ This structure was mostly used in old systems like bank servers with simple needs (e.g.,
batch processing or time-sharing).
➢ Since all parts work together in one big unit, there's no clear separation between
components.
✅ Advantages:
• Very simple design — no layers to manage.
• Faster performance due to fewer system calls and direct hardware access.
• All code in one place — easy for developers to understand.
• No delay from layer-to-layer communication.
❌ Disadvantages:
• A bug in one part can crash the whole system.
• Hard to debug or fix, since everything is connected.
• Difficult to update or scale, as small changes may affect everything.
• Less secure, because all components share the same memory space.
🔸Microkernel Structure
➢ A Microkernel OS keeps only the most essential functions in the kernel (like memory
management, CPU scheduling, and communication).
➢ Other services like file systems, device drivers, etc. run in user space, not inside the kernel.
➢ This makes the system more modular, secure, and stable.
➢ If a service crashes, the whole system doesn't crash — only that service fails.
➢ Microkernel-based systems include macOS, QNX, and some versions of Windows NT.
✅ Advantages:
• More stable and secure — one service crash doesn’t affect the whole OS.
• Easy to update or modify services without touching the kernel.
• Better flexibility — services can be added or removed as needed.
• Portable — microkernels are small and work well across different hardware.
• Clear isolation between system components, reducing bugs and vulnerabilities.
❌Disadvantages
• Slower performance due to more communication between kernel and user services.
• More context switching between user space and kernel space slows things down.
• Development is tricky — splitting services properly takes time and planning.
• Fewer OSes use it, because it’s harder to build from scratch.
• More overhead than monolithic systems, especially in high-load environments.
1.5 System calls- uses, process control, file management, device
management
🔹 What is a System Call?
A system call is a way for a user-level program to request services from the operating system’s
kernel.
• It allows programs to perform operations like file handling, process control, device access,
etc.
• Acts as an interface between user programs and OS functions.
• Requires a switch from user mode to kernel mode for security and control.
🔹 Uses of System Call
System calls are needed for:
• Creating, reading, writing, or deleting files
• Accessing hardware devices (printers, scanners)
• Managing processes (create, terminate)
• Sending or receiving data over a network
• Memory allocation or deallocation
• Communicating between processes
• Enforcing security and access control
🔵 Process Control System Calls
These system calls manage the life cycle of a process.
🔸 Common Uses:
• Creating or terminating processes
• Suspending or resuming processes
• Managing process execution and synchronization
🔸 Examples:
• fork() – Creates a new process (child) that runs alongside the original (parent) process.
• exec() – Replaces the current running program with a new one in the same process.
• exit() – Ends a process and tells the OS it’s done.
• wait() – Makes a parent process wait until its child process finishes.
📌 These calls allow the OS to multitask and manage resources across multiple
programs.
🔵 File Management System Call
These allow a program to interact with files stored on disk.
🔸 Common Uses:
• Creating or deleting files
• Reading or writing data to files
• Opening or closing files
• Setting file permissions
🔸 Examples:
• open() – Opens a file so it can be read or written.
• read() – Reads data from a file into the program.
• write() – Writes data from the program into a file.
• close() – Closes an open file to save resources.
• unlink() – Deletes a file from the storage.
📌 Used when saving documents, reading configuration files, etc.
🔵 Device Management System Calls
Used to control and interact with I/O devices.
🔸 Common Uses:
• Sending data to output devices (like printers)
• Reading input from devices (like keyboards)
• Getting device status
• Allocating or releasing devices
🔸 Examples:
• read() – Reads input from a device like a keyboard or scanner.
• write() – Sends output to a device like a printer.
• ioctl() – Gets or sets device-specific settings, like volume or brightness.
• request_device() – Asks the OS to allow access to a hardware device.
• release_device() – Frees up the device after it's no longer needed.0
📌 Helps manage hardware without allowing direct user access for safety.