Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

Chapter 8 Operating System Support

Presentasi serupa


Presentasi berjudul: "Chapter 8 Operating System Support"— Transcript presentasi:

1 Chapter 8 Operating System Support
Pokok-Pokok Penting Sistem Operasi merupakan s/w yg mengontrol eksekusi program-program pada sebuah prosesor dan mengatur sumber daya prosesornya. Salah satu fungsi paling utama Sistem Operasi adalah penjadwalan proses-proses Fungsi sistem operasi penting lainnya adalah manajemen memori.

2 Chapter 8 Operating System Support
Tujuan dan Fungsi Sistem Operasi Kenyamanan : dengan sistem operasi membuat komputer lebih mudah untuk digunakan Efisiensi: memungkinkan sumber daya sistem komputer dapat digunakan dgn cara yang efisien.

3 1. Sebagai extended machine
FUNGSI SISTEM OPERASI 1. Sebagai extended machine Menyembunyikan kompleksitas pemrograman hardware dari programmer atau user Menyajikan fasilitas yang lebih mudah untuk menggunakan hardware 2. Sebagai resource manager Mengatur dan mengefisienkan penggunaan sumber daya komputer Masing-masing program mendapatkan waktu dan space terhadap sumber daya

4 Layers and Views of a Computer System

5 Komponen utama sistem komputer

6 Penempatan Sistem Operasi pada Sistem Komputer

7 Operating System Services (Layanan-layanan Sistem Operasi
Pembuatan Program Biasanya dlm bentuk utiliti spt: editor, debugger untuk membantu programmer Eksekusi Program Menaruh instruksi dan data ke main memory Akses ke perangkat I/O Sistem operasi mengatasi masalah detail operasional perangkat I/O, shg pemrogram dpt menggunakan dlm bentuk yg lebih sederhana. Controlled access to files Sistem multi user, o/s menyediakan mekanisme perlindungan untuk akses ke file System access Perlindungan sumber daya dan data Error detection and response Accounting o/s mengumpulkan statistik pemakaian untuk berbagai sumber daya, yg berguna untuk peningkatan kinerja

8 O/S as a Resource Manager (Sistem Operasi sebagai Manajer Sumber Daya)

9 Types of Operating System ( Jenis-jenis Sistem Opersai )
Interactive User berinteraksi secara langsung dgn komputer Batch Program user ditampung bersama-sama dgn user yg lainnya, dan kemudian disampaikan ke operator komputer. (sekarang jarang) Single program (Uni-programming) Mengerjakan satu program setiap saat Multi-programming (Multi-tasking) Menjaga agar prosesor sibuk setiap saat, dgn mengerjakan program lebih dari satu setiap saat Beberapa program di-load ke main memory dan prosesor beralih dari satu program ke program yang lainnya.

10 MonoProgrammming, MultiProgramming, ParalelProgramming
job Selesai 3 2 1 T0 T1 T2 T3 waktu Mono Programming

11 MonoProgrammming, MultiProgramming, ParalelProgramming
job 3 2 1 waktu T0 Multi Programming

12 MonoProgrammming, MultiProgramming, ParalelProgramming
3 2 1 waktu T0 Paralel Programming

13 A B MonoProgramming

14 MonoProgramming

15 MonoProgramming

16 MonoProgramming

17 MonoProgramming

18 MonoProgramming

19 MultiProgramming

20 MultiProgramming

21 Quantum MultiProgramming

22 MultiProgramming

23 MultiProgramming

24 MultiProgramming

25 MultiProgramming

26 MultiProgramming

27 MultiProgramming

28 MultiProgramming

29 MultiProgramming

30 MultiProgramming

31 MultiProgramming

32 Paralel Programming

33 Paralel Programming

34 Paralel Programming

35 Paralel Programming

36 Paralel Programming

37 Early Systems (sistem-sistem awal)
Akhir 1940 s/d pertengahan 1950 Tidak menggunakan Sistem Operasi Program berinteraksi langsung dgn hardware Dua masalah utama: Scheduling (penjadwalan) Mendaftar menggunakan prosesor dlm waktu kelipatan 30 menit, jika ada error => berhenti sebelum dpt memecahkan masalah. Setup time (Waktu setup) Pemasangan pita atau punch card, dll

38 Simple Batch Systems (Sistem Batch Sederhana)
Simple batch system disebut juga dgn: Monitor Resident Monitor program (lihat gbr slide berikutnya) Users menyerahkan jobs ke operator Operator melakukan batches jobs => melalui perangkat input yg bisa diakses oleh Monitor Monitor mengontrol urutan peristiwa Bila satu job sdh selesai, control dikembalikan ke Monitor, dan Monitor akan membaca job berikutnya Monitor handles scheduling

39 Batch System

40 Memory Layout for Resident Monitor

41 Job Control Language (JCL)
Bahasa pemrogram khusus yg digunakan untuk memberikan instruksi ke Monitor Contoh: e.g. $JOB $FTN //memuat kompiler ... Some Fortran instructions $LOAD //kompilasi $RUN ... Some data $END

42 Desirable Hardware Features ( Fitur-fitur perangkat keras yg dibutuhkan)
Memory protection To protect the Monitor (program user tdk boleh merubah area memori monitor) Timer / pengatur waktu To prevent a job monopolizing the system Jika pengatur waktu berakhir, terjadi interrupt dan kontrol kembali ke monitor Privileged instructions / istruksi-instruksi istimewa Only executed by Monitor e.g. I/O Interrupts Memberikan o/s lebih fleksibel dlm melepaskan kontrol ke program pengguna dan mendapatkan kembali kontrol dari pengguna.

43 Multi-programmed Batch Systems
I/O devices very slow When one program is waiting for I/O, another can use the CPU Single Program

44 Multi-Programming with Two Programs

45 Multi-Programming with Three Programs

46 Utilization

47 Time Sharing Systems (Sistem berbagi waktu)
Sistem Multiprogramming: Memaksimalkan penggunaan prossor Perintah dari Jobs Time sharing system: Meminimumkan waktu respon Perintah dimasukkan dari terminal

48 Scheduling Long term (penjadwalan Jangka Panjang)
Medium term (penjadwalan Jangka Menengah) Short term (penjadwalan jangka pendek) I/O (penjadwalan I/O)

49 Long Term Scheduling Menentukan program yang akan diproses / submitted
Mengontrol degree of multi-programming Sekali di-submitted, a job becomes a process for the short term scheduler (or it becomes a swapped out job for the medium term scheduler)

50 Medium Term Scheduling
Part of the swapping function Swapping-in & Swapping-out

51 Short Term Scheduler Disebut juga = Dispatcher
Fine grained decisions of which job to execute next

52 Process States

53 Process Control Block Isi dari PCB :
Identifier : Setiap proses yg sedang berjalan mempunyai Identifier yg unik State Priority Program counter Memory pointers : Lokasi awal dan akhir dari proses di memori Context data : Data pada register pada saat program dieksekusi I/O status : Permintaan I/O yg belum dipenuhi, I/O yg ditugaskan pd proses ini, daftar file yg di open. Accounting information : Jumlah waktu prosesor dan waktu yg digunakan.

54 PCB Diagram

55 Key Elements of O/S (Elemen-elemen penting sistem operasi untuk multiprogramming)

56 Process Scheduling

57 Memory Management Uni-program Multi-program Memori dibagi menjadi dua
Satu untuk Operating System (monitor) Satunya lagi untuk mengeksekusi program Multi-program “User” part is sub-divided and shared among active processes

58 Swapping Problem: I/O is so slow compared with CPU that even in multi-programming system, CPU can be idle most of the time Solutions: Increase main memory Expensive Program kecenderungannya bertambah besar Swapping

59 What is Swapping? Long term queue of processes stored on disk
Processes “swapped” in as space becomes available As a process completes it is moved out of main memory (dipindahkan dari memori utama) If none of the processes in memory are ready (i.e. all I/O blocked) Swap out a blocked process to intermediate queue Swap in a ready process or a new process But swapping is an I/O process...

60 Partitioning Splitting memory into sections to allocate to processes (including Operating System) Fixed-sized partitions May not be equal size Process is fitted into smallest hole that will take it (best fit) Some wasted memory Leads to variable sized partitions

61 Fixed Partitioning

62 Variable Sized Partitions (1)
Allocate exactly the required memory to a process When all processes are blocked, swap out a process and bring in another New process may be smaller than swapped out process Another hole

63 Variable Sized Partitions (2)
Eventually have lots of holes (fragmentation) Solutions: Coalesce - Join adjacent holes into one large hole Compaction - From time to time go through memory and move all hole into one free block (c.f. disk de-fragmentation)

64 Effect of Dynamic Partitioning

65 Relocation No guarantee that process will load into the same place in memory Instructions contain addresses Locations of data Addresses for instructions (branching) Logical address - relative to beginning of program Physical address - actual location in memory (this time) Automatic conversion using base address

66 Paging Split memory into equal sized, =>page frames
Split programs (processes) into equal sized => pages Allocate the required number page frames to a process Operating System maintains list of free frames A process does not require contiguous page frames Use page table to keep track

67 Logical and Physical Addresses - Paging

68 Virtual Memory Demand paging Page fault
Do not require all pages of a process in memory Bring in pages as required Page fault Required page is not in memory Operating System must swap in required page May need to swap out a page to make space Select page to throw out based on recent history

69 Thrashing Too many processes in too little memory
Operating System spends all its time swapping Little or no real work is done Disk light is on all the time Solutions Good page replacement algorithms Reduce number of processes running Fit more memory

70 Bonus We do not need all of a process in memory for it to run
We can swap in pages as required So - we can now run processes that are bigger than total memory available! Main memory is called real memory User/programmer sees much bigger memory - virtual memory

71 Page Table Structure

72 Translation Lookaside Buffer
Every virtual memory reference causes two physical memory access Fetch page table entry Fetch data Use special cache for page table TLB

73 TLB Operation

74 TLB and Cache Operation

75 Segmentation Paging is not (usually) visible to the programmer
Segmentation is visible to the programmer Usually different segments allocated to program and data May be a number of program and data segments

76 Advantages of Segmentation
Simplifies handling of growing data structures Allows programs to be altered and recompiled independently, without re-linking and re-loading Lends itself to sharing among processes Lends itself to protection Some systems combine segmentation with paging


Download ppt "Chapter 8 Operating System Support"

Presentasi serupa


Iklan oleh Google