0% found this document useful (0 votes)
39 views28 pages

OSY CT1 Qbans

The document discusses operating system concepts like real-time operating systems, time sharing operating systems, command line vs graphical user interfaces, multiprogramming operating systems, batch operating systems, multiprocessor operating systems, operating system services, file management system calls, operating system components, system calls, and operating system tools like device management and performance monitor.

Uploaded by

tester
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)
39 views28 pages

OSY CT1 Qbans

The document discusses operating system concepts like real-time operating systems, time sharing operating systems, command line vs graphical user interfaces, multiprogramming operating systems, batch operating systems, multiprocessor operating systems, operating system services, file management system calls, operating system components, system calls, and operating system tools like device management and performance monitor.

Uploaded by

tester
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/ 28

CT1 Question Set(W23-OSY-22516)

Unit 1:- Overview of Operating System ( C22516.a)

1) Define real time operating system. List its any four applications of it.

A real-time operating system (RTOS) is an operating system designed to handle tasks


with specific timing requirements or deadlines.

In a real-time operating system each job has well defined fixed time constraints which
need to be maintained otherwise the system will fail.

The time taken by the system to respond to an input and provide the output or display
the
updated information is known as the response time. So, in these systems, the response
time should be very minimum. The system should complete the task within the deadline.

Hard Real-Time: Hard real-time refers to tasks or processes that have strict and critical
timing requirements. These tasks must be completed within a specific deadline;
otherwise, it can lead to system failure or dangerous consequences.

Soft Real-Time: Soft real-time refers to tasks or processes that have timing requirements,
but they are not as strict as hard real-time tasks. In soft real-time systems, missing
occasional deadlines may not have catastrophic consequences, but it can degrade
system performance or user experience.
Applications:
• Air traffic control systems
• Railway signaling systems
• Nuclear reactor control systems
• Aerospace and Missile Defense systems
• Medical devices
• Telecommunications

2) Explain Time sharing O.S.


Advantages

Disadvantages
3) Compare between command line and Graphical user interface.
(Any four points)

4) List any four advantages of Multiprogramming operating system


5) With the help of diagram describe Batch operating system

The programmers leave their programs with the operator and the operator
then sorts the programs with similar requirements into batches.
6) With the help of diagram describe Multiprocessor operating system.
OR
6) State and describe any two advantages of multiprocessor system
Unit 2:- Services and components of Operating System ( C22516.b)

1) State any four services of operating system.

2) Write any four systems call related to file management.


Some common system calls
are create, delete, read, write, reposition, or close.

• Create and delete file:-We first need to create and delete files.
• Open and close :- Once the file is created, we need to open it and to use it.
Finally, we need to close the file, indicating that we are no longer using it.
• Read,Write,Reposition:- Read and write operations perform read and write
operations on a file .By using Reposition a pointer may be set at starting position
or can be repositioned anywhere in a file.
• Get and Set file attributes:- When any file created or in use much more
information gets attached to file by OS like file name,acess rights,protection
code,date and time,accounting information.Thus thesesystem calls used to set
and get file attributes. We may need these same sets of operations for directories
if we have a directory structure for organizing files in the file system. In addition,
for either files or directories, we need to be able to determine the values of
various attributes and perhaps to reset them if necessary. File attributes include
the file name, a file type, protection codes, accounting information, and so on

3) Describe any two components of O.S.

4) Describe system calls with suitable example .


OR
What is purpose of system call? State any two system calls with their
functions

The purpose of a system call is to provide an interface between user-


level processes and the operating system. It allows user-level
programs to request services from the operating system kernel.
System calls provide a controlled and standardized way for
applications to interact with the underlying operating system.

open(): The open() system call is used to open a file or create a new
file if it doesn't exist. It provides access to the file system and returns
a file descriptor, which is a unique identifier for the opened file. The
open() system call allows specifying various flags and permissions
related to file access.
read(): The read() system call is used to read data from a file or a file-
like resource. It takes a file descriptor, a buffer, and the number of
bytes to read as parameters. The read() system call allows applications
to retrieve data from files, input devices, or other sources of input.

write(): The write() system call is used to write data to a file or a file-
like resource. It takes a file descriptor, a buffer containing the data to
be written, and the number of bytes to write as parameters. The
write() system call allows applications to send data to files, output
devices, or other destinations.

5) Enlist the operating system tools. Explain any two in detail.

Operating System tools:


1. Computer management
2. Device Manager
3. Task Manager
4. Task Schedular
5. Performance Monitor
6. Users & Groups
7. Local Security Policy

Computer Management
Computer management option can be found within the control
panel of any computer system. One may go to the control panel
from the start menu.
On the computer management window, one may find there are
three panes. The left pane will show some functions, and when
one chooses a function from the left pane, the details of the
pane will be available at the pane at the centre, where as the
right section will show the series of action that can be taken.
There is Task Scheduler within the system tools, and even the
windows event
viewer can be also accessed from the computer management list.
One can
also start defragmentation of the disk and disk spaces from here. And
in the
performance sector, one can see how the system is performing and
that can
be observed for a long period also.

D
OR
5) Describe with example, use of following tools:
i) Device Management
• Description: Device Management tools are used to manage and configure
hardware devices on a computer. These tools help you install, update,
troubleshoot, and monitor the status of hardware components such as graphics
cards, network adapters, and storage devices.
• Example: In Windows, you can access Device Manager to update device drivers,
disable or enable devices, and check for hardware-related issues. For instance, if
your graphics card is not functioning correctly, you can open Device Manager to
update the graphics card driver or disable and re-enable the device to resolve
potential driver conflicts.

ii) Performance monitor


ii) Performance Monitor:
• Description: Performance Monitor, often known as "PerfMon" or "Resource
Monitor" in some operating systems, is a tool used to monitor and analyze the
performance of a computer. It provides real-time and historical data on various
system metrics, allowing you to diagnose performance problems.
• Example: In Windows, you can use Performance Monitor to track CPU usage,
memory usage, disk activity, and network performance. For example, if your
computer is running slowly, you can use PerfMon to identify which processes are
consuming the most CPU or memory, helping you pinpoint the cause of the
performance issue.

iii) Task scheduler

6) Describe various activities performed by following operating system


components.
i) Main memory management

• Memory management refers to management of Primary Memory or


Main Memory
• Main memory provides a fast storage that can be accessed directly by
the CPU and I/O devices. For a program to be executed, it must in the
main memory.
• Main memory is a volatile storage device. It loses its contents in the
case of system failure.
ii) File management

• Description: File management involves managing files and


directories on secondary storage devices like hard drives, SSDs, or
network drives.
• Activities:
• File Creation and Deletion: The OS provides mechanisms to
create, delete, and rename files and directories.
• File Access Control: It enforces file access permissions to
protect data from unauthorized access.
• File I/O: The OS manages reading from and writing to files,
including buffering and caching for efficiency.
• File Organization: It decides how files are stored on disk, which
can involve various file systems like FAT, NTFS, or ext4.
• File Backup and Recovery: Some OSes offer backup and
recovery utilities for data protection.

iii) Process Management


A process is a program in execution.
A process needs certain resources, including CPU time, memory, files,
and I/O
devices, to accomplish its task. These resources are provided when
process is
created or allocated while it is running.

iv) I/O System management

• Description: I/O (Input/Output) system management handles communication


between the CPU and peripheral devices.
• Activities:
• Device Drivers: The OS provides device drivers to control and interact
with hardware components like printers, keyboards, and disk drives.
• Buffering and Caching: It uses buffers and caches to optimize I/O
operations, reducing latency and improving performance.
• Error Handling: Detects and manages errors in I/O operations, ensuring
data integrity.
• Device Scheduling: Prioritizes and manages access to I/O devices to
prevent bottlenecks.

v) Secondary storage management

• Description: Secondary storage management deals with managing data on long-


term storage devices like hard disks.
• Activities:
• File System Management: Manages the organization, allocation, and
access to data on secondary storage using file systems.
• Disk Space Allocation: Allocates and manages space on disks for storing
files and data efficiently.
• Disk Scheduling: Optimizes access to disk sectors for faster data retrieval.
• Fault Tolerance: Implements measures like RAID to ensure data
availability and redundancy.

Unit 3:- Process Mangement (C22516.c)

1)Draw and explain process state diagram.


A process state is a condition of the process at a specific instant of time. It also
defines the current position of the process.

2)Explain multithreading model in detail (Any Two).


• Advantages:
• Lightweight: User-level threads are lightweight and have low
overhead.
• Simplicity: Easier to implement than other models.
• Disadvantages:
• Limited Parallelism: Limited parallelism as all user-level threads
are tied to a single kernel thread.
• Blocking: If one thread blocks, the entire process is blocked.

One-to-One Model:
• Description: Each user-level thread maps to a separate kernel-level
thread, allowing for true parallelism.
• Advantages:
• Enhanced Parallelism: True parallelism with the ability to fully
utilize multi-core processors.
• Independent Blocking: If one thread blocks, others can
continue.
• Disadvantages:
• High Overhead: Creating and managing many kernel-level
threads can be resource-intensive.
• Limited Scalability: Can be inefficient when managing a large
number of threads.

Many-to-Many Model:
• Description: A hybrid model where many user-level threads are
mapped to a smaller or equal number of kernel-level threads,
providing a balance between parallelism and efficiency.
• Advantages:
• Scalability: Provides a balance between parallelism and resource
management.
• Efficient: Can efficiently utilize both user-level and kernel-level
threads.
• Disadvantages:
• Complexity: More complex to implement than the other
models.
• Performance Overhead: Managing the mapping between user
and kernel threads adds some overhead.

3) Write the outputs of following commands


(i) Wait 2385018
wait is a built-in command of Linux that waits for completing any running
process. wait command is used with a particular process id (PID) or job id. In this
case if the PID 2385018 exists, it will wait for that process to complete before
continuing execution, and if the PID does not exists there will be an error stating
“wait: pid 2385018 is not a child of this shell”
(ii) Sleep 09
The sleep command is used to pause execution of a script for the specified
amount of time in seconds. In this case if the command ‘Sleep 09’ is run in a
interactive shell or command line environment, the shell will simply pause or
sleep for 9 seconds and then return control back to the user.
(iii) PS –u Asha
The PS command is used to display information about running processes on the
system. The “ps -u Asha” command would list all the processes owned/started by
the user “Asha” including their PID(process id), TTY(terminal number), Time ( CPU
time used by process), and CMD (the command which initiated the process)
(iv) exit

The "exit" command is used to exit the current shell or terminal session. When we
run this command, it typically terminates the shell session, and we will be
returned to the parent shell or terminal.

4) State and describe types of Schedulers.


5)With a neat diagram explain Interprocess Communication Model.

Message-Passing Model:
In the message-passing model, processes communicate by sending and
receiving messages. These messages can be simple data structures or more
complex packets of information. Here's a description of the key
components of the message-passing model:

• Message Queues: In this model, processes typically use message


queues to send and receive messages. A message queue is a data
structure that holds messages in a first-in, first-out (FIFO) order.
Processes can enqueue messages (send) and dequeue messages
(receive) from these queues.

• Sender and Receiver: The sender process creates a message,


specifies the destination process, and sends the message to the
destination's message queue. The receiver process checks its message
queue for incoming messages and retrieves them.

• Synchronization: Message-passing often involves synchronization


mechanisms to ensure that the sender and receiver don't access the
same message queue simultaneously. This prevents data corruption
and race conditions.

• Blocking and Non-Blocking: Message-passing can be blocking or


non-blocking. In blocking communication, the sender waits until the
receiver acknowledges receipt of the message. In non-blocking
communication, the sender continues execution without waiting.

2. Shared Memory Model:

In the shared memory model, processes share a common region of


memory. They can read from and write to this shared memory region,
enabling efficient data exchange. Here's a description of the key
components of the shared memory model:
• Shared Memory Segment: A region of memory is designated as a
shared memory segment. All processes that want to communicate
through shared memory must attach to this segment.

• Read and Write: Processes can read and write data directly to and
from the shared memory segment. This allows for fast data exchange.

• Synchronization: Synchronization mechanisms, such as semaphores


or mutexes, are often used to coordinate access to the shared
memory region, preventing conflicts when multiple processes attempt
to access it simultaneously.

• Data Consistency: Ensuring data consistency is crucial in shared


memory communication. Processes must agree on how to structure
data and use synchronization primitives to avoid data corruption.

OR

5)Differentiate between shared memory system and message passing system of


interprocess communication.

Aspect Shared Memory System Message Passing System

Communication Mechanism Processes share a common Processes exchange data


region of memory. through messages.

Data Sharing Efficient data sharing as Less efficient data sharing as


processes read/write directly data must be copied into and
to/from shared memory. out of messages.
Speed Faster communication Relatively slower

Usage It can be used in exchanging It can be used in exchanging


larger amounts of data. small amounts of data.

Synchronization Typically requires Synchronization mechanisms


synchronization mechanisms are built into the message-
like semaphores or mutexes to passing system, and messages
coordinate access to shared often provide better isolation.
memory.

System type It is used for communication It is typically used in a


between processes on a single distributed environment where
processor or multiprocessor communicating processes
systems where the reside on remote machines
communicating processes connected through a network.
reside on the same machine

Memory Overhead Generally lower memory Higher memory overhead due


overhead as processes access a to message buffers and copying
common memory region. data into/out of messages.

Complexity Simpler to implement for More complex to implement


sharing data among processes due to the need for message
that require concurrent access. queues and associated
mechanisms.

Granularity of Communication Fine-grained communication Coarser-grained


with direct access to shared communication where data is
data, suitable for parallel sent and received as discrete
processing. messages.

Scalability May face scalability challenges Typically more scalable for a


when many processes need to larger number of processes as
access the same shared each message exchange can be
memory. independent.

Error Isolation Errors in one process can Errors are often isolated to
potentially affect data integrity individual processes, reducing
across all processes sharing the the risk of widespread data
memory. corruption.

Examples Examples include multithreaded Examples include client-server


applications sharing data applications using sockets or
through global variables. interprocess communication
libraries.

6)State benefits of Multithreading.


Task Parallelism: Multithreading is particularly well-suited for task parallelism, where different
threads can perform independent tasks concurrently. This is common in scientific computing and
data processing applications.

Concurrency: Multithreading enables concurrent execution of tasks, which is beneficial for


applications that require handling multiple simultaneous events or processing multiple data
streams concurrently.

Modularity: Multithreading promotes a modular design of software. Different aspects of a


program can be implemented as separate threads, making it easier to develop and maintain
complex applications.

You might also like