Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

download Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

of 16

Transcript of Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    1/16

    Computing (9691/03)

    Upper Sixth

    (a) Features of Operating System

    Part 1

    Lecture 1 : The Functions of Operating System

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    2/16

    Main features of OS

    The operating system (OS) must provide and

    manage hardware resources as well as provide aninterface between the user and the machine andbetween applications software and the machine.

    The OS must also provide other services such as

    data security.

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    3/16

    Originally, if a program needed input, theprogram would have to contain the code to dothis, similarly if output were required.

    This led to duplication of code so the idea of anOS was born.

    The OS contained the necessary input and outputfunctions that could be called byan application.

    Similarly, disk input and output routines wereincorporated into the OS.

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    4/16

    This led to the creation ofsubroutines to do thesesimple tasks, such as read a character from akeyboard or send a character to a printer.

    The joining together of all these basic input and

    output routines led to the input-output controlsystem (IOCS).

    Originally, the IOCS could only read a punchedcardor send data to a card punch.

    However, as new input and output media, such asmagnetic tape and disk, were developed the IOCSbecame more complex.

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    5/16

    Another complication was added when assembly andhigh-level languages were developed as the machinedid not use these languages.

    Machines use binary codes for very simpleinstructions.

    With the development of these new types ofprogramming language a computer would have to

    a) load an assembler, compiler or interpreter,

    b) load the assembly or high-level program,

    c) do the translation,d) store the results somewhere in memory,

    e) execute the program,

    f) read input data,

    g) output the results.

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    6/16

    The system had now become too complexfor thehuman user to be able to organise it all.

    Also, as the processor could work much fasterthan the manual operator and the input and

    output devices, much time was wasted. Further, to make full use of the processor, more

    than one program should be stored in memoryand the processor should give time to each of theprograms.

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    7/16

    Suppose two programs are stored in memory and,if one is using an input or output device (both veryslow compared to the processor), it makes sensefor the other program to use the processor.

    In fact this can be extended to more than twoprograms as shown in Fig. 3.1.a.1.

    The OS must now manage the memory so that allthree programs shown in Fig. 3.1.a.1 are kept

    separate as well as any data that they use. It must also schedule the jobs into a sequence that

    makes best use of the processor.

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    8/16

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    9/16

    The I/O phase should not hold up the processortoo much which can easily happen if the I/Odevices are very slow, like a keyboard or printer.

    This can be overcome by using Simultaneous

    Peripheral Operations On-Line (spooling). The idea is to store all input and output on a high-

    speed device such as a disk.

    Fig. 3.1.a.2 shows how this may be achieved,

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    10/16

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    11/16

    Another problem is that programs may not beloaded into the same memory locations each timethey are loaded.

    For example, suppose that three programs

    are loaded in the order A, B, C on oneoccasion and in the order C, A, B on anotheroccasion.

    The results are shown in Fig. 3.1.a.3.

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    12/16

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    13/16

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    14/16

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    15/16

    Now the two users can use the compiler in turns and

    will want to use different parts of the compiler. Also note that there are two different sets of data for

    the compiler, user X's program and user Y'sprogram.

    These two sets of data and the outputs from thecompiler for the two programs must be keptseparate.

    Programs such as this compiler, working in the waydescribed, are called re-entrant.

    Memory management, scheduling andspooling are described in more detail in the

    following Sections.

  • 8/3/2019 Lecture 3.1.1 - The Functions of Operating Systems - Features of OS

    16/16

    Distributed systems have operating systems that

    arrange for the sharing of the resources of the systemby the users of that system. No action is required from the user. The file server and print server networks are examples

    of distributed computer systems. An example would be when a user A asks for a

    particular resource in a network system, the resource would be allocated by the O.S. in a way that istransparent to the user B.

    Another example, a computer A can run a program oncomputer B, using a file located elsewhere on thenetwork without the user being aware of whereexecution is taking place or where the files are

    physically located.