SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
Operating-System Structures
 Operating System Services
 User Operating System Interface
 System Calls
 Types of System Calls
 System Programs
 Operating System Design and Implementation
 Operating System Structure
 Virtual Machines
 Operating System Generation
 System Boot
                                                           1
                                  Loganathan R, CSE , HKBKCE
1. Operating System Services
•   One set of operating-system services provides functions that are helpful to the user:
     – User interface - Almost all operating systems have a user interface (UI)
       Command-Line (CLI), Batch Interface & Graphics User Interface (GUI)
     – Program execution - Load a program into memory and to run that program, end
       execution, either normally or abnormally (indicating error)
     – I/O operations - A running program may require I/O, which may involve a file or
       an I/O device.
     – File-system manipulation - Programs need to read and write files and
       directories, create and delete them, search them, list file Information,
       permission management.
     – Communications – Between process in the same or different computer via
       shared memory or message passing
     – Error Detection - Errors may occur in the CPU and memory hardware ( memory
       error or power failure), in I/O devices (parity error on tape, a connection failure
       on a network, or lack of paper in the printer) and in the user program
       (arithmetic overflow, illegal memory location access, or a too-great use of CPU
       time)


                                                                                           2
                                                                   Loganathan R, CSE , HKBKCE
1. Operating System Services Contd..
•   Another set of OS functions exists for ensuring the efficient operation of the
    system itself via resource sharing
     – Resource allocation - When multiple users or multiple jobs running
        concurrently, resources must be allocated to each of them
          • Many types of resources - Some (such as CPU cycles, main memory, and
             file storage) may have special allocation code, others (such as I/O
             devices) may have general request and release code.
     – Accounting - To keep track of which users use how much and what kinds of
        computer resources
     – Protection and security - The owners of information stored in a multiuser or
        networked computer system may want to control use of that information,
        concurrent processes should not interfere with each other
          • Protection involves ensuring that all access to system resources is
             controlled
          • Security of the system from outsiders requires user authentication,
             extends to defending external I/O devices from invalid access attempts
          • If a system is to be protected and secure, precautions must be instituted
             throughout it. A chain is only as strong as its weakest link.



                               Loganathan R, CSE , HKBKCE                           3
2.User Operating System Interface
• 2.1 Command Interpreter / CLI
  • Implemented in kernel, sometimes by systems program
  • Function of the command interpreter is to get and execute
    the user-specified command.
  • Multiple command interpreters to choose from the
    interpreters are known as shells
  • Example :Bourne shell, C shell, Bourne-Again shell, the Korn
    shell
  • Command Interpreter Implementation
     • Command interpreter itself contains the code to execute the
       command
     • Through system programs – uses the command to identify a file to
       be loaded into memory and executed
     • Example rm file.txt


                       Loganathan R, CSE , HKBKCE                    4
User Operating System Interface Cntd..
 2.2 Graphical User Interfaces
  User-friendly desktop metaphor interface
   ◦ Usually mouse, keyboard, and monitor
   ◦ Icons represent files, programs, actions, etc
   ◦ Various mouse buttons over objects in the interface cause various
     actions (provide information, options, execute function, open
     directory (known as a folder)
   ◦ Invented at Xerox PARC
  Many systems now include both CLI and GUI interfaces
   ◦ Microsoft Windows is GUI with CLI “command” shell
   ◦ Apple Mac OS X as “Aqua” GUI interface with UNIX kernel
     underneath and shells available
   ◦ Solaris is CLI with optional GUI interfaces (Java Desktop, KDE)


                        Loganathan R, CSE , HKBKCE                       5
3. System Calls
 Programming interface to the services provided by the OS
 Typically written in a high-level language (C or C++)
 Example of how system calls are used to copy the files




                    Loganathan R, CSE , HKBKCE               6
Application Programming Interface(API)
   System calls are mostly accessed by programs via a high-
    level Application Program Interface (API) rather than
    direct system call use
 • API specifies a set of functions that are available to an
    application programmer, including the parameters that are
    passed
   Three most common APIs are Win32 API for Windows,
    POSIX API for POSIX-based systems (including virtually all
    versions of UNIX, Linux, and Mac OS X), and Java API for
    the Java virtual machine (JVM)
   Why use APIs rather than system calls?
 • Program portability
 • Actual system calls can be more detailed and difficult to
    work with than the API


                      Loganathan R, CSE , HKBKCE            7
System Call Implementation
• Programming languages provides a system-call interface that serves as the
  link to system calls made available by the OS
• System-call interface intercepts function calls in the API and invokes the
  necessary system call within the OS
• System-call interface maintains a table indexed according to these numbers
  associated with each system call
• The system call interface invokes intended system call in OS kernel and
  returns status of the system call and any return values




                                                                                 8
                                                    Loganathan R, CSE , HKBKCE
System Call Parameter Passing
• Registers
• Parameters stored in a block, or table, in memory, and address of block
  passed as a parameter in a register (Linux and Solaris) as shown
• Parameters placed, or pushed, onto the stack by the program and popped off
  the stack by the operating system
   – Block and stack methods do not limit the number or length of parameters
      being passed




                                                    Loganathan R, CSE , HKBKCE   9
4. Types of System Calls
4.1 Process control
 •   End, abort • Load, execute
 •   Create process terminate –process
 •   get process attributes, set process attributes
 •   Wait for time • Wait event, signal event
 •   Allocate and free memory




                                                                               fork()
                                                                               exec()
                                                                               exit()



     Single Tasking: MS-DOS execution,                Multitasking: FreeBSD
     (a) At system startup, (b) Running a             running multiple programs
                                                                                        10
     program                                            Loganathan R, CSE , HKBKCE
4. Types of System Calls Contd
4.2 File management
 • File – create, delete, open, close, read, write, reposition
 • Get / set file attributes
4.3 Device management
The various resources controlled by the OS can be thought of as devices
 • Device – request, release, read, write, reposition
 • get / set device attributes          • Logically attach or detach devices
4.4 Information maintenance
Transferring information between the user program and the OS
   and keeps information about all its processes and system calls
 • get / set – time or date                 • get / set system data
 • get / set – process, file or device attributes
4.5 Communications
Inter-process communication Models :
                 Message passing model & Shared-memory model
 • Create, delete communication connection     • Send, receive messages
 • Transfer status information        • Attach or detach remote devices
                                                                                   11
                                                      Loganathan R, CSE , HKBKCE
5. System Programs
 System programs provide a convenient environment for
  program development and execution.
 Categories
  ◦ File management - create, delete, copy, rename, print, dump, list,
    and manipulate files and directories
  ◦ Status information - date, time, available memory or disk space, no
    of users, performance, logging, and debugging information
  ◦ File modification - text editors to create and modify the content of
    files, search contents of files.
  ◦ Programming language support - Compilers, assemblers, debuggers
    and interpreters
  ◦ Program loading and execution - absolute loaders, relocatable
    loaders, linkage editors, overlay loaders and debuggers
  ◦ Communications - Creating virtual connections among processes,
    users, and computer systems
  ◦ System utilities Application programs - web browsers, word
    processors , text formatters, spreadsheets, database systems,
    compilers, plotting and statistical-analysis packages and games
 Most users’ view of the operation system is defined by
  system programs, not the actual system calls
                                                                              12
                                                 Loganathan R, CSE , HKBKCE
6. OS Design and Implementation
 Design and Implementation of OS not “solvable”,
  but some approaches have proven successful
 6.1 Design Goals
  – The design of the system is affected by the choice of
    hardware and the type of system: batch, time shared,
    single user, multiuser, distributed, real time, or general
    purpose
  – The requirement can be divided to User goals and
    System goals
    ◦ User goals – operating system should be convenient to use,
      easy to learn, reliable, safe, and fast
    ◦ System goals – operating system should be easy to design,
      implement, and maintain, as well as flexible, reliable, error-
      free, and efficient


                         Loganathan R, CSE , HKBKCE                    13
6. OS Design and Implementation Contd..
6.2 Mechanisms and Policies
• Mechanisms determine how to do something, policies decide
  what will be done
   – Example : timer construct is a mechanism for ensuring CPU
     protection(loop), but deciding how long the timer is to be set for
     a particular user is a policy decision
   – The separation of policy from mechanism is a very important
     principle, it allows maximum flexibility if policy decisions are to
     be changed later
6.3 Implementation
• Traditionally, written in assembly language, now C or C++
• Advantages of using a higher-level language
   – Faster Coding , more compact, easier to understand and debug
   – Easier to port—to move to some other hardware
• Disadvantages of using a higher-level language
   – Reduced speed and increased storage requirements
                           Loganathan R, CSE , HKBKCE                  14
7. Operating-System Structure
• How     OS    components     are
  interconnected and melded into a
  kernel.
7.1 Simple Structure
• Started as small, simple, and limited
  systems and then grown beyond their
  original scope
• Example : MS-DOS – written to
  provide the most functionality in the
  least space
   – Not divided into modules
   – Although MS-DOS has some
      structure, its interfaces and levels
      of functionality are not well
      separated
                                             MS-DOS layer structure
                                                                           15
                                              Loganathan R, CSE , HKBKCE
7. Operating-System Structure Contd…
• 7.2 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 H/W The highest (layer N) is the UI.
 – A layer is an implementation of an abstract object consists of data
   structures and a set of routines that can be invoked by higher-level layers
• Advantage
  • Simplicity of construction and
     debugging
 • Each layer is implemented with only
    those operations provided by lower
    level layers
 • The first layer can be debugged
    without any concern for the rest of the
    system
 • Correct functioning of first layer can
    be assumed while the second layer is
    debugged, and so on
                                                                                 16
                                                    Loganathan R, CSE , HKBKCE
Example: UNIX
 UNIX – limited by hardware functionality, the original UNIX operating system
   had limited structuring. The UNIX OS consists of two separable parts
 ◦ Systems programs
 ◦ The kernel
   Consists of everything below the system-call interface and above the
     physical hardware
   Provides the file system, CPU scheduling, memory management, and other
     operating-system functions; a large number of functions for one level




                                                  Loganathan R, CSE , HKBKCE
                                                                               17
7. Operating-System Structure Contd…
 7.3 Microkernels
• Structures the OS by removing all nonessential
   components from the kernel and implementing
   them as system and user-level programs.
  Communication takes place between user modules
   using message passing
  Benefits:
  ◦   Easier to extend a microkernel
  ◦   Easier to port the operating system to new architectures
  ◦   More reliable (less code is running in kernel mode)
  ◦   More secure
 Detriments:
  ◦ Performance overhead of user space to kernel space
    communication

                       Loganathan R, CSE , HKBKCE                18
7. Operating-System Structure Contd…
7.4 Modules
  –   Uses object-oriented approach
  –   Each core component is separate
  –   Each talks to the others over known interfaces
  –   Each is loadable as needed within the kernel
  –   a core kernel with seven types of loadable kernel modules




                                              Loganathan R, CSE , HKBKCE 19
Mac OS X Structure(Darwin)
• Uses a hybrid structure – layered technique with one layer consists of the Mach
  microkernel.
• Top layers include application environments and a set of services providing a
  graphical interface to applications
• Below these layers is the kernel consists primarily of the Mach microkernel and
  the BSD kernel
• Mach provides m/y mgmt, support RPC and IPC facilities, including message
  passing and thread scheduling
• BSD component provides a BSD CLI, support for networking and file systems, and
  an implementation of POSIX APIs, including Pthreads




                                                      Loganathan R, CSE , HKBKCE   20
8. Virtual Machines
• A virtual machine takes the layered approach to its logical
  conclusion.
• It abstracts hardware of a single computer into several different
  execution environments i.e.         creates illusion of separate
  execution environment is running its own private computer.
• 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
• The resources of the physical computer are shared to create the
  virtual machines
• A major difficulty is disk systems, solved using Virtual disks
  (minidisks in IBM)
• Users are given their own virtual machines and they can run any
  of the operating systems or software packages that are available


                                              Loganathan R, CSE , HKBKCE 21
8. Virtual Machines Cont…




Non-virtual Machine        Virtual Machine
                                  Loganathan R, CSE , HKBKCE 22
8. Virtual Machines Cont…
• 8.1 Implementation
 – Much work is required to provide an exact duplicate of
   the underlying machine
 – A virtual user mode and a virtual kernel mode, both of
   which run in a physical user mode.
 – Transfer from user mode to kernel mode on a real
   machine also cause a transfer from virtual user mode to
   virtual kernel mode on a virtual machine
 – A system call in virtual user mode will cause a transfer to
   the virtual-machine monitor, it can simulate the effect of
   the system call by changing the register and program
   counter for the virtual machine
 – The real I/O may take100 milliseconds, the virtual I/O
   might take less time(spooled) or more time(interpreted).
                                          Loganathan R, CSE , HKBKCE 23
8. Virtual Machines Cont…
• 8.2 Benefits
 – Complete protection of the various system resources
 – No direct sharing of resources and implementation
   through
     • Share a minidisk and thus to share files through
       software
     • Network of virtual machines over the virtual
       communications network
 – VM system is a perfect vehicle for OS research and
   development
 – A virtual-machine system eliminates system development
   time
     • System must be stopped and taken out of use while
       changes are made and tested , this period is called
       system development time
                                       Loganathan R, CSE , HKBKCE 24
8. Virtual Machines Cont…
• 8.3 Examples
 – 8.3.1 Vmware
  • Abstracts Intel 80X86 hardware into isolated virtual machines.
  • Runs as an application on host OS and allows concurrently
    running several different guest operating systems as
    independent virtual machines




                                                              25
8. Virtual Machines Cont…
• 8.3 Examples
– 8.3. 2 The Java Virtual Machine
 – Java program consists of one or more classes, for each, the compiler
   produces an architecture-neutral bytecode output (.class) file that will
   run on any implementation of the JVM.
 – JVMis a specification for an abstract computer
 – consists of a class loader and a Java interpreter (or a fast just-in-
   time (JIT) compiler ) that executes the architecture-neutral bytecodes


   Java Program                                         Java API
                           Class loader
     .class files                                      .class files

                                Java
                             Interpreter

                            Host systems
                        (Windows, Linux, etc)
                                                                       26
9. Operating-System Generation
• It is possible to design, code, and implement an operating system
  specifically for one machine at one site
• A processes of configuring or generating system for each specific
  computer site, is known as system generation (SYSGEN)
• The SYSGEN program reads from a given file, or asks the operator for
  the specific configuration of the hardware system, or probes the
  hardware directly
• Once information is determined , a system administrator can use it
  to modify the source code of OS , then compile and the output
  object version is tailored to the system
• A slightly less tailored level modules are selected from a
  precompiled library and linked together to form OS
• Other extreme, all the code is always part of the system, and
  selection occurs at execution time, rather than at compile or link
  time.
• The major differences among these approaches are the size and
  generality                                                      27
10. System Boot
• Operating system must be made available to hardware so
  hardware can start it
• When power initialized on system, execution starts at a
  predefined memory location (in ROM) where initial bootstrap
  program stored
• Small piece of code – bootstrap program or bootstrap
  loader, locates the kernel, loads it into memory, and starts its
  execution
• Sometimes two-step process where simple boot block /
  bootstrap loader fetches a complex boot program, which
  loads kernel
• A disk that has a boot partition is called a boot disk or system
  disk.
• Problem with ROM is that changing the bootstrap code
  requires changing the ROM hardware chips which is resolved
  using erasable programmable read-only memory (EPROM)
                                                              28
                        Loganathan R, CSE , HKBKCE

Contenu connexe

Tendances

Operating system structures
Operating system structuresOperating system structures
Operating system structuresMohd Arif
 
Kernel. Operating System
Kernel. Operating SystemKernel. Operating System
Kernel. Operating Systempratikkadam78
 
Operating system concepts (notes)
Operating system concepts (notes)Operating system concepts (notes)
Operating system concepts (notes)Sohaib Danish
 
Process management
Process managementProcess management
Process managementBirju Tank
 
Operating system kernal
Operating system kernalOperating system kernal
Operating system kernalSumit Rajpal
 
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And GagneSlides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And Gagnesarankumar4445
 
Chapter 8 : Memory
Chapter 8 : MemoryChapter 8 : Memory
Chapter 8 : MemoryAmin Omi
 
Operating System Operations ppt.pptx
Operating System Operations ppt.pptxOperating System Operations ppt.pptx
Operating System Operations ppt.pptxMSivani
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and PropertiesSaadi Rahman
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Mukesh Chinta
 
Memory management ppt
Memory management pptMemory management ppt
Memory management pptManishaJha43
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system conceptsStarlee Lathong
 

Tendances (20)

Operating system structures
Operating system structuresOperating system structures
Operating system structures
 
Architecture of Linux
 Architecture of Linux Architecture of Linux
Architecture of Linux
 
Kernel. Operating System
Kernel. Operating SystemKernel. Operating System
Kernel. Operating System
 
Operating system concepts (notes)
Operating system concepts (notes)Operating system concepts (notes)
Operating system concepts (notes)
 
Process management
Process managementProcess management
Process management
 
Kernel (OS)
Kernel (OS)Kernel (OS)
Kernel (OS)
 
Operating system kernal
Operating system kernalOperating system kernal
Operating system kernal
 
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And GagneSlides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Chapter 8 : Memory
Chapter 8 : MemoryChapter 8 : Memory
Chapter 8 : Memory
 
Operating System Operations ppt.pptx
Operating System Operations ppt.pptxOperating System Operations ppt.pptx
Operating System Operations ppt.pptx
 
My ppt hpc u4
My ppt hpc u4My ppt hpc u4
My ppt hpc u4
 
Memory management
Memory managementMemory management
Memory management
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system concepts
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 

En vedette (8)

Paging
PagingPaging
Paging
 
Os concepts
Os conceptsOs concepts
Os concepts
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
 
Chapter 2: Operating System Structures
Chapter 2: Operating System StructuresChapter 2: Operating System Structures
Chapter 2: Operating System Structures
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System Structures
 
Cs6703 grid and cloud computing unit 3
Cs6703 grid and cloud computing unit 3Cs6703 grid and cloud computing unit 3
Cs6703 grid and cloud computing unit 3
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 

Similaire à 2 operating system structures

Ch2 operating-system structures
Ch2   operating-system structuresCh2   operating-system structures
Ch2 operating-system structuresWelly Dian Astika
 
OS Services, System call, Virtual Machine
OS Services, System call, Virtual MachineOS Services, System call, Virtual Machine
OS Services, System call, Virtual MachineDivya S
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System CallsVandana Salve
 
Operating System Structure Part-I.pdf
Operating System Structure Part-I.pdfOperating System Structure Part-I.pdf
Operating System Structure Part-I.pdfHarika Pudugosula
 
OS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxOS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxPRABAVATHIH
 
operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)Rohit malav
 
OS - Ch2
OS - Ch2OS - Ch2
OS - Ch2sphs
 
Operating-System Structures
Operating-System StructuresOperating-System Structures
Operating-System StructuresCloudbells.com
 
Operating System 2
Operating System 2Operating System 2
Operating System 2tech2click
 
Services and system calls
Services and system callsServices and system calls
Services and system callssangrampatil81
 
Lecture_02_Operating System Structures Operating Systems
Lecture_02_Operating System Structures Operating SystemsLecture_02_Operating System Structures Operating Systems
Lecture_02_Operating System Structures Operating SystemsArnoyKhan
 
MELJUN CORTES operating_system_structure
MELJUN CORTES operating_system_structureMELJUN CORTES operating_system_structure
MELJUN CORTES operating_system_structureMELJUN CORTES
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsRai University
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsRai University
 

Similaire à 2 operating system structures (20)

Os unit 1(cont)
Os unit 1(cont)Os unit 1(cont)
Os unit 1(cont)
 
Ch2 operating-system structures
Ch2   operating-system structuresCh2   operating-system structures
Ch2 operating-system structures
 
OS Services, System call, Virtual Machine
OS Services, System call, Virtual MachineOS Services, System call, Virtual Machine
OS Services, System call, Virtual Machine
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
Operating System Structure Part-I.pdf
Operating System Structure Part-I.pdfOperating System Structure Part-I.pdf
Operating System Structure Part-I.pdf
 
OS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxOS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptx
 
chapter2.pptx
chapter2.pptxchapter2.pptx
chapter2.pptx
 
Unit 4
Unit  4Unit  4
Unit 4
 
operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)
 
Ch2
Ch2Ch2
Ch2
 
OS - Ch2
OS - Ch2OS - Ch2
OS - Ch2
 
Operating-System Structures
Operating-System StructuresOperating-System Structures
Operating-System Structures
 
Operating System 2
Operating System 2Operating System 2
Operating System 2
 
Services and system calls
Services and system callsServices and system calls
Services and system calls
 
Lecture_02_Operating System Structures Operating Systems
Lecture_02_Operating System Structures Operating SystemsLecture_02_Operating System Structures Operating Systems
Lecture_02_Operating System Structures Operating Systems
 
MELJUN CORTES operating_system_structure
MELJUN CORTES operating_system_structureMELJUN CORTES operating_system_structure
MELJUN CORTES operating_system_structure
 
CH02.pdf
CH02.pdfCH02.pdf
CH02.pdf
 
Operating system concept
Operating system conceptOperating system concept
Operating system concept
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systems
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systems
 

Plus de Dr. Loganathan R

Ch 6 IoT Processing Topologies and Types.pdf
Ch 6 IoT Processing Topologies and Types.pdfCh 6 IoT Processing Topologies and Types.pdf
Ch 6 IoT Processing Topologies and Types.pdfDr. Loganathan R
 
IoT Sensing and Actuation.pdf
 IoT Sensing and Actuation.pdf IoT Sensing and Actuation.pdf
IoT Sensing and Actuation.pdfDr. Loganathan R
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersDr. Loganathan R
 
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.Dr. Loganathan R
 
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Dr. Loganathan R
 
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Dr. Loganathan R
 
Bcsl 033 data and file structures lab s4-3
Bcsl 033 data and file structures lab s4-3Bcsl 033 data and file structures lab s4-3
Bcsl 033 data and file structures lab s4-3Dr. Loganathan R
 
Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s4-2Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s4-2Dr. Loganathan R
 
Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3Dr. Loganathan R
 
Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2Dr. Loganathan R
 
Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1Dr. Loganathan R
 
Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Dr. Loganathan R
 
Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3Dr. Loganathan R
 
Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2Dr. Loganathan R
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Dr. Loganathan R
 
Introduction to Information Security
Introduction to Information SecurityIntroduction to Information Security
Introduction to Information SecurityDr. Loganathan R
 

Plus de Dr. Loganathan R (20)

Ch 6 IoT Processing Topologies and Types.pdf
Ch 6 IoT Processing Topologies and Types.pdfCh 6 IoT Processing Topologies and Types.pdf
Ch 6 IoT Processing Topologies and Types.pdf
 
IoT Sensing and Actuation.pdf
 IoT Sensing and Actuation.pdf IoT Sensing and Actuation.pdf
IoT Sensing and Actuation.pdf
 
Ch 4 Emergence of IoT.pdf
Ch 4 Emergence of IoT.pdfCh 4 Emergence of IoT.pdf
Ch 4 Emergence of IoT.pdf
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointers
 
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.
 
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3
 
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2
 
Bcsl 033 data and file structures lab s4-3
Bcsl 033 data and file structures lab s4-3Bcsl 033 data and file structures lab s4-3
Bcsl 033 data and file structures lab s4-3
 
Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s4-2Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s4-2
 
Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3
 
Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2
 
Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1
 
Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3
 
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2
 
Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1
 
Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4
 
Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3
 
Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
 
Introduction to Information Security
Introduction to Information SecurityIntroduction to Information Security
Introduction to Information Security
 

Dernier

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Dernier (20)

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

2 operating system structures

  • 1. Operating-System Structures  Operating System Services  User Operating System Interface  System Calls  Types of System Calls  System Programs  Operating System Design and Implementation  Operating System Structure  Virtual Machines  Operating System Generation  System Boot 1 Loganathan R, CSE , HKBKCE
  • 2. 1. Operating System Services • One set of operating-system services provides functions that are helpful to the user: – User interface - Almost all operating systems have a user interface (UI) Command-Line (CLI), Batch Interface & Graphics User Interface (GUI) – Program execution - Load a program into memory and to run that program, end execution, either normally or abnormally (indicating error) – I/O operations - A running program may require I/O, which may involve a file or an I/O device. – File-system manipulation - Programs need to read and write files and directories, create and delete them, search them, list file Information, permission management. – Communications – Between process in the same or different computer via shared memory or message passing – Error Detection - Errors may occur in the CPU and memory hardware ( memory error or power failure), in I/O devices (parity error on tape, a connection failure on a network, or lack of paper in the printer) and in the user program (arithmetic overflow, illegal memory location access, or a too-great use of CPU time) 2 Loganathan R, CSE , HKBKCE
  • 3. 1. Operating System Services Contd.. • Another set of OS functions exists for ensuring the efficient operation of the system itself via resource sharing – Resource allocation - When multiple users or multiple jobs running concurrently, resources must be allocated to each of them • Many types of resources - Some (such as CPU cycles, main memory, and file storage) may have special allocation code, others (such as I/O devices) may have general request and release code. – Accounting - To keep track of which users use how much and what kinds of computer resources – Protection and security - The owners of information stored in a multiuser or networked computer system may want to control use of that information, concurrent processes should not interfere with each other • Protection involves ensuring that all access to system resources is controlled • Security of the system from outsiders requires user authentication, extends to defending external I/O devices from invalid access attempts • If a system is to be protected and secure, precautions must be instituted throughout it. A chain is only as strong as its weakest link. Loganathan R, CSE , HKBKCE 3
  • 4. 2.User Operating System Interface • 2.1 Command Interpreter / CLI • Implemented in kernel, sometimes by systems program • Function of the command interpreter is to get and execute the user-specified command. • Multiple command interpreters to choose from the interpreters are known as shells • Example :Bourne shell, C shell, Bourne-Again shell, the Korn shell • Command Interpreter Implementation • Command interpreter itself contains the code to execute the command • Through system programs – uses the command to identify a file to be loaded into memory and executed • Example rm file.txt Loganathan R, CSE , HKBKCE 4
  • 5. User Operating System Interface Cntd..  2.2 Graphical User Interfaces  User-friendly desktop metaphor interface ◦ Usually mouse, keyboard, and monitor ◦ Icons represent files, programs, actions, etc ◦ Various mouse buttons over objects in the interface cause various actions (provide information, options, execute function, open directory (known as a folder) ◦ Invented at Xerox PARC  Many systems now include both CLI and GUI interfaces ◦ Microsoft Windows is GUI with CLI “command” shell ◦ Apple Mac OS X as “Aqua” GUI interface with UNIX kernel underneath and shells available ◦ Solaris is CLI with optional GUI interfaces (Java Desktop, KDE) Loganathan R, CSE , HKBKCE 5
  • 6. 3. System Calls  Programming interface to the services provided by the OS  Typically written in a high-level language (C or C++)  Example of how system calls are used to copy the files Loganathan R, CSE , HKBKCE 6
  • 7. Application Programming Interface(API)  System calls are mostly accessed by programs via a high- level Application Program Interface (API) rather than direct system call use • API specifies a set of functions that are available to an application programmer, including the parameters that are passed  Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM)  Why use APIs rather than system calls? • Program portability • Actual system calls can be more detailed and difficult to work with than the API Loganathan R, CSE , HKBKCE 7
  • 8. System Call Implementation • Programming languages provides a system-call interface that serves as the link to system calls made available by the OS • System-call interface intercepts function calls in the API and invokes the necessary system call within the OS • System-call interface maintains a table indexed according to these numbers associated with each system call • The system call interface invokes intended system call in OS kernel and returns status of the system call and any return values 8 Loganathan R, CSE , HKBKCE
  • 9. System Call Parameter Passing • Registers • Parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register (Linux and Solaris) as shown • Parameters placed, or pushed, onto the stack by the program and popped off the stack by the operating system – Block and stack methods do not limit the number or length of parameters being passed Loganathan R, CSE , HKBKCE 9
  • 10. 4. Types of System Calls 4.1 Process control • End, abort • Load, execute • Create process terminate –process • get process attributes, set process attributes • Wait for time • Wait event, signal event • Allocate and free memory fork() exec() exit() Single Tasking: MS-DOS execution, Multitasking: FreeBSD (a) At system startup, (b) Running a running multiple programs 10 program Loganathan R, CSE , HKBKCE
  • 11. 4. Types of System Calls Contd 4.2 File management • File – create, delete, open, close, read, write, reposition • Get / set file attributes 4.3 Device management The various resources controlled by the OS can be thought of as devices • Device – request, release, read, write, reposition • get / set device attributes • Logically attach or detach devices 4.4 Information maintenance Transferring information between the user program and the OS and keeps information about all its processes and system calls • get / set – time or date • get / set system data • get / set – process, file or device attributes 4.5 Communications Inter-process communication Models : Message passing model & Shared-memory model • Create, delete communication connection • Send, receive messages • Transfer status information • Attach or detach remote devices 11 Loganathan R, CSE , HKBKCE
  • 12. 5. System Programs  System programs provide a convenient environment for program development and execution.  Categories ◦ File management - create, delete, copy, rename, print, dump, list, and manipulate files and directories ◦ Status information - date, time, available memory or disk space, no of users, performance, logging, and debugging information ◦ File modification - text editors to create and modify the content of files, search contents of files. ◦ Programming language support - Compilers, assemblers, debuggers and interpreters ◦ Program loading and execution - absolute loaders, relocatable loaders, linkage editors, overlay loaders and debuggers ◦ Communications - Creating virtual connections among processes, users, and computer systems ◦ System utilities Application programs - web browsers, word processors , text formatters, spreadsheets, database systems, compilers, plotting and statistical-analysis packages and games  Most users’ view of the operation system is defined by system programs, not the actual system calls 12 Loganathan R, CSE , HKBKCE
  • 13. 6. OS Design and Implementation  Design and Implementation of OS not “solvable”, but some approaches have proven successful  6.1 Design Goals – The design of the system is affected by the choice of hardware and the type of system: batch, time shared, single user, multiuser, distributed, real time, or general purpose – The requirement can be divided to User goals and System goals ◦ User goals – operating system should be convenient to use, easy to learn, reliable, safe, and fast ◦ System goals – operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error- free, and efficient Loganathan R, CSE , HKBKCE 13
  • 14. 6. OS Design and Implementation Contd.. 6.2 Mechanisms and Policies • Mechanisms determine how to do something, policies decide what will be done – Example : timer construct is a mechanism for ensuring CPU protection(loop), but deciding how long the timer is to be set for a particular user is a policy decision – The separation of policy from mechanism is a very important principle, it allows maximum flexibility if policy decisions are to be changed later 6.3 Implementation • Traditionally, written in assembly language, now C or C++ • Advantages of using a higher-level language – Faster Coding , more compact, easier to understand and debug – Easier to port—to move to some other hardware • Disadvantages of using a higher-level language – Reduced speed and increased storage requirements Loganathan R, CSE , HKBKCE 14
  • 15. 7. Operating-System Structure • How OS components are interconnected and melded into a kernel. 7.1 Simple Structure • Started as small, simple, and limited systems and then grown beyond their original scope • Example : MS-DOS – written to provide the most functionality in the least space – Not divided into modules – Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated MS-DOS layer structure 15 Loganathan R, CSE , HKBKCE
  • 16. 7. Operating-System Structure Contd… • 7.2 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 H/W The highest (layer N) is the UI. – A layer is an implementation of an abstract object consists of data structures and a set of routines that can be invoked by higher-level layers • Advantage • Simplicity of construction and debugging • Each layer is implemented with only those operations provided by lower level layers • The first layer can be debugged without any concern for the rest of the system • Correct functioning of first layer can be assumed while the second layer is debugged, and so on 16 Loganathan R, CSE , HKBKCE
  • 17. Example: UNIX  UNIX – limited by hardware functionality, the original UNIX operating system had limited structuring. The UNIX OS consists of two separable parts ◦ Systems programs ◦ The kernel  Consists of everything below the system-call interface and above the physical hardware  Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level Loganathan R, CSE , HKBKCE 17
  • 18. 7. Operating-System Structure Contd… 7.3 Microkernels • Structures the OS by removing all nonessential components from the kernel and implementing them as system and user-level programs.  Communication takes place between user modules using message passing  Benefits: ◦ Easier to extend a microkernel ◦ Easier to port the operating system to new architectures ◦ More reliable (less code is running in kernel mode) ◦ More secure  Detriments: ◦ Performance overhead of user space to kernel space communication Loganathan R, CSE , HKBKCE 18
  • 19. 7. Operating-System Structure Contd… 7.4 Modules – Uses object-oriented approach – Each core component is separate – Each talks to the others over known interfaces – Each is loadable as needed within the kernel – a core kernel with seven types of loadable kernel modules Loganathan R, CSE , HKBKCE 19
  • 20. Mac OS X Structure(Darwin) • Uses a hybrid structure – layered technique with one layer consists of the Mach microkernel. • Top layers include application environments and a set of services providing a graphical interface to applications • Below these layers is the kernel consists primarily of the Mach microkernel and the BSD kernel • Mach provides m/y mgmt, support RPC and IPC facilities, including message passing and thread scheduling • BSD component provides a BSD CLI, support for networking and file systems, and an implementation of POSIX APIs, including Pthreads Loganathan R, CSE , HKBKCE 20
  • 21. 8. Virtual Machines • A virtual machine takes the layered approach to its logical conclusion. • It abstracts hardware of a single computer into several different execution environments i.e. creates illusion of separate execution environment is running its own private computer. • 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 • The resources of the physical computer are shared to create the virtual machines • A major difficulty is disk systems, solved using Virtual disks (minidisks in IBM) • Users are given their own virtual machines and they can run any of the operating systems or software packages that are available Loganathan R, CSE , HKBKCE 21
  • 22. 8. Virtual Machines Cont… Non-virtual Machine Virtual Machine Loganathan R, CSE , HKBKCE 22
  • 23. 8. Virtual Machines Cont… • 8.1 Implementation – Much work is required to provide an exact duplicate of the underlying machine – A virtual user mode and a virtual kernel mode, both of which run in a physical user mode. – Transfer from user mode to kernel mode on a real machine also cause a transfer from virtual user mode to virtual kernel mode on a virtual machine – A system call in virtual user mode will cause a transfer to the virtual-machine monitor, it can simulate the effect of the system call by changing the register and program counter for the virtual machine – The real I/O may take100 milliseconds, the virtual I/O might take less time(spooled) or more time(interpreted). Loganathan R, CSE , HKBKCE 23
  • 24. 8. Virtual Machines Cont… • 8.2 Benefits – Complete protection of the various system resources – No direct sharing of resources and implementation through • Share a minidisk and thus to share files through software • Network of virtual machines over the virtual communications network – VM system is a perfect vehicle for OS research and development – A virtual-machine system eliminates system development time • System must be stopped and taken out of use while changes are made and tested , this period is called system development time Loganathan R, CSE , HKBKCE 24
  • 25. 8. Virtual Machines Cont… • 8.3 Examples – 8.3.1 Vmware • Abstracts Intel 80X86 hardware into isolated virtual machines. • Runs as an application on host OS and allows concurrently running several different guest operating systems as independent virtual machines 25
  • 26. 8. Virtual Machines Cont… • 8.3 Examples – 8.3. 2 The Java Virtual Machine – Java program consists of one or more classes, for each, the compiler produces an architecture-neutral bytecode output (.class) file that will run on any implementation of the JVM. – JVMis a specification for an abstract computer – consists of a class loader and a Java interpreter (or a fast just-in- time (JIT) compiler ) that executes the architecture-neutral bytecodes Java Program Java API Class loader .class files .class files Java Interpreter Host systems (Windows, Linux, etc) 26
  • 27. 9. Operating-System Generation • It is possible to design, code, and implement an operating system specifically for one machine at one site • A processes of configuring or generating system for each specific computer site, is known as system generation (SYSGEN) • The SYSGEN program reads from a given file, or asks the operator for the specific configuration of the hardware system, or probes the hardware directly • Once information is determined , a system administrator can use it to modify the source code of OS , then compile and the output object version is tailored to the system • A slightly less tailored level modules are selected from a precompiled library and linked together to form OS • Other extreme, all the code is always part of the system, and selection occurs at execution time, rather than at compile or link time. • The major differences among these approaches are the size and generality 27
  • 28. 10. System Boot • Operating system must be made available to hardware so hardware can start it • When power initialized on system, execution starts at a predefined memory location (in ROM) where initial bootstrap program stored • Small piece of code – bootstrap program or bootstrap loader, locates the kernel, loads it into memory, and starts its execution • Sometimes two-step process where simple boot block / bootstrap loader fetches a complex boot program, which loads kernel • A disk that has a boot partition is called a boot disk or system disk. • Problem with ROM is that changing the bootstrap code requires changing the ROM hardware chips which is resolved using erasable programmable read-only memory (EPROM) 28 Loganathan R, CSE , HKBKCE