SlideShare a Scribd company logo
1 of 42
Download to read offline
Operating-System Structures

 System Components
 Operating System Services
 System Calls
 System Programs
 System Structure
 Virtual Machines
 System Design and Implementation
 System Generation
Common System Components

 Process Management
 Main Memory Management
 File Management
 I/O-System Management
 Secondary-Storage Management
 Networking
 Protection System
 Command-Interpreter System
Process Management
 A process is a program in execution. A process is an active entity.
 A process needs certain resources, including CPU time, memory, files,
    and I/O devices, to accomplish its task.
   Initialization data is also passed for execution of a process.
   A program can have many processes as it runs.
   System processes execute OS code whereas user processes execute
    user code.
   OS reclaims reusable resources from the process on its termination.
   The OS is responsible for the following activities in connection with
    process management:
     Process creation and deletion.
     process suspension and resumption.
     Provision of mechanisms for:
         process synchronization
         process communication
         deadlock handling
Main-Memory Management
 Memory is a large array of words or bytes, each with its own address. It is a
    repository of quickly accessible data shared by the CPU and I/O devices.
   Main memory is a volatile storage device. It loses its contents in the case of
    system failure.
   The I/O operations implemented via DMA also read and write in memory.
   Main-memory is frequently addressed by CPU for accessing instructions and
    data from memory during program execution.
   Different memory-management techniques are used to keep several
    programs in memory for improving CPU utilization and response time.
   An appropriate memory-management scheme is used for a specific
    hardware design of the system.
   The operating system is responsible for the following activities in connection
    with memory management:
      Keep track of which parts of memory are currently being used and by whom.
      Decide which processes to be loaded when memory space becomes available.
      Allocate and deallocate memory space as needed.
File Management
 A file is a collection of related information defined by its creator. Commonly,
    files represent programs (both source and object forms) and data.
   Computers can store files on HD, FD, MD, OD or magnetic tape/ drum. Each
    media has its own characteristics, device controller and properties such as
    access speed, capacity, data-transfer rate, and access-method (random or
    sequential).
   OS maps files (logical storage units) onto physical media and accesses
    these files via the storage devices.
   OS manages the mass storage media and the devices that control them and
    provides protection to files in multi-user environment.
   The operating system is responsible for the following activities in connection
    with file management:
      File creation and deletion.
      Directory creation and deletion.
      Support of primitives for manipulating files and directories.
      Mapping files onto secondary storage.
      File backup on stable (nonvolatile) storage media.
I/O System Management
 OS hides the peculiarities of specific hardware of I/O devices
  from the user.
 The I/O system consists of:
   A memory-management component that includes buffereing, caching,
    and spooling.
   A general device-driver interface.
   Drivers for specific hardware devices.
 The device-driver knows the peculiarities of the specific
  device to which it is assigned.
 Interrupt handlers and device drivers are used in the
  construction of efficient I/O subsystems.
 The I/O subsystem interfaces to other system components,
  manages devices, transfers data, and detects I/O completion.
Secondary-Storage Management
 Since main memory (primary storage) is volatile and too small to
    accommodate all data and programs permanently, the computer
    system must provide secondary storage to back up main memory.
   Secondary-storage devices are used to store data and programs of
    the users.
   Application programs (compilers, assemblers, editors, AutoCAD
    etc.) are commonly available on FDs, CDs, HDs, Ods etc.
   Most modern computer systems use disks as the principal on-line
    storage medium, for both programs and data.
   OS uses optimal techniques for secondary-storage management in
    order to increase its efficiency.
   The operating system is responsible for the following activities in
    connection with disk management:
     Free space management.
     Storage allocation.
     Disk scheduling.
Networking (Distributed Systems)
 A distributed system is a collection of processors (PCs, workstations,
    minicomputers, large and general purpose computer systems) that do not
    share memory or a clock. Each processor has its own local memory and
    clock.
   The processors in the system are connected through communication lines
    (high speed buses or networks).
   Communication takes place using a protocol (FTP, NFS, TCP/IP) which have
    a great effect on the system’s utility and popularity.
   The communication network design considers routing, connection strategies,
    problems of contention, and security.
   Os provides network access using network interface’s device drivers.
   A distributed system provides user access to various system resources.
   WWW provides a new access method for information sharing using http - for
    use in communication between a web server and a web browser.
   Access to a shared resource allows:
      Computation speed-up.
      Increased functionality.
      Increased data availability.
      Enhanced reliability.
Protection System
 Users must be protected during the concurrent execution
    of multiple processes.
   OS’s authorization is required to utilize the resources (i.e.
    files, memory segments, CPU, plotters, printers, tapes).
   Different mechanisms are used to provide to different
    resources.
   Protection refers to a mechanism for controlling access
    by programs, processes, or users to both system and
    user resources.
   The protection mechanism must:
      distinguish between authorized and unauthorized usage.
      specify the controls to be imposed.
      provide a means of enforcement.
      Improves reliability by detecting errors at an early
       stage.
Command-Interpreter System
 Most important system component being an interface between the user
    and OS.
   In some systems it is in the kernel while in other OSs (MS DOS, UNIX),
    it is a special program that runs when a job is initiated or when user
    logs-on.
   Named as command.com in MSDOS and shell in UNIX. In these
    OSs, commands are typed and entered for execution by the user.
   In latest OSs, User-friendly interface style has been incorporated to
    facilitate the users.
   Many commands are given to the operating system by control
    statements which deal with:
     process creation and management
     I/O handling
     secondary-storage management
     main-memory management
     file-system access
     protection
     networking
Operating System Services
 OS services for convenience of the users/programmers:-
    Program execution – system capability to load a program into memory, run, and
       end it normally or abnormally.
      I/O operations – since user programs cannot execute I/O operations directly, the
       operating system must provide some means to perform I/O.
      File-system manipulation – program capability to read, write, create, and delete
       files.
      Communications – exchange of information between processes executing either
       on the same computer or on different systems tied together by a network.
       Implemented via shared memory or message passing approaches.
      Error detection – ensures correct computing by detecting errors in the CPU and
       memory hardware, in I/O devices, or in user programs.
 OS services for ensuring efficient system operations:-
    Resource allocation – allocating resources to multiple users or multiple jobs
     running at the same time.
    Accounting – keep track of which users use how many and which kinds of
     computer resources for account billing or for accumulating usage statistics.
    Protection – ensuring that all access to system resources is controlled.
System Calls
 System calls provide the interface between a process and the OS:
     Generally available as assembly-language instructions.
     Languages defined to replace assembly language for systems programming allow
        system calls to be made directly (e.g., C, C++).
 A system call is used to complete a specific task:
       Reading input file name
       Opening a file
       Error message if any
       Abnormal termination
       Deletion of a file
       Prompting a message
       Reading data for the file
       Writing data to the file or console
       Closing the file
       Normal termination
 Three general methods are used to pass parameters between a running
   program and the operating system:
     Pass parameters in registers.
     Store the parameters in a table in memory, and the table address is passed as a
      parameter in a register (used in linux)
     Push (store) the parameters onto the stack by the program, and pop off the stack by
      OS.
Passing of Parameters as a Table
Types of System Calls
 Process control
      End, Abort
      Load, Execute
      Create process, Terminate process
      Get process attributes, Set process attributes
      Wait for time
      Wait event, Signal event
      Allocate memory, Free memory
 File management
      Create file, Delete file
      Open, Close
      Read, Write, Reposition
      Get file attributes, Set file attributes
 Device management
      Request device, Release device
      Read, Write, Reposition
      Get device attributes, Set device attributes
      Logically attach devices, Logically detach devices
Types of System Calls
 Information maintenance
   Get time or date, Set time or date
   Get system data, Set system data
   Get process, file, or device attributes, Set process, file, or device
    attributes
 Communications
   Create    communication connection, Delete           communication
    connection
   Send messages, Receive messages
   Transfer status information
   Attach remote devices, Detach remote devices
MS-DOS Execution




At System Start-up   Running a Program
UNIX Running Multiple Programs
Communication Models
 Communication may take place using either message
  passing or shared memory.




    Message Passing            Shared Memory
System Programs
 System programs are user interfaces to system calls and provide a
  convenient environment for program development and execution.
  Categories of system programs are :-
    File Manipulation – used for creating, deleting, renaming, printing, dumping,
       listing, and generally manipulating files and directories.
      Status Information – ask the system for date, time, available memory/disk, used
       memory/disk, number of users etc.
      File Modification – text editors to create and modify the content of files stored
       on disk or tape.
      Programming Language Support – compilers, assemblers, and interpreters for
       common programming languages are provided to the user with the OS.
      Program Loading and Execution – OS may provide absolute loaders,
       relocatable loaders, linkage editors, and debuggers for program loading and
       execution.
      Communications – provide mechanism for creating virtual connections among
       processes, users, and different computer systems which allows message
       passing, browse web pages, send e-mail messages, log-in remotely, transfer
       files from one machine to another.
      Application Programs or System Utilities – many OSs are supplied with
       system utilities or application programs (i.e. web browsers, word processors, text
       formatters, spreadsheets, database systems) to perform common operations.
System Programs
 Most users’ view of the operation system is defined by system programs, not
   by the actual system calls.
 Command-interpreter is the most important system program and can be
   implemented in two ways:-
     Schemes of commands implementation are:
        Command interpreter itself contains the code to execute the commands,
         jumps to a section of its code that sets up the parameters, and makes the
         appropriate system call.
            Advantages: faster execution; easy to use by the programmers.
           Disadvantages: bigger size of the command-interpreter; needs
              changes for new commands.
        All commands are implemented through special system programs.
         Command file is loaded in the memory and executed.
            Advantages : small size of command interpreter; not changed for
              new commands, new commands can be incorporated easily.
            Disadvantages : clumsy task of passing parameters from the
              command-interpreter to the system program; slower in loading and
              execution; misinterpretation of the command parameters as they are
              designed and implemented at different times by different
              programmers.
Simple System Structure
                        (MS-DOS)

 MS-DOS     was written to
  provide       the     most
  functionality in the least
  space.
 It was not divided into
  modules carefully.
 Although     MS-DOS    has
  some       structure,   its
  interfaces and levels of
  functionality are not well
  separated.
Simple System Structure
                           (UNIX)
 UNIX – limited by hardware functionality, the original
  UNIX operating system had limited structuring. The UNIX
  OS consists of two separable parts:
    Systems programs
       Systems programs are provided to define the user interface.
    The kernel
       Consists of everything below the system-call interface and
         above the physical hardware.
        Separated into a series of interfaces and device drivers.
        Different components (file system, CPU scheduling, memory
         management and other OS functions) were layered in its
         design.
    OS may provide smaller modules for much greater control of
     computer resources, incorporating changes in the separate
     modules easily to enhance functionality and hide information in
     different components.
UNIX System Structure
Layered Approach
 The operating system is divided into a number of layers (levels),
    each built on top of lower layers. The bottom layer (layer 0) is
    the hardware; the highest (layer N) is the user interface.
   With modularity, layers are selected such that each uses
    functions (operations) and services of only lower-level layers.
   OS has a greater control over the computer resources and
    applications that make use of it.
    Provides more freedom to the implementers to make changes
    in the inner workings of the system.
   Provides information hiding by allowing the programmers to
    implement the low-level routines using top-down modular
    programming approach.
   Layered approach is used for modularization of the OS.
   Higher-level layers can invoke lower-level layers.
   Less number of layers provide more functionality at each level
    while reducing the problems.
Layered Approach
 Advantages: modularization makes debugging and
  verification much easier; design and implementation
  is simplified; each layer hides certain data structures,
  operations and hardware details from higher-level
  layers.
 Disadvantages: level definition and implementation is
  very difficult; order of levels for the design of layered
  structure is problematical; interaction between layers
  and passing of parameters / data is very complex;
  less efficient as a system call takes longer time for
  execution than a non-layered system.
 Examples: Technische Hogeschool Eindhoven (THE)
  OS and Venus layer structure.
An Operating System Layer
Level 5: User programs
 Level 4: buffering for input and output devices
 Level 3: operator-console device driver
                                               Figure : THE layer structure
 Level 2: memory management
 Level 1: CPU scheduling
 Level 0: hardware


Level 6: User programs
Level 5: device drivers and schedulers
Level 4: virtual memory
Level 3: I/O channel
                                                   Figure : Venus layer structure
Level 2: CPU scheduling
Level 1: instruction interpreter
Level 0: hardware
Layered Approach
 OS/2    provides multitasking and dual mode
  operation on more powerful hardware.
 OS/2 does not provide direct user access to low-
  level facilities like DOS, OS has more control over
  the hardware, and has more information about
  usage of resources.
 Windows NT 4.0 has increased its performance by
  moving layers from user space to kernel space and
  closely integrating them.
OS/2 Layer Structure
Microkernel System Structure
 Larger kernels need more space and are difficult to manage.
 Microkernel approach moves all non-essential components from the
    kernel and implements them as system-level programs and user-
    level programs, moving as much from the kernel into “user” space.
   Microkernel provides minimal process memory management and
    communication facility.
   Microkernel provides communication facility through message-
    passing between the client program and various services that are
    also running in the user space.
   Microkernel provides indirect communication between the client
    program and the service.
   Benefits:
       easier to extend a microkernel
       fewer changes required in the modification of microkernel
       easier to port the operating system to new architectures
       more reliable (less code is running in kernel mode)
       more secure – if a routine fails, the rest of the OS remains untouched
Windows NT Client-Server Structure
Virtual Machines
 The layered approach is taken to its logical conclusion in
    the concept of a virtual machine.
   The virtual machine concept treats the kernel of the OS
    and the hardware though they were all hardware.
   System programs treat hardware instructions and system
    calls as they were at the same level. Application
    programs can also call system programs.
   A virtual machine provides an interface identical to the
    underlying bare hardware.
   The operating system creates the illusion of multiple
    processes, each executing on its own processor with its
    own (virtual) memory.
Virtual Machines
 The resources of the physical computer are shared to create the virtual
    machines:
      CPU scheduling can create the appearance that users have their
        own processor.
      Spooling and a file system can provide virtual card readers and
        virtual line printers.
      A normal user time-sharing terminal serves as the virtual machine
        operator’s console.
   A virtual machine has virtual memory, virtual disks, virtual printer, virtual
    console, virtual processor and virtual communication network.
   A user can run any type of software package on his/her virtual machine.
   The virtual machine software is concerned with multiprogramming
    multiple virtual machines onto a physical machine.
   Virtual disks (minidisks) are difficult to implement in a virtual machine.
    A lot of effort is required to provide an exact duplicate of the underlying
    machine.
   Virtual user mode and virtual monitor mode run in the physical user
    mode.
Virtual Machines
 Advantages
    The virtual-machine concept provides complete protection of
     system resources since each virtual machine is isolated from all
     other virtual machines.
    A virtual-machine system is a perfect vehicle for operating-
     systems research and development. System development is
     done on the virtual machine, instead of on a physical machine
     and so does not disrupt normal system operation.
    Virtual machines are useful for solving system compatibility
     problems.
 Disadvantages
    No direct sharing of resources as each virtual machine is
     isolated from all other virtual machines.
    The virtual machine concept is difficult to implement due to the
     effort required to provide an exact duplicate to the underlying
     machine.
    The privileged instructions (needed mainly for I/O) must be
     simulated and hence execute more slowly.
System Models




Non-virtual Machine              Virtual Machine
Java Virtual Machine
 In addition to a language specification and a large API library, Java
    also provides a specification for a Java Virtual Machine (JVM).
   For each Java class, the Java compiler produces an architecture-
    neutral bytecode output (.class) file that will run on any implementation
    of the JVM.
   JVM consists of:
    - class loader
    - class verifier
    - runtime interpreter
   The Java interpreter may be a software module that interprets the
    byte-codes one at a time, or it may be a Just-In-Time (JIT) compiler
    that turns the architecture-neutral bytecodes into native machine
    language for the host computer.
   Most implementations of the JVM use a JIT compiler for enhanced
    performance.
   JVM design provides a secure, efficient, object-oriented, portable, and
    architecture-neutral platform on which to run Java programs.
Java Virtual Machine
System Design Goals
 System goals and specifications are required to be
  defined for the design of OS.
 Choice of hardware and type of OS to be decided.
 Requirements of OS can be divided in two groups:
    Goals desired by users: the system should be
      convenient and easy to use; easy to learn; reliable;
      safe, and fast.
    Goals desired by programmers / designers: easy
      to design, implement, maintain and operate; it should
      be flexible; reliable; error free, and efficient.
 The wide range of systems shows that different
  requirements can result in a large variety of solutions for
  different environments.
System Mechanisms and Policies
 Mechanisms determine how to do something and
    policies decide what will be done.
   Timer used in the CPU protection is a mechanism and
    the time to be set for a particular user is a policy
    decision.
   Mechanisms and policies should be treated separately
    – an important principle. Policies do change from time
    to time or place to place but mechanisms rarely
    change.
   Policy-independent mechanisms are incorporated for
    flexibility.
   Policy decisions must be made for all resource-
    allocation and scheduling problems.
System Implementation
 Designed OS is implemented using either assembly language or a high
    level language. Both languages can be used in the implementation of
    an OS.
   Traditionally written in assembly language, operating systems can now
    be written in higher-level languages (MCP in ALGOL, MULTICS in PL/1
    PRIMOS in FORTRAN, and Unix, OS/2 and Windows in C).
   Advantages of using a high level language: code writing is much
    faster; more compact; easier to understand; easier to debug; OS is far
    easier to port; better data structures and algorithms provide
    performance improvements.
   Disadvantages of using a high level language: reduced speed, and
    increased storage requirements.
   The most critical or bottleneck routines (memory manager, CPU
    scheduler) can be written in assembly language for obtaining better
    performance with small code.
   Trace listings of system behaviour (using log file or real time approach)
    and analysis program help to identify bottlenecks and inefficiencies.
System Generation (SYSGEN)
 As the OSs are designed to run on any of a class of machines at a
  variety of sites with a variety of peripheral configurations, the system
  must be configured or generated for each specific computer site. This
  process is known as SYSGEN.
 The SYSGEN program reads from a file or asks the operator for
  following information concerning the specific configuration of the
  hardware system or probes the hardware directly to determine the
  type of components:
    CPU type: options for instruction sets; description of each CPU
       for multiple CPU systems.
    Memory: total memory, available memory - normally determined
       by the system.
    Devices: total devices, system needs to know the device number,
       the device interrupt number, type and model of each device.
    Options: Desired options of the OS and parameters values
       needed (buffers and their sizes, CPU scheduling algorithm,
       maximum number of processes to be supported).
System Generation Approaches
 Approaches
    The source code of the OS is modified and the OS is completely compiled
     to meet requirements of the described system – fully tailored OS (one
     extreme).
    The system description could cause the creation of tables and the selection
     of modules from a precompiled library. These modules would be linked to
     form the generated OS. SYSGEN is faster but has more generality that was
     actually needed.
    A completely table driven system can be constructed. All the code would
     always be a part of the system and selection would occur at execution time,
     not at a compile or link time – another extreme.
 The major differences among these approaches are the size,
  generality of the generated system, and the ease of modification as the
  hardware configuration changes.
 Bootstrap program or Bootstrap loader locates the kernel, loads it into
  main memory and starts the execution. So OS is made available for use
  by the hardware and users.

More Related Content

What's hot

Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating SystemsRitu Ranjan Shrivastwa
 
Operating system structures
Operating system structuresOperating system structures
Operating system structuresMohd Arif
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
Memory management ppt
Memory management pptMemory management ppt
Memory management pptManishaJha43
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSvampugani
 
Lecture 1 introduction to parallel and distributed computing
Lecture 1   introduction to parallel and distributed computingLecture 1   introduction to parallel and distributed computing
Lecture 1 introduction to parallel and distributed computingVajira Thambawita
 
Process management os concept
Process management os conceptProcess management os concept
Process management os conceptpriyadeosarkar91
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-SystemsVenkata Sreeram
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.Ravi Kumar Patel
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating SystemsMukesh Chinta
 
Operating system architecture
Operating system architectureOperating system architecture
Operating system architectureSabin dumre
 
Operating system components
Operating system componentsOperating system components
Operating system componentsSyed Zaid Irshad
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)Vaibhav Bajaj
 
File system Os
File system OsFile system Os
File system OsNehal Naik
 
Operating system and its types
Operating system and its types Operating system and its types
Operating system and its types vimal kumar arora
 

What's hot (20)

System call
System callSystem call
System call
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Operating system structures
Operating system structuresOperating system structures
Operating system structures
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Lecture 1 introduction to parallel and distributed computing
Lecture 1   introduction to parallel and distributed computingLecture 1   introduction to parallel and distributed computing
Lecture 1 introduction to parallel and distributed computing
 
Process state in OS
Process state in OSProcess state in OS
Process state in OS
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
Kernel (OS)
Kernel (OS)Kernel (OS)
Kernel (OS)
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating Systems
 
Operating system architecture
Operating system architectureOperating system architecture
Operating system architecture
 
Operating system components
Operating system componentsOperating system components
Operating system components
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
Ch1-Operating System Concept
Ch1-Operating System ConceptCh1-Operating System Concept
Ch1-Operating System Concept
 
File system Os
File system OsFile system Os
File system Os
 
Operating system and its types
Operating system and its types Operating system and its types
Operating system and its types
 

Similar to operating system structure

operating system structure
operating system structureoperating system structure
operating system structureHAMZA AHMED
 
ch3 - operating system structures.ppt
ch3 - operating system structures.pptch3 - operating system structures.ppt
ch3 - operating system structures.pptdivyang32
 
Ch3 OS
Ch3 OSCh3 OS
Ch3 OSC.U
 
chapter 3 opreating system lecture note and its is impaortamt concept for mn
chapter 3 opreating system  lecture note and its is impaortamt concept for mnchapter 3 opreating system  lecture note and its is impaortamt concept for mn
chapter 3 opreating system lecture note and its is impaortamt concept for mndejenehundaol91
 
installing and optimizing operating system software
installing and optimizing operating system software   installing and optimizing operating system software
installing and optimizing operating system software Jaleto Sunkemo
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating SystemSoumit Ghosh
 
Unit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptxUnit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptxThamaraiselviAvinuty
 
OS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxOS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxPRABAVATHIH
 
System components (os)
System components (os)System components (os)
System components (os)snegacmr
 
Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]Amit Gupta
 
Operating system
Operating systemOperating system
Operating systemmak120
 
2 opreating system
2 opreating system2 opreating system
2 opreating systemHekmatFaisal
 
Operating system
Operating systemOperating system
Operating systemADITHYAM19
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptL-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptKirti Verma
 

Similar to operating system structure (20)

operating system structure
operating system structureoperating system structure
operating system structure
 
Ch3
Ch3Ch3
Ch3
 
ch3 - operating system structures.ppt
ch3 - operating system structures.pptch3 - operating system structures.ppt
ch3 - operating system structures.ppt
 
Ch3 OS
Ch3 OSCh3 OS
Ch3 OS
 
OSCh3
OSCh3OSCh3
OSCh3
 
OS_Ch3
OS_Ch3OS_Ch3
OS_Ch3
 
chapter 3 opreating system lecture note and its is impaortamt concept for mn
chapter 3 opreating system  lecture note and its is impaortamt concept for mnchapter 3 opreating system  lecture note and its is impaortamt concept for mn
chapter 3 opreating system lecture note and its is impaortamt concept for mn
 
installing and optimizing operating system software
installing and optimizing operating system software   installing and optimizing operating system software
installing and optimizing operating system software
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating System
 
Os structure
Os structureOs structure
Os structure
 
Unit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptxUnit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptx
 
OS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxOS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptx
 
System components (os)
System components (os)System components (os)
System components (os)
 
Introduction of operating system
Introduction of operating systemIntroduction of operating system
Introduction of operating system
 
Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]
 
Operating System
Operating SystemOperating System
Operating System
 
Operating system
Operating systemOperating system
Operating system
 
2 opreating system
2 opreating system2 opreating system
2 opreating system
 
Operating system
Operating systemOperating system
Operating system
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptL-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.ppt
 

Recently uploaded

GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxJanEmmanBrigoli
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 

Recently uploaded (20)

Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptx
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 

operating system structure

  • 1. Operating-System Structures  System Components  Operating System Services  System Calls  System Programs  System Structure  Virtual Machines  System Design and Implementation  System Generation
  • 2. Common System Components  Process Management  Main Memory Management  File Management  I/O-System Management  Secondary-Storage Management  Networking  Protection System  Command-Interpreter System
  • 3. Process Management  A process is a program in execution. A process is an active entity.  A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task.  Initialization data is also passed for execution of a process.  A program can have many processes as it runs.  System processes execute OS code whereas user processes execute user code.  OS reclaims reusable resources from the process on its termination.  The OS is responsible for the following activities in connection with process management:  Process creation and deletion.  process suspension and resumption.  Provision of mechanisms for:  process synchronization  process communication  deadlock handling
  • 4. Main-Memory Management  Memory is a large array of words or bytes, each with its own address. It is a repository of quickly accessible data shared by the CPU and I/O devices.  Main memory is a volatile storage device. It loses its contents in the case of system failure.  The I/O operations implemented via DMA also read and write in memory.  Main-memory is frequently addressed by CPU for accessing instructions and data from memory during program execution.  Different memory-management techniques are used to keep several programs in memory for improving CPU utilization and response time.  An appropriate memory-management scheme is used for a specific hardware design of the system.  The operating system is responsible for the following activities in connection with memory management:  Keep track of which parts of memory are currently being used and by whom.  Decide which processes to be loaded when memory space becomes available.  Allocate and deallocate memory space as needed.
  • 5. File Management  A file is a collection of related information defined by its creator. Commonly, files represent programs (both source and object forms) and data.  Computers can store files on HD, FD, MD, OD or magnetic tape/ drum. Each media has its own characteristics, device controller and properties such as access speed, capacity, data-transfer rate, and access-method (random or sequential).  OS maps files (logical storage units) onto physical media and accesses these files via the storage devices.  OS manages the mass storage media and the devices that control them and provides protection to files in multi-user environment.  The operating system is responsible for the following activities in connection with file management:  File creation and deletion.  Directory creation and deletion.  Support of primitives for manipulating files and directories.  Mapping files onto secondary storage.  File backup on stable (nonvolatile) storage media.
  • 6. I/O System Management  OS hides the peculiarities of specific hardware of I/O devices from the user.  The I/O system consists of:  A memory-management component that includes buffereing, caching, and spooling.  A general device-driver interface.  Drivers for specific hardware devices.  The device-driver knows the peculiarities of the specific device to which it is assigned.  Interrupt handlers and device drivers are used in the construction of efficient I/O subsystems.  The I/O subsystem interfaces to other system components, manages devices, transfers data, and detects I/O completion.
  • 7. Secondary-Storage Management  Since main memory (primary storage) is volatile and too small to accommodate all data and programs permanently, the computer system must provide secondary storage to back up main memory.  Secondary-storage devices are used to store data and programs of the users.  Application programs (compilers, assemblers, editors, AutoCAD etc.) are commonly available on FDs, CDs, HDs, Ods etc.  Most modern computer systems use disks as the principal on-line storage medium, for both programs and data.  OS uses optimal techniques for secondary-storage management in order to increase its efficiency.  The operating system is responsible for the following activities in connection with disk management:  Free space management.  Storage allocation.  Disk scheduling.
  • 8. Networking (Distributed Systems)  A distributed system is a collection of processors (PCs, workstations, minicomputers, large and general purpose computer systems) that do not share memory or a clock. Each processor has its own local memory and clock.  The processors in the system are connected through communication lines (high speed buses or networks).  Communication takes place using a protocol (FTP, NFS, TCP/IP) which have a great effect on the system’s utility and popularity.  The communication network design considers routing, connection strategies, problems of contention, and security.  Os provides network access using network interface’s device drivers.  A distributed system provides user access to various system resources.  WWW provides a new access method for information sharing using http - for use in communication between a web server and a web browser.  Access to a shared resource allows:  Computation speed-up.  Increased functionality.  Increased data availability.  Enhanced reliability.
  • 9. Protection System  Users must be protected during the concurrent execution of multiple processes.  OS’s authorization is required to utilize the resources (i.e. files, memory segments, CPU, plotters, printers, tapes).  Different mechanisms are used to provide to different resources.  Protection refers to a mechanism for controlling access by programs, processes, or users to both system and user resources.  The protection mechanism must:  distinguish between authorized and unauthorized usage.  specify the controls to be imposed.  provide a means of enforcement.  Improves reliability by detecting errors at an early stage.
  • 10. Command-Interpreter System  Most important system component being an interface between the user and OS.  In some systems it is in the kernel while in other OSs (MS DOS, UNIX), it is a special program that runs when a job is initiated or when user logs-on.  Named as command.com in MSDOS and shell in UNIX. In these OSs, commands are typed and entered for execution by the user.  In latest OSs, User-friendly interface style has been incorporated to facilitate the users.  Many commands are given to the operating system by control statements which deal with:  process creation and management  I/O handling  secondary-storage management  main-memory management  file-system access  protection  networking
  • 11. Operating System Services  OS services for convenience of the users/programmers:-  Program execution – system capability to load a program into memory, run, and end it normally or abnormally.  I/O operations – since user programs cannot execute I/O operations directly, the operating system must provide some means to perform I/O.  File-system manipulation – program capability to read, write, create, and delete files.  Communications – exchange of information between processes executing either on the same computer or on different systems tied together by a network. Implemented via shared memory or message passing approaches.  Error detection – ensures correct computing by detecting errors in the CPU and memory hardware, in I/O devices, or in user programs.  OS services for ensuring efficient system operations:-  Resource allocation – allocating resources to multiple users or multiple jobs running at the same time.  Accounting – keep track of which users use how many and which kinds of computer resources for account billing or for accumulating usage statistics.  Protection – ensuring that all access to system resources is controlled.
  • 12. System Calls  System calls provide the interface between a process and the OS:  Generally available as assembly-language instructions.  Languages defined to replace assembly language for systems programming allow system calls to be made directly (e.g., C, C++).  A system call is used to complete a specific task:  Reading input file name  Opening a file  Error message if any  Abnormal termination  Deletion of a file  Prompting a message  Reading data for the file  Writing data to the file or console  Closing the file  Normal termination  Three general methods are used to pass parameters between a running program and the operating system:  Pass parameters in registers.  Store the parameters in a table in memory, and the table address is passed as a parameter in a register (used in linux)  Push (store) the parameters onto the stack by the program, and pop off the stack by OS.
  • 13. Passing of Parameters as a Table
  • 14. Types of System Calls  Process control  End, Abort  Load, Execute  Create process, Terminate process  Get process attributes, Set process attributes  Wait for time  Wait event, Signal event  Allocate memory, Free memory  File management  Create file, Delete file  Open, Close  Read, Write, Reposition  Get file attributes, Set file attributes  Device management  Request device, Release device  Read, Write, Reposition  Get device attributes, Set device attributes  Logically attach devices, Logically detach devices
  • 15. Types of System Calls  Information maintenance  Get time or date, Set time or date  Get system data, Set system data  Get process, file, or device attributes, Set process, file, or device attributes  Communications  Create communication connection, Delete communication connection  Send messages, Receive messages  Transfer status information  Attach remote devices, Detach remote devices
  • 16. MS-DOS Execution At System Start-up Running a Program
  • 18. Communication Models  Communication may take place using either message passing or shared memory. Message Passing Shared Memory
  • 19. System Programs  System programs are user interfaces to system calls and provide a convenient environment for program development and execution. Categories of system programs are :-  File Manipulation – used for creating, deleting, renaming, printing, dumping, listing, and generally manipulating files and directories.  Status Information – ask the system for date, time, available memory/disk, used memory/disk, number of users etc.  File Modification – text editors to create and modify the content of files stored on disk or tape.  Programming Language Support – compilers, assemblers, and interpreters for common programming languages are provided to the user with the OS.  Program Loading and Execution – OS may provide absolute loaders, relocatable loaders, linkage editors, and debuggers for program loading and execution.  Communications – provide mechanism for creating virtual connections among processes, users, and different computer systems which allows message passing, browse web pages, send e-mail messages, log-in remotely, transfer files from one machine to another.  Application Programs or System Utilities – many OSs are supplied with system utilities or application programs (i.e. web browsers, word processors, text formatters, spreadsheets, database systems) to perform common operations.
  • 20. System Programs  Most users’ view of the operation system is defined by system programs, not by the actual system calls.  Command-interpreter is the most important system program and can be implemented in two ways:-  Schemes of commands implementation are:  Command interpreter itself contains the code to execute the commands, jumps to a section of its code that sets up the parameters, and makes the appropriate system call.  Advantages: faster execution; easy to use by the programmers.  Disadvantages: bigger size of the command-interpreter; needs changes for new commands.  All commands are implemented through special system programs. Command file is loaded in the memory and executed.  Advantages : small size of command interpreter; not changed for new commands, new commands can be incorporated easily.  Disadvantages : clumsy task of passing parameters from the command-interpreter to the system program; slower in loading and execution; misinterpretation of the command parameters as they are designed and implemented at different times by different programmers.
  • 21. Simple System Structure (MS-DOS)  MS-DOS was written to provide the most functionality in the least space.  It was not divided into modules carefully.  Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated.
  • 22. Simple System Structure (UNIX)  UNIX – limited by hardware functionality, the original UNIX operating system had limited structuring. The UNIX OS consists of two separable parts:  Systems programs  Systems programs are provided to define the user interface.  The kernel  Consists of everything below the system-call interface and above the physical hardware.  Separated into a series of interfaces and device drivers.  Different components (file system, CPU scheduling, memory management and other OS functions) were layered in its design.  OS may provide smaller modules for much greater control of computer resources, incorporating changes in the separate modules easily to enhance functionality and hide information in different components.
  • 24. Layered Approach  The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface.  With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers.  OS has a greater control over the computer resources and applications that make use of it.  Provides more freedom to the implementers to make changes in the inner workings of the system.  Provides information hiding by allowing the programmers to implement the low-level routines using top-down modular programming approach.  Layered approach is used for modularization of the OS.  Higher-level layers can invoke lower-level layers.  Less number of layers provide more functionality at each level while reducing the problems.
  • 25. Layered Approach  Advantages: modularization makes debugging and verification much easier; design and implementation is simplified; each layer hides certain data structures, operations and hardware details from higher-level layers.  Disadvantages: level definition and implementation is very difficult; order of levels for the design of layered structure is problematical; interaction between layers and passing of parameters / data is very complex; less efficient as a system call takes longer time for execution than a non-layered system.  Examples: Technische Hogeschool Eindhoven (THE) OS and Venus layer structure.
  • 27. Level 5: User programs Level 4: buffering for input and output devices Level 3: operator-console device driver Figure : THE layer structure Level 2: memory management Level 1: CPU scheduling Level 0: hardware Level 6: User programs Level 5: device drivers and schedulers Level 4: virtual memory Level 3: I/O channel Figure : Venus layer structure Level 2: CPU scheduling Level 1: instruction interpreter Level 0: hardware
  • 28. Layered Approach  OS/2 provides multitasking and dual mode operation on more powerful hardware.  OS/2 does not provide direct user access to low- level facilities like DOS, OS has more control over the hardware, and has more information about usage of resources.  Windows NT 4.0 has increased its performance by moving layers from user space to kernel space and closely integrating them.
  • 30. Microkernel System Structure  Larger kernels need more space and are difficult to manage.  Microkernel approach moves all non-essential components from the kernel and implements them as system-level programs and user- level programs, moving as much from the kernel into “user” space.  Microkernel provides minimal process memory management and communication facility.  Microkernel provides communication facility through message- passing between the client program and various services that are also running in the user space.  Microkernel provides indirect communication between the client program and the service.  Benefits:  easier to extend a microkernel  fewer changes required in the modification of microkernel  easier to port the operating system to new architectures  more reliable (less code is running in kernel mode)  more secure – if a routine fails, the rest of the OS remains untouched
  • 32. Virtual Machines  The layered approach is taken to its logical conclusion in the concept of a virtual machine.  The virtual machine concept treats the kernel of the OS and the hardware though they were all hardware.  System programs treat hardware instructions and system calls as they were at the same level. Application programs can also call system programs.  A virtual machine provides an interface identical to the underlying bare hardware.  The operating system creates the illusion of multiple processes, each executing on its own processor with its own (virtual) memory.
  • 33. Virtual Machines  The resources of the physical computer are shared to create the virtual machines:  CPU scheduling can create the appearance that users have their own processor.  Spooling and a file system can provide virtual card readers and virtual line printers.  A normal user time-sharing terminal serves as the virtual machine operator’s console.  A virtual machine has virtual memory, virtual disks, virtual printer, virtual console, virtual processor and virtual communication network.  A user can run any type of software package on his/her virtual machine.  The virtual machine software is concerned with multiprogramming multiple virtual machines onto a physical machine.  Virtual disks (minidisks) are difficult to implement in a virtual machine. A lot of effort is required to provide an exact duplicate of the underlying machine.  Virtual user mode and virtual monitor mode run in the physical user mode.
  • 34. Virtual Machines  Advantages  The virtual-machine concept provides complete protection of system resources since each virtual machine is isolated from all other virtual machines.  A virtual-machine system is a perfect vehicle for operating- systems research and development. System development is done on the virtual machine, instead of on a physical machine and so does not disrupt normal system operation.  Virtual machines are useful for solving system compatibility problems.  Disadvantages  No direct sharing of resources as each virtual machine is isolated from all other virtual machines.  The virtual machine concept is difficult to implement due to the effort required to provide an exact duplicate to the underlying machine.  The privileged instructions (needed mainly for I/O) must be simulated and hence execute more slowly.
  • 36. Java Virtual Machine  In addition to a language specification and a large API library, Java also provides a specification for a Java Virtual Machine (JVM).  For each Java class, the Java compiler produces an architecture- neutral bytecode output (.class) file that will run on any implementation of the JVM.  JVM consists of: - class loader - class verifier - runtime interpreter  The Java interpreter may be a software module that interprets the byte-codes one at a time, or it may be a Just-In-Time (JIT) compiler that turns the architecture-neutral bytecodes into native machine language for the host computer.  Most implementations of the JVM use a JIT compiler for enhanced performance.  JVM design provides a secure, efficient, object-oriented, portable, and architecture-neutral platform on which to run Java programs.
  • 38. System Design Goals  System goals and specifications are required to be defined for the design of OS.  Choice of hardware and type of OS to be decided.  Requirements of OS can be divided in two groups:  Goals desired by users: the system should be convenient and easy to use; easy to learn; reliable; safe, and fast.  Goals desired by programmers / designers: easy to design, implement, maintain and operate; it should be flexible; reliable; error free, and efficient.  The wide range of systems shows that different requirements can result in a large variety of solutions for different environments.
  • 39. System Mechanisms and Policies  Mechanisms determine how to do something and policies decide what will be done.  Timer used in the CPU protection is a mechanism and the time to be set for a particular user is a policy decision.  Mechanisms and policies should be treated separately – an important principle. Policies do change from time to time or place to place but mechanisms rarely change.  Policy-independent mechanisms are incorporated for flexibility.  Policy decisions must be made for all resource- allocation and scheduling problems.
  • 40. System Implementation  Designed OS is implemented using either assembly language or a high level language. Both languages can be used in the implementation of an OS.  Traditionally written in assembly language, operating systems can now be written in higher-level languages (MCP in ALGOL, MULTICS in PL/1 PRIMOS in FORTRAN, and Unix, OS/2 and Windows in C).  Advantages of using a high level language: code writing is much faster; more compact; easier to understand; easier to debug; OS is far easier to port; better data structures and algorithms provide performance improvements.  Disadvantages of using a high level language: reduced speed, and increased storage requirements.  The most critical or bottleneck routines (memory manager, CPU scheduler) can be written in assembly language for obtaining better performance with small code.  Trace listings of system behaviour (using log file or real time approach) and analysis program help to identify bottlenecks and inefficiencies.
  • 41. System Generation (SYSGEN)  As the OSs are designed to run on any of a class of machines at a variety of sites with a variety of peripheral configurations, the system must be configured or generated for each specific computer site. This process is known as SYSGEN.  The SYSGEN program reads from a file or asks the operator for following information concerning the specific configuration of the hardware system or probes the hardware directly to determine the type of components:  CPU type: options for instruction sets; description of each CPU for multiple CPU systems.  Memory: total memory, available memory - normally determined by the system.  Devices: total devices, system needs to know the device number, the device interrupt number, type and model of each device.  Options: Desired options of the OS and parameters values needed (buffers and their sizes, CPU scheduling algorithm, maximum number of processes to be supported).
  • 42. System Generation Approaches  Approaches  The source code of the OS is modified and the OS is completely compiled to meet requirements of the described system – fully tailored OS (one extreme).  The system description could cause the creation of tables and the selection of modules from a precompiled library. These modules would be linked to form the generated OS. SYSGEN is faster but has more generality that was actually needed.  A completely table driven system can be constructed. All the code would always be a part of the system and selection would occur at execution time, not at a compile or link time – another extreme.  The major differences among these approaches are the size, generality of the generated system, and the ease of modification as the hardware configuration changes.  Bootstrap program or Bootstrap loader locates the kernel, loads it into main memory and starts the execution. So OS is made available for use by the hardware and users.