Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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
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
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
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
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
RAM
ELET 4300
LESSON 1 - 8
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
I/O Devices
. . .
. . .
I/O Controller
Processor
. ..
Processor
ELET 4300
LESSON 1 - 11
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
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
ELET 4300
LESSON 1 - 16
Provides Abstraction
Clean interfaces to hardware
Processes Unbounded Memory Files Synchronization and Communications
ELET 4300
LESSON 1 - 17
Consumes Resources
Takes up physical memory CPU time
ELET 4300
LESSON 1 - 18
Most users see total package: Windows, Unix Tighter integration in modern systems
Interface
ELET 4300
LESSON 1 - 19
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
Restart Interrupts
Initiated by consoles restart button, or restart instruction arrives from another processor on a multiprocessor system.
ELET 4300
LESSON 1 - 24
ELET 4300
/* 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
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