Chapter 2Operating System Overview

Western Illinois UniversityComputer ScienceAntonio Cardenas

Operating Systems:Internals

and Design Principles CS 410

Operating Systems

Operating System

■ A program that controls the execution of application programs

■ An interface between applications and hardware

Operating System Services

■ Program development■ Program execution■ Access I/O devices■ Controlled access to files■ System access■ Error detection and response■ Accounting

Key Interfaces

■ Instruction set architecture (ISA)

■ Application binary interface (ABI)

■ Application programming interface (API)

The Role of an OS

■ A computer is a set of resources for the movement, storage, and processing of data

■ The OS is responsible for managing these resources

Operating System as Software

■ Functions in the same way as ordinary computer software

■ Program, or suite of programs, executed by the processor

■ Frequently relinquishes control and must depend on the processor to allow it to regain control

Serial ProcessingEarliest Computers:

■ No operating system■ programmers interacted

directly with the computer hardware

■ Computers ran from a console with display lights, toggle switches, some form of input device, and a printer

■ Users have access to the computer in “series”

Problems:■ Scheduling:

■ most installations used a hardcopy sign-up sheet to reserve computer time

■ time allocations could run short or long, resulting in wasted computer time

■ Setup time■ a considerable amount of

time was spent just on setting up the program to run

Evolution of Operating Systems

▪A major OS will evolve over time for a number of reasons:


■ The processor spends a certain amount of time executing, until it reaches an I/O instruction; it must then wait until that I/O instruction concludes before proceeding


■ There must be enough memory to hold the OS (resident monitor) and one user program

■ When one job needs to wait for I/O, the processor can switch to the other job, which is likely not waiting for I/O


■ Multiprogramming■ also known as multitasking■ memory is expanded to hold three, four, or more

programs and switch among all of them

Multiprogramming Example

Table 2.1 Sample Program Execution Attributes

Effects on Resource Utilization

Table 2.2 Effects of Multiprogramming on Resource Utilization

Time-Sharing Systems

■ Can be used to handle multiple interactive jobs

■ Processor time is shared among multiple users

■ Multiple users simultaneously access the system through terminals, with the OS interleaving the execution of each user program in a short burst or quantum of computation

Major Achievements■ Operating Systems are among the most

complex pieces of software ever developed

Causes of Errors

■ Nondeterminate program operation■ program execution is

interleaved by the processor when memory is shared

■ the order in which programs are scheduled may affect their outcome

■ Deadlocks■ it is possible for two or

more programs to be hung up waiting for each other

■ may depend on the chance timing of resource allocation and release

■ Improper synchronization■ a program must wait until

the data are available in a buffer

■ improper design of the signaling mechanism can result in loss or duplication

■ Failed mutual exclusion■ more than one user or

program attempts to make use of a shared resource at the same time

■ only one routine at a time allowed to perform an update against the file

Components of a Process

■ The execution context is essential:■ it is the internal data by

which the OS is able to supervise and control the process

■ includes the contents of the various process registers

■ includes information such as the priority of the process and whether the process is waiting for the completion of a particular I/O event

■ A process contains three components:■ an executable program■ the associated data

needed by the program (variables, work space, buffers, etc.)

■ the execution context (or “process state”) of the program

Virtual Memory■ A facility that allows programs to address

memory from a logical point of view, without regard to the amount of main memory physically available

■ Conceived to meet the requirement of having multiple user jobs reside in main memory concurrently

Paging■ Allows processes to be comprised of a number of

fixed-size blocks, called pages

■ Program references a word by means of a virtual address

■ consists of a page number and an offset within the page

■ each page may be located anywhere in main memory

■ Provides for a dynamic mapping between the virtual address used in the program and a real (or physical) address in main memory

Information Protection and Security

■ The nature of the threat that concerns an organization will vary greatly depending on the circumstances

■ The problem involves controlling access to computer systems and the information stored in them

Different Architectural Approaches

■ Demands on operating systems require new ways of organizing the OS

Fault Tolerance

■ Refers to the ability of a system or component to continue normal operation despite the presence of hardware or software faults

■ Typically involves some degree of redundancy

■ Intended to increase the reliability of a system■ typically comes with a cost in financial terms or


■ The extent adoption of fault tolerance measures must be determined by how critical the resource is

Table 2.4 Availability Classes

Availability Classes

Fault Categories■ Permanent

■ a fault that, after it occurs, is always present■ the fault persists until the faulty component is replaced or repaired

■ Temporary■ a fault that is not present all the time for all operating conditions■ can be classified as

■ Transient – a fault that occurs only once■ Intermittent – a fault that occurs at multiple, unpredictable times

Traditional UNIX Systems■ Were developed at Bell Labs and became operational on a PDP-7 in 1970

■ Incorporated many ideas from Multics

■ PDP-11 was a milestone because it first showed that UNIX would be an OS for all computers

■ Next milestone was rewriting UNIX in the programming language C■ demonstrated the advantages of using a high-level language for

system code

■ Was described in a technical journal for the first time in 1974

■ First widely available version outside Bell Labs was Version 6 in 1976

■ Version 7, released in 1978 is the ancestor of most modern UNIX systems

■ Most important of the non-AT&T systems was UNIX BSD (Berkeley Software Distribution)

LINUX Overview■ Started out as a UNIX variant for the IBM PC

■ Linus Torvalds, a Finnish student of computer science, wrote the initial version

■ Linux was first posted on the Internet in 1991

■ Today it is a full-featured UNIX system that runs on several platforms

■ Is free and the source code is available

■ Key to success has been the availability of free software packages

■ Highly modular and easily configured

Modular Monolithic Kernel

■ Includes virtually all of the OS functionality in one large block of code that runs as a single process with a single address space

■ All the functional components of the kernel have access to all of its internal data structures and routines

■ Linux is structured as a collection of modules

Loadable Modules

■ Relatively independent blocks

■ A module is an object file whose code can be linked to and unlinked from the kernel at runtime

■ A module is executed in kernel mode on behalf of the current process

■ Have two important characteristics:

■ dynamic linking■ stackable modules

Table 2.6 Some Linux Signals

Linux Signals

Power ManagementAlarms

■ Implemented in the Linux kernel and is visible to the app developer through the AlarmManager in the RunTime core libraries

■ Is implemented in the kernel so that an alarm can trigger even if the system is in sleep mode

■ this allows the system to go into sleep mode, saving power, even though there is a process that requires a wake up


■ Prevents an Android system from entering into sleep mode

■ These locks are requested through the API whenever an application requires one of the managed peripherals to remain powered on

■ An application can hold one of the following wakelocks:

■ Full_Wake_Lock■ Partial_Wake_Lock■ Screen_Dim_Wake_Loc

k■ Screen_Bright_Wake_L


Summary■ Operating system objectives

and functions■ User/computer interface■ Resource manager

■ Evolution of operating systems■ Serial processing■ Simple/multiprogrammed/ti

me-sharing batch systems■ Major achievements■ Developments leading to

modern operating systems■ Fault tolerance

■ Fundamental concepts■ Faults■ OS mechanisms

■ OS design considerations for multiprocessor and multicore

■ Microsoft Windows overview■ Traditional Unix systems

■ History/description■ Modern Unix systems

■ System V Release 4 (SVR4)■ BSD■ Solaris 10

■ Linux■ History■ Modular structure■ Kernel components

■ Android■ Software/system architecture■ Activities■ Power management