unit iitdept.yolasite.com/resources/os - unit1.pdf · 2011. 2. 5. · • third process to update...

71
By J.Jabez / Sathyabama University 1 UNIT I Introduction-Computer and software , Operating system strategies, Resources, Processes, Threads, Objects, Factors in OS Design, Basic Functions, Basic Implementation considerations, Device Management, Different approaches, Buffering device drivers.

Upload: others

Post on 14-Feb-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

  • By J.Jabez / Sathyabama

    University

    1

    UNIT I

    • Introduction-Computer and software ,

    Operating system strategies, Resources,

    Processes, Threads, Objects, Factors in OS

    Design, Basic Functions, Basic

    Implementation considerations, Device

    Management, Different approaches,

    Buffering device drivers.

  • By J.Jabez / Sathyabama

    University

    2

    Operating System : Definition

  • By J.Jabez / Sathyabama

    University

    3

    • It is an interface between user and

    Hardware

    Every general-purpose computer must have an operating system to run other programs.

  • By J.Jabez / Sathyabama

    University

    4

    Few Points about OS

    • Every general-purpose computer must have an operating system to run other programs.

    Basic tasks :

    Recognizing input from keyboard.

    Sending output to the display screen

    Keeping track of files and directories on the disk .

    Controlling peripheral devices such as disk drives and printers.

    Memory Management etc..

    Make the computer system convenient to use.

    Use the computer hardware in an efficient manner.

    http://www.webopedia.com/TERM/I/input.htmhttp://www.webopedia.com/TERM/K/keyboard.htmhttp://www.webopedia.com/TERM/O/output.htmhttp://www.webopedia.com/TERM/D/display_screen.htmhttp://www.webopedia.com/TERM/F/file.htmhttp://www.webopedia.com/TERM/D/directory.htmhttp://www.webopedia.com/TERM/D/disk.htmhttp://www.webopedia.com/TERM/P/peripheral_device.htmhttp://www.webopedia.com/TERM/D/disk_drive.htmhttp://www.webopedia.com/TERM/P/printer.htm

  • By J.Jabez / Sathyabama

    University

    5

    User & OS

  • By J.Jabez / Sathyabama

    University

    6

    User & System View of OS

  • By J.Jabez / Sathyabama

    University

    7

    Classification of OS

    • multi-user : Allows two or more users to run programs at the same time. Some operating systems permit hundreds or even thousands of concurrent users.

    • multiprocessing : Supports running a program on more than one CPU.

    • multitasking : Allows more than one program to run concurrently.

    • multithreading : Allows different parts of a single program to run concurrently.

    • real time: Responds to input instantly. General-purpose operating systems, such as DOS and UNIX, are not real-time.

    http://www.webopedia.com/TERM/M/multi_user.htmhttp://www.webopedia.com/TERM/M/multi_user.htmhttp://www.webopedia.com/TERM/M/multi_user.htmhttp://www.webopedia.com/TERM/M/multiprocessing.htmhttp://www.webopedia.com/TERM/S/support.htmhttp://www.webopedia.com/TERM/C/CPU.htmhttp://www.webopedia.com/TERM/M/multitasking.htmhttp://www.webopedia.com/TERM/M/multithreading.htmhttp://www.webopedia.com/TERM/R/real_time.htmlhttp://www.webopedia.com/TERM/D/DOS.htmhttp://www.webopedia.com/TERM/U/UNIX.htm

  • By J.Jabez / Sathyabama

    University

    8

    So what does OS Do ?

    refers to routines run immediately after power is applied

  • By J.Jabez / Sathyabama

    University

    9

    Computers & Software

    • Computer System consists of S/W & H/W

    that are combined to provide a tool to

    solve problem.

    • Application S/W : - to solve specific

    problem eg :- inventory, mail, spread

    sheet, editing text etc..

    • Allow user to store and manipulate

    information for decision support.

  • By J.Jabez / Sathyabama

    University

    10

    Perspectives of the computer

    Application

    S/W

    System

    S/W

    Hardware

    Cut Print

    Save

    END USER VIEW

    Application

    S/W

    System S/W

    Hardware

    Open() Close()

    Input()

    Application Programmer View

    Application

    S/W

    System S/W

    Hardware

    Start-Printer Read-Disk

    Track-Mouse

    OS Programmer View

  • By J.Jabez / Sathyabama

    University

    11

    • System Software :

    • Provides a general programming environment in which programmers can create specific application.

    • System Software and the H/W exist to support the creation and effective use of application software.

    • System software provides much functionality to application programmers.

    • It should try to minimize the use of machine’s resources ( processor time & memory).

    • Operating System is part of System Software that manages the use of H/W by other system software.

    • The orginal motivation for sys s/w like

    • Enable application software to share the hardware. Eg. One program reading information from the disk while another programme computing square root

    • This Sharing increases overall performance of System. (use different parts of computer simultaneously)

    • Decreases the execution time.

    • Os ensure this sharing done safely and efficiently.

  • By J.Jabez / Sathyabama

    University

    12

    Hardware

    Using System Software

    Software API

    Application Programmer

    Command LineInterpreter

    Libraries

    Window SystemLoader

    Compiler

    Database Management

    System

    OS

    System Software

  • By J.Jabez / Sathyabama

    University

    13

    • API – Application Programming Interface

    • Command Line Interpreter: called as shell

    • Is text based program that user invokes to interact with sys s/w .

    • Eg . Dir in windows, ls in Linux.

    • Window System : provides virtual terminal to application program. Eg: Microsoft Windows Desktop.

    • DBMS : used to store information on the computers permanent storage devices. Eg . Oracle , MySQL.

  • By J.Jabez / Sathyabama

    University

    14

    • Resource Abstraction : Sys software hides (from user )

    details how the underlying machinery operates.

    • User operates a computer without knowing very much about

    how the hardware operates

    • Eg : Imagine how much you have to learn to set a screen

    bitmap so that it would print “Hello world” on screen. Rather

    learning all those details – C programmer just learns printf() &

    stdio library. The time that a programmer would spent in writing

    code to form characters is at hand.

    • Abstraction of Disk Drive :

    • Load(block,length,device)

    • Seek(device,track)

  • By J.Jabez / Sathyabama

    University

    15

    • Resources Sharing:

    • To Achieve Speed.

    • Computer is faster than Human.

    • Os accompolishes this by swithching the Hardware among programs at a very high rate.

    • Ie) Simultaneous operation.

    • Eg) One Program wants to do numerical operation at the same time another wants to read a disk.

    • Concurrency- two or more are being executed simultaneously.

    • Concurrency & Parallel execution is related to the notation resources sharing.

    • For executing programm concurently or parallel, they must share computer.

    • An OS provides mechanism for this Resource sharing.

  • By J.Jabez / Sathyabama

    University

    16

    Abstract Machines & Transperent

    Resource Sharing

    An OS can Provide an Abstract machine for the use of application programmer by creating simulation of a computer. By simulating the abstract machine, the OS can direct the physical machine to simulate several abstract machines at the same time

  • By J.Jabez / Sathyabama

    University

    17

    Abstract Machines & Transparent Resource Sharing

    • Multiple program executions that appear to have their own private computer on which to execute.

    • This is accomplished by designing OS so that it carefully manages the computer’s processor, memory, devices etc

    • So they are shared among execution of programs, then by presenting an abstraction of machine itself – called an ABSTRACT MACHINE.

    • A program that is being executed by abstract machine is called process

    • Two Kinds of sharing used to create the abstract machines : Space –multiplexed sharing and time multiplexed sharing

    • Space- Multiplexed sharing : Resources are divided into two or more distinct units, and then the individual parts are allocated to process.

    • Eg) City Bus , Many people share the bus by each occupying one seat.

    • In Computer, abstract machines (Process) can space multiplex a space multiplex a rsource when OS allocates exclusive control of different units of resources at the same time.

    • The main memory and disk are exs of Space Multiplexed Resource Sharing.

  • By J.Jabez / Sathyabama

    University

    18

    Time – Multiplexed Resource Sharing :• Here a resource is not divided into units, instead one

    resource can use the entire resource for a period of time and then another process uses it later.

    • Eg. Taxi Cab.

    • Here in computer , process can have exclusive control of an entire resource for a period of time. After time elapsed, the resource is de allocated from the process and allocated to another.

    • The abstract machine for one process used the physical processor for a fraction of second (Called Time Slice)

    • Then Os time multiplex the Processor to different abstract machine.

  • By J.Jabez / Sathyabama

    University

    19

    • Multiprogramming :• Technique for sharing the processor.

    • uses Time-mutiplexed & Space multiplexed.

  • By J.Jabez / Sathyabama

    University

    20

    • In the above figure, there are N different abstract machines (named Pi,Pj…Pk).

    • Os divides physical memory into N different blocks and allocates a block to each abstract machine.

    • When a program Pi is loaded into its block of memory, it can then share the processor using time-multiplexed sharing.

    • Over a time period equal to N time slices, each Pi uses the processor for only one time slices, but it occupies its block of memory for entire time.

  • By J.Jabez / Sathyabama

    University

    21

    Does Multiprogramming improve

    performance of a computer ?

    • It cannot improve any single process’s

    Performance , but it can improve the

    overall performance.

    • Illustrated in next diagram….

  • By J.Jabez / Sathyabama

    University

    22

  • By J.Jabez / Sathyabama

    University

    23

    Operating System Strategies

    • Strategy refers to the general characteristics of the

    programmer’s abstract machine.

    • The preferred strategy for any given computer depends

    on business & engineering criteria such as how will the

    computer be used?

    • Is human interaction more important than the rate at

    which process are completed?

    • Earliest computers were dedicated to single program in

    execution at a time (No Multiprogramming )

    • Let us briefly discuss about most Significant OS

    strategies.

  • By J.Jabez / Sathyabama

    University

    24

    Base Line Strategies

    • Batch System

    • Time Sharing System

    • Personal Computers & Workstation

    • Embedded Systems

    • Small Communicating Computers

    • Network Technologies.

  • By J.Jabez / Sathyabama

    University

    25

    Batch Systems.

    • Handles collections or batches of jobs.

    • A job is a predefined sequence of commands, program and data.

    • Job is self sufficient ie) it contains all programs and data required for execution without human intervention.

    • Non Interactive System.

    • This allowed OS to execute few jobs concurrently.

    • Each batch of job is specified by a predefined list of OS Commands called a Job Control Specification.

    • Once OS begins to execute a job, it executes all commands in the list of sequence.

    • When resources required by the job becomes available OS executes it.

    • After completion results are printed and return to user.

  • By J.Jabez / Sathyabama

    University

    26

    • User’s Perspective :

    • From user, the job control specification defines all the requests necessary for the OS to perform an information processing task.

    • Ex: To produce a corporation’s monthly invoices.

    • OS may have to execute a suite of program execution to produce the invoices : One process to accumulate sales in each division.

    • Another process the invoice ammout

    • Third process to update company’s accont payable information.

    • These information are collected into a batch and submitted to the computer.

    • After computer finished executing it , it produces output.

  • By J.Jabez / Sathyabama

    University

    27

  • By J.Jabez / Sathyabama

    University

    28

    • Input spooling component reads job

    and saves it in the current batch of

    jobs.

    • Earliest system used punched card

    input and separate spooling computer

    for creating the batch.

    • The output spool tape was printed by

    another spooling computer.

  • By J.Jabez / Sathyabama

    University

    29

    Time Sharing Systems :• Becomes popular in 1970’s

    • Goal was to enable many users to interact with computer system at the same time.

    • During execution user can interact directly with the system.

    • Each using his own terminal keyboard and display device.

    • This strategy was the first step in making the computer available to many people who were involved in many different types of information processing tasks.

    • The time-sharing system would provide a complete operating environment, including a variety of programming language processors, various software packages, file storage, bulk printing, and off-line storage.

    • Multiple interactive sessions are implemented by a set of virtual machines.

    • Users were charged rent for the terminal, a charge for hours of connect time, a charge for seconds of CPU time, and a charge for kilobyte-months of disk storage.

  • By J.Jabez / Sathyabama

    University

    30

    • There were four early systems that defines time sharing OS Strategy.

    • CTSS (Compatible Time sharing System).

    • Developed in mid of 1960s at MIT.

    • MULTICS : Replaced CTSS because unreliable, crashing for no apparent reason. It is reliable.

    • CAL :

    • Focused on protection & Security.

    • UNIX :

    • Tiny Os Kernel with minimum functionality but capable of supporting very broad class of OS Services .

  • By J.Jabez / Sathyabama

    University

    31

  • By J.Jabez / Sathyabama

    University

    32

    • As timesharing evolved, process were

    sometime called tasks.

    • A timesharing multiprogramming

    system that supports multiple process

    per user is sometimes called a

    multitasking system.

    • Since multiple user uses it protection &

    Security becomes an issue.

  • By J.Jabez / Sathyabama

    University

    33

    Personal Computers & Workstations :

    • Apple Launched in April 1977.

    • IBM – August 1981.

    • Personal computer system software was generally designed to allow one user to execute one program at a time- No Multiprogramming.

    • Therefore no requirement for resources isolation or resource sharing.

    • Primary requirement of sys s/w to provide hardware abstraction..

    • Both Apple & IBM stores abstraction s/w in ROM (read only memory).

    • Information will persist even if powered down.

    • Disappeared in 1990. (Still used in today’s Intel based microprocessors).

  • By J.Jabez / Sathyabama

    University

    34

    • In 1982, Sun announced its first small computer.

    • Others like HP, Apollo, Three Rivers also delivered.

    • Workstation differs from Personal computers (Such as IBM or Apple II).

    • Workstations were configured with enough resources that made sense to use timesharing OS technology, especially multiprogramming for their OS.

    • Almost all workstations eventually used some form of UNIX.

    • Today there is no distinction between Personal computer and workstation.

    • Can be placed directly in office

    • User Perspective :

    • PC & Workstation gave users freedom in computing.

    • Changed the way people perceived the computer.

    • Rather than viewing as corporate resource, people use it similar to telephone, typewriter or copier…

    • Used in many ways like word processor, spread sheet, databases etc…

  • By J.Jabez / Sathyabama

    University

    35

    • OS Technology :

    • Most popular early Os was CP/M.

    • Dominated by MS-Dos.

    • Today many personal computers uses Microsoft’s follow on OS.

    • Windows 95/98/Me and Windows NT/2000/XP.

    • Unix, designed as time sharing System..

    • Traditionally single user systems.

    • Workstation Incorporated With more resources, more memory, faster & Powerful processor, larger storage, higher resolution graphics monitors.

  • By J.Jabez / Sathyabama

    University

    36

    EMBEDED Systems.

    • An embedded system is a computer that is a component in some more complex system.

    • Dedicated to support host system.

    • Examples computers that control flood gates of a dam, cooling process of a nuclear reactor, guide a missile, regulate a residential sprinkler system.

    • Commercially successful in many years.

    • Popularity with introduction large scale integrated circuits in 1970’s and 1980’s.

  • By J.Jabez / Sathyabama

    University

    37

    User Perspective :

    • Do not have Human user.

    • Instead system user is a set of sensors or actuators.

    • Less Expensive.

    • OS Technology :

    • Differs from one application of the technology to another.

    • It is driven by response time.

    • Challenging problem : How to guarantee maximum response time.

  • By J.Jabez / Sathyabama

    University

    38

    SMALL COMMUNICATING COMPUTERS

    • Advances in chip technology and Internet have been catalyst for a revolution in computing devices.

    • Demand for consumer electronics has provided the incentive for rapid development of Small, Communicating Computers.

    • Used for specific tasks.

    • Devices like portable MP3 Players, Internet capable mobile phones, TV set-top boxes.

    • Mobile computers with a wireless network connection.

    • There may be Scarcity of certain resources (Example memory, Network Bandwidth etc)

  • By J.Jabez / Sathyabama

    University

    39

    • USER’S PERSEPECTIVE :

    • An SCC OS is responsible for the same requirements as any other OS.

    • Difference between SCC OS & OS for a Larger Machine are :

    • SCC devices are different from conventional machine devices, so the hardware abstractions for an SCC need to be different from those used in conventional machines.

  • By J.Jabez / Sathyabama

    University

    40

    NETWORKS :

    • Used to transfer/ retrieve data from one computer to another.

    • Resources Isolation, sharing provide a new challenge for system software designers.

    • Until 1980, computers were interconnected with point to point , bit serial communication media that operated at speed less than 10 Kilobits per seconds (Kbps).

    • LAN :

    • Became a cost effective communicating technology.

    • In 1980, Ethernet and Token Ring LAN technology provided fully connected network capable of transmitting 10 to 16 Mbps.

    • Faster than point to point forwarding networks.

    • After 2000, Wireless networks (Such as Radio, Television, Satellite).

    • Blue Tooth :Small Physical Area radius less than 100 Feet, transmits at 11 Mbps.

  • By J.Jabez / Sathyabama

    University

    41

    Evaluation of Modern OS.

  • By J.Jabez / Sathyabama

    University

    42

    Purpose of OS

    • Device Management.

    • Process, Thread & Resource Management.

    • Memory Management.

    • File Management.

  • By J.Jabez / Sathyabama

    University

    43

    Resources • A Resource is any physical or virtual component of limited

    availability within a computer system.

    • Every device connected to a computer system is a resource .

    • Virtual system resources include files, network connections.

    • A Resource is anything that can be used by only a single process at any instant of time.

    • OS treats any entity as a resource if it satisfies these characteristics :

    • A Process must request it from the OS.

    • The Process must suspends its operation until the entity is allocated to it.

    • The most common resource is a file.

    • A Process must request a file before it can read it or write it.

    • If the file (Resource) is unavailable, the process is forced to wait until it becomes available.

    • In some OS the process automatically blocked when a resource request fails and awaked when it becomes available.

  • By J.Jabez / Sathyabama

    University

    44

    Types of Resource• Preempt able resource is one that can be taken away from the

    process owning it with no ill effects.

    • Eg . Process swapping from Main Memory.

    • (32 MB Memory, 1 Printer, two 32 MB Process

    • Time Slice , Preempt (Take Away), Swapping)

    • Non Preempt able - is one cannot be taken away from the process owning it without causing the computation to fail.

    • Eg : - CD Rom

    • Process begin to burn - take away CD Recorder to another Process – garbled CD.

  • By J.Jabez / Sathyabama

    University

    45

    Files• Mechanism to store and retrieve information from the

    disk.

    • Represent programs (both source and object) and data.

    • Data files may be numeric, alphanumeric, alphabetic, or binary.

    • Accessed by a name.

    • File name have an extension (c, Doc) which defines file type.

    • Created by a process and continues to exist after the process has terminated.

    • Information in the file is defined by creator.

    • File attributes - Protection, Password, Creator, Owner, Read-only flag, Hidden file flag, Record length, Creation time , Time of last access, Time of last change, Current size, Maximum size.

    • File operations : create, delete, open, close , Read ,Write, append, Seek etc.

  • By J.Jabez / Sathyabama

    University

    46

    • Files are distinguished from other

    resources for two reasons.

    • 1) They are prevalent (existing) form by

    which information is stored in a computer.

    • 2)Operating Systems often take the file as

    a primitive ( not derived ) and then model

    other resource abstraction after it.

    • Related files are organized into Directories

    • Like other resources, files have

    descriptors.

  • By J.Jabez / Sathyabama

    University

    47

    Other Resources• A resource is any abstract machine component including a file.

    • A program have explicitly allocate resource before it executes the program.

    • Process discontinues execution when resources requested by it is not available.

    • Process remains blocked until the resource becomes available.

    • Memory is another resource.

    • The program may request and reference all needed memory at the time the process comes into existence.

    • It may be permitted to request the memory be dynamically allocated and freed as needed.

    • Tape Drive : If programmer wishes to read information from magnetic tape then drive must be allocated to the process prior to tape’s being mounted and read.

    • Other important resources are processor, Keyboards, Display etc.

  • By J.Jabez / Sathyabama

    University

    48

    Process

    • Can be defined as program in execution.

    • With multiple applications active at the same time there are many processes that are active.

    • The OS needs to manage all these processes.

    • Inter process communication forms the basis of distributed computing.

    • The components of Process

    • The Object Program (or code) to be executed.

    • The data on which the program will execute.

    • Resources required by the program..

    • A Process can complete only when all requested resources have been allocated to the process.

    • The OS keeps an internal data structure to describe each process it manages just like files and other resources.

    • When the OS creates the process, it creates a Process Descriptor. When the process terminated, the descriptor data structure is released.

    • The exact content of process descriptor varies from OS to OS.

  • By J.Jabez / Sathyabama

    University

    49

  • By J.Jabez / Sathyabama

    University

    50

    Threads :• Motivation for thread model is to create a simple OS abstraction where there

    be multiple entries that execute the same program, using same files and devices.

    • Called as “lightweight” processes.• There can be several threads associated with a single process.

    • Important motivation for using threads is to minimize context switching time.

    • This allows the processor to switch from one unit of computation to another unit computation with minimal overhead.

    • Thread must have a minimum of its own allocated resources.

    • So that its internal state is not confused with internal state of other threads associated with the same process.

    • Processes vs. Threads– Threads are “lightweight” processes,

    – processes are expensive to create but threads are easier to create and destroy.

  • By J.Jabez / Sathyabama

    University

    51

    A) Three Process with one Thread B) One Process with three threads

    A thread Scheduler switches the processor among a set of competing threads.

    Today threads are an important tool in achieving concurrent task.

  • By J.Jabez / Sathyabama

    University

    52

    Factors in OS Design

    • In addition to the management facilities, a

    number of other factors have significantly

    influenced the evaluation & Design of OS

    Performance.

    Protection & Security.

    Correctness.

    Maintainability.

    Commercial Factors.

    Standards and Open Systems.

  • By J.Jabez / Sathyabama

    University

    53

    • Performance :

    • People use computers because it is potential for rapid information processing greater than manual techniques.

    • OS must have the ability to provide simplified programming interface.

    • Mechanism to manage resource sharing.

    • It should provide environment in Memory management , Resource Sharing in a cost effective manner.

    • Even though OS provides good abstraction to write a program easily ,It should manage the slowdown of the program execution .

    • OS should manage the performance cost of using files rather than commands the manipulate storage devices directly.

    • Every design issue in an OS must be evaluated with respect to its contribution to the functionality of the system.

    • This design has to be done with careful engineering work and a careful analysis of functionality versus its performance.

  • By J.Jabez / Sathyabama

    University

    54

    • Protection & Security :

    • Multi programmed computer systems support multiple process at same time.

    • This establishes a computation environment in which processes share resources.

    • This leads OS to provide a mechanism by which one process does not interfere with others currently using the machine.

    • The OS must be able to create a configuration in which specific resources are isolated to one process or shared among a specific set of process.

    • Protection mechanisms are tools that the OS provides to implement a particular security policy chosen by system’s administrator.

    • A security policy defines the strategy for managing access to a resource.

    • Eg. A file protection mechanism to implement this policy. (Read/Write). 1process can have file open for writing –many process open file for reading – file protection mechanism uses Locks

  • By J.Jabez / Sathyabama

    University

    55

    • Correctness :

    • Correctness is another basic requirements must be considered when designing OS.

    • Software correctness is a critical factor in the acceptance of application programming technology.

    • With regard to the protection some parts of the software can be described as being “trusted” and others as “Un trusted”.

    • Correctness can be determined only if there are specific requirements for each OS function.

    • For Ex: It is not possible to determine If a scheduler were correct unless we knew exactly what the scheduler do.

  • By J.Jabez / Sathyabama

    University

    56

    • Maintainability :

    • How could one change the OS software

    and have any assurance the result could

    be trusted, was correct and did not

    introduce new bugs?

    • One branch of designers chose to ensure

    that their implementations could be easily

    maintained.

    • Cost , performance.

  • By J.Jabez / Sathyabama

    University

    57

    • Commercial Influence on OS :• Commercial OS based on multi programmed timesharing

    OS extended to Network Interaction.

    • UNIX was designed as timesharing OS.

    • Minicomputers & Workstation

    • Personal computers dominated by MS-Dos and now micro

    soft windows probably due to designer’s relationship with

    dominant hardware.

    • Success of UNIX & Windows OS interfaces has resulted in

    severe constraints on continue growth of OS technology.

    (Should have compilers, Linkers, Loaders)

    • New OS implementation can contain much innovation as

    desired.

    • MAC OS

    • Research in OS still follow the general trend.

  • By J.Jabez / Sathyabama

    University

    58

    • Standards & Open Systems :• Open System is essentially a business are in which

    computer technology has a tremendous influence.

    • Since 1980’s a revolution has occurred in the way

    computers are used in business organization.

    • As organization more dependent on information

    technologies it became end purchaser to acquire

    computing equipment in open competitive market .

    • The desire for a mixture of vendors provides the

    motivation for open systems and applications.

    • The goal of open system is to enable end users to

    employ a heterogeneous network of computers to

    accomplish information processing tasks in organization.

  • By J.Jabez / Sathyabama

    University

    59

    • Three complementary strategies for achieving goals of open system

    • Application Integration : All Application programs could be built so that they present a common interface to users

    • Portability : Application program can be moved easily from one type of hardware to other.

    • Interoperability : provided in network environment to standardize access to remote facilities.

  • By J.Jabez / Sathyabama

    University

    60

    Basic Functions of OS :

    • Can be classified roughly into four

    categories :

    Device Management

    Process & Resource Management.

    Memory Management.

    File Management.

  • By J.Jabez / Sathyabama

    University

    61

    Basic OS Organization

  • By J.Jabez / Sathyabama

    University

    62

    • Device Management :• Device management refers to the way these generic devices

    are handled.

    • Generally Os must manage allocation, isolation and sharing

    of devices according to desired policy.

    • Even OS do not support multiple process incorporate device

    management.

    • Normally the source code for an OS is provided with the

    computer Hardware.

    • If an end user organization adds a physical device to the

    computer, it must also add a device driver to the OS.

    • Most OS extends special management for the processor &

    Memory.

  • By J.Jabez / Sathyabama

    University

    63

    Process & Resources Management• Process are the basic unit of computation defined by the programmers.

    • Resources are the elements of computing environment needed by

    process.

    • So process & Resources management could be separated into their own

    module but OS combine them into single module.

    • The single module allows multiple users (or process) to share the

    machine by providing multiple “Console Devices” and by scheduling the

    processor.

    • Each process receives equitable fraction of available time.

    • Resource allocation method generally incorporated into process &

    resources management facilities.

    • This mechanism include those for representing the resource for the

    process to use and for managing the resource allocation.

  • By J.Jabez / Sathyabama

    University

    64

    Memory Management.• The memory manager administers the allocation and use of the primary

    memory resource.

    • Every process request and uses memory according to its program

    definition.

    • The memory manager allocates memory to competing process and

    enforcing sharing restrictions.

    • Memory manager uses specific isolation mechanism

    • Modern memory managers provides virtual memory extension so that

    primary memory appears to be larger than it really is.

    • This is accomplished by integration of computer's main memory and

    memory from its storage device.

    • Allowing process to reference memory stored on a storage devices as if it

    is in main memory.

    • Modern memory manager also allows a process of one machine to

    access physical memory of another machine.

  • By J.Jabez / Sathyabama

    University

    65

    File Management

    • The system that an operating system or program uses to organize

    and keep track of files.

    • Files are abstract resource of storage devices.

    • Information stored in the main memory will be overwritten as soon

    as the memory is deallocated from a process.

    • Information to be saved, must be copied to a storage device, such

    as magnetic tape or a disk.

    • Different file manager provides different abstractions with the

    requirements.

    • In modern OS file system is distributed so that a process of one

    machine can read and write file on its local machine as wells

    another machine using network.

    http://www.webopedia.com/TERM/S/system.htmlhttp://www.webopedia.com/TERM/O/operating_system.htmlhttp://www.webopedia.com/TERM/P/program.htmlhttp://www.webopedia.com/TERM/F/file.html

  • By J.Jabez / Sathyabama

    University

    66

    Basic Implementation ConsiderationThree basic implementation mechanism are used in OS Design.

    Processor Modes, Kernels, Method of requesting System Service.

    Processor Modes : The Mode bit is used to distinguish between execution on

    behalf of an OS and execution on behalf of a user.

    Processor incorporate mode bit to define execution capability of a program on

    the processor.

    Bits can be set to supervisor mode or user mode.

    In Supervisor mode the processor can execute every instruction in H/W

    repertoire.

    In user mode it can execute only subset of Instructions.

    Instruction that can be executed only in supervisor mode are called

    supervisor, privileged or protected instruction.

    If an application program executes in user mode, it cannot perform its own I/O

    O/S perform this I/O

    When an application program makes a system request, a special hardware

    instruction is invoked that switches the processor to supervisor mode and

    begins to execute device driver.

  • By J.Jabez / Sathyabama

    University

    67

  • By J.Jabez / Sathyabama

    University

    68

    • Kernels : The most critical part of the OS is encapsulated in a kernel. Kernel is designed as a trusted S/W modules that supports the operation of all other software.

    • In abstract machine organization used by an OS, the part of sys S/W executing its supervisor state is called Kernel or Nuclear of OS.

    • Functional design decision for any function to be incorporated into the OS to implemented in kernel.

    • If it is in kernel – will execute supervisor space –will be trusted software by other parts of the kernel

    • If the function is implemented to execute in user mode – has no access to kernel data structure –very limited effort to invoke the function.

  • By J.Jabez / Sathyabama

    University

    69

    Method of requesting System

    Service :• This issue is concerned with the way user process

    request services from the OS : by calling system function or by sending a message to system process.

    • System Call should appear to be an ordinary procedure call to the application program.

    • User process uses trap instruction.

    • OS provides library of user function with corresponding to each system call.

    • Each of the function contains trap to the OS Function .

    • It switches to supervisor mode to execute it and returns to user mode after it completes function.

  • By J.Jabez / Sathyabama

    University

    70

    • In message passing approach, user process

    constructs a message, A.

    • Which describes the desired service.

    • Then it uses a trusted send function to pass the

    message to a trusted OS Process.

    • It checks the message, Switches the processor

    supervisor mode to process it.

    • User process waits for the result of the service

    request with a message.

    • When OS process completes the operation it

    sends a message B back to the user process.

  • By J.Jabez / Sathyabama

    University

    71

    .