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

Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresWayne Jones Jnr
 
Distributed Operating System
Distributed Operating SystemDistributed Operating System
Distributed Operating SystemSanthiNivas
 
Process management os concept
Process management os conceptProcess management os concept
Process management os conceptpriyadeosarkar91
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSKumar Pritam
 
Operating Systems - Processor Management
Operating Systems - Processor ManagementOperating Systems - Processor Management
Operating Systems - Processor ManagementDamian T. Gordon
 
11. operating-systems-part-1
11. operating-systems-part-111. operating-systems-part-1
11. operating-systems-part-1Muhammad Ahad
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory managementrprajat007
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process ConceptsMukesh Chinta
 
File replication
File replicationFile replication
File replicationKlawal13
 
Operating System Lecture Notes
Operating System Lecture NotesOperating System Lecture Notes
Operating System Lecture NotesFellowBuddy.com
 
Operating System BCA 301
Operating System BCA 301Operating System BCA 301
Operating System BCA 301cpjcollege
 
types of operating system
types of operating systemtypes of operating system
types of operating systemMahira Rashdi
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecturejeetesh036
 

Tendances (20)

RTOS - Real Time Operating Systems
RTOS - Real Time Operating SystemsRTOS - Real Time Operating Systems
RTOS - Real Time Operating Systems
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System Structures
 
System call
System callSystem call
System call
 
Distributed Operating System
Distributed Operating SystemDistributed Operating System
Distributed Operating System
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Operating Systems - Processor Management
Operating Systems - Processor ManagementOperating Systems - Processor Management
Operating Systems - Processor Management
 
11. operating-systems-part-1
11. operating-systems-part-111. operating-systems-part-1
11. operating-systems-part-1
 
kernels
 kernels kernels
kernels
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
File replication
File replicationFile replication
File replication
 
Operating System Lecture Notes
Operating System Lecture NotesOperating System Lecture Notes
Operating System Lecture Notes
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
 
Operating System BCA 301
Operating System BCA 301Operating System BCA 301
Operating System BCA 301
 
Memory management
Memory managementMemory management
Memory management
 
types of operating system
types of operating systemtypes of operating system
types of operating system
 
Ch4 memory management
Ch4 memory managementCh4 memory management
Ch4 memory management
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
 

En vedette (7)

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
 
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
 
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
 
Operating System Concepts Presentation
Operating System Concepts PresentationOperating System Concepts Presentation
Operating System Concepts PresentationNitish Jadia
 

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
 
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
 
Operating System Concepts Presentation
Operating System Concepts PresentationOperating System Concepts Presentation
Operating System Concepts Presentation
 

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

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
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
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
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
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
 
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
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
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
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 

Dernier (20)

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
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
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
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
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
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.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
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
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
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.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