0% found this document useful (0 votes)
15 views11 pages

Osy Ans PDF

The document provides an overview of key concepts in operating systems, including definitions of processes, process control blocks, and process management. It discusses various types of schedulers, process states, memory management techniques, and file attributes. Additionally, it covers the distinctions between multiprogramming and multitasking operating systems, as well as the services provided by operating systems.

Uploaded by

dagadeparamdeep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views11 pages

Osy Ans PDF

The document provides an overview of key concepts in operating systems, including definitions of processes, process control blocks, and process management. It discusses various types of schedulers, process states, memory management techniques, and file attributes. Additionally, it covers the distinctions between multiprogramming and multitasking operating systems, as well as the services provided by operating systems.

Uploaded by

dagadeparamdeep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

1.

Define
i.Process: - A process is an instance of a computer program that is being
executed by one or many threads. It is an independent and dynamic entity that
executes a set of instructions within a computer system. A process has its own
memory space, resources, and state.
ii.PCB (Process Control Block): - A Process Control Block is a data structure
maintained by the operating system to store information about a process. It
contains details such as process state, program counter, register values, memory
allocation, and other relevant information needed for process management.
2. What is Process Management?
- Process management involves the coordination and control of processes within
a computer system. It includes creating, scheduling, terminating, and managing
processes, as well as providing mechanisms for processes to communicate and
synchronize.
3.Define Scheduler and state its types:**
-Scheduler: A scheduler is a component of the operating system responsible for
deciding which process/thread should run next. It determines the order and
priority of processes in the ready queue.
- Types of Schedulers:**
1. **Long-Term Scheduler (Job Scheduler):** Selects which processes
should be brought into the ready queue for execution.
2. **Short-Term Scheduler (CPU Scheduler):** Selects which process should
be executed next and allocates CPU time.

3.Medium term scheduler: When a process is in running state, due to


some interrupt it is blocked. System swaps out blocked process
andstore it into a blocked and swapped out process queue

4. **Define Thread and its advantages (any 2):**


Thread:** A thread is the smallest unit of a process, and it represents a single
sequence of execution within that process.
Advantages:
1. **Concurrency:** Threads allow multiple tasks to be executed
concurrently within a process, improving overall system efficiency.
2. **Resource Sharing:** Threads within the same process share resources
such as memory space, which can lead to more efficient communication and
data sharing.
5. What is Process Scheduling? State its objectives:**
Process Scheduling:** It is the mechanism used by the operating system to
manage the execution of processes. It involves selecting processes from the
ready queue and allocating the CPU to them.
Objectives:1. Fairness: Ensure fair allocation of CPU time among competing
processes. 2. Efficiency: Maximize CPU and system utilization. 3. Throughput:
Maximize the number of processes completed in a given time.
6. **What is non-preemptive scheduling?
- Non-preemptive scheduling is a type of scheduling where a process cannot be
interrupted during its execution. Once a process starts running, it continues until
it completes or voluntarily yields the CPU. No other process can preemptively
force it to release the CPU.
7. **State scheduling criteria:**
Scheduling Criteria: 1.CPU Utilization: Maximizing CPU usage for increased
system throughput.2.Throughput:The number of processes completed per unit
of time 3. Turnaround Time: The total time taken to execute a process, including
waiting time and execution time.4.Waiting Time: The total time a process
spends waiting in the ready queue.5. Response Time:The time between
submitting a request and receiving the first response.
8. **Define Virtual Memory:**
- Virtual memory is a memory management technique that provides an
"idealized abstraction of the storage resources that are actually available on a
given machine" which creates the illusion to users of a very large (main)
memory.
9. **Define Physical Address:**
- A physical address refers to a specific location in the physical memory
(RAM) hardware of a computer. It is the actual location where data is stored in
the computer's memory.
10. **Describe any four file attributes:**
- **File attributes describe various properties and characteristics of a file.**
1. **Name:** The unique identifier or label given to the file.
2. **Size:** The amount of storage space occupied by the file.
3. **Timestamps:** Information about the last modification time, creation
time, and access time of the file.
4. **Permissions:** The set of rules that determine who can access the file
and what operations they can perform on it..
1. Process States and State Transitions:
Process States:1. New: The process is being created.2. Ready: The process is
ready to execute but waiting for the CPU 3. Running: The process is currently
being executed.4. Blocked (Waiting): The process is waiting for an event (e.g.,
I/O) to complete.5. Terminated: The process has finished execution.
- Process State Transitions Diagram:

2. **PCB (Process Control Block) with Diagram:**


- **PCB Diagram:**

- **Explanation:** ![
- The PCB contains information about the process, including process ID,
state, program counter, CPU registers, memory information, and other details
needed for process management.
Process State ,Process number ,Program Counter, CPU Registers ,Memory
Management Information
3. **Differentiate between Long-Term and Short-Term Scheduler:**

Long Term Scheduler Short Term Scheduler

Sr.
No

1 It is job scheduler It is CPU scheduler

2 It selects processes from job It selects processes from


pool and loads them into ready queue which are ready
memory for execution to execute and allocates
CPU to one of them

3 Access job pool and ready Access ready queue and


queue CPU

4 It executes much less It executes frequently. It


frequently. It executes when executes when CPU is
memory has space to available for allocation
accommodate new process.

5 Speed is less than short term Speed is fast


scheduler

6 It controls the degree of It provides lesser control


multiprogramming over degree of
multiprogramming

7 It chooses a good process It chooses a new process for


that is a mix-up of a processor quite frequently.
input/output bound and CPU
bound.

4. **Explain Partitioning with its Types:**


Partitioning: Memory partitioning involves dividing the physical memory into
fixed-size or variable-size partitions to accommodate multiple processes.
Types 1. **Fixed Partitioning: - Memory is divided into fixed-size partitions.
- Each partition can hold one process. - Inefficient for varying process sizes.
2. Variable Partitioning:- Memory is divided into variable-size partitions.
- Can accommodate processes of different sizes.
- Requires dynamic memory management.
5. **Explain Free Space Management Techniques:**
- **Free Space Management:**
- Techniques to keep track of free and allocated memory space.
- **Techniques:**
1. **Bit Vector or Bitmap:**
- Each bit represents a block of memory.
- 0 indicates free, 1 indicates allocated.
Bit Vector:
The free-space list is implemented as a bit map or bit vector.
Each block is represented by 1 bit. If the block is free, the bit is
1; if the block is allocated, the bit is 0.
For example, consider a disk where blocks
2, 3, 4, 5, 8, 9, 10, 11, 12, 13 are free and the rest of the blocks
are allocated.
The free-space bit map would be : 0011110011111100
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 0 1 1 1 1 0 0 1 1 1 1 1 1 00
2. **Linked List:**
- Maintain a linked list of free memory blocks.
- Each block points to the next free block.
3. **Buddy System:**
- Memory is split into blocks of powers of 2.
- Allocates and deallocates in blocks of size 2^n.
6. **Explain Linked File Allocation Method:**
- **Linked Allocation: - Each file is a linked list of disk blocks. - File
allocation table (FAT) stores pointers to the blocks.- Supports dynamic file size
changes - May lead to fragmentation and inefficient use of space.
These explanations provide a basic understanding of the concepts. For detailed
illustrations and further study, referring to textbooks or additional resources
would be beneficial.
7. Describe I/O Burst and CPU Burst cycle with neat diagram. 4M
Ans CPU burst cycle: It is a time period when process is busy with
CPU.
I/O burst cycle: It is a time period when process is busy in working
with I/O resources.
A process execution consists of a cycle of CPU execution and
I/O wait.
A process starts its execution when CPU is assigned to it, so
process execution begins with a CPU burst cycle.
This is followed by an I/O burst cycle when a process is busy
doing I/O operations.
A process switch frequently from CPU burst cycle to I/O burst
cycle and vice versa.
The complete execution of a process starts with CPU burst cycle,
followed by I/O burst cycle, then followed by another CPU burst
cycle, then followed by another I/O burst cycle and so on.
The final CPU burst cycle ends with a system request to
terminate execution.
Parameter
Command Line Graphic User
Interface(CLI) Interface(GUI)
Definition Interaction is by
Interaction with devices is by
typing commands
graphics and visual
components and icons

Understan Commands need to be Visual indicators and icons are


ding memorized easy to understand
emory Less memory is
required for storage More memory is required as
visual components are
involved.

Working Use of keyboard for Use of mouse for interaction


Speed commands makes makes it slow
CLI quicker.

Only keyboard
Resources Mouse and keyboard both can
used be used

Accuracy High Comparatively low

Flexibility Command line Structure and design can


interface does not change with updates
change, remains
same over time

1. Differentiate between Multi programmed and Multitasking operating System (Any two
points)

Multi programmed System Multitasking operating System


It includes the single CPU to execute It uses multiple tasks for the task
the program. allocation.
Concept of Context Switching is Concept of Context Switching and
used. Time Sharing is used.
Multi-programming increases CPU In multi-tasking also increases CPU
utilization by organizing jobs utilization, it also increases
responsiveness.
Execution of process takes more Execution of process takes less time.
time.

1.Enlist types of operating system. Explain multiprogramming OS in detail.


Types of os = Batch Operating System,Multi-Programming System,Multi-
Processing System,Multi-Tasking Operating System,Time-Sharing Operating
System,Distributed Operating System,Network Operating System,Real-Time
Operating System.
multiprogramming OS
A Multiprogramming Operating System runs multiple programs on a single
processor. If a program has to wait for an I/O operation, other programs utilize
the CPU in the meantime. These operating systems form an important and
popular class of operating systems. Some examples are Linux distributions,
Windows, IOS, etc.
1. State and describe any two advantages of multiprocessor system
The advantages of the multiprocessing system are: Increased Throughput −
By increasing the number of processors, more work can be completed in a
unit time. Cost Saving − Parallel system shares the memory, buses,
peripherals etc.

2. Describe working of time sharing system with neat diagram.


USER 3 USER 4

CPU
USER 2 (ACTIVE STATUS)
USER 5

USER 1 USER 6 (READY STATUS)

Time-sharing is a method of allowing multiple individuals at different terminals to


access the same computer system simultaneously. Multiprogramming is logically
followed by time-sharing. Many processes are assigned to computer resources in
time slots in this time-sharing operating system.

2. Explain Time sharing O.S.


Time sharing operating system is a type of operating system. An operating system
is basically, a program that acts as an interface between the system hardware and
the user. Time sharing OS allows the user to perform more than one task at a time,
each task getting the same amount of time to execute. Hence, the name time
sharing OS. Multiple jobs are running at the CPU time and also, they use the CPU
simultaneously
Advantages of Time Sharing Operating System

1.Response time of CPU reduces. 2.Idle time of CPU reduces.3Each task/process


gets an equal time slot to execute.
Disadvantages 1The data
of each program should be secure so that they don’t mix.
2Communication is very important to maintain. Lack of communication can affect
the whole working.
1. Explain any 4 services provided by OS.
2. Ans=
1.User Interface: All operating systems have a user interface that allows users to
communicate with the system. Three types of user interfaces are available: a.
Command line interface (CLI) b. Batch interface c. Graphical user interface (GUI)
2.Resource allocation: Operating system manages resource allocation to the
processes. These resources are CPU, main memory, file storage and I/O
devices.
3.Accounting: Operating system keeps track of usages of various computer
resources allocated to users.
4.I/O operations: When a program is running, it may require input/output
resources such as a file or devices such as printer. So the operating system
provides a service to do I/O.

List components of OS. Explain process management in detail.+


Ans=
List of System Components: 1. Process management 2. Main memory
management 3. File management 4. I/O system management 5. Secondary
storage management
Process Management: The operating system manages many kinds of activities
ranging from user programs to system programs like printer spooler, name
servers, file server etc. Each of these activities is encapsulated in a process.
 A process includes the complete execution context (code, data, PC, registers,
OS resources in use etc.).
 The basic unit of software that the operating system deals with in scheduling
the work done by the processor is either a process or a thread, depending on
the operating system.
 It’s tempting to think of a process as an application, but that gves an
incomplete picture of how processes relate to the operating system and
hardware.

3. What is purpose of system call? State two system calls with their
functions.+
Ans=
System call provides an interface between a running program and operating
system. It allows user to access services provided by operating system. This
system calls are procedures written using C, C++ and assembly language
instructions. Each operating system has its own name for each system call. Each
system call is associated with a number that identifies itself.
*System calls:
*Process Control: Program in execution is a process. A process to be executed
must be loaded in main memory. while executing it may need to wait,
terminate or create & terminate child processes.
 end, abort  load, execute  create process, terminate process get process
attributes, set process attributes  wait for time  wait event, signal event 
allocate and free memory
* Device Management: When a process is in running state, it requires several
resources to execute. These resources include main memory, disk drives, files
and so on. If the resource is available, it is assigned to the process. Once the
resource is allocated to the process, process can read, write and reposition the
device.
 request device, release device  read, write, reposition  get device
attributes, set device attributes  logically attach or detach devices

4. Enlist the operating system tools. Explain any two in detail.+


Ans=
Following are the operating tools:
 User Management  Security policy  Device Management 
Performance Monitor  Task Scheduler
User management:  User management includes everything from creating a
user to deleting a user on your system. User management can be done in three
ways on a Linux system.Useradd: With useradd commands you can add a user
B) Device Management: Device management is the process of managing the
implementation, operation and maintenance of a physical and/or virtual
device. All Linux device files are located in the /dev directory, which is an
integral part of the root (/) filesystem because these device files must be
available to the operating system during the boot process. Example: ls –l /dev
Above example gives the list of device file from kernel. Udev supplies a
dynamic device directory containing only the nodes for devices which are
connected to the system. It creates or removes the device node files in the
/dev directory
5. State any four types of system calls
Create file: This system call is used to create a new file in any application.
Delete file: This system c all is used to delete a specific file from the given
directory.
Open file: This system call is used to open an existing file
Close file: This system call is used to close an already opend file
6. Describe any two components of O.S.
1.Process Management:
The operating system manages many kinds of activities ranging from user
programs to system programs like printer spooler, name servers, file server etc.
2.file management in operating system is nothing but software that handles or
manages the files present in computer software. The file system in the
operating system is capable of managing individual as well as groups of files
present in the computer system.
7. Write any four systems call related to file management.
System calls related to file management are:
1. create new file 2. delete existing file 3. open file 4. close file 5. create
directories 6. delete directories 7. read, write, reposition in file 8. getfile
attributes 9. set file attribute

8. Write two uses of following O.S. tools


(i) Device Management
(ii) Performance monitor
(iii) Task Scheduler

Device management:  Allocate devices to the process as per process


requirement and priority.
 Deallocate devices either temporarily or permanently depending on
condition.
Performance monitor :1Monitor various activities on a computer such as CPU
or memory usage. 2. Used to examine how programs running on their
computer affect computer’s performance
Task scheduler 1. Assign processor to task ready for execution
2. Executing predefined actions automatically whenever a certain
set of condition is met.

You might also like