Osy Model Ans DH
Osy Model Ans DH
3Explian component of Os
ANS
Main Memory Management:
This component manages the system's RAM, ensuring efficient allocation and deallocation of memory
to programs. It tracks which parts of memory are in use and by whom. It prevents programs from
accessing each other’s memory without permission. This ensures smooth and secure multitasking.
1. I/O System Management:
The OS controls input and output devices like keyboards, mice, and printers. It uses I/O drivers
and buffers to manage data transfer between hardware and software. This ensures efficient and
error-free communication. It abstracts hardware complexity, making it easier for programs to
access I/O devices.
2. Process Management:
The OS manages all running programs (processes), handling creation, scheduling, and
termination. It ensures fair allocation of CPU time to processes. It also manages inter-process
communication and prevents deadlocks. This allows multiple processes to run smoothly on the
system.
3. File Management:
This component organizes and manages data in files and directories on storage devices. It
provides functions like creating, reading, writing, and deleting files. The OS also controls
access permissions to ensure data security. It keeps track of file locations and manages storage
efficiently.
Time-Shared OS Multiprogramming OS
Focuses on time-sharing. Focuses on CPU efficiency.
Interactive systems. Batch processing systems.
Uses time slices. Switches on I/O wait.
Requires preemption. Can be non-preemptive.
For multi-user tasks. For multiple programs.
Examples: UNIX, Windows. Examples: OS/360, early UNIX.
Q.Explain with diagram single level directory structure andtwo level directory
structure with adv and disv.
Hh
j
Q.4
1.Explain Round robin algorithm with suitable example
Definition:
Round Robin (RR) is a CPU scheduling algorithm that assigns a fixed time slice
(or quantum) to each process in the ready queue. Processes are executed in a
circular order, ensuring that no single process monopolizes the CPU.
,.
◦ Steps to Follow:
• A reference string tells the order in which pages are requested:
7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1
• Assume the number of frames (spaces for pages in memory). Let’s take 3 frames
for this example.
• Start placing pages in the frames as they are requested.
• If the requested page is already in memory, it’s a hit (no page fault).
• If the page is not in memory, it’s a page fault and the page must be loaded.
• When memory is full, use the LRU rule to remove the page that was used least
recently.
.
2. Optimal and FIFO
5 , 6, 7, 8 9, 7,8,5,9,7,8,7,9,6,5,6
.
.
Explain user level thread and Kernel level thread with its advantages and disadvantages
User Level Thread
In a user thread, all of the work of thread management is done by the application and the kernel is not
aware of the existence of threads.
The thread library contains code for creating and destroying threads, for passing message and data
between threads, for scheduling thread execution and for saving and restoring thread contexts.
The application begins with a single thread and begins running in that thread. User level threads are
generally fast to create and manage.
Advantages:
1. Faster to create and manage:
2. Less overhead:
3. 1. Thread switching does not require Kernel mode privileges.
4. 2. User level thread can run on any operating system
5. . 3. Scheduling can be application specific
6. . 4. User level threads are fast to create and manage.
Disadvantages:
1. Limited use of multi-core processors:
2. Blocking issue:
3. No True Parallelism:
4. . It is not appropriate for a multiprocessor system
.
Advantages:
1. Better use of multi-core processors: T
2. Independent execution:
3. Kernel can simultaneously schedule multiple threads from the same process on multiple process.
4 If one thread in a process is blocked, the Kernel can schedule another thread of the same process.
5.Kernel routines themselves can multithreaded.
Disadvantages:
1. Kernel threads are generally slower to create and manage than the user threads.
2. Transfer of control from one thread to another within same process requires a mode switch to the
Kernel
More overhead: S
Slower to create and manage
User Management:
• This tool helps you control who can use the computer.
• You can create user accounts with usernames and passwords.
• You can decide what each user can do, like what files they can open or what programs they can
use.
• For example, an admin user can have full control of the system, while a regular user may only
use some programs.
• This tool helps keep the computer safe by making sure only the right people can use it.
• Security Policy:
• This tool helps protect the computer from hackers or unwanted access.
• It lets you set rules for things like passwords, firewalls, and who can use certain parts of the
system.
• You can make sure users have strong passwords and limit access to important files.
• This helps keep your computer and data safe.
• Device Management:
• This tool helps manage the devices connected to the computer, like printers, keyboards, and
monitors.
• It checks if the devices are working correctly.
• If a device isn’t working, it can help install the right software (called drivers) to make it work.
• It helps you fix problems with devices and make sure they run smoothly.
• Performance Monitor:
• This tool checks how well the computer is working.
• It looks at how much memory, CPU, and other parts of the system are being used.
• It can show if the computer is slow or if something is using too many resources, like memory or
CPU.
• This tool helps find problems and makes the computer work better by showing what needs
fixing.
advantages:- 1)Fast switching:- Quickly switches between thread because it doesn’t involve the os
2)Low ovrehead:-use fewer system resources
Disadvntages:-1)blocing issue:- if one thread is blockes all thread can be blocked.
2)no multicore use- only one thread runs at a time so it doesn’t use multicore process
effectively
.
One-to-Many Model:
• In the One-to-Many model, one thread manages many threads.
• The operating system knows about these threads and can run them on different processors.
• This helps make the program run faster because it can use more than one processor at the same
time.
• If one thread has a problem, only that thread stops, and the others keep working.
• Example: Imagine one boss giving work to many workers. If one worker has a problem, the
other workers can still keep working.
Advantages:-
1)Better Performance:
• The threads can run on multiple processors (CPUs) at the same time, which makes the program
faster and more efficient.
• No Full Program Failure:
• If one thread has a problem or stops, the other threads can continue working. This makes the
program more reliable.
• Efficient Use of Resources:
• The operating system manages the threads, so it can balance the workload and use system
resources (like CPU and memory) more effectively.
•
Disadvantages
1.more ovrehead
2. slower switching