mc 0070 01 operating sys

Upload: shrikrush

Post on 03-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Mc 0070 01 Operating Sys

    1/13

    MC 0070 -01

    OPERATING SYSTEMS

    Part A

    1) List out salient Oeratin! s"ste# $un%tions

    There are 3 major functions of operating systems. They are as follows:-

    a) To hide details of hardware

    An operating system transforms the physical world of devices, instructions,memory, and time into virtual world that is the result of abstractions built by the

    operating system

    b) esources management

    An operating system as resource manager, controls how !rocesses " the activeagents) may access esources "passive entities).

    c) !rovide a effective user interface

    the user interacts with the operating systems through the user interface and

    usually interested in the loo# and feel of the operating system

    &) List out #a'or %o#onents o$ Oeratin! s"ste#(

    a) Pro%ess Mana!e#ent

    A process includes the complete e$ecution conte$t "code, data, !%, registers, &'

    resources in use etc.).This is not a program, but one instant of a program ine$ecution.

    b) Main-Me#or" Mana!e#ent

    (ain-(emory provides storage that can be access directly by the %!. That is,

    for a program to be e$ecuted, it must be in the main memory.

    *

  • 8/12/2019 Mc 0070 01 Operating Sys

    2/13

    c) +ile (anagement

    A file is a collection of a related information by its creator. A file system normallyorganied into directories to ease their use.

    d) & system (anagement

    & subsystem hides the peculiarities of specific hardware devices from the user.

    &nly the device driver #nows to whom it is assigned.

    e) 'econdary-'torage (anagement

    'econdary storage consists of tapes, dis#s, and other media designed to hold

    information what will eventually be accessed in primary storage"primary, secondary,cache) where it is ordinarily divided into bytes or words consisting of a fi$ed number

    of bytes.

    f) /etwor#ing

    The !rocessors communicate with one another through communication lines callednetwor#. This networ# design must consider routing and connection strategies, andthe problems of contention and security.

    g) !rotection system

    !rotection refers to mechanism for controlling the access of programs, process, orusers to the resources defined by a computer system.

    h) %ommand nterpreter 'ystem

    A command interpreter is an interface of the operating system with the user. Theuser gives commands which are e$ecuted by operating system

    0

  • 8/12/2019 Mc 0070 01 Operating Sys

    3/13

    ) *e$ine Pro%ess

    The term process is used somewhat interchangeably with 1tas#2 or 1job2.

    there are few number of definitions of !rocess li#e A program in $ecution, An

    asynchronous activity, The entity to which processors are assigned, The

    1dispatchable2 unit. 4ut the definition, 5!rogram in $ecution2 is fre6uently used.

    !rocess is not the same as program. a process is more than a program code. t is an

    1active2 entity as oppose to program which considered being a 1passive2 entity. As

    program is an algorithm e$pressed in some programming language, and being a

    passive, a program is only a part of !rocess

    ) *e$ine T+rea,s

    A thread is a single se6uence stream within in a process. 4ecause threads have

    some of the properties of processes, they are sometimes called lightweight processes.

    n process, threads allow multiple e$ecutions or streams. A thread has or consists of

    a program counter "!%), a register set, and a stac# space. Threads ae not independent

    of one another li#e processes as a result threads shares with other threads their code

    section, data section, &' resources also #nown as tas#, such as open files and

    signals.

    3

  • 8/12/2019 Mc 0070 01 Operating Sys

    4/13

    ) Mention t+e ne%essar" %on,itions $or *ea,lo%. o%%urren%e(

    n order for 7eadloc# to occur, four conditions must be true. they

    are as follows:-

    a) (utual $clusion-

    ach resource is either currently allocated to e$actly one process

    or it is available. "Two processes cannot simultaneously

    control the same resource or be in their critical section).

    b) 8old and wait 9

    !rocesses currently holding resources can re6uest new resources.

    c) /o preemption 9

    &nce a process holds a resource, it cannot be ta#en away by

    another processor the #ernel.

    d) %ircular wait 9

    ach process is waiting to obtain a resource which is held by

    another process.

  • 8/12/2019 Mc 0070 01 Operating Sys

    5/13

    PART - /

    1) rite a note on

    Real Ti#e Oeratin! S"ste#s 2RTOS)

    *istri3ute, Oeratin! S"ste#s

    a) Real Ti#e Oeratin! S"ste# 2RTOS)

    The advent of time sharing provided good response times to

    computer users. 8owever, time sharing could not satisfy the re6uirements

    of some applications. eal-time"T) operating systems were developed to

    meet the response re6uirements of such applications.

    A eal-Time operating system is one, which helps to fulfill the

    worst-case response time re6uirements of an application. An T&' provides

    the following facilities for this purpose:-

    - (ultitas#ing within an application

    - ability to define the priorities of tas#s.

    - !riority driven or deadline oriented scheduling.

    - !rogrammer defined interrupts.

    A tas# is a sub-computation in an application program, which can

    be e$ecuted concurrently, with other sub-computations in the program, e$cept

    at specific places in its e$ecution called synchroniation points.

    (ulti tas#ing which permits the e$istence of many tas#s within the application

    program, provides the possibility of overlapping the %! and & activities of the

    application with one another. This helps in reducing its elapsed time. The

    ability to specify priorities for the tas#s provides additional controls to a

    ;

  • 8/12/2019 Mc 0070 01 Operating Sys

    6/13

    designer while structuring an application to meet its response-time

    re6uirements.

    eal time operating systems "T&') are specifically designed to respond

    to events that happen in real time. This can include computer systems that run

    factory floors, computer systems for emergency room or intensive care unit e6uipment

    " or even the entire %), computer system for air traffic control, or embedded systems.

    T&'s are grouped according to the response time that is acceptable "seconds,

    milliseconds, microseconds) and according to whether or not they involve systems

    where failure can result in loss of life. $amples of real-time operating systems include

    aluna-*, %horus&', ?yn$&', @indows %./T and $@or#s A, etc B.

    3) *istri3ute, Oeratin! s"ste#s

    The latest trend in computer system is to distribute computation among several

    processors. n the loosely coupled systems, the processors do not share memory or a

    cloc#. nstead each processor has its own local memory. The processors communicate

    with one another using communication networ#. The processors in a distributed system

    may vary in sie and function, and referred by a umber of different names, such as sites,

    nodes, computers and so on depending on the te$t. There are four major reasons for

    building distributed systems. They are:-

    - Resour%e S+arin! f a number of different sites are connected to one another,

    then, a user at one site may be able to use the resources available at the other.

    - Co#utation see, uf a particular computation can be portioned into a number

    of sub computations that can run concurrently, then a distributed system may allow a

    user to distribute computation among the various sites to run them concurrently.

    - Relia3ilit"f one sites fails in distributed system, the remaining sites can potentially

    continue operations.

    C

  • 8/12/2019 Mc 0070 01 Operating Sys

    7/13

    - Co##uni%ationThere are many instances in which programs need to e$change

    data with one another. 7istributed data base system is an e$ample of this.

    &) rite a note on

    Mi%ro 4ernel Ar%+ite%ture

    5ni6 Ar%+ite%ture

    Mi%ro-4ernels

    As /= e$panded, the #ernel became large and difficult to manage.

    Then researchers at %arnegie (ellon niversity developed an operating system

    called (ach that modularied the #ernel using the micro#ernel approach. This

    method structures the operating system by removing all non-essential

    components from the #ernel and implementing them as system and user-level

    programs. This resulted in a smaller #ernel. (icro#ernels provide minimal

    process and memory management in addition to a communication facility.

    The main function of the micro#ernel is to provide a communication

    facility between the client program and the various services that are also

    running in user space. %ommunication is provided by message passing. $., the

    client program and service never interact directly. They communicate indirectly

    by e$changing messages with the micro#ernel.

    &ne benefit of the micro#ernel approach is ease of e$tending the

    operating system. All new a services are added to user space and conse6uently

    do not re6uire modification of the #ernel. @hen the #ernel does have to be

    modified, the changes tend to be fewer, because the micro#ernel is a smaller

    #ernel. The resulting operating system is easier to port from one hardware

    design to another. The micro#ernel also provides more security and reliability,

    D

  • 8/12/2019 Mc 0070 01 Operating Sys

    8/13

    since most services are running as user-rather than #ernel- processes, even if a

    service fails the rest of the operating system remains untouched.

    'everal contemporary operating systems have used the micro#ernel

    approach. TruC /= "formerly 7igital /=) provides a /= interface to

    the user, but it is implemented with a (arch #ernel. The (arch #ernel maps

    /= system calls into messages to the appropriate user-level services.

    5ni6 Ar%+ite%ture

    The /= #ernel has components as shown in the figure below. t has

    three modes: user mode, #ernel mode, and hardware.

    E

  • 8/12/2019 Mc 0070 01 Operating Sys

    9/13

    The user mode contains user programs which can access the services of the

    #ernel components using system call interference.

    The #ernel mode has four major components: system calls, file subsystem,

    process control subsystem, and hardware control. The system calls are interface

    between user programs and file and process control subsystems. The file

    subsystem is responsible for file and & management through device drivers.

    The process control subsystem contains scheduler, inter-process

    communication and memory management. +inally the hardware control is the

    interface between these two subsystems and hardware.

    Another e$ample is

  • 8/12/2019 Mc 0070 01 Operating Sys

    10/13

    ) /rin! out t+e $eatures o$ /est it8 orst it an, irst it 9it+ a 3lo%.

    ,ia!ra#s illustratin! t+e#

    /est it

    The allocator places a process in the smallest bloc# of unallocated

    memory in which it will fit. +or e$, suppose a process re6uests *0 H4 of

    memory and the memory manager currently has a list of unallocated bloc#s of C

    H4, *H4, *FH4, **H4 and *3 H4 bloc#s. The best fit strategy will allocate

    *0H4 of the *3H4 bloc# to the process.

    orst it

    The memory manager places a process in the largest bloc# of unallocated

    memory available. The idea is that this placement will create the largest hold

    after the allocations, thus increasing the possibility that, compared to best fit

    another process can use the remaining space. sing the same e$ample as

    above, worst fit will allocate *0H4 of the *FH4 bloc# to the process, leaving a

    DH4 blc# for future use.

    irst it

    There may be many holes in the memory, so the operating system, to

    reduce the amount of time it spends analysiing the available spaces, begins at

    the start of primary memory and allocates memory from the first hole it

    encounters large enough to satisfy the re6uest. sing the same e$ample as

    above, first fit will allocate *0H4 of the *H4 to the process.

    *G

  • 8/12/2019 Mc 0070 01 Operating Sys

    11/13

    @e can notice in the diagram above that the 4est fit and +irst fit strategies

    both leave a tiny segment of memory unallocated just beyond the new process.

    'ince the amount of memory is small, it is not li#ey that any new processes can

    be loaded here. This condition of spilitting primary memory into segments as

    the memory is allocated and deallocated is #nown as fragmentation. The worst

    fit strategy attempts to reduce the problem of fragmentation by allocating the

    largest fragments to new processes. thus, a larger amount of space will be left

    as seen in the figure.

    Another way in which the memory manager enhances the ability of the

    operating system to support multiple process running simultaneously is by the

    use of virtual memory. According, to the /utt, 5virtual memory strategies allow

    a process to use the %! when only part of its address space is loaded in the

    primary memory. n this approach, each process2s address space is partitioned

    into parts that can be loaded into primary memory when they are needed and

    written bac# to secondary memory otherwiseI. Another conse6uence of this

    approach is that the system can run programs which are actually larger than the

    primary memory of the system, hence the idea of 5virtual memoryI.

    4roo#shear e$plains this as follows:-

    5'uppose, for e$, thata main memory of C(4 is re6uired but only 30

    (4 is actually available. to create the illusion of the larger memory space, the

    memory manager would divide the re6uired space into units called pages and

    store the contents of these pages in mass storage. A typical page sie is no more

    than #ilobytes. As different pages are actually re6uired in main memory, the

    memory manager would e$change them for pages that are no longer re6uired,

    **

  • 8/12/2019 Mc 0070 01 Operating Sys

    12/13

    and thus the other software units could e$ecute as though there were actually

    C(4 of main memory in the machineI.

    *0

  • 8/12/2019 Mc 0070 01 Operating Sys

    13/13

    *3