Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Sr. No. Network Operating System Distributed Operating System

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

What is the relationship between operating systems and computer hardware?

Answer: Operating system helps to make computer hardware available to


the application programs. Without Operating System we cannot access
computer hardware.

Question: How Buffering can improve the performance of a Computer


system?

Answer: If C.P.U and I/O devices are nearly same at speed, the buffering
helps in making the C.P.U and the I/O devices work at full speed in such a
way that C.P.U and the I/O devices never sit idle at any moment.

Normally the C.P.U is much faster than an input device. In this case the C.P.U
always faces an empty input buffer and sits idle waiting for the input device
which is to read a record into the buffer.For output, the C.P.U continues to
work at full speed till the output buffer is full and then it starts waiting.

Thus buffering proves useful for those jobs that have a balance between
computational work and I/O operations. In other cases, buffering scheme
may not work well.

Question: What are the primary differences between Network Operating


System and Distributed Operating System?

Answer: Network and Distributed Operating systems have a common


hardware base, but the difference lies in software.

Sr. Network Operating Distributed Operating


No. System System

1 A network operating system A distributed operating


is made up of software and system is an ordinary
associated protocols that centralized operating
allow a set of computer system but runs on
network to be used together. multiple independent CPUs.

2 Environment users are aware Environment users are not


of multiplicity of machines. aware of multiplicity of
machines.
3 Control over file placement is It can be done
done manually by the user. automatically by the
system itself.

4 Performance is badly affected It is more reliable or fault


if certain part of the tolerant i.e distributed
hardware starts operating system performs
malfunctioning. even if certain part of the
hardware starts
malfunctioning.

5 Remote resources are


accessed by either logging
into the desired remote
machine or transferring data
from the remote machine to
user's own machines.

Question: What inconveniences that a user can face while interacting with a
computer system, which is without an operating system?

Answer: Operating system is a required component of the computer system.

Without an operating system computer hardware is only an inactive electronic


machine, which is inconvenient to user for execution of programs.

As the computer hardware or machine understands only the machine


language. It is difficult to develop each and every program in machine
language in order to execute it.

Thus without operating system execution of user program or to solve user


problems is extremely difficult.

What are the differences between Batch processing system and Real Time
Processing System?

Answer: Following are the differences between Batch processing system and
Real Time Processing System.

Sr. Batch Processing Realtime Processing System


No. System
1 Jobs with similar In this system, events mostly
requirements are external to computer system
batched together and run are accepted and processed
through the computer as within certain deadlines.
a group.

2 This system is This processing system is


particularly suited for particularly suited for
applications such as applications such as scientific
Payroll, Forecasting, experiments, Flight control, few
Statistical analysis etc. military applications, Industrial
control etc.

3 It provides most Complex and costly processing


economical and simplest requires unique hardware and
processing method for software to handle complex
business applications. operating system programs.

4 In this system data is Supports random data input at


collected for defined random time.
period of time and is
processed in batches.

5 In this system sorting is No sorting is required.


performed before
processing.

6 It is measurement It is action or event oriented.


oriented.

7 Transactions are batch Transactions are processed as


processed and and when they occur.
periodically.

8 In this processing there It has to handle a process


is no time limit. within the specified time limit
otherwise the system fails.

Following are a few common services provided by an operating system −


 Program execution

 I/O operations

 File System manipulation

 Communication

 Error Detection

 Resource Allocation

 Protection

Program execution
Operating systems handle many kinds of activities from user programs to
system programs like printer spooler, name servers, file server, etc. Each of
these activities is encapsulated as a process.

A process includes the complete execution context (code to execute, data to


manipulate, registers, OS resources in use). Following are the major activities
of an operating system with respect to program management −

 Loads a program into memory.

 Executes the program.

 Handles program's execution.

 Provides a mechanism for process synchronization.

 Provides a mechanism for process communication.

 Provides a mechanism for deadlock handling.

I/O Operation
An I/O subsystem comprises of I/O devices and their corresponding driver
software. Drivers hide the peculiarities of specific hardware devices from the
users.

An Operating System manages the communication between user and device


drivers.

 I/O operation means read or write operation with any file or any specific I/O
device.

 Operating system provides the access to the required I/O device when required.
File system manipulation
A file represents a collection of related information. Computers can store files
on the disk (secondary storage), for long-term storage purpose. Examples of
storage media include magnetic tape, magnetic disk and optical disk drives
like CD, DVD. Each of these media has its own properties like speed, capacity,
data transfer rate and data access methods.

A file system is normally organized into directories for easy navigation and
usage. These directories may contain files and other directions. Following are
the major activities of an operating system with respect to file management

 Program needs to read a file or write a file.

 The operating system gives the permission to the program for operation on file.

 Permission varies from read-only, read-write, denied and so on.

 Operating System provides an interface to the user to create/delete files.

 Operating System provides an interface to the user to create/delete directories.

 Operating System provides an interface to create the backup of file system.

Communication
In case of distributed systems which are a collection of processors that do
not share memory, peripheral devices, or a clock, the operating system
manages communications between all the processes. Multiple processes
communicate with one another through communication lines in the network.

The OS handles routing and connection strategies, and the problems of


contention and security. Following are the major activities of an operating
system with respect to communication −

 Two processes often require data to be transferred between them

 Both the processes can be on one computer or on different computers, but are
connected through a computer network.

 Communication may be implemented by two methods, either by Shared Memory


or by Message Passing.

Error handling
Errors can occur anytime and anywhere. An error may occur in CPU, in I/O
devices or in the memory hardware. Following are the major activities of an
operating system with respect to error handling −

 The OS constantly checks for possible errors.

 The OS takes an appropriate action to ensure correct and consistent computing.

Resource Management
In case of multi-user or multi-tasking environment, resources such as main
memory, CPU cycles and files storage are to be allocated to each user or job.
Following are the major activities of an operating system with respect to
resource management −

 The OS manages all kinds of resources using schedulers.

 CPU scheduling algorithms are used for better utilization of CPU.

Protection
Considering a computer system having multiple users and concurrent
execution of multiple processes, the various processes must be protected
from each other's activities.

Protection refers to a mechanism or a way to control the access of programs,


processes, or users to the resources defined by a computer system. Following
are the major activities of an operating system with respect to protection −

 The OS ensures that all access to system resources is controlled.

 The OS ensures that external I/O devices are protected from invalid access
attempts.

 The OS provides authentication features for each user by means of passwords.


3. Describe the two general roles of an operating system, and elaborate why these
roles are important.
Operating systems provide:
- a fairly standardised abstraction between hardware and userspace software, that
allows userspace software to be written with little concern for the hardware it is
running on, and having access to a bunch of useful things like memory, files, screens,
i/o etc.
- resource management and allocation to processes & threads. resources include
files, memory, cpu runtime, etc.

i) high-level abstractions
why?
- more friendly to programmers
- provides common core for all applications
- hides details of hardware to make application code portable

ii) resource manager


why?
- divides resources amongst competing programs or users according to some system
policy to ensure fairness and no starvation where possible.
3.2 Why must the operating system be more careful when accessing input to a system
call (or producing the result) when the data is in memory instead of registers?

The operating system needs to verify that the memory being written to / read from
is a valid address, owned by the process making the request. It must prevent
processes from corrupting other processes, or reading memory owned by other
processes.

The operating system much take care with inputs from memory as:

a) The address given by the application as the address of the input or output could
be
- an address of an illegal area of memory
- an address of a legal area that is paged to disk

b) or, could change if the application is multithreaded.

Basically, the operating system must ensure that it cannot be corrupted, crashed, or
bypassed as a result of accessing memory as directed by the application.
3.3 Enumerate the advantages and disadvantages of supporting multi-threaded
applications with kernel-level threads.
Enumerate eh?

Advantages

1. assuming that the user-threads package is cooperative, user programs do not


need to be written with yields everywhere
2. each thread is guaranteed a fair amount of execution time (as fair as the os is)
3. userspace programs do not require extra checking around blocking i/o to
avoid it - i.e. other ready threads within the process can be scheduled if the
running thread blocks on a system call or page fault.
4. low granularity multitasking, gives the illusion of parallelism
5. can take advantage of multiprocessors, as the kernel can dispatch threads to
other cpus as it sees appropriate

Disadvantages

1. the user program must use locks and mutexes appropriately around critical
sections, since it cannot control when context switching will occur (...but so
what)
2. code is less portable since this requires operating system support
3. cannot choose the scheduling algorithm
4. Thread management (create, delete, ect) is more expensive as it now requires
system calls.

4.1 Describe system calls and its type


System calls works as a mediator between user program and service provided by operating
system. In actual situation, functions that make up an API (application program interface)
typically invoke the actual system calls on behalf of the application programmer.

Types of System Call

System calls can be grouped roughly into five major categories:


Sr Example
No.

1 Process control Create process, terminate process,end,allocate and free memory etc

2 File manipulation Create file, delete file, open file, close file, read, write.

3 Device manipulation request device, release device, read, write, reposition, get device
attributes, set device attributes etc.

4 Information get or set process, file, or device attributes


maintenance

5 Communications Send, receive messages, transfer status information

4.3 Explain Booting the system and Bootstrap program in


operating system.
The procedure of starting a computer by loading the kernel is known as booting the system.

When a user first turn on or booted the computer, it needs some initial program to run. This
initial program is known as Bootstrap Program. It is stored in read-only memory (ROM) or
electrically erasable programmable read-only memory (EEPROM). Bootstrap program locates
the kernel and loads it into main memory and starts its execution.

4.4 What is an operating system?


An operating system is a collection of software programs which control the allocation and usage
of various hardware resources in the system. It is the first program to be loaded in the computer
and it runs in the memory till the system is shut down.

Some of the popular Operating Systems are DOS, Windows, Ubuntu, Solaris etc.

5.1 What is a Kernel?

- Kernel is the part of OS which handles all details of sharing resources and device handling.
- It can be considered as the core of OS which manages the core features of an OS.
- Its purpose is to handle the communication between software and hardware
- Its services are used through system calls.
- A layer of software called shell wraps around the Kernel.

What are the main functions of a Kernel?

The main functions of a Kernel are:

- Process management
- Device management
- Memory management
- Interrupt handling
- I/O communication
- File system management

5.2

What are the different types of Kernel?

Kernels are basically of two types:

a. Monolithic Kernels - In this architecture of kernel, all the system services were packaged into a single system
module which lead to poor maintainability and huge size of kernel.
b. Microkernels - They follow the modular approach of architecture. Maintainability became easier with this
model as only the concerned module is to be altered and loaded for every function. This model also keeps a tab
on the ever growing code size of the kernel.

What are the disadvantages of Microkernels?

Following are the main disadvantages of Microkernels. Usually these disadvantages are situation based.

a. Larger running memory footprint


b. Performance loss due to the requirement of more software for interfacing.
c. Difficulty in fixing the messaging bugs.
d. Complicated process management.

5.3 What is synchronization? What are the different synchronization mechanisms?

Synchronization means controlling access to a resource that is available to two or more threads or process.
Different synchronization mechanisms are:

- Mutex
- Semaphores
- Monitors
- Condition variables
- Critical regions
- Read/ Write locks

6.1 Name the functions constituting the OS's memory management.

- Memory allocation and de-allocation


- Integrity maintenance
- Swapping
- Virtual memory

6.2 Name the different types of memory?

a. Main memory also called primary memory or RAM


b. Secondary memory or backing storage
c. Cache
d. Internal process memory

6.3 Throw some light on Internal Process Memory.

- This memory consists of a set of high-speed registers. They work as temporary storage for instructions and
data.
6.4 What are the basic functions of file management in OS?

- Creation and deletion of files/ directories.


- Support of primitives for files/ directories manipulation.
- Backing up of files on storage media.
- Mapping of files onto secondary storage.

7.1 Explain thread.

- It is an independent flow of control within a process.


- It consists of a context and a sequence of instructions for execution.

7.2 What are the advantage of using threads?

The main advantages of using threads are:

a.) No special communication mechanism is required.


b.) Readability and simplicity of program structure increases with threads.
c.) System becomes more efficient with less requirement of system resources.

7.3 What are the advantages of distributed system?

Advantages of distributed system are:

- Resources get shared


- Load gets shared
- Reliability is improved
- Provide a support for inter-process communication

7.4Why is interrupt vector used in operating systems?

- The operating system these days are interrupt driven and this requires the interrupt vector.
- This interrupt vector contains the addresses of the interrupt service routines for various devices.
- Here the interrupts can be indirectly called through the table with no intermediate routine needed.
- This leads to interrupt handling at a faster rate.
- Operating systems like MS DOS and UNIX are using the interrupt vector.

8.1 Differentiate between the user mode and monitor mode.

- User mode and monitor mode are distinguished by a bit called the mode bit.
- User mode uses bit 1 and monitor mode uses bit 0.
- At the boot time hardware starts with the monitor mode.
- Also, at the time of interrupt user mode is shifted to the transfer mode.
- System always switches to the user mode before passing control to the user program.
- Whenever system gains control of the computer it works in monitor mode otherwise in user mode.
8.2 The UNIX OS consists of two separable parts Systems programs The kernel Consists of everything below
the system-call interface and above the physical hardwareProvides the file system, CPU scheduling, memory
management, and other operating-system functions; a large number of functions for one levelLayered
Operating SystemLayered approach is used to break the OS into a number of layers (levels). The overall
functionality and features are determined and are separated into components. The bottom layer (layer 0) is the
hardware; the highest (layer N) is the user interface15

You might also like