Operating Systems Chapter 1: Introduction
Operating Systems Chapter 1: Introduction
General Info
Course
Instructor Office Phone E-mail
of your e-mail.
1.2
1.3
of operating systems since their birth. Then it will cover the major components of most operating systems and the tradeoffs that can be made between performance and functionality during the design and implementation of an operating system. Particular emphasis will be given to three major OS subsystems:
process management (processes, threads, CPU scheduling, synchronization, and deadlock), memory management (segmentation, paging, swapping) storage management (file systems, disk management, I/O operations).
1.4
Understand the design and implementation issues that have led to the current modern operating systems.
Understand and apply key concepts for process management in modern operating systems. Understand and apply essential concepts for memory management in modern operating systems. Understand and apply important concepts of storage management in modern operating systems. Understand and compare different operating systems in order to be able to select them in different use scenarios.
Understand and apply essential algorithms that are implemented as part of an operating system.
Understand and apply essential concepts regarding the deployment of modern operating systems. Understand and apply essential concepts for increasing the performance of modern operating systems.
1.5
Data Structures. Silberschatz, Abraham, Galvin, Peter and Gagne, Greg, (2005). Operating System Concepts, Seventh edition, New York, NY: John Wiley & Sons ISBN: 0-471-69466-5. (required). Andrew Tanenbaum, Modern Operating Systems, Prentice Hall. Second Edition. (only specific sections of the book will be required for special topics).
Required Readings
1.6
Contents
Introduction to Operating Systems
Operating System Structure Processes Threads
CPU Scheduling
Process Synchronization Deadlocks Main Memory Virtual Memory File System Interface File System Implementation
Mass-Storage Systems
I/O Systems
1.7
Grading
Project Midterm
Final
40% 30%
30%
Internet use is necessary since students should regularly check the course home page. Material can be downloaded from course website! Continued and regular use of e-mail is expected Students must keep copies of all assignments and projects sent by e-mail.
1.8
Lack of determination?
Lack of target? Lack of work? Hard work will help!!!
Response
http://www.youtube.com/watch?v=Dy6DRsm2VaM
1.9 Silberschatz, Galvin and Gagne 2005
Recommendations
Start studying now
Do not be shy! Ask any questions that you might have. Every
GOOD LUCK!
1.10
Chapter 1: Introduction
What Operating Systems Do
History of Operating Systems Computer-System Organization Computer-System Architecture
Operating-System Structure
Operating-System Operations Process Management Memory Management Storage Management Protection and Security Distributed Systems
Special-Purpose Systems
Computing Environments
1.11
Objectives
To provide a grand tour of the major operating
systems components
To provide coverage of basic computer system
organization
1.12
Execute user programs and make solving user problems easier. Make the computer system convenient to use.
manner.
1.13
Operating system
Controls
Application programs define the ways in which the system resources are used to solve the computing problems of the users
Word
processors, compilers, web browsers, database systems, video games machines, other computers
1.14 Silberschatz, Galvin and Gagne 2005
Users
People,
1.15
1.16
1.17
Manages all resources Decides between conflicting requests for efficient and fair resource use
OS is a control program
Controls execution of programs to prevent errors and improper use of the computer
1.18
the kernel. Everything else is either a system program (ships with the operating system) or an application program
1.19
It is a resource manager
Each program gets time with the resource Each program gets space on the resource
1.20
transistors, batch systems Third generation 1965 1980 ICs and multiprogramming Fourth generation 1980 present personal computers
1.21
Pennsylvania
Vacuum Tubes, plug boards
Computers were used for calculations and all programming was done in MACHINE LANGUAGE.
1.23
Early batch system bring cards to 1401 read cards to tape put tape on 7094 which does computing put tape on 1401 which prints output
1.24
Multiprogramming system
1.26
Weakness: all software including the OS would run on all models Millions of lines of code written by hundreds of programmers Copy jobs from cards onto disk
Spooling
Time-sharing systems
Introduced
DEC PDP-1
Only
120.000$ Culminating
Unix
Ken
Thompson, wrote from PDP-7 a one-user version of MULTICS. Berkeley Software Distribution
BSD:
System
Posix,
V: AT&T.
Minix, Linux.
1.28 Silberschatz, Galvin and Gagne 2005
Disk-based operating system To run on 8-bit Intel 8080 Digital Research rewrote CP/M and for 5 years it was the most used system in the world IBM released IBM Personal Computer DOS: Disk Operating System
1980s
Bill Gates bought it from Seattle Computer Products ($50.000) Package DOS/Basic was offered by Gates to IBM
GUI: Graphical User Interface Microsoft Windows: 90s Initially run over DOS Not really a different OS Windows 95 Underlying DOS: only for booting and running old DOS programs. Windows 98 Both W95 and Win98 retain large portions of 16-bit assembly language. Windows NT (New Technology) Full 32-bit system Would kill off DOS: Win NT 4.0 Win NT 4.0 was renamed to Windows 2000.
Operating System Concepts 7th Edition, Jan 12, 2005 1.30 Silberschatz, Galvin and Gagne 2005
X Windows
1.31
1.32
Computer Startup
bootstrap program is loaded at power-up or reboot
Typically stored in ROM or EPROM, generally known as firmware Initializes all aspects of system Loads operating system kernel and starts execution
1.33
One or more CPUs, device controllers connect through common bus providing access to shared memory Concurrent execution of CPUs and devices competing for memory cycles
1.34
Bus
Bus
1.35
Computer-System Operation
I/O devices and the CPU can execute concurrently.
Each device controller is in charge of a particular device
type.
Each device controller 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
1.36
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.
1.37
Interrupt Handling
The operating system preserves the state of the CPU by storing
Polling: a polled interrupt is a specific type of I/O interrupt that notifies the part of the computer containing the I/O interface that a device is ready to be read or otherwise handled but does not indicate which device. The interrupt controller must poll (send a signal out to) each device to determine which one made the request. vectored interrupt system: The alternative to a polled interrupt is a vectored interrupt, an interrupt signal that includes the identity of the device sending the interrupt signal.
1.38
Interrupt Timeline
1.39
upon I/O completion: synchronous Wait instruction idles the CPU until the next interrupt Wait loop (contention for memory access). At most one I/O request is outstanding at a time, no simultaneous I/O processing.
2. After I/O starts, control returns to user program without
waiting for I/O completion: asynchronous System call request to the operating system to allow user to wait for I/O completion. Device-status table contains entry for each I/O device indicating its type, address, and state. Operating system indexes into I/O device table to determine device status and to modify table entry to include interrupt.
Operating System Concepts 7th Edition, Jan 12, 2005 1.40 Silberschatz, Galvin and Gagne 2005
Synchronous
Asynchronous
1.41
Device-Status Table
1.42
1.43
Storage Structure
Main memory only large storage media that the CPU can
access directly.
Secondary storage extension of main memory that
Disk surface is logically divided into tracks, which are subdivided into sectors. The disk controller determines the logical interaction between the device and the computer.
1.44
Storage Hierarchy
Storage systems organized in hierarchy.
system; main memory can be viewed as a last cache for secondary storage.
1.45
Storage-Device Hierarchy
1.46
Disk is slow
1.47
Caching
Important principle, performed at many levels in a computer
software
temporarily
Faster storage (cache) checked first to determine if
information is there
If it is, information used directly from the cache (fast) If not, data copied to cache and used there Cache management important design problem Cache size and replacement policy
1.48 Silberschatz, Galvin and Gagne 2005
Storage-Device Speed
1.49
implicit
1.50
Single user cannot keep CPU and I/O devices busy at all times Multiprogramming organizes jobs (code and data) so CPU always has one to execute
Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing
Response time should be < 1 second Each user has at least one program executing in memory process If several jobs ready to run at the same time CPU scheduling If processes dont fit in memory, swapping moves them in and out to run Virtual memory allows execution of processes not completely in memory
1.51
hardware such that all CPUs have the most recent value in their cache
Distributed environment situation even more complex
1.52
1.53
Operating-System Operations
Interrupt driven by hardware
Software error or request creates exception or trap
Division by zero, request for operating system service Other process problems include infinite loop, processes modifying each other or the operating system Dual-mode operation allows OS to protect itself and other system components User mode and kernel mode
Mode bit provided by hardware Provides ability to distinguish when system is running user code or kernel code Some instructions designated as privileged, only executable in kernel mode System call changes mode to kernel, return from call resets it to user
1.54
Set interrupt after specific period Operating system decrements counter When counter zero generate an interrupt Set up before scheduling process to regain control or terminate program that exceeds allotted time
1.55
Process Management
A process is a program in execution. It is a unit of work within
location of next instruction to execute Process executes instructions sequentially, one at a time, until completion Multi-threaded process has one program counter per thread
Typically system has many processes, some user, some
1.57
Memory Management
All data in memory before and after processing
All instructions in memory in order to execute Memory management determines what is in memory
1.58
Storage Management
OS provides uniform, logical view of information storage
Abstracts physical properties to logical storage unit - file Each medium is controlled by device (i.e., disk drive, tape drive) Varying properties include access speed, capacity, datatransfer rate, access method (sequential or random)
File-System management
Files usually organized into directories Access control on most systems to determine who can access what
OS activities include Creating and deleting files and directories Primitives to manipulate files and dirs Mapping files onto secondary storage
1.59
Mass-Storage Management
Usually disks used to store data that does not fit in main memory or
Free-space management Storage allocation Disk scheduling Tertiary storage includes optical storage, magnetic tape Still must be managed Varies between WORM (write-once, read-many-times) and RW (read-write)
1.60
I/O Subsystem
One purpose of OS is to hide peculiarities of hardware
(storing data temporarily while it is being transferred) (storing parts of data in faster storage for performance) (the overlapping of output of one job with input of other jobs)
caching
spooling
1.61
users to resources defined by the OS Security defense of the system against internal and external attacks Huge range, including denial-of-service, worms, viruses, identity theft, theft of service Systems generally first distinguish among users, to determine who can do what User identities (user IDs, security IDs) include name and associated number, one per user User ID then associated with all files, processes of that user to determine access control Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file
Computing Environments
Traditional computer
connected to a network, terminals attached to mainframe or minicomputers providing batch and timesharing portals allowing networked and remote systems access to same resources to be single system, then modems
Now
Home networks
Used Now
firewalled, networked
1.63
Client-Server Computing Dumb terminals supplanted by smart PCs Many systems now are servers, responding to requests generated by clients Compute-server provides an interface to client to request services (i.e. database) File-server provides interface for clients to store and retrieve files
1.64
Peer-to-Peer Computing
Another model of distributed system
P2P does not distinguish clients and servers
its service with central lookup service on network, or request for service and respond to requests for service via discovery protocol
Broadcast
1.65
Web-Based Computing
Web has become ubiquitous (existing or being everywhere
evolved into Linux and Windows XP, which can be clients and servers
1.66
Readings
Silberschatz: Chapter 1.
Tanenbaum: Sections 1.1, 1.2, 1.3 Get slides from website
http://www.marenglenbiba.net/opsys/
1.67
Keep in mind
1.68
End of Chapter 1