teacher's notes - lec chapter 1 - introduction

Upload: francisemmanuelgonzaga

Post on 24-Feb-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 Teacher's Notes - Lec Chapter 1 - Introduction

    1/5

    J.E.D.I.

    1 Introduction to Operating Systems

    1.1 ObjectivesThis chapter serves as an introduction to operating systems. We discuss different operatingsystem definitions. At the end of the chapter, the students should be able to provide a good

    definition to what an operating system is.

    1.2 What is an Operating System?There are many definitions for an operating system. or our discussion, we will consider thefollowing three definitions!

    Definition by parts

    Definition by functionality

    Definition by goals

    1.3 Definition by parts

    1.3.1 Everyday definition

    "ne may consider the operating system to be the program that comes with the computer when

    you first buy it. This could be your "pen #olaris system, $inu% system, Windows &' system,etc, together with all of the programs that come with it.

    (owever, this begs the )uestion. Are A$$ the programs that are included in the defaultinstallation part of the operating system* Is +indsweeper part of the Windows &' operating

    system* Is the on)ueror web browser part of the "pen #olaris system* Would the computerstop running when these programs are stopped or deleted from the system*

    1.3.2 Better definition: Kernel

    We could define our operating system as that one program that is running all the time. This isalso called the system -ernel. The -ernel is the program that provides all the basicfunctionalities to ma-e your program wor-. All other programs are simply application programswhich run on top of the -ernel, using builtin operating system libraries in order to run.

    1. !ayered vie"To provide a definition by functionality, let us first ta-e a loo- at a layered view of thecomputer system, to see where the operating system lies.

    "perating #ystems /

  • 7/25/2019 Teacher's Notes - Lec Chapter 1 - Introduction

    2/5

    J.E.D.I.

    1.4.1 Physical layer

    The lowest layer of the computer is the physical device layer. This represents the raw

    transistors, switches, wires and capacitors of your computer. The values 0 and / arerepresented here as voltage differences.

    1.4.2 Microarchitecture level

    At the microarchitecure level, the circuity of the physical layer is combined to form meaningfulcircuits that are used to store 0s and /s, perform simple mathematical and logical operations,

    send1receive data over wire or load1save data into a medium.

    or e%ample, transistors can be combined in a certain way to perform binary addition. 2ircuits

    are arranged in a certain way as to enable a bit to be stored in your hard dis-. This layer

    provides for the layer above it an abstract view of hardware! no longer do the above layershave to worry about voltages or circuits. We can now thin- in terms of 0s and /s . We do nothave to worry about how numbers are added.

    1.4.3 Machine Language

    The machine language level bundles up the features of the microarchitecture level into a set ofinstructions which form the programming language of your 2'3. Instructions from the layers

    above are converted into machine language which are then made to run at themicroarchitecture level. #ome machine language instructions may ta-e several

    microarchitecture components and operations to run 4e%! division5, but the machine languageprovides only a single instruction for this.

    1.4.4 Oerating !yste" Kernel

    +achine level language is often very complicated. #aving files to a dis- for e%ample meansspecifying what trac-, cylinder and sector on the hard dis- to save individual bits on. 'rinting

    to the screen means specifying what memory address to write the data, and then instruct the2'3 to send that data to the video card. +achine language is in numeric format and programsare written in he%adecimal.

    The "perating #ystem $evel abstracts machine language from the levels above it. A single

    6save file6 instruction is used instead of tedious sector by sector writing. +emory allocation isalso handled here. 'rogramming in machine language means having to worry about e%actly

    what location in memory to store your program.

    There are also additional features, such as allowing multiple programs to run at the same time

    "perating #ystems 7

  • 7/25/2019 Teacher's Notes - Lec Chapter 1 - Introduction

    3/5

    J.E.D.I.

    on the 2'3, protecting programs from illegal instructions or accessing memory belonging toother programs.

    The "# level differentiates from protected mode to user mode. Instructions run in protected

    mode can be e%ecuted only by the operating system8 these are instructions that can

    potentially damage the computer 4such as sending information to the monitor, causing it toburn out5 or other processes 4writing to memory without restrictions5. 3ser mode instructionsare only a subset of instructions the the machine language provides.

    1.4.# !yste" tools

    #ystem tools are additional programs provided by the operating system publisher. These arenot part of the operating system -ernel. (owever they form an integral part of the operating

    system. These programs are the command line program, compilers, program for userpassword changing, etc.

    Although these tools run in user mode, they are allowed access to some protected modeinstructions, as these are trusted programs created by the "# system developers.

    1.4.$ %lication rogra"s

    inally, at the top of the heap are our user programs. These ta-e advantage of all of the lowerlevels in order to provide the functionalities we re)uire of them.

    1.4.& 'unctionality definition

    As can be seen, the operating system acts as an intermediary between hardware and userprograms. It provides a simpler view of the underlying hardware for user programs. Also, ittranslates user program instructions to hardware instructions

    1.# $ajor functiona%itiesWhat functionalities does the operating system provide to the layers about it then* We willdiscuss the following

    'rocess (andling

    +emory +anagement

    I1" +anagement

    ile storage

    'rotection #ystem

    2ommand Interpreter #ystem

    1.#.1 Process (andling

    9ormal computer use now re)uires multiple applications to be run at the same time. (owever,the 2'3 itself can only handle one instruction at a time: The "# provides functionalities thatallow the 2'3 to switch tas-s, sometimes running one program, sometimes another, allabstracted from the view of the programs themselves. The "# provides scheduling routines,giving priority to some processes, how to deal when processes are deadloc-ed andsynchroni;ation handling.

    "perating #ystems

  • 7/25/2019 Teacher's Notes - Lec Chapter 1 - Introduction

    4/5

    J.E.D.I.

    1.#.2 Me"ory "anage"ent

    E%ecuting programs re)uire memory space to run. The operating system answers some of thefollowing issues!

    +emory allocation and deallocation

    What if memory space isn=t contiguous* The "# must provide a way to ma-e it appear

    to the program that it is running on continuous memory. +emory allocated to the

    application is distributed.

    What if there isn=t enough space for a program to run but a lot of idle programs are

    clogging up memory*

    What if a program needs more memory than it is allocated with *

    1.#.3 )*O Manage"ent

    'rogramming an application used to mean programming for every type of hardware that would

    come with it. "ld word processing programs have to handle every -ind of printer in themar-et. 9ew printers would mean having to wait for the programmers to release a new versionof the word processing application to handle these new printers. 9ow, operating systems

    provide a generic interface for whatever hardware is being used for the computer.

    In addition, I1" handles some )uestions li-e what to do if more than one application wants tosend data to the printer at the same time.

    1.#.4 'ile !torage

    "f course , computer usage does not involve >ust running programs or sending information todevices. A significant portion of your hard dis- space is data, such as document files, videofiles, music files, etc.

    The operating system should

    be able to create, delete, manipulate, load and save files

    be able to manage directories

    -now where the files are actually stored in the storage media

    provide an easy and standard ways to store data even among different storage media

    types

    The file system should be able to address the following!

    Where the file is stored in the hard dis-

    (ow does the "# -now if that area of the hard dis- is free or not*

    (ow to load the data efficiently

    Who can access the file 4security5

    Is the file readable, writable, and1or e%ecutable*

    (ow to handle saving files if they have to be spread out 4no single bloc- of continuous

    space large enough to store file5

    1.#.# Protection !yste"

    As the "# handles multiple processes by multiple uses, there must be a way to providesecurity for these processes and users.

    "perating #ystems ?

  • 7/25/2019 Teacher's Notes - Lec Chapter 1 - Introduction

    5/5

    J.E.D.I.

    1.#.$ +o""and )nterreter

    The "# should provide a way for users to enter commands, either via a commandlineinterpreter or via a graphical user interface

    1.& Definition by 'oa%sWe have seen where the operating system resides in the computer, and what operating systemprovides the user, we now as- the )uestion! what are the goals of an operating system*

    According to authors #ilberschat; and @alvin of the boo- "perating #ystems 2oncepts, thegoals of an operating system are convenience and efficiency.

    1.$.1 +onvenience

    It is the current trend of operating systems to ma-e it easy for users to access and use thecomputer. (ardware details should be abstracted from the user. Instructions should be simple.

    3serfriendliness is a paramount concern.

    1.$.2 Efficiency

    Efficiency means having the computer operate to its fullest potential. #ome of the ways toachieve this are!

    Do other tas-s while waiting for user input

    Allow for multiple tas-s to operate at the same time

    "rgani;e files in the hard dis- and processes in memory for speedy access

    "perating #ystems