Sei sulla pagina 1di 14

For More Ignou Solved Assignments Please Visit - www.ignousolvedassignments.

com

Connect on Facebook :

http://www.facebook.com/pages/IgnouSolvedAssignmentscom/346544145433550

Subscribe and Get Solved Assignments Direct to your Inbox :

http://feedburner.google.com/fb/a/mailverify?uri=ignousolvedassignments_com

Request Any Solved Assignment at :

http://ignousolvedassignments.com/request-and-share-solved-assignments/

Course Code : MCS-041

Course Title : Operating Systems

Assignment Number : MCA(4)/041/Assign/12

Maximum Marks : 100

Weightage : 25%

Last Dates for Submission : 15th October, 2012 (For July 2012 Session)

15th April, 2013 (For January 2013 Session)

This assignment has four questions. Answer all questions. Each question is of 20 marks. Rest 20
marks are for viva voce. You may use illustrations and diagrams to enhance the explanations.
Please go through the guidelines regarding assignments given in the Programme Guide.

Question 1: Consider the following jobs:


Job # Arrival Run
time time
A 0 4
B 2 5
C 3 2
D 5 4

a) Using the SJF method, compute the completion times of the above jobs, average turn
around time and average waiting time.
b) Using the SRTF (Shortest Remaining Time first) method, compute the completion times
of the above jobs, the average turn around time and the average waiting time. Note that
SRTF is SJF with preemption. (Hint: Completion time - arrival time = turnaround time).
c) Using the Round Robin method (with Quantum = 2), compute the completion times of the
above jobs and the average waiting time.
Question 2:
a. Explain the Banker’s problem. Consider the following snapshot of a system:

Answer the following questions using Banker's algorithm:


i. What is the content of the matrix need?
ii. Is the system in a safe state?
iii. If a request from P1 arrives for (0, 4, 2, 0), can the request be granted immediately?

Answer the following questions using the banker’s algorithm:

a. What is the content of the matrix Need?


 The values of Need for processes P0 through P4 respectively are (0, 0, 0, 0), (0, 7,
5, 0), (1, 0, 0, 2), (0, 0, 2, 0), and (0, 6, 4, 2)

b. Is the system in a safe state?


 Yes. With Available being equal to (1, 5, 2, 0), either process P0 or P3 could run.
Once process P3 runs, it releases its resources which allow all other existing
processes to run.

c. If a request from process P1 arrives for (0,4,2,0), can the request be granted
immediately?
 Yes it can. This results in the value of Available being (1, 1, 0, 0).One ordering of
processes that can finish is P0, P2, P3, P1, and P4.
b. Consider the following page-reference string:
1, 2, 3, 4, 2, 1, 3, 4, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 4

How many page faults would occur for following replacement algorithms assuming one, two,
three, four, five, six or seven frames? Remember that all frames are initially empty, so your first
unique pages will all cost one fault each.
i. LRU replacement.
ii. FIFO replacement.
iii. Optimal replacement.

The reference string

R21 R20 R19 R18 R17 R16 R15 R14 R13 R12 R11 R10 R9 R8 R7 R5 R5 R4 R3 R2 R1

4 3 2 1 2 3 6 7 3 2 1 2 6 4 3 1 2 4 3 2 1

a) Memory with 5 frames + FIFO method:

1
Page out Page in When?
2
----- 1,2,3,4,5 R1 => R7
3
1 6 R8
4
2 1 R10
5
3 2 R11
6
4 3 R12
1
5 7 R13
2

Swapped out page

Swapped in page
# of page faults using FIFO =5 (without replacement) + 5 (with replacement)=10

b) Memory with 5 frames + LRU method:

1
Why?
2 Page out Page in When?
(Notes)
3 6
----- 1,2,3,4,5 R1 => R7 There is free
4 3 frames

5 7 3 6 R8 5,1,2,4,3

4 3 R12 2,1,6,5,4
Swapped out page 5 7 R13 3,2,1,6,5

Swapped in page

# of page faults using LRU =5 (without replacement) + 3 (with replacement)=8

c) Memory with 5 frames + OPTIMAL method:

1
Why?
2 Page out Page in When?
(Notes)
3
----- 1,2,3,4,5 R1 => R7 There is free
4 6 frames

5 7 4 6 R8 2,1,3,4 or 5

5 7 R13 6,3,2,1 ,5
Swapped out page

Swapped in page
# of page faults using OPTIMAL =5 (without replacement) + 2 (with replacement)=7

# Frames LRU FIFO Optimal

1 20 20 20

2 18 18 15

3 15 16 11

4 10 14 8

5 8 10 7

6 7 10 7

7 7 7 7

Under what circumstances do page faults occur? Describe the actions taken by the operating
system when a page fault occurs.

- Under what circumstances do page faults occur?

A page fault occurs when an access to a page that has not been brought into main memory takes
place.

- Describe the actions taken by the operating system when a page fault occurs.

The operating system verifies the memory access, aborting the program if it is invalid. If it is valid, a
free frame is located and I/O is requested to read the needed page into the free frame. Upon
completion of I/O, the process table and page table are updated and the instruction is restarted.
Q.3(a) The Linux kernel does not allow paging out of kernel memory. What effect does this
restriction have on the kernel’s design? What are two advantages and two disadvantages of this
design decision?

Answer: The primary impact of disallowing paging of kernel memory in Linux is that the non-
preemptability of the kernel is preserved. Any process taking a page fault, whether in kernel or in
user mode, risks being rescheduled while the required data is paged in from disk. Because the kernel
can rely on not being rescheduled during access to its primary data structures, locking requirements
to protect the integrity of those data structures are very greatly simplified. Although design
simplicity is a benefit in itself, it also provides an important performance advantage on uniprocessor
machines due to the fact that it is not necessary to do additional locking on most internal data
structures.

There are a number of disadvantages to the lack of pageable kernel memory, however. First of all, it
imposes constraints on the amount of memory that the kernel can use. It is unreasonable to keep
very large data structures in non-pageable memory, since that represents physical memory that
absolutely cannot be used for anything else. This has two impacts: first of all, the kernel must prune
back many of its internal data structures manually, instead of being able to rely on a single
virtualmemory mechanism to keep physical memory usage under control. Second, it makes it
infeasible to implement certain features that require large amounts of virtual memory in the kernel,
such as the /tmp-74 Chapter 21 The Linux System filesystem (a fast virtual-memory-based file
system found on some UNIX systems).

Note that the complexity of managing page faults while running kernel code is not an issue here. The
Linux kernel code is already able to deal with page faults: it needs to be able to deal with system
calls whose arguments reference user memory that may be paged out to disk.

Q.3(b) The Windows 2000 VM manager uses a two-stage process to allocate memory. Identify
several ways in which this approach is beneficial?

Answer: A process in Windows 2000 is limited to 2 gigabytes address space for data.The two-stage
process allows the access of much larger datasets, by reserving space in the processes address space
first and then committing the storage to a memory mapped file. An application could thus window
through a large database (by changing the com-mitted section) without exceeding process quotas or
utilizing a huge amount of physical memory.

Question 4:

a. Discuss in detail the Process management, Memory management, I/O management, File
management and Security and Protection in WINDOWS 7 Operating System. (20 Marks)

Answer : These are the pieces of the system we’ll be looking at:

Process Management

Main Memory Management


File Management

I/O System Management

Secondary Management

Networking

Protection System

Command-Interpreter System

PROCESS MANAGEMENT

A process is a program in execution: (A program is passive, a process active.)

A process has resources (CPU time, files) and attributes that must be managed.

Management of processes includes:

· Process Scheduling (priority, time management, . . . )

· Creation/termination

· Block/Unblock (suspension/resumption )

· Synchronization

· Communication

· Deadlock handling

· Debugging

MAIN MEMORY MANAGEMENT

· Allocation/de-allocation for processes, files, I/O.

· Maintenance of several processes at a time

· Keep track of who's using what memory

· Movement of process memory to/from secondary storage.

FILE MANAGEMENT

A file is a collection of related information defined by its creator. Commonly, files represent
programs (both source and object forms) and data. The operating system is responsible for the
following activities in connections with filemanagement:
File creation and deletion.

Directory creation and deletion.

Support of primitives for manipulating files and directories.

Mapping files onto secondary storage.

File backup on stable (nonvolatile) storage media.

I/O MANAGEMENT

· Buffer caching system

· Generic device driver code

· Drivers for each device - translate read/write requests into disk position commands.

SECONDARY STORAGE MANAGEMENT

· Disks, tapes, optical, ...

· Free space management ( paging/swapping )

· Storage allocation ( what data goes where on disk )

· Disk scheduling

NETWORKING

· Communication system between distributed processors.

· Getting information about files/processes/etc. on a remote machine.

· Can use either a message passing or a shared memory model.

Windows 7 operating system memory manager creates a virtual memory system comprising of
available physical memory (RAM) and a page file system on the hard disk (usually found in C drive).

Total virtual physical memory = Physical Memory (RAM) + a small portion on hard disk which is
treated similar to physical memory (page file).

If you look on running processes then you'll notice something like:


Few terminology about Processes table:

1. Commit: Amount of virtual memory reserved by the operating system for the
process. This includes both amount of physical memory (RAM) being used and any page that
is saved in page file (HDD).
2. Working Set: Amount of physical memory currently in use by the process. This
memory component is consiste of 2 parts: Shareable & Private.
1. Shareable: Amount of physical memory in use by the process that can be
shared with other processes. By sharing memory we mean sharing those files, in fact
dll, which are required by multiple processes so that instead of loading them multiple
times for different processes , load one copy of the file in physical memory and
map it to the virtual address space of other processes that need access. Thus
sharing memory saves memory space as only one copy of the page/file is loaded.
2. Private: Amount of physical memory in use by the process that cannot be
used by other processes. This number provides a pretty accurate measure of the
amount of memory that a particular application need in order to run.
3. Hard Faults/ sec (not visible in above figure because might be not in use currently on
my system): The Hard Faults/sec column shows the average number of hard page faults per
second that have occurred in the last minute. If a process attempts to use more physical
memory than is currently available, the system must write, or page, some of the memory
contents (RAM) to disk (in the form of page file on Hard drive). If the process later needs and
accesses the memory contents that exist on the disk, it is called a Hard Fault i.e. this terms
denotes how much hard disk page file contents are being used/fetched.
Windows 7 memory management:
When you open and work with applications, the operating system’s memory manager monitors the
Working Set of each process and watches for requests for additional memory resources. As the
Working Set of a process grows, the memory manager balances the process’ demand for more
memory against requests from the kernel and other processes. If available address space becomes
scarce, the memory manager must scale back the size of the working set. This typically means
paging some of the memory contents to disk. Thus a portion of memory content of RAM is moved to
hard disk in the form of page file.

If an application requires the content of that page file (stored in HDD), it will read back and causes a
Hard Fault. While Hard Faults are a pretty normal occurrence, multiple Hard Faults typically require
additional time so that the system can read pages from the disk. When Hard Faults occur too
frequently, the resulting disk reads will decrease system responsiveness. If you have ever been
working on your system and suddenly everything seems to run in slow motion and then just
as suddenly comes back to regular speed, chances are good that your system is busily
swapping memory around so that it can continue working. As such, if you notice an excessive
number of Hard Faults related to a particular process on a regular basis, chances are your system
needs more physical memory.

Visualizing your physical memory distribution:


In order to visualize the memory usage of physical memory, you can use physical memory table in
Resource Monitor which is actually a bar graph showing memory distribution.

*My system memory distribution with visual studio running and few chrome tabs open
As you use your system, the memory manager is at work in the background moving memory back
and forth between these lists in order to maintain a delicate balance between using physical memory
and the hard disk in order to allow your system to work efficiently and effectively.

Following are the 5 major categories where physical memory is distributed:


1. Hardware Reserved
2. In Use
3. Modified
4. StandBy
5. Free

Windows 7 the newest operating system from Microsoft, simplifies computer security, making it easier for you to
reduce the risk of damage caused by viruses, spyware and other malware. Windows 7 also features an improved
backup solution to help keep your information safe, and its improved parental controls help you protect your
family.

Read about the new and improved safety, security, and privacy features in Windows 7.

The Action Center: security information at your fingertips


The new Windows 7 Action Center in the Control Panel helps you make sure that your firewall is on, your antivirus
software is up to date, and your computer is set to install updates automatically. For more information, see How
does Action Center check for problems?
Protect your data from theft, hackers, and accidental loss
BitLocker Drive Encryption encrypts your Windows hard disk to help keep documents, passwords, and other
important data safe. Once you turn on BitLocker, any file that you save on that drive is encrypted automatically.

Windows Firewall can also help protect your computer from hackers and malicious software. With Windows 7, the
built-in firewall is more flexible and easier to use than before.

The Microsoft backup system is also improved for Windows 7. Backup and Restore creates copies of your most
important files, so you're always prepared for the worst. For more information, see Backup and restore: frequently
asked questions.

Defend your computer against viruses, spyware, and


other malware
Microsoft Security Essentials is a free download for Windows 7 that helps protect your computer from viruses,
spyware, worms, Trojans, and other malware. For more information, see Help Protect your PC with Microsoft
Security Essentials.

Windows 7 also includes Windows Defender, software that helps protect your computer from pop-up ads, slow
performance, and security threats caused by spyware and other unwanted software. For more information,
see Using Windows Defender.

Reduce risk by enhancing security and control


Windows 7 makes it easier and less intrusive to run your computer as a standard user instead of as an
administrator. Windows Vista introduced User Account Control, a feature that warned you when a program
wanted to make a change on your computer. Windows 7 improves on this feature, which means you’ll get the
same level of protection, but with fewer messages than before.
To learn more, see Windows 7 features: Windows User Account Control.

Help protect your family


Windows Vista included parental controls, but they are new and improved forWindows 7. Now they're more
flexible and easier to use. With Windows 7 Parental Controls you can:

Prevent your children from playing games you don't want them to play.

Keep your children from running specific programs.

Set specific time limits on your children's computer use.

With the Parental Controls in Windows Media Center (available in Windows 7 Home Premium and above), you
can also block access to objectionable TV shows and movies.

Here's a look at some of the more significant security enhancements in Windows 7.

Core System Security

As it did with Windows Vista, Microsoft developed Windows 7 according to the Security
Development Lifecycle (SDL). It built the new OS from the ground up to be a secure computing
environment and retained the key security features that helped protect Vista, such as Kernel
Patch Protection, Data Execution Prevention (DEP), Address Space Layout Randomization
(ASLR), and Mandatory Integrity Levels. These features provide a strong foundation to guard
against malicious software and other attacks. A few key elements are worth noting.

Enhanced UAC

You're probably familiar with UAC, or User Account Control. Introduced with Windows Vista, the
feature is meant to help enforce least-privileged access and to improve the total cost of
ownership by allowing organizations to deploy the operating system without granting
administrator access to users. Though Microsoft's primary intent with UAC was to force software
developers to use better coding practices and not expect access to sensitive areas of the
operating system, most people have perceived UAC as a security feature.

When users think of UAC, they typically associate it with the access-consent prompts it issues.
Though Microsoft has made significant progress since Vista's introduction in reducing the types
and number of events that trigger the UAC prompt (or that prevent standard users from executing
tasks entirely), UAC has still been the subject of a great deal of negative feedback for Vista.

Windows 7 allows you to configure the level of UAC protection.With


Windows 7, Microsoft has again reduced the number of applications and operating system tasks
that trigger the prompt. It has also incorporated a more flexible interface for UAC. Under User
Accounts in the Control Panel, you can select Change User Account Control Settings to adjust
the feature with a slider.
The configuration slider lets you choose from among four levels of UAC protection, ranging from
Always Notify (essentially the level of UAC protection that Windows Vista provides) to Never
Notify. Obviously, you'll get the most protection with Always Notify. The advantage to setting the
slider to Never Notify as opposed to disabling UAC completely is that the prompt is only one
aspect of what UAC does. Under the Never Notify setting, though UAC pop-ups will no longer
interrupt you, some of UAC's core protections will remain, including Protected Mode Internet
Explorer.

Integrated Fingerprint Scanner Support

Many Windows users configure the operating system to log them in without a user name and
password--but that's the computer equivalent of leaving the front door of your house wide open
with a neon sign flashing "Enter Here." I highly recommend that you assign all user accounts in
Windows 7 a relatively strong password or passphrase (that means your dog's name or your
favorite basketball team don't count).

Even passwords aren't all they're cracked up to be. Passwords are secure only until they're
cracked, and cracking a password is more a matter of when than if, assuming an attacker is
sufficiently dedicated. Experts recommend two-factor authentications--in other words, adding
another layer of protection on top of the password--for better security. Many computers, laptops
in particular, come equipped with built-in biometric security in the form of a fingerprint scanner.
With Windows 7, Microsoft provides much smoother integration between the operating system
and the fingerprint-scanning hardware.
Enroll fingers to register them for user authentication.Windows 7 has better
driver support and more reliable fingerprint reading across different hardware platforms.
Configuring and using a fingerprint reader with Windows 7 for logging in to the operating system,
as well as for authenticating users for other applications and Web sites, is easy. Click
on Biometric Devices in the Control Panel to access the console for enrolling and managing
fingerprint data and customizing biometric-security settings.
The Biometric Devices console will display any detected biometric devices. If the fingerprint
reader is not yet configured, the status will display 'Not Enrolled'. Click on that status to access
the console.

You can add scans of one finger or all ten. Adding multiple fingers allows you to continue using
the biometric security even if your primary finger is in a bandage, for instance, or if your hand is
in a cast. On screen, select the finger you want to add, and then place your finger on the
fingerprint reader (or slowly drag your finger across the reader, depending on the type of
hardware you have). You will have to scan each finger successfully at least three times to
register it in the database, similar to how you have to reenter a password to confirm that you
entered it correctly.

-----------------------------------------------------THE END----------------------------------------------------------------

Potrebbero piacerti anche