Operating System by MikeJenny


									EIE 282: Information

   Operating Systems
                    Lecture Outline
     • Basics of Operating Systems (OS)
     • OS Examples: Microsoft Windows, Unix, Linux
     • OS for Process Management:
         •   Multi-Tasking,
         •   Multi-Processing.

     • OS for Memory Management:
         •   Virtual memory management
         •   Virtual address management

     • OS for Hardware/Software Management
     • OS for Security: internal and external
eie282                                    os         2
                Operating System
• An operating system (OS) is a computer program that
  manages the hardware and software resources of a computer
• At the foundation of all system software, the OS performs
  these basic tasks:
     • prioritizing system requests
     • controlling and allocating memory, managing files
     • controlling input and output devices, providing a graphical user
       interface for higher-level functions
     • facilitating networking
     • providing security
eie282                                os                                  3
 Operating System Categories
• Four categories:
  – Real-Time (RTOS)
     • Real-time operating systems don’t require the
       intervention of any users at all.
  – Single-User, Single-Task
     • Single-user, single-task operating systems are
       proprietary systems developed specifically for the
       devices they manage.
  – Single-User, Multitask
  – Multiuser
 Real-Time Operating Systems
• Systems with a
  specific purpose and
  a certain result
• Uses include:
  –   Industrial machines
  –   Robotic equipment
  –   Automobiles
  –   Video game consoles
  –   Home appliances

Single-User Operating Systems
 Single-task systems               Multitask systems
• Perform one task at a time   •   Perform simultaneous tasks
• PDAs:                        •   Windows
   – Pocket PC                 •   MAC OS
   – Palm OS                   •   Linux
   – Windows Mobile

  Multiuser Operating Systems
• Known as network operating systems
• Allow access to the computer system by
  more than one user
• Manage user requests
• Systems include:
  – UNIX
  – Novell Netware
  – Windows Server 2003

                      Features of an OS
•   Co-ordinates programs to work

    with various devices and other


•   Allocates resources to different


•   Provides user-interface.

•   Organizes files on memory-disks.

•   Provides security control.

eie282                                 os   8
Starting the Computer: Loading the OS
 •   When the computer is first powered up, nothing is in the RAM.

 •   The CPU starts to read the BIOS-instructions stored in the ROM.

 •   The CPU then:

         – Initializes all I/O devices: hard disk, video, mouse, keyboard, CD-ROM, etc

         – Loads the bootstrap-loader of the operating system to RAM.

         – Starts to execute the bootstrap-loader in RAM

 •   The bootstrap-loader further loads the other part of the operating system to the RAM

eie282                                       os                                          9
           Starting the Computer
     The Boot Process
• Step 1: The basic input/output
  system (BIOS) is activated               2

• Step 2: A Power-on self-test
  (POST) checks attached           1
• Step 3: The operating system
  loads into memory

• Step 4: Configuration and
  customization settings are
    Operating systems -Examples
•   DOS
•   Windows (95, 98, NT, 2000, XP)
•   Mac OS X
•   Unix
    – Linux
• ...
              Operating system
• Allocates and assigns:
   – memory
      • e.g., file system, virtual memory
   – processor time
      • e.g., multitasking, multiprocessing
   – input-output devices
      • e.g., printer, keyboard, etc.
• May also provide other capabilities useful to many
  users or programs
   – Graphical User Interface (GUI) capabilities
   – Fonts, network protocols, ...
   – Web browser?
  Desktop Operating Systems
• Operating system combined with the
  processor is known as a platform
  – Microsoft Windows / Intel
  – Apple Macintosh / Motorola
• Desktop operating systems include:
  – Microsoft Windows
  – MAC OS
  – UNIX
  – Linux
    OS for Personal Computers

• For IBM-PC compatible computers
     – Microsoft Windows, Unix variants, and Linux
• For Apple Macintosh computers
     – Mac OS X (a Unix variant), Linux, BSD

eie282                    os                         14
Microsoft Windows OS

• The Microsoft Windows family of operating systems originated as a
  graphical layer on top of the older MS-DOS environment for the
• In 2010, Windows held a near-monopoly of around 92% of the
  worldwide desktop market share.
• Windows is also used on low-end and mid-range servers, supporting
  applications such as web-servers and database-servers
• Recent Windows OS: Windows XP, Windows Vista (formerly
  Longhorn, new functionalities, particularly in security, network
  administration, and digital rights management), Windows 7.

eie282                          os                               15
                       MAC OS
• First operating system with point-and-click technology
  (Graphical User Interface)
• Excellent in:                            MAC OS X
   – Graphics display
   – Processing capabilities
   – System reliability
   – Document recovery
• Fewer software applications

• Multiuser, multitask operating system
• Used primarily with mainframes

• Open-source operating
• Based on UNIX
• Stable system
• Free
• May be downloaded
  through the Internet

    What the Operating System Does
• Manages the CPU
• Manages memory
• Manages hardware
• Provides user
• Coordinates
  application software
  with the CPU

Operating system as magician: The
           four illusions
• Many separate computers, one for each
  – “Multitasking”
• Large memory
  – “Virtual memory”
• Disks and other secondary storage are
  organized as collections of files
  – “File systems”
• Windows and menus
  – “Graphical User Interface (GUI)”
• Reality:
   – One CPU
   – One instruction at a time
• Illusion:
   – Several application programs executing concurrently
• Implementation:
   – Operating system divides CPU time among
     application programs (time sharing)
      • each program “thinks” it is the only one running
      • OS copies Instruction Pointer and Registers back and forth
        as each program takes its turn
     Processor Management
• The OS arranges for the execution of all
  its activities in a systematic way.
• The OS assigns a slice of its time to each
  activity requiring the CPU’s attention. The
  OS then switches between processes
  thousands of times a second so it appears
  that everything is happening seamlessly.

      Processor Management
• Controls the timing of events the
  processor works on
  – Interrupts: tell the OS it is in need of attention.
  – Interrupt handler: a special numerical code
    that prioritizes the requests
  – Interrupt table: in RAM
  – Stack                                    Operatin
  REQUEST                                    System

           Multitasking issues
• How is control passed to next task?
  – Cooperative multitasking (Windows, Windows 95)
     • Application explicitly passes control back to OS
     • What if application never passes control back?
  – Preemptive multitasking (Unix, NT, XP)
     • Operating system interrupts application when I/O
       requested or when preset time limit has passed
• Can one task access the memory of another
  – Preventing this is called “memory management”
  – Done by Unix, NT, XP, Mac OS X (Not by older
    versions of Mac OS and Windows)
       Memory Management
• The operating system allocates space in
  RAM for instructions and data


             Memory Management
•   Parkinson's Law: "Data expands to fill the space available for storage“
•   Memory Properties:
     – has finite size and finite speed.
     – is arranged hierarchically, from the fastest registers to the slowest
       disk storage.
•   Memory Management:
     – The OS’ memory manager coordinates the finite memories by
         • which memory is available,
         • which memory is to be allocated or de-allocated to which
         • how to swap between the main memory and the secondary
             –   Can If the running processes require more RAM than available, there will be a speed-penalty in
                 swapping RAM to disk-memory.
             –   greatly increase the amount of memory available for each process.

eie282                                                os                                                          26
              Virtual Memory
• Some data is not used for a long time
  – Why keep it all in memory?
• Copy a unit of data (called a “page”) to hard disk
  and use memory for other data
• Copy pages back from hard disk to main memory
  as they're needed
• Process (and its programmer) not aware that main
  memory is too small (the big memory illusion)
  – It asks for a main memory location (Page # , offset on
  – OS has to get that page into main memory if not
    already there
            Virtual Memory
• Instructions and data are stored on the
  hard drive when RAM is full
  – Swap file

  – Paging
  – Thrashing

           Memory Management
• If multiple processes are simultaneously in the
  primary memory, they must be prevented from
  interfering with each other's memory.
• This is achieved by having separate address-
     – Each process sees the whole virtual address-space
       as uniquely assigned to it.
     – The operating system maintains tables to match
       virtual addresses to physical addresses. This process
       is called “paging”.
• The OS tracks all memory used by each process,
  so that when a process terminates, that process’
  memory will be made available to other processes.
eie282                        os                           29
               File Systems
• Reality:
  – Disks are sets of tracks
  – Tracks are sets of sectors
  – Sectors can store fixed-sized byte blocks
• Illusion:
  – Disks are sets of directories
  – Directories contain other directories or files
  – Files are variable-size byte sequences
  – Directories and files have names
     GUI: Windows and Menus
• Reality: Screen is an array of pixels
• Illusion 1: Menus
   – Depending on where you click, different action
   – Technique: OS looks up location where mouse was
     clicked, executes appropriate action
• Illusion 2: Overlapping windows
   – A window may cover part or all of another
   – When a window is uncovered, its contents are
   – Technique: OS saves bitmap of covered windows
      • Application does not need to know how to redraw the
        contents of its window
             Hardware Management
• Networking
     – Most OS use the TCP/IP networking protocols.
     – A computer can appear on another computer’s network to share
       resources, such as files, printers, and scanners.
• Device Drivers
     – A computer and its OS do not know how to control every device.
     – A device driver is an interface software to allow specific OS or
       software applications to communicate transparently with specific
       hardware devices –
         • to provide commands to the device,
         • to receive data from the device,
         • to translate these OS’ function-calls into device-specific function-calls.
         • provides the requisite interrupt-handling for any asynchronous time-
           dependent hardware interfacing needs.
         • is generally hardware-specific and OS-specific.

eie282                                    os                                            32
         Hardware Management
• Device drivers:
   – Programs that enable the
     operating system to
     communicate with
     peripheral devices
   – Provided by the
     manufacturer of the device
• Plug and Play:
   – Hardware and software
   – Facilitates the installation
     of new hardware

 Software Application Coordination
• Application programming interfaces
  – Blocks of code contained in the operating
  – Coordinates the operating system with
    software applications
    • Similar toolbars and menus
  – Microsoft Direct X

             File Management
• The operating system provides an
  organizational structure to the computer’s
• Hierarchical structure of directories:
  – Drives
     • Folders
          » Files

                        File path

• File path
    – Location of the file

                   Secondary                Filename

        C:\My Documents\Tech in Action\TIA Pics\dotmatrix.gif
Drive    Primary

           Working with Files
• File management
  –   Open
  –   Copy
  –   Move
  –   Rename
  –   Delete
• Recycle bin
                     Saving files

           The User Interface
• Enables you to
  interact with the Command-driven
• Types of interfaces:
  – Command-driven
    interface (CLI:
    command line
  – Menu-driven
    interface              Graphical
  – Graphical user
    interface                          38
           Utility Programs
• Small application programs that perform
  special functions:
  – Manage system resources
  – Create pleasant environment
  – Improve efficiency

• The OS provides access to a number of
  resources, directly or indirectly. E.g., files on a
  local disk, privileged system calls, personal
  information about users, and the services offered
  by the programs running on the system.
• The OS can distinguish between authorized
  requesters of these resources allowed access,
  from unauthorized (forbidden) requesters.
• OS has requester identity, such as a user name.

eie282                    os                            40
• Internal security: an already running program.
  Sometimes, a program (once it is running) has no
  limitations. More often, a program has an identity
  which it keeps and is used to check all of its
  requests for resources.
     – A high-security OS audits: tracking of requests for
       access to resources (such as, "who has been reading
       this file?")
• External security: a new request from outside the
  computer, e.g., a login at a connected console or
  some kind of network connection. To establish
  identity, there may be a process of authentication,
  e.g., username & password.
eie282                       os                          41
                 Internal Security
• protects the computer's resources from other
  programs concurrently running.
• is especially relevant for multi-user systems, allowing
  each user to have private files that other users cannot
  change or read.
• is vital for auditing, as a program can potentially
  bypass the operating system.
• For a less-privileged program:
     – Less-privileged programs are disallowed from certain
       hardware instructions, they have to ask a privileged
       program (e.g., the OS) to do so.
     – The operating system can thus check the less-privileged
       program's identity. The OS may then allow or refuse the
eie282                          os                               42
              External Security
• An OS offers various services to (i.e., hosts) other
  computers on a network, e.g., file sharing, print
  services, email, web sites, and file transfer protocols.
• At the front line of the external security are hardware
  devices known as firewalls.
• In OS, a software firewall is configured to allow or
  deny traffic to a service running on top of the operating
• Thus, while running insecure service (e.g., Telnet or
  FTP) , another service would not be threatened by a
  security breach because the firewall would deny all
  attempts from telnet or FTP to connect to the other

eie282                      os                           43
        Microcomputer Operating
        Systems Characteristics
   – text-based interface, no multitasking
• Windows NT (including Windows 2000, Windows XP)
   –   built-in networking capabilities
   –   plug-and-play device configuration
   –   full multitasking
   –   full memory management
• UNIX (including Linux)
   – great memory management, multitasking
   – complex, text-based interface
• Mac OS X
   – Based on Unix
   – Easy to use
   – can only run on Macintoshes
 Selecting an Operating System
• Is our existing software compatible with the OS?
• Does the OS have a large base of compatible
• How reliable is the OS? Does it crash frequently?
• Is the OS available for a wide variety of hardware?
• How quickly does it run?
• How easy it is to learn and use?
• How easy is it to install and configure?
• How much does it cost?
                 Lecture Summary
     • Basics of Operating Systems (OS)
     • OS Examples: Microsoft Windows, Unix, Linux
     • OS for Process Management:
         •   Multi-Tasking
         •   Multi-Processing

     • OS for Memory Management:
         •   Virtual memory management
         •   Virtual address management

     • OS for Hardware/Software Management
     • OS for Security: internal and external
eie282                                    os         46

To top