Sei sulla pagina 1di 28

ELET4300 UNIX Operating System

Lesson 1 Introduction to Modern OS


Engineering Technology College of Technology University of Houston

ELET 4300

LESSON 1 - 1

Unit Objectives

What is an operating system (OS)? Computer System Operating Systems How does an operating system differ from a computer program? Computer System Architecture General Purpose Digital Computer Computer System Components Operating System Support Components Operating System Goals Why Study Operating Systems? What Does a Modern Operating System Do? Operating System Architecture Interrupts, Interrupt Handling, and Interrupt Classes
LESSON 1 - 2

ELET 4300

What is an Operating System (OS)?


Sometimes called the executive. A software responsible for controlling the allocation and usage of hardware resources. A program that acts as an intermediary between a user of a computer and the computer hardware. Schedules computer hardware including the CPU, RAM, I/O, disks, etc. Simplifies procedures for electronic mail, file transfer, word-processing, etc.

ELET 4300

LESSON 1 - 3

Computer System A
User Banking System Compilers Airline Reservation Editors Web Browser Command Interpreter System Programs

Application Programs

Operating System Machine Language Microprograms Physical Devices (Hardware)


Hardware

ELET 4300

LESSON 1 - 4

Operating Systems

ELET 4300

CPM MS-DOS Windows-95, 98, 2000, XP, NT, 2007 Unix Linux AIX Sun Solaris
LESSON 1 - 5

How Does an Operating System Differ From a Computer Program?

The operating system is the host platform for the compiler (e.g., C, C++, Java, etc.). The operating system can access all hardware devices associated with the system. The operating system has extended capabilities (scheduling, I/O, file control, etc.).

ELET 4300

LESSON 1 - 6

Computer System Architecture


Central Processing Unit (CPU) Random-Access Memory (RAM) Read-Only Memory (ROM) System and Disk Storage Devices I/O interface (PIAs, Modems, NICs) Peripherals (CD ROMs, DVDs, VGAs, Drivers)

ELET 4300

LESSON 1 - 7

General Purpose Digital Computer


CPU Registers ALU Control
Data Bus Address Bus Control Bus

RAM

I/O Interface Peripherals

ELET 4300

LESSON 1 - 8

Computer System Components


Hardware provides basic computing resources (CPU, memory, I/O devices) Operating System controls and coordinates the use of the hardware among the various application programs for the various users Application Programs define the ways in which the system resources are used to solve the computing problems of the users (compilers, database systems, video games, business programs) Users (people, machines, other computers)
LESSON 1 - 9

ELET 4300

Computer-System Operation

I/O devices and the CPU can execute concurrently Each device controller is in charge of a particular device type and has a local buffer. CPU moves data from/to main memory to/from local buffers I/O is from the device to local buffer of controller Device controller informs CPU that it has finished its operation by causing an interrupt

ELET 4300

LESSON 1 - 10

Conceptual View of a Computer System Operation


Memory Operating System Software I/O Controller I/O Controller

I/O Devices

Programs and Data

. . .

. . .

I/O Controller

Processor

. ..

Processor

Storage OS Programs Data

ELET 4300

LESSON 1 - 11

Operating System Support Components


File Manager The BIOS (Basic Input/Output System) Device Drivers Shells Memory Management

ELET 4300

LESSON 1 - 12

File Manager

DOS
FAT (File Allocation Table) Directory Structure File Name Extensions (.BAT, .EXE, .SYS, etc.)

UNIX
Paths and directory structure Unix directories (/bin, /usr, /tmp, etc.) File permissions (chgrp, chmod, chown)

ELET 4300

LESSON 1 - 13

Shell

User-interface to the operating system.


DOS
Specifies location of the DOS command interpreter; sets environment space.

UNIX
Highly developed (Bourne, C, Korn shells). Supports programmable user interface.

ELET 4300

LESSON 1 - 14

UNIX

Developed from MULTICS - multi-user interactive system supported by a GE-645 mainframe (1965-69) Ken Thompson of AT&T Bell Labs developed the first UNIX operating system for a DEC PDP-7 UNIX never intended as a commercial product 1970s - Universities were encouraged to develop and use the UNIX system 1980s - engineering and CAD applications 1990s - Server side of a client/server model

ELET 4300

LESSON 1 - 15

Modern Operating System Goals

Efficient Use of Resources


Avoid bottlenecks that affect performance. Keep all components as busy as possible.

Convenience and Productivity for Users


The user costs more than the machine. Deliver function as efficiently as possible.

Availability and Reliability


Computer systems are critical. A failed system can mean a failed company.

ELET 4300

LESSON 1 - 16

What Does a Modern OS Do?

Provides Abstraction
Clean interfaces to hardware
Processes Unbounded Memory Files Synchronization and Communications

Provides Standard Interface


Portability (Unix runs on many very different computer systems)

ELET 4300

LESSON 1 - 17

What Does a Modern OS Do? (Cont.)

Mediate Resource Usage


Allow multiple users to share resources fairly, efficiently, safely, and securely
Multiple Processes Multiple Programs

Consumes Resources
Takes up physical memory CPU time

ELET 4300

LESSON 1 - 18

Operating System Architecture

Most users see total package: Windows, Unix Tighter integration in modern systems

Hardware Operating System Libraries Utilities

Interface

ELET 4300

LESSON 1 - 19

Other Examples of Abstractions


Threads or Processes (Fork) Address Spaces (Allocate, Deallocate) Files (Open, Close, Read, Write) Messages (Send, Receive)

ELET 4300

LESSON 1 - 20

Interrupts

Interrupt transfers control to the interrupt service routine (ISR) generally, through the interrupt vector, which contains the addresses of all the service routines. Interrupt architecture must save the address of the interrupted instruction. Incoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt. A trap is a software-generated interrupt caused either by an error or a user request. An operating system is interrupt driven.
LESSON 1 - 21

ELET 4300

Interrupt Handling

The operating system preserves the state of the CPU by storing registers and the program counter. Determines which type of interrupt has occurred: polling - generally a high-overhead operation vectored interrupt system- more efficient Separate segments of code determine what action should be taken for each type of interrupt.

ELET 4300

LESSON 1 - 22

Interrupt Classes

Supervisor Interrupts
Initiated by a running process that executes the supervisory call instruction. Include user request for a particular service:
Performing I/O Obtaining more storage

I/O Interrupts
Initiated by I/O hardware and are caused when an I/O operation completes, when an I/O error occurs, or when an I/O device is made ready.

ELET 4300

LESSON 1 - 23

Interrupt Classes (Cont.)


External Interrupts
Initiated by operator, receipt of signal from another processor on a multiprocessor system.

Restart Interrupts
Initiated by consoles restart button, or restart instruction arrives from another processor on a multiprocessor system.

ELET 4300

LESSON 1 - 24

Interrupt Classes (Cont.)

Program Check Interrupts


Initiated by programs machine language instructions. Include
division by zero, arithmetic overflow or underflow, data is in the wrong format, attempt to execute an invalid operation code, attempt to reference a memory location beyond the limits of real memory, attempt by a user process to execute a privileged instruction, and an attempt to reference a protected resource.

Machine Check Interrupts


Initiated by malfunctioning hardware.
LESSON 1 - 25

ELET 4300

Low-Level & High-Level Codes


Machine code
0100 BA0901 0103 B409 0105 CD21 0107 CD20 0109 54 45 53 54 24

Assembly code (x86 processors)


MOV DX,0109H MOV AH,09H INT 21H INT 20H 0109 DB TEST$

Shell Script (csh)


% echo TEST

/* C code */
#include <stdio.h> #include <stdlib.h> int main(void) { printf(TEST); return EXIT_SUCCESS; }
ELET 4300

// C++ code
#include <iostream> using namespace std; int main(void) { cout << TEST; return EXIT_SUCCESS; }
LESSON 1 - 26

History of Operating Systems: Change!


Typical academic computer in 1981 and 1999
CPU (MHz) Cycles/instruction
DRAM Capacity

Disk capacity Net Bandwidth #address bit

1981 10 3-4 128 KB 10 MB 9600 b/s 16

1999 550 0.5-1 128 MB 16GB 155 Mb/s 64

factor 55 3-8 1000 1600 16000 4

Operating systems have to vary over time to adapt to changing tradeoffs.

ELET 4300

LESSON 1 - 27

References
1. Operating Systems: Internals and Design Principles William Stallings Prentice Hall; 7th edition (July 28, 2011) 2. Operating Systems: Design and Implementation Andrew S. Tanenbaum, Albert S. Woodhull Prentice Hall; 3rd edition (June 15, 2011) 3. Computer Organization and Architecture: Designing for Performance William Stallings Pearson Education; International ed of 9th revised edition (May 1, 2012) 4. Operating System Concepts Abraham Silberschatz, Peter Baer Galvin, Greg Gagne Wiley; 8th edition (December 1, 2011)

ELET 4300

LESSON 1 - 28

Potrebbero piacerti anche