Presentation is loading. Please wait.

Presentation is loading. Please wait.

GEOMATIKA UNIVERSITY COLLEGE CHAPTER 2 OPERATING SYSTEM PRINCIPLES

Similar presentations


Presentation on theme: "GEOMATIKA UNIVERSITY COLLEGE CHAPTER 2 OPERATING SYSTEM PRINCIPLES"— Presentation transcript:

1 GEOMATIKA UNIVERSITY COLLEGE CHAPTER 2 OPERATING SYSTEM PRINCIPLES
Your company information DOOD 330/OPS 330 OPERATING SYSTEM CHAPTER 2 OPERATING SYSTEM PRINCIPLES

2 Outline Abstractions, processes and resources
Concepts of Application Program Interfaces (APIs) Interrupts Device organization

3 Abstractions, processes and resources
Coordinate Use of the Abstractions The Abstractions Processes Create the Abstractions

4 OS Requirements Provide resource abstractions:
Process abstraction of CPU/memory use Address space Thread abstraction of CPU within address space Resource abstraction “Anything a process can request that can block the process if it is unavailable” NT uses “object abstraction” to reference resources File abstraction of secondary storage use

5 OS Requirements (Cont.)
Manage resource sharing Time/space-multiplexing Exclusive use of a resource Isolation Managed sharing

6 Abstraction & Sharing Program State Process Program State Process
Libraries Program State Process OS Services Abstraction Manage sharing ROM Routines Processor(s) Main Memory Devices

7 Performance The OS is an overhead function  should not use too much of machine’s resources Minimum functionality is to implement abstractions Additional function must be traded off against performance DOS: one process UNIX: low level file system

8 Process, Thread, and Resource Management
Abstraction Process Abstraction Generic Resource Manager Multiprogramming Other Primary Memory Abstract Resources Processor

9 API’s An Application Programming Interface (API) is a set of commands, functions and protocols which programmers can use when building a software. It allows the programmers to use predefined functions to interact with systems, instead of writing them from scratch. Characteristics of good API Easy to learn and use, Hard to misuse. Easy to read and maintain code that uses it. Is programming language neutral. Sufficiently powerful to support all computational requirements.

10 Diagram Of Application Programming Interface (API)
API’s (Cont.) Diagram Of Application Programming Interface (API)

11 API’s (Cont.) It allows a user to access wordnet database and to create wordnet tools without the knowledge of the underlying database design. The API is object-oriented design. The API is designed in such a way that it supports single/ multiple languages. The API is designed in two layers: Application layer Database layer

12 Interrupts An event external to the currently executing process that causes a change in the normal flow of instruction execution Usually generated by hardware devices external to the CPU

13 Why Interrupts? People like connecting devices
A computer is much more than the CPU • Keyboard, mouse, screen, disk drives • Scanner, printer, sound card, camera, etc. These devices occasionally need CPU service External events typically occur on a macroscopic timescale

14 Possible Solution: Polling
CPU periodically checks each device to see if it needs service - takes CPU time even when no requests pending - overhead may be reduced at expense of response time - can be efficient if events arrive rapidly “Polling is like picking up your phone every few seconds to see if you have a call. …”

15 Alternative: Interrupts
Give each device a wire (interrupt line) that it can use to signal the processor • When interrupt signalled, processor executes a routine called an interrupt handler to deal with the interrupt • No overhead when no requests pending

16 Polling vs. Interrupts “Polling is like picking up your phone every few seconds to see if you have a call. Interrupts are like waiting for the phone to ring.” • Interrupts win if processor has other work to do and event response time is not critical • Polling can be better if processor has to respond to an event ASAP

17 Types of Interrupts There are three types of interrupts, each with several different uses: External Interrupts Internal Interrupts Software Interrupts Procedures for processing all types of interrupts are almost identical

18 External Interrupts Used by CPU to interact with input/output devices;
e.g. the CPU requests a data transfer and in input device asserts an interrupt when it is ready. Improve system performance by allowing the CPU to execute instructions. Also used to initiate transfers.

19 Internal Interrupts Occurs entirely within the CPU
Used to handle exception that occur during the execution of valid instructions; e.g: Divide by zero exception Arithmetic overflow Page faults Invalid instruction codes

20 Software Interrupts Generated by specific interrupt instructions in the CPU’s instruction set. These interrupt act like subroutine call statements except they always go to a specific address.

21 Computer Organization
The components from which computers are built, i.e., computer organization. In contrast, computer architecture is the science of integrating those components to achieve a level of functionality and performance. Example: It is as if computer organization examines the lumber, bricks, nails, and other building material While computer architecture looks at the design of the house.

22 Basic Terminology

23 Basic Terminology (Cont.)


Download ppt "GEOMATIKA UNIVERSITY COLLEGE CHAPTER 2 OPERATING SYSTEM PRINCIPLES"

Similar presentations


Ads by Google