Sunteți pe pagina 1din 10

Name: Nkosinathi Nkosi ICAS: 117164 Module: Operating System 600

Table of Contents

Text Page No

Table of Contents .................................................................................................................................... 1


Introduction ............................................................................................................................................ 2
Question One .......................................................................................................................................... 3
Question Two .......................................................................................................................................... 7
Necessary condition for dead lock occurrence ................................................................................... 8
References ............................................................................................................................................ 10

1
Name: Nkosinathi Nkosi ICAS: 117164 Module: Operating System 600

Introduction

A computer system typically consists of software (programs) and hardware (the tangible machine
and its electronic components).

2
Name: Nkosinathi Nkosi ICAS: 117164 Module: Operating System 600

Question One

1.1 Discuss the role of operating system.


The operating system software is the chief piece of software, the portion of the
computing system that manages all of the hardware and all of the other software. To be
specific, it controls every file, every device, every section of main memory, and every
moment of processing time. It controls who can use the system and how. In short, the
operating system is the boss.
1.2 Discuss the various scheduling technique of operating system.
First-come, first-served (FCFS) is a non-primitive scheduling algorithm that handles all
incoming objects according to their arrival time: the earlier they arrive, the sooner
they’re served. It’s a very simple technique to implement because it uses a First In, First
out (FIFO) queue. This algorithm is fine for most batch systems, but it is unacceptable
for interactive systems because interactive users expect quick response times.
Shortest job next (SJN) is a nonpreemptive scheduling algorithm (also known as
shortest job first, or SJF) that handles jobs based on the length of their CPU cycle time.
It’s possible to implement in batch environments where the estimated CPU time
required to run the job is given in advance by each user at the start of each job.
However, it doesn’t work in most interactive systems because users don’t estimate in
advance the CPU time required to run their jobs.
1.3 What is file allocation table?
A file allocation table (FAT) is a file system developed for hard drives that originally used
12 or 16 bits for each cluster entry into the file allocation table. It is used by the
operating system (OS) to manage files on hard drives and other computer systems. It is
often also found on in flash memory, digital cameras and portable devices. It is used to
store file information and extend the life of a hard drive.

1.4 What is virtual memory?


Virtual memory is a memory management capability of an operating system (OS) that
uses hardware and software to allow a computer to compensate for physical memory
shortage by temporarily transferring data from random access memory (RAM) to disk
storage.

3
Name: Nkosinathi Nkosi ICAS: 117164 Module: Operating System 600

1.5 What is Swapping?


Swapping is a mechanism in which a process can be swapped or moved temporarily out
of main memory to a backing store, and then brought back into memory for continued
execution.

2. What are various functions of KERNEL of UNIX?


Kernel is the central core component of UNIX operating system.

 Kernel manages memory, scheduling as well as communication with peripherals


like printers, keyboards etc.
 Kernel provides many system calls. A software program interacts with Kernel by
using system calls.
 Kernel has a protected memory area that cannot be overwritten accidentally by
any process.
 The Processor Manager of a UNIX system kernel handles the allocation of the
CPU, process scheduling, and the satisfaction of process requests. To perform
these tasks, the kernel maintains several important tables to coordinate the
execution of processes and the allocation of devices.
 Disk Storage with files
 Memory allocation
 Security control, user separation

4
Name: Nkosinathi Nkosi ICAS: 117164 Module: Operating System 600

 Quota controls
 CPU allocation controls

3. Explain the services provided by Kernel I/O sub system.


Several services such as scheduling, caching, spooling, device reservation, and error
handling – are provided by the kernel, s I/O subsystem built on the hardware and device
driver infrastructure. The I/O subsystem is also responsible for protecting itself from the
errant processes and malicious users.
 I/O Scheduling
To schedule a set of I/O request means to determine a good order in which to
execute them. The order in which application issues the system call is the best
choice. Scheduling can improve the overall performance of the system, can share
device access permission fairly to all the processes, reduce the average waiting time,
response time, turnaround time for I/O to complete.
OS developers implement scheduling by maintaining a wait queue of the request for
each device. When an application issue a blocking I/O system call, the request is
placed in the queue for that device. The I/O scheduler rearranges the order to
improve the efficiency of the system.
 A buffer is a memory area that stores data being transferred between two devices or
between a device and an application. Buffering is done for three reasons.
1. First is to cope with a speed mismatch between producer and consumer a
data stream.
2. The second use of buffering is to provide adaptation for that has different
data-transfer size.
3. Third use of buffering is to support copy semantics for the application I/O.
“copy semantic” mean, suppose that an application wants to write data on
disk that is stored in its buffer. It calls the write() system s=call, providing a
pointer to the buffer and the integer specify the number of bytes to write.

After the system call returns, what happens if the application of the buffer
changes the content of the buffer? With copy semantic, the version of the
data written to the disk is guaranteed to be the version at the time of the
application system call.

 Caching
A cache is a region of fast memory that holds copy of data. Access to the cached
copy is much easier than the original file. For instance, the instruction of the
currently running process is stored on the disk, cached in physical memory, and
copies again in the CPU’s secondary and primary cache. The main difference
between a buffer and a cache is that a buffer may hold only the existing copy of data
item, while cache, by definition, holds a copy on faster storage of an item that
resides elsewhere.

 Spooling and Device Reservation

5
Name: Nkosinathi Nkosi ICAS: 117164 Module: Operating System 600

A spool is a buffer that holds the output of a device, such as a printer that cannot
accept interleaved data stream. Although a printer can serve only one job at a time,
several applications may wish to print their output concurrently, without having
their output mixes together. The OS solves this problem by preventing all output
continuing to the printer. The output of all application is spooled in a separate disk
file. When an application finishes printing then the spooling system queues the
corresponding spool file for output to the printer.

 Error Handling
An Operating System that uses protected memory can guard against many kinds of
hardware and application errors, so that a complete system failure is not the usual
result of each minor mechanical glitch, Devices, and I/O transfers can fail in many
ways, either for transient reasons, as when a network becomes overloaded or for
permanent reasons, as when a disk controller becomes defective.

 I/O Protection
Errors and the issue of protection are closely related. A user process may attempt to
issue illegal I/O instruction to disrupt the normal function of a system. We can use
the various mechanisms to ensure that such disruption cannot take place in the
system. To prevent illegal I/O access, we define all I/O instruction to be privileged
instructions. The user cannot issue I/O instruction directly.

4. Explain ‘File Concept’. What are the different operations performed on files?.
As we know that Computers are used for storing the information for a Permanent Time or
the Files are used for storing the Data of the users for a Long time Period. And the files can
contains any type of information means they can Store the text, any Images or Pictures or
any data in any Format. So that there must be Some Mechanism those are used for Storing
the information, Accessing the information and also Performing Some Operations on the
files.
Files are not made for just reading the Contents; we can also perform some other
operations on the Files those are explained below as:
 Read Operation: Meant To Read the information which is Stored into the Files.
 Write Operation: For inserting some new Contents into a File.
 Rename or Change the Name of File.
 Copy the File from one Location to another.
 Sorting or Arrange the Contents of File.
 Move or Cut the File from One Place to Another.
 Delete a File.
 Execute Means to Run Means File Display Output.

6
Name: Nkosinathi Nkosi ICAS: 117164 Module: Operating System 600

Question Two

a) BITNET, one of the predecessors of the Internet, was launched in 1981. What does
BITNET stand for?
Because It's Time NETwork

b) What worm struck internet in 2001?


Code Red worm and Sircam virus infiltrate thousands of web servers and email
accounts, respectively, causing a spike in Internet bandwidth usage and security
breaches (July).

c) What food could you order through the Internet in 1994?


Pizza

d) What famous person sent an e-mail in 1976?


Elizabeth II, Queen of the United Kingdom.

e) What country offered Internet Voting for local election in 2005?


Estonia

f) In 2008, what kind of network did NASA test?


Disruption-Tolerant Networking (DTN).

1. Why does Amazon need a firewall?


To hide the internal network from unauthorized users requesting network
information.

2. Assume OS1 is a normal Linux system (e.g., Ubuntu 12.04). What types of system
calls does it have? (Give at least 4 broad categories, and broadly describe each).
 Process Control
A running program needs to be able to stop execution either normally or
abnormally. When execution is stopped abnormally, often a dump of
memory is taken and can be examined with a debugger.

 File Management
Some common system calls are create, delete, read, write, reposition,
or close. Also, there is a need to determine the file attributes – get
and set file attribute. Many times the OS provides an API to make these
system calls.

 Device Management

7
Name: Nkosinathi Nkosi ICAS: 117164 Module: Operating System 600

Process usually requires several resources to execute, if these resources are


available, they will be granted and control returned to the user process.
These resources are also thought of as devices. Some are physical, such as a
video card, and others are abstract, such as a file.

 Information Management
Some system calls exist purely for transferring information between the user
program and the operating system. An example of this is time, or date.

 Communication
There are two models of inter-process communication, the message-passing
model and the shared memory model.

1. Message-passing uses a common mailbox to pass messages between


processes.
2. Shared memory use certain system calls to create and gain access to
create and gain access to regions of memory owned by other
processes. The two processes exchange information by reading and
writing in the shared data.

3. Suppose Bob rents another virtual machine, VM2, running on the same hardware
machine with Alice. What problems may affect the applications of Alice and Bob
simultaneously?
 Every time you virtualize something, you get penalty over running it on the
bear hardware. That means operating system running in virtual machine will
run slower than if it would run directly on that same machine without
virtualization layer.

4. Describe the necessary condition for dead lock occurrence? How can u prevent a system
from deadlock?

Necessary condition for dead lock occurrence


 Mutual exclusion- At least one resource beheld in a non-shareable mode.
Otherwise, the processes would not be prevented from using the resource
when necessary. Only one process can use the resource at any given instant
of time.
 Hold and wait or resource holding- a process is currently at least one
resource and requesting additional resources which are being held by other
processes.
 No preemption- a resource can be released only voluntarily by the process
holding it.
 Circular wait- each process must be waiting for a resource which is being held
by another process, which in turn is waiting for the first process to release
the resource.

Deadlock Prevention

8
Name: Nkosinathi Nkosi ICAS: 117164 Module: Operating System 600

We can prevent Deadlock by eliminating any of these four conditions.


 Mutual Exclusion
 Hold and Wait
 No preemption
 Circular wait
Eliminate Mutual Exclusion
It is not possible to dis-satisfy the mutual exclusion because some resources, such as the
tape drive and printer, are inherently non-shareable.

Eliminate Hold and wait


 Allocate all required resources to the process before the start of its
execution, this way hold and wait condition is eliminated but it will lead to
low device utilization. For example, if a process requires printer at a later
time and we have allocated printer before the start of its execution printer
will remain blocked till it has completed its execution.
 The process will make a new request for resources after releasing the current
set of resources. This solution may lead to starvation.

Eliminate No Preemption
 Preempt resources from the process when resources required by other high
priority processes.

Eliminate Circular Wait


 Each resource will be assigned with a numerical number. A process can
request the resources increasing/decreasing. Order of numbering. For
Example, if P1 process is allocated R5 resources, now next time if P1 ask for
R4, R3 lesser than R5 such request will not be granted, only request for
resources more than R5 will be granted.

9
Name: Nkosinathi Nkosi ICAS: 117164 Module: Operating System 600

References

Source In-text Paraphrased In-text Direct Quote Bibliography/Reference


List
Understanding The concept of
According Pinkert, J. Pinkert, J. R. & Wear,
Operating Systems 7th swapping “is aR. & Wear, L. L. L. L. (1989).
edition (Ann McIver mechanism in which(1989). “A computer Operating systems:
McHoes) a process can be system typically concepts, policies,
swapped or moved consists of software and mechanisms.
…”. (programs) and Englewood Cliffs, NJ:
hardware (the Prentice-Hall.
tangible machine
and its electronic Bic, L. & Shaw, A. C.
Operating System The role of CPU components)”. (2003). Operating
Concept s scheduling by Rashid systems principles.
and Robertson “is to Upper Saddle River,
select from among NJ: Pearson
the processes that Education, Inc.
are in the ready
queue and allocate a
CPU core”

M. Accetta, R. B. (1986). ANew Kernel Foundation for UNIX Development (Vol. 3rd). (W. B. Baron,
Ed.)

M. Accetta, R. B. (1986). ANew Kernel Foundation for UNIX Development (Vol. 3rd). (W. B. Baron,
Ed.)

10

S-ar putea să vă placă și