Matakuliah Tahun Versi : H0344/Organisasi dan Arsitektur Komputer : 2005 : 1/1 Pertemuan 13 Operating System 1 1 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : • Menghubungkan prinsip-prinsip scheduling proses komputasi 2 Outline Materi • Overview • Scheduling 3 Overview An operating system is a program that controls the execution of application programs and acts as an interface between the user of a computer and the computer hardware. It can be thought of as having two objectives: • Convenience • Efficiency 4 Overview Layers and views of computer system End user Programmer Application program Operating system designer Utilities Operating system Computer hardware 5 Overview The operating system typically provides services in the following areas: • Program creation • Program execution • Access to I/O devices • Control access to files • System access • Error detection and response • Accounting 6 Overview The operating system as resource manager Computer system Operating system software I/O devices Printers, keyboards, digital camera, etc I/O controller I/O controller Programs and data I/O controller Processor Processor OS Program Data 7 Overview Memory layout for a resident monitor Interrupt processing Device drivers Monitor Job sequencing Control language interpreter Boundary User program area 8 Overview Multiprogramming batch systems Run Run Wait Wait time (a) Uniprogramming Program A Run Program B Wait Run Run A Run B Run Wait Wait Wait Run A Wait Run Wait Run B Wait time (a) Multiprogramming with two program Program A Run Program B Wait Program C Run Wait Run A Run Wait Run B Run Wait Run Run C Wait Wait Wait Run A Run B Wait Run Wait Run C Wait time (a) Multiprogramming with three program 9 Overview Batch multiprogramming versus time sharing Batch multiprogramming Time sharing Principal objective Maximize processor use Minimize response time Source of directives to operating system Job control language commands provided with the job Command entered at the terminal 10 Scheduling Type of scheduling Long term scheduling The decision to add to the pool of processes to be executed Medium term scheduling The decision to add to the number of processes that are partially or fully in main memory Short term scheduling The decision as to which available process will be executes by the processor I/O scheduling The decision as to which process’s pending I/O request shall be handled by an available I/O device 11 Scheduling Five state process model New Admit Dispatch Ready Running Release Exit Timeout Event occurs Event wait Blocked 12 Scheduling Identifier State Process control block Priority Program counter Memory pointer Context data I/O status information Accounting information 13 Scheduling Example Operating system Operating system Operating system In control Service handler Service handler Scheduler Interrupt handler A “Running” Scheduler Interrupt handler Service handler Scheduler Interrupt handler A “Waiting” A “Waiting” B “Ready” B “Running” In control B “Ready” In control Other partition Other partition Other partition 14 Scheduling Key elements of an operating system for multiprogramming Operating system Service call from process Interrupt from process Interrupt from I/O Service call handler (code) Interrupt handler (code) Longterm queue Shortterm queue I/O queue Short-term scheduler (code) Pass control to process 15 Scheduling Queuing diagram representation of processor scheduling Long term queue Short term queue End Processor I/O1 occurs I/O1 queue I/O2 occurs I/O2 queue I/On occurs I/On queue 16