Operating System by MikeJenny

VIEWS: 13 PAGES: 46

									EIE 282: Information
    Technology

   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
                                                            4
 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



                               5
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
• MS-DOS




                                                                6
  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

                                           7
                      Features of an OS
•   Co-ordinates programs to work

    with various devices and other

    programs.

•   Allocates resources to different

    users.

•   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
  hardware
                                               3
• Step 3: The operating system
  loads into memory

• Step 4: Configuration and
                                       4
  customization settings are
  checked
                                                   10
    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
                                       13
    OS for Personal Computers

• For IBM-PC compatible computers
     – Microsoft Windows, Unix variants, and Linux
       variants
• 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
  IBM-PC.
• 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




                                                           16
                  UNIX
• Multiuser, multitask operating system
• Used primarily with mainframes




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


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


                                     19
Operating system as magician: The
           four illusions
• Many separate computers, one for each
  process
  – “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)”
                    Multitasking
• 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.


                                            22
      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
                                              Process
                                              Process
                                                g
                                               1st
                                               3rd
                                               4th
                                               2nd
  REQUEST                                    System


                                                      23
           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
  one?
  – 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


RAM




                   Operating
                    System
                                            25
             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
       tracking
         • which memory is available,
         • which memory is to be allocated or de-allocated to which
           process,
         • how to swap between the main memory and the secondary
           memories.
             –   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
    page)
  – 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

                        FULL
  – Paging
  – Thrashing



                    Operating
                     System
                                            28
           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-
  spaces.
     – 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
     happens
   – 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
     redisplayed
   – 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
     standard
   – Facilitates the installation
     of new hardware


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


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



                                               35
                        File path

• File path
    – Location of the file


                   Secondary                Filename
                    folders

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




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


                                    37
           The User Interface
• Enables you to
  interact with the Command-driven
  computer
• Types of interfaces:
  – Command-driven
    interface (CLI:
                         Menu-driven
    command line
    interface)
  – 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




                                            39
                    Security
• 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
                       Security
• 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
       request.
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
  system.
• 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
  service.

eie282                      os                           43
        Microcomputer Operating
        Systems Characteristics
• DOS
   – 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
  software?
• 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