What is an Operating System An OS is




































- Slides: 36

What is an Operating System? An OS is a program that acts an intermediary between the user of a computer and computer hardware. Major cost of general purpose computing is software. OS simplifies and manages the complexity of running application programs efficiently.

Operation System : System Resources Manages all the resources in a computer (including processor, memory, i/o devices) Provides an interface between the hardware and application software. What are the functions of an operating start the computer system? provide a user interface manage programs administer security manage memory control a network provide file management and other utilities monitor performance establish an Internet connection schedule jobs and configure devices

Abstract View of System Figure 1. 1 The operating system is a set of system software routines that sits between the application program and the hardware. User 1 compiler User 2 assembler User 3 . . . Text editor System and Application Programs Operating System Computer Hardware User n Database system

Interfaces Points of connection or linkage User interfaces with application program Application program interfaces with operating system Operating system interfaces with hardware Application program accesses hardware Through the operating system Following the operating system’s rules

Figure 1. 2 The operating system routines that interface with the application program represent a consistent platform for running application programs.

Figure 1. 3 View each layer of abstraction as a black box. Abstraction A simplified view of an object that ignores the internal details. Layers of abstraction Black box Inputs/outputs known Contents hidden Functionally independent

Figure 1. 4 Two black boxes communicate through a shared interface. To use a black box, all you must know are its interface rules.

Figure 1. 5 An operating system can support many application programs.

Hardware ressources : Memory Holds active programs and data. Contents Bit: one binary digit (0 or 1). Byte: eight bits (1 character). Word: a group of bytes. Write is a destructive operation. Read is not destructive.

Figure 1. 6 In a computer’s memory, bits are grouped to form bytes, which in turn are grouped to form words.

Addressing Memory Each byte (or word) is assigned a unique address. The bytes (or words) are numbered sequentially. Bytes (or words) are the basic addressable units of memory.

Figure 1. 8 Think of cache memory as a staging area for the processor.

Figure 1. 9 The processor manipulates data stored in memory under the control of a program stored in memory.

Figure 1. 10 Each instruction has an operation code and one or more operands. Program: a series of instructions.

Figure 1. 1 The processor contains four key components.

Figure 1. 12 A computer executes instructions by following a basic machine cycle. a. As the example begins, memory holds both instructions and data. The instruction counter points to the first instruction to be executed.

b. The first instruction is fetched from memory and stored in the instruction register. Note that the instruction counter points to the next instruction.

c. The arithmetic and logic unit executes the instruction in the instruction register.

d. The instruction control unit once again looks to the instruction counter for the address of the next instruction.

e. The next instruction is fetched into the instruction register. Note that the instruction counter points to the next instruction.

f. The arithmetic and logic unit executes the instruction in the instruction register.

Figure 1. 13 During a machine cycle, an instruction is fetched during I-time and executed during E-time. I-time fetch E-time execute Clock speed Cycles per second Measured in MHz or GHz

Op-code: specifies which machine operation to execute Definition: Operand. The variable data to be operated on by a specific operation. Figure 1. 14: Decoding the instruction 35 A 7 Figure 1. 15: Adding values stored in memory

Figure 1. 16: An encoded version of the Instructions in Figure 1. 14 1: Load to register 5 Content of address 6 C 5: Add 3: Store C: Stop

Program execution • • Figure 1. 17: The machine cycle Controlled by two special-purpose registers – Program counter: address of next instruction – Instruction register: current instruction Steps performed by control unit – Fetch – Decode – Execute – Store (some times implicit) Figure 1. 18: Decoding the instruction B 258 If R 0=R 2, then Program Counter content of address 58

Figure 1. 19: The program from Figure 1. 16 stored in main memory ready for execution Figure 1. 20: Performing the fetch step of the machine cycle

Input and Output Input Output The act of transferring data into memory from a peripheral device. The act of transferring data from memory to a peripheral device. Input and Output Support human interaction with a computer.

Storage Hierarchy Very fast storage is very expensive. So the Operating System manages a hierarchy of storage devices in order to make the best use of resources. In fact, considerable effort goes into this support. Fast and Expensive Slow an Cheap

Cache Read Operation

Storage Hierarchy Operation of Two-Level Memory H : fraction of time reference is found in M 1 (faster memory) T 1 is the access time to level 1 T 2 is the access time to level 2 Ts : average (system) access time ?

Figure 1. 22 Opening a file. The user clicks Open The shell interprets the command File management finds the file Device management reads the file from disk

Figure 1. 23 Inter-computer communication is enabled by communication services installed on both machines.

Operating System Functions What is booting? Process of starting or restarting a computer Getting it started (bootstrapping): Figure 1. 24: The booting process Bootstrap: program in read only memory (ROM) Run by the CPU when power is turned on Transfers operating system from mass storage to main memory Executes jump to operating system

Figure 1. 25 The boot. a. Hardware automatically reads the boot when power is turned on.

b. The boot reads the rest of the operating system into memory.

Philosophies Open source Proprietary UNIX and Linux Based on open, published source code Apple Macintosh Closed Hybrid Microsoft Some elements open, some elements closed