0% found this document useful (0 votes)
8 views14 pages

operating system notes

A Virtual Machine (VM) allows a single physical computer to operate as multiple independent machines, each with its own operating system and applications. VMs provide advantages such as running multiple OS simultaneously, easier software testing, and enhanced security since each VM operates independently. The document also discusses the evolution of operating systems, multicore and multiprocessor systems, and various types of operating systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views14 pages

operating system notes

A Virtual Machine (VM) allows a single physical computer to operate as multiple independent machines, each with its own operating system and applications. VMs provide advantages such as running multiple OS simultaneously, easier software testing, and enhanced security since each VM operates independently. The document also discusses the evolution of operating systems, multicore and multiprocessor systems, and various types of operating systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Explain the concept of virtual machines and their

advantages .
What is a Virtual Machine?

A Virtual Machine (VM) is a system that creates an illusion of a real machine. This means that even
though we have only one physical computer, we can make it act like many computers using special
software called a Virtual Machine OS (like VMware, VirtualBox, etc.).

Example:

Imagine you have one big house but you divide it into multiple rooms with separate keys. Now,
different people can live in their own rooms as if they have their own house, even though it is
actually a single house.

Similarly, one computer (physical machine) can be divided into multiple virtual machines, where
each can have its own Operating System (OS), storage, and applications.

How does it work?

A virtual machine system gives an illusion that each user has their own personal computer. It does
this by simulating:

1. Virtual Processor – Each VM gets a part of the CPU, making it feel like it has its own
processor.

2. Virtual Storage & I/O devices – Each VM gets its own space on the hard disk and has access
to input/output devices like printers.

The operating system manages this by sharing the CPU among multiple virtual machines using a
technique called Process Scheduling.

Example:

Think of a school bus where many students travel together. Even though it is one bus, each student
feels like they have their own seat. Similarly, in a virtual machine setup, multiple users feel like they
have their own computer, but actually, they are sharing a single powerful machine.

Diagram Explanation

Your diagram shows:

 One real machine with one CPU.

 Multiple virtual machines, each with its own OS (OS1, OS2, OS3).

 Each VM has a virtual CPU, printer, reader, and virtual disk.

This means that even though there is only one physical machine, multiple virtual machines are
running independently, just like different students using the same school bus.
Advantages of Virtual Machines

1. Run multiple OS at the same time

o You can run Windows, Linux, and macOS on the same computer at the same time.

o Example: A software tester can test an app on Windows and Linux without needing
two separate computers.

2. No need to convert programs

o Normally, a program written for Windows may not run on Linux.

o But with VMs, you can run both Windows and Linux on the same computer without
modifying the program.

3. Easier software development and testing

o Developers can test software on different OS without needing multiple computers.

o Example: A gaming company can check if their game works properly on both
Windows and macOS using virtual machines.

4. Security and Privacy

o Since each VM is independent, if one VM gets a virus, it does not affect the other
VMs or the main computer.

o Example: If a hacker attacks one virtual machine, the other virtual machines remain
safe.

Final Summary

 A Virtual Machine (VM) allows a single computer to behave like multiple computers.

 It helps in running multiple Operating Systems (OS) on the same machine.

 It is useful for testing software, security, and running different programs without converting
them.

 It ensures privacy and security since each VM is independent.


Evolution of Operating System (OS)

An Operating System (OS) is software that helps to manage computer hardware and software
resources. It can process tasks in two ways:

1. Serially (One after another)

2. Concurrently (Multiple tasks at the same time, switching between them)

Example:

 Serial Processing: If you are washing clothes, you will first wash one shirt, then another, and
so on.

 Concurrent Processing: If you are washing clothes while also watching TV, both tasks happen
together.

The evolution of OS has three stages:

1. Serial Processing

2. Batch Processing

3. Multiprogramming

1. Serial Processing

In this method, each step in a program requires manual interference, meaning a human must
complete each step before moving to the next.

Example of Serial Processing

Imagine you are baking a cake:

1. First, you mix the ingredients.

2. Then, you manually start the oven.

3. Then, you place the batter in the oven and wait.

4. After baking, you manually take it out and cool it.

This takes time, and after every step, a person must be involved.

Why is Serial Processing Slow?

 It requires a human to manually complete each step.

 It leads to low resource utilization (CPU sits idle while waiting for input).

 Early computers used punched cards and paper tapes for input.

2. Batch Processing
To solve the problem of Serial Processing, Batch Processing was introduced.

 In Batch Processing, multiple jobs (programs with similar requirements) are grouped
together and executed automatically without manual interference.

 A special software called Monitor was used to manage these jobs.

Example of Batch Processing

Think of a laundry shop:

1. Customers bring clothes for washing.

2. The shopkeeper collects all similar clothes (whites, colored, delicate).

3. All white clothes are washed together in one batch.

4. All colored clothes are washed in another batch.

5. This saves time and effort.

Similarly, in computers:

 Programs with similar needs are grouped and executed together.

 The Monitor software controls the order of execution.

 Job Control Language (JCL) was used to give instructions.

Example of Job Control Language

sql

CopyEdit

$JOB – First card of a job

$TC – Execute the C compiler

$LOAD – Load program into memory

$RUN – Execute the user program

$END – Last card of the job

3. Multiprogramming

Even though Batch Processing helped, computers still wasted time when waiting for input/output
operations.
To improve efficiency, Multiprogramming was introduced.

 Multiprogramming allows multiple programs to run at the same time.

 When one program is waiting for input/output, the CPU switches to another program.

 This increases resource utilization and makes execution faster.

Example of Multiprogramming
Imagine a chef in a restaurant:

1. The chef is cooking Dish 1 but has to wait for water to boil.

2. Instead of waiting, the chef starts preparing Dish 2.

3. When the water boils, the chef returns to Dish 1 and continues.

Similarly, in computers:

 Sequential Execution → The CPU waits when a program is idle.

 Multiprogramming → The CPU switches to another program while waiting.

Diagram in your notes:

 Sequential Execution (Old method): Program 1 runs fully, then Program 2 starts.

 Multiprogramming Execution (New method): The CPU switches between Program 1 and
Program 2.

Advantages of Multiprogramming

✅ Better resource utilization – No CPU idle time.


✅ Faster execution – Multiple programs run in an interleaved fashion.
✅ Can handle multiple users at the same time.
✅ More efficient than Batch Processing.

Challenges in Multiprogramming

⚠️Complex OS – Needs better scheduling and management.


⚠️Memory Sharing & Protection – Programs must not overwrite each other.
⚠️Synchronization Issues – The system must manage multiple processes smoothly.

Final Understanding

1. Serial Processing – One job at a time, slow and manual.

2. Batch Processing – Grouping similar jobs, automatic execution, faster than serial.

3. Multiprogramming – Multiple jobs run together, CPU switches between tasks, fastest
method.

Bonus Real-Life Analogy

 Serial Processing → A person cooking one dish at a time.

 Batch Processing → A restaurant preparing multiple orders of the same dish together.

 Multiprogramming → A chef cooking multiple dishes at the same time by switching between
them.
# Services provide by the an operating system .

Understanding Operating System Services


An Operating System (OS) provides various services to make computer usage easier and
more efficient. Let’s go step by step and understand them with simple explanations and
examples.

1) User Interface
The OS provides a way for users to interact with the computer.
 Command-Line Interface (CLI): Users type commands to operate the system.
Example: Using the command prompt (cmd) in Windows or Terminal in Linux.
 Graphical User Interface (GUI): Users interact using a mouse, windows, and menus.
Example: Windows, macOS, and Android.
Example:
If you want to open a file, in CLI, you type open file.txt, but in GUI, you just double-click the
file.

2) Program Execution
The OS allows us to run applications. It manages the resources (CPU, memory, etc.) needed
for execution.
Example:
When you open a web browser like Chrome, the OS ensures it gets the necessary CPU and
memory to run smoothly.

3) I/O Operations
Programs need to interact with input/output (I/O) devices like keyboards, mice, printers, and
USB drives. The OS handles these operations.
Example:
When you type in Notepad, your keyboard’s input goes to the OS, which then displays it on
the screen.

4) File System Manipulation


The OS manages files, allowing users to create, delete, read, write, and organize them. It also
controls access to files.
Example:
 Saving a document in MS Word means writing data to a file.
 The OS ensures only authorized users can open certain files (like password-protected
PDFs).

5) Communication
Processes (programs running at the same time) need to communicate with each other. This
happens in two ways:
 Inter-process Communication (IPC): Two programs on the same computer exchange
data. Example: A media player fetching a song from a file explorer.
 Network Communication: Two computers exchange data over the internet. Example:
WhatsApp messages between two users.

6) Error Detection
The OS continuously checks for errors and tries to fix them. Errors can be:
 Memory Error: Insufficient RAM to run an application.
 Connection Failure: Internet disconnects while downloading a file.
 I/O Device Failure: Printer not responding.
Example:
If your computer crashes while running an app, the OS may show a "Blue Screen of Death"
(BSOD) in Windows or automatically restart the app.

7) Resource Allocation
The OS distributes resources (CPU, memory, files, I/O devices) among different programs and
users.
Example:
When playing a game and using a web browser at the same time, the OS ensures both get
CPU and RAM properly.

8) Resource Sharing & Protection


 Sharing: In a multi-user system, different users or programs can share resources like
files or printers. Example: A shared printer in an office.
 Protection: Prevents one program from interfering with another. Example: Antivirus
software stopping malware from deleting files.

9) Accounting
The OS keeps records of how resources are used, which helps in optimizing performance and
security.
Example:
On your phone, the "Battery Usage" section shows which apps use the most power, helping
you manage battery life.

Final Thoughts
The OS acts as a manager of all computer activities. Without it, using a computer would be
extremely difficult.

Multicore and Multiprocessor Systems

1. What is a Multicore System?


A multicore system is a single CPU (processor) that contains multiple small processing units
called cores. Each core can perform tasks independently, allowing multiple tasks to be
executed at the same time.
Think of it like a kitchen with multiple chefs. If there is only one chef, food preparation takes
more time. But if multiple chefs (cores) are working, different tasks (cutting vegetables,
cooking, serving) can happen at the same time, making the process faster.

Features of a Multicore System:


 Multiple cores in one CPU: It can execute multiple instructions at the same time.
 Faster processing: Since many tasks can run in parallel.
 Efficient execution: It doesn’t need complex configurations like a multiprocessor
system.
 Shared memory: Some cores may have their own memory, but they often share a
common memory.
 Better performance: The overall speed of executing programs increases.
Example of a Multicore System:
 A quad-core processor (like Intel i5, i7, AMD Ryzen 5) has four cores, so it can
handle four different tasks at once.
 A dual-core processor has two cores, so it can handle two tasks at once.

Advantages of Multicore Systems


1. Faster than single-core processors – More cores mean more instructions can run at
the same time.
2. Uses less space – Instead of using multiple separate processors, a single chip
contains multiple cores.
3. Less data traffic – Multiple cores reduce congestion in processing data.
4. Energy efficient – More work is done with less power consumption.
5. Good for multitasking – You can run multiple applications at the same time without
slowing down.
Example:
 When you play a game and stream music at the same time, a multicore processor
ensures both work smoothly.

Disadvantages of Multicore Systems


1. Not all software supports multicore processors – Some operating systems and
applications still work better with single-core processors.
2. Consumes more electricity – More cores mean more power is needed.
3. Heats up more – Since multiple cores are working, they generate more heat.
4. Expensive – Multicore processors cost more than single-core ones.
5. Older applications may run slower – If software is designed for a single-core
processor, it may not run efficiently on a multicore system.

2. What is a Multiprocessor System?


A multiprocessor system is a system with multiple CPUs (processors) working together. It is
different from a multicore system because it uses separate processors instead of multiple
cores inside one CPU.
Example:
 Imagine two kitchens instead of one. Each kitchen (processor) has its own chefs
(cores) working independently, so the work is done even faster.
 A server that handles multiple requests from different users often uses a
multiprocessor system.

Types of Multiprocessor Systems


One common type is Symmetric Multiprocessing (SMP), where all processors share the
same main memory and can work together.
Features of SMP:
 Multiple processors in one system – Each processor executes different instructions
simultaneously.
 Shared memory – All processors can access the same data.
 Fault tolerance – If one processor fails, the other processors can continue working.
 Uses a common data bus – Processors communicate using a shared bus
(connection).

Advantages of Multiprocessor Systems


1. Reliable – If one processor fails, the others continue working.
2. Faster execution – Tasks are divided among multiple processors.
3. Handles more work – More users and applications can run simultaneously.
4. Parallel processing – Multiple processors can work on the same task at once.
Example:
 Large companies like Google, Facebook, and Amazon use multiprocessor systems to
handle millions of user requests at the same time.
Disadvantages of Multiprocessor Systems
1. Requires more space – Multiple processors need more physical space and memory.
2. Expensive – More processors mean higher costs.
3. Risk of deadlock – If two processors try to access the same resource at the same
time, it may cause a system freeze.
4. Complex design – Operating systems need to manage multiple processors efficiently.
Example:
 If two people try to book the same train ticket at the same time using different
processors, one may face an error if the system doesn’t handle it properly.

Conclusion
 Multicore systems are like a single kitchen with multiple chefs (cores) inside one
CPU.
 Multiprocessor systems are like multiple kitchens, each with its own chefs (separate
CPUs).
 Both systems improve performance, but multicore processors are common in
personal computers, while multiprocessor systems are used in large servers.
Best Choice?
 If you need gaming, video editing, or multitasking, a multicore processor is enough.
 If you are running huge databases, cloud computing, or high-performance servers, a
multiprocessor system is better.

Types of Operating System

There are different types of operating systems (OS), and some of the important ones are:
1. Batch Processing System
2. Uni-Programming System
3. Multi-Programming System
4. Time Sharing System
5. Clustered System
6. Distributed System
7. Network Operating System
8. Real-Time System

2. Batch Processing System


Concept:
 This system was developed to improve computer utilization.
 Instead of running one job at a time, similar jobs were grouped together and
processed in batches.
 Users do not interact with the system while their job is being processed.
Example:
 Think of a bank that processes salary payments. Instead of transferring money one by
one, they process thousands of payments together in a batch.
Advantages:
✅ Less work for the operator because the system manages scheduling.
✅ Improved performance because one job starts as soon as the previous one finishes.
Disadvantages:
❌ Turnaround time (time taken to complete a job) is high.
❌ Debugging errors is difficult.
❌ If one job fails, it can affect other jobs in the batch.

3. Uni-Programming System
Concept:
 In this system, only one program runs at a time.
 If the program needs input/output (I/O) or an exception occurs, the processor waits
until the task is completed.
Example:
 Suppose you are writing a document in Notepad. While typing, if you start printing,
the system will wait until printing is complete before allowing you to continue typing.
Disadvantage:
 Processor remains idle when waiting for I/O, which wastes time.
4. Multi-Programming System
Concept:
 In this system, multiple programs are loaded into memory and the CPU switches
between them.
 When one program is waiting (for input/output), the CPU executes another program.
Example:
 Suppose you are downloading a file, listening to music, and browsing the internet.
While the download is in progress (waiting for the network), the system continues
playing music and allowing web browsing.
Advantage:
✅ CPU never stays idle, which improves efficiency.

5. Time-Sharing System
Concept:
 This is an extension of multi-programming where multiple users can use the system
at the same time.
 The CPU divides time into small slots and switches between different processes
quickly, so every user gets a response.
Example:
 Imagine a school computer lab where 10 students are using the same server. The OS
ensures that all students get equal time to use the processor.
Advantages:
✅ Easy to use.
✅ User-friendly.
✅ Acts as a bridge between hardware and software.
Disadvantages:
❌ If the OS crashes, all users may lose their work.
❌ Unauthorized users can misuse the system.

6. Clustered System
Concept:
 A group of computers is connected together using a high-speed communication link.
 Each computer has its own memory and devices but works as a single unit.
 Clustering improves system availability (less downtime).
Types of Clustering:
1. Asymmetric Clustering – One computer (master) controls others (slaves).
2. Symmetric Clustering – All computers share the workload equally.
Example:
 Google uses a cluster of thousands of computers to handle search queries quickly
and efficiently.

Conclusion
 Batch processing is used for processing multiple similar jobs without user
interaction.
 Uni-programming runs one job at a time but wastes CPU time.
 Multi-programming allows multiple programs to run by switching between them.
 Time-sharing extends multi-programming for multiple users.
 Clustered systems use multiple computers to improve efficiency and reliability.

You might also like