operating systems
play

Operating Systems Hadi Salimi Computer Engineering Department Iran - PDF document

Operating Systems Hadi Salimi Computer Engineering Department Iran University of Science and Technology y gy Tehran, Iran hsalimi@iust.ac.ir Spring 2009 Course motivation and goals Course motivation and goals Programming computer


  1. Operating Systems Hadi Salimi Computer Engineering Department Iran University of Science and Technology y gy Tehran, Iran hsalimi@iust.ac.ir Spring 2009 Course motivation and goals Course motivation and goals � Programming computer hardware g g p directly is difficult � Operating systems provide a layer � Operating systems provide a layer between applications and computer h hardware (VM) d (VM) � Understanding operating system concepts is essential to many advanced programming tasks advanced programming tasks 2

  2. Class outline Class outline � Introduction and Overview � Introduction and Overview � Processes and threads � Operating system structures � Operating system structures � Memory management � Scheduling � Scheduling � Input/Output � File Systems y � Security 3 Textbook Textbook � Andrew S. Tanenbaum. “Operating Systems design and implementation”, 3nd ed., Prentice Hall, 2006. � Abraham Silberschatz, Galvin, and Gagne. Operating � Abraham Silberschatz, Galvin, and Gagne. “ Operating Systems Concepts”, 7nd ed., John Wiley and Sons, 2005 � William Stallings. “Operating Systems”, 4nd ed., Willi St lli “O ti S t ” 4 d d Prentice Hall, 2001. � Andrew S. Tanenbaum. “Modern Operating Systems”, p g y , 2nd ed., Prentice Hall, 2001. 4

  3. Overview: Overview: � What is an operating system? � Operating systems history � The zoo of modern operating systems � Review of computer hardware � Operating system concepts � System calls � Operating system structure � User interface to the operating system U i t f t th ti t � Anatomy of a system call 5 Samples of Operating Systems Samples of Operating Systems � IBSYS (IBM 7090) � MACH � OS/360 (IBM 360) OS/360 (IBM 360) � Apollo DOMAIN � TSS/360 (360 mod 67) � Unix (System V & BSD) � Michigan Terminal � Apple Mac (v 1– v 9) � Apple Mac (v. 1 v. 9) System � MS-DOS � CP/CMS & VM 370 � Windows NT, 2000, XP � MULTICS (GE 645) ( ) � Novell Netware � Alto (Xerox PARC) � Linux � Pilot (Xerox STAR) � CP/M � CP/M � FreeBSD � FreeBSD � IRIX � PalmOS � Solaris � PocketPC � MVS � VxWorks � VxWorks 6

  4. Samples of Operating Systems (continue Samples of Operating Systems (continue…) ) 7 What is an Operating System? What is an Operating System? � An Operating System is a program that acts as an intermediary/interface between a user of a computer and the computer hardware. � It is an extended machine � Hides the messy details which must be performed Hides the messy details which must be performed � Presents user with a virtual machine, easier to use � It is a resource manager � Each program gets time with the resource � Each program gets space on the resource 8

  5. The Operating System controls the machine controls the machine Debugger Compiler User OS Kernel Video Game Hard Application Application ware App. Editor Operating System Terminal … emulator Hardware Browser 9 Static View of System Components … User 1 User 2 User 3 User 4 User n Compiler Editor Database Calculator WP Operating System Operating System Hardware 10

  6. Dynamic View of System Components Dynamic View of System Components 11 L Layers of a Computer System f C t S t End User Programmer Application Programs Operating- Utilities System Designer O e ti Operating-System S te Computer Hardware 12

  7. History of Operating Systems History of Operating Systems � First generation: 1945 – 1955 � Vacuum tubes, Plug boards V b Pl b d � Second generation: 1955 – 1965 � Transistors, Batch systems � Third generation: 1965 – 1980 � Integrated circuits, Multiprogramming � Fourth generation: 1980 – present � Fourth generation: 1980 – present � Large scale integration, Personal computers � Next generation: ??? Next generation: ??? � Systems connected by high-speed networks? � Wide area resource management? Wid t? 13 First generation: direct input First generation: direct input � Run one job at a time � Enter it into the computer (might require rewiring!) � Run it � Record the results Record the results � Problem: lots of wasted computer time! � Computer was idle during first and last steps Computer was idle during first and last steps � Computers were very expensive! � Goal: make better use of an expensive commodity: computer time 14

  8. Second generation: batch systems Second generation: batch systems � Bring cards to 1401 � Read cards onto input tape � Put input tape on 7094 � Perform the computation, writing results to output tape � Put output tape on 1401 which prints output � Put output tape on 1401, which prints output 15 Structure of a typical 2nd generation job Structure of a typical 2nd generation job Data for $END program FORTRAN $RUN $LOAD program $FORTRAN $JOB, 10,6610802, JANE DOE 16

  9. Third generation: multiprogramming Third generation: multiprogramming � Multiple jobs in memory � Protected from one P d f another Job 3 � Operating system protected from each job Job 2 as well Memory � Resources (time � Resources (time, Job 1 Job 1 partitions hardware) split between jobs Operating Operating � Still not interactive Still t i t ti system � User submits job � Computer runs it � User gets results minutes (hours, days) later 17 Multi tasking Multi tasking Task 1 Operat Job 1 Task 2 Main n Memory C CPU ing System Job 2 Job 3 � Resource utilization � Resource utilization � Multiprogramming, multitasking, and multiple users. � Time sharing. � Response time. 18

  10. Timesharing Timesharing � Multiprogramming allowed several jobs to be active at one time � Initially used for batch systems � Cheaper hardware terminals → interactive use Cheaper hardware terminals interactive use � Computer use got much cheaper and easier � No more “priesthood” � No more priesthood � Quick turnaround meant quick fixes for problems 19 Types of modern operating systems Types of modern operating systems � Mainframe operating systems: MVS � Server operating systems: FreeBSD, Solaris � Multiprocessor operating systems: Cellular IRIX � Personal computer operating systems: XP, Linux � PDA operating systems: PalmOS, PocketPC � Real-time/embedded operating systems: VxWorks, QNX � Smart card operating systems Smart card operating s stems ⇒ Some operating systems can fit into more than one category category 20

  11. Computer Hardware Review Computer Hardware Review � Computer block diagram p g � Components of a simple personal computer computer � CPU internals � Memory Memor � Storage pyramid � Disk drive structure � Anatomy of a device request y q � Structure of a large Pentium system 21 Computer Input Unit Input Unit Output Unit Output Unit Control Unit Control Unit Keyboard Mouse Monitor ALU CPU CPU Scanner Printer Modem Modem Registers Bank Cache Memory Main Memory RAM ROM Memory HD Secondary Memory FD CD Flash Tertiary Memory Tape 22

  12. Computer Components: Top-Level View p p p � MAR - Memory Address Register � address for next read or write � MBR - Memory Buffer Register � data to be written into memory � data to be written into memory � receives data read from memory � I/OAR - I/O Address � specifies a particular I/O device � I/OBR - I/O Buffer � exchange of data between an I/O � exchange of data between an I/O module and the processor 23 Components of a simple personal computer Components of a simple personal computer Outside Outside world Video Hard drive USB Network controller controller controller controller controller controller controller controller CPU Computer internals (inside the “box”) ( ) Memory 24

  13. CPU internals CPU internals Execute Execute unit Fetch Decode unit unit Holding Execute Fetch Decode Execute buffer unit unit unit unit Fetch Decode Execute unit unit unit (a) A three-stage Pipelined CPU (b) A Superscalar CPU 25 Memory Memory Address Address 0x0002ffff 0x0002ffff 0x0002ffff 0x0002ffff User 2 data User 2 program 0x0002d000 and data Limit 2 0x0002b000 0x0002bfff User 1 data Base 2 0x00029000 Limit Limit 2 0x00027fff 0x00027fff User 1 program Limit 1 0x00024fff and data User program 0x00023000 Base Base 1 0x00023000 0x0001dfff 0x0001dfff 0x0001dfff 0x0001dfff Operating Operating system system 0x00000000 0x00000000 � Single base/limit pair: set for each process � Two base/limit registers: one for program, one for data T b /li it i t f f d t 26

Recommend


More recommend