Docsity

Processes - Computer Operating Systems - Lecture Slides, Slides of Operating Systems

Partial preview of the text

Download Processes - Computer Operating Systems - Lecture Slides and more Slides Operating Systems in PDF only on Docsity!

Lecture 4

Chapter 3: Processes

Chapter 2: 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 Debugging
  • Operating System Generation
  • System Boot

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)
    • Program execution - The system must be able to 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 - The file system is of particular interest. Programs need to read and write files and directories, create and delete them, search them, list file Information, permission management.
    • Communications โ€“ Processes may exchange information, on the same computer or between computers over a network
    • Error detection โ€“ OS needs to be constantly aware of possible errors

Operating System Services (Cont)

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

System Call Implementation

  • Typically, a number associated with each system call
    • System-call interface maintains a table indexed according to these numbers
  • The system call interface invokes intended system call in OS kernel and returns status of the system call and any return values
  • The caller need know nothing about how the system call is implemented - Just needs to obey API and understand what OS will do as a result call - Most details of OS interface hidden from programmer by API - Managed by run-time support library (set of functions built into librariesincluded with compiler)

API โ€“ System Call โ€“ OS Relationship

Types of System Calls

System Programs

  • Provide a convenient environment for program development and execution - Some of them are simply user interfaces to system calls; - others are considerably more complex
  • File management - Create, delete, copy, rename, print, dump, list, and generally manipulate files and directories
  • Status information
    • Some ask the system for info - date, time, amount of available memory, disk space, number of users
    • Others provide detailed performance, logging, and debugging information
    • Typically, these programs format and print the output to the terminal or other output devices
    • Some systems implement a registry - used to store and retrieve configuration information

Operating System Design and Implementation

  • Design and Implementation of OS not โ€œsolvableโ€, but some approaches have proven successful
  • Internal structure of different Operating Systems can vary widely
  • Start by defining goals and specifications
  • Affected by choice of hardware, type of system
  • User goals and System goals Docsity.com

Operating System Design and Implementation (Cont)

  • Important principle to separate

Policy: What will be done? Mechanism: How to do it?

  • Mechanisms determine how to do something, policies decide what will be done - The separation of policy from mechanism is a very important principle, it allows maximum flexibility if policy decisions are to be changed later

Virtual Machines Benefits

  • Fundamentally, multiple execution environments (different operating systems) can share the same hardware
  • Protect from each other
  • Some sharing of file can be permitted, controlled
  • Commutate with each other, other physical systems via networking
  • Useful for development, testing
  • Consolidation of many low-resource use Docsity.com

Operating-System Debugging

  • Debugging is finding and fixing errors, or bugs
  • OSes generate log files containing error information
  • Failure of an application can generate core dump file capturing memory of the process
  • Operating system failure can generate crash dump file containing kernel memory

System Boot

  • Operating system must be made available to hardware so hardware can start it - Small piece of code โ€“ bootstrap loader , locates the kernel, loads it into memory, and starts it - Sometimes two-step process where boot block at fixed location loads bootstrap loader - When power initialized on system, execution starts at a fixed memory location - Firmware used to hold initial boot code

Chapter 3: Processes

  • Process Concept
  • Process Scheduling
  • Operations on Processes
  • Interprocess Communication
  • Examples of IPC Systems