Chapter 1: Introduksi
n Apakah tugas dari sistem operasi ?
n Computer-System Organization
n Computer-System Architecture
n Operating-System Structure
n Operating-System Operations
n Process Management
n Memory Management
n Storage Management
n Protection and Security
n Distributed Systems
n Special-Purpose Systems
n Computing Environments
Apakah Sistem Operasi ?
n Adalah sebuah sistem (berupa program) yang beraksi pada level menengah yang menghubungkan antara pemakai (user) dengan perangkat keras (hardware) dari komputer.
n Tujuan dari sistem operasi:
l Mengeksekusi program pemakai dan menyelesaikan masalahnya dengan mudah.
l Membuat sistem komputer mudah digunakan.
n Menggunakan piranti kesar komputer dalam bentuk yang efisien.
Struktur Sistem Komputer
n Komputer dapat dibagi menjadi empat komponen
l Hardware – merupakan sumber utama
4 CPU, memory, I/O devices
l Sistem Operasi
4 Mengendalikan dan mengkoordinasi pemakaian hardware antara beragam aplikasi yang dipakai dan penguna (user)
l Program Aplikasi – program yang dibuat untuk menyelesaikan tugas tertentu yang diinginkan user
4 Word processors, compilers, web browsers, database systems, video games
l Users
4 People, machines, selai komputer
Definisi Sistem Operasi (SO)
n SO adalah resource allocator
l Memenej semua sumber daya (resources)
l Memutuskan secara efisien dan fair sumber daya yang dipakai apabila terjadi konflik pada permintaan
n SO adalah pengendali program (control program)
l Mengendalikan program-program yang dieksekusi agar tidak terjadi kesalahan dan pemakaian dari komputer yang tidak berguna
Definisi Sistem Operasi (Cont.)
n “Everything a vendor ships when you order an operating system” adalah sebuah pendekatan yang baik
l Namun demikian masih terasa luas
n “The one program running at all times on the computer” adalah kernel. Selain daripada itu adalah program (ships with the operating system) atau program aplikasi
Computer Startup
n bootstrap program di load pada saat power-up atau reboot
l Jenis yang disimpan di ROM atau EPROM, secara umum dikenal dengan firmware
l Menginisialisasi semua aspek dari sistem
l Me-Load kernel dari SO dan memulai eksekusi
Organisasi Komputer
n Operasi dari sistem komputer
l Satu atau lebih CPUs, device pengendali yang terkoneksi langsung pada jalur (bus) agar dapat menggunakan memori secara bersama-sama (shared memory)
l Eksekusi bersama dari CPU dan persaingan pada perlatan untuk siklus memori
Operasi pada Sistem Komputer
n I/O devices dan CPU dapat dieksekusi bersama (concurrently).
n Setiap device controller didukung oleh particular device.
n Setiap device controller mempunyai local buffer.
n CPU move data dari/ke main memory ke/dari local buffers
n I/O dari device ke local buffer kendali (controller).
n Device controller menginformasikan CPU bahwa operasi selesai oleh adanya sebuah interrupt.
Fungsi-Fungsi pada INTERUPT
n Secara umum Interrupt transfers mengacu pada interrupt service routine, melalui interrupt vector, yang mana berisi alamat dari semua service routine.
n Interrupt architecture harus menyimpan alamat dari instruksi-instruksi interrupt.
n Interupt-interupt yang masuk di- disabled manakala interupt lain sedang diproses untuk menghindari adanya lost interrupt.
n trap adalah sebuah software (program) yang menghasilkan -interrupt oleh karena adanya error atau user request.
n SO merupakan interrupt driven.
Interrupt Handling
n SO memelihara state dari CPU dengan menyimpan registers dan program counter.
n Menentukan jenis interrupt mana yang terjadi:
l polling
l vectored interrupt system
n Bagian dari code segmen yang menentukan aksi apa yang harus diambil untuk tiap jenis interupt
Struktur I/O
n Setelah I/O start, kontrol dikembalikan ke program user hanya apabila I/O menyelesaikan pekerjaannya.
l Instruksi Wait merehatkan CPU sampai next interrupt
l Wait loop (contention for memory access).
l Hanya sebuah I/O yang aktif pada satu waktu, tidak ada proses I/O secara simultan.
n Setelah I/O start, kontrol dikembalikan ke program user tanpa menunggu penyelesaian I/O.
l System call – me-request pada SO untuk mengizinkan user untuk menunggu I/O menyelesaikan tugasnya.
l Device-status table berisi masukan tiap peralatan I/O ditandai oleh jenis, alamat & state.
l SO mengindeks ke tabel peralatan I/O untuk menentukan status peralatan dan memodifikasi tabel masukan untuk menyertakan interupt.
Two I/O Methods
Struktur Direct Memory Access
n Digunakan untuk piranti I/O yang berkecepatan tinggi (high-speed) dan diberi kewenangan untuk mentransfer informasi pada kecepatan yang mendekati kecepatan memori.
n Piranti (device) pengendali mentransfer blok-blok data dari bufer penyimpan langsung ke memori utama tanpa intervensi CPU.
n Hanya sebuah interupt yang dihasilkan atau sebuah interupt per byte.
Struktur Penyimpan (Storage)
n Memori utama (Main memory) – media penyimpan terbesar yang dapat diakses CPU secara langsung.
n Secondary storage – memori tambahan extension memory) yang merupakan large nonvolatile storage capacity.
n Magnetic disks – rigid metal atau glass platters yang dibungkus dengan magnetic recording material
l Permukaan disk secara logika dibagi menjadi beberapa track, dimana pada subbagiannya dibagi menjadi beberapa sector.
l Disk controller menentukan interaksi logik antara piranti dengan komputer.
Hirarki Penyimpan
n Secara hirarki organisasi media penyimpan dibagi menjadi.
l Kecepatan (Speed)
l Harga (Cost)
l Volatility - data menguap atau tidak
n Caching – menyalin informasi ke dalam media sistem penyimpan yang lebih cepat; memori utama dapat dilihat sebagai cache terakhir bagi secondary storage.
Caching
n Important principle, terdapat di banyak level di dalam sebuah komputer (dalam hardware, SO, software)
n Informasi yang digunakan disalin dari slower ke faster temporari storage
n Pertama-tama faster storage (cache) mengecek untuk menentukan apakah informasi tsb ada di sana
l Jika ada maka informasi digunakan langsung dari cache (fast)
l Jika tidak ada maka data disalin (copi) ke cache dan gunakan yang di cache tsb
n Cache lebih kecil daripada storage yang disimpan(cached)
l Perancangan cache management merupakan problem penting
l Aturan main untuk cache size dan pergantian (replacement)
Performance of Various Levels of Storage
n Pergerakan antar level dari hirarki storage ditinjau secara explisit atau implisit
Migrasi Integer dari Disk ke Register
n Multitasking environment harus hati-hati dalam menggunakan most recent value, bukan masalah dimana menyimpannya dalam hirarki penyimpanan (storage hierarchy)
n Multiprocessor environment harus menentukan cache coherency pada hardware seperti CPU mempunyai most recent value di dalam cache
n Situasi distributed environment bisa sangat kompleks
l Beberapa kali salinan data dapat terjadi
Struktur SO
n Multiprogramming kebutuhan akan efisiensi
l Single user tidak dapat mengklaim CPU & piranti I/O sibuk setiap waktu
l Multiprogramming mengorganisir job (code & data) sehingga CPU hanya mengeksekusi satu perintah saja
l Subset dari total job dalam sistem diletakkan di memory
l Sebuah job yang dipilih & dijalankan via job scheduling
l Manakala harus tunggu (I/O contohnya), SO pindah ke lain job
n Timesharing (multitasking) secara logikan dimana CPU pindah jobs sehingga secara berkala user dapat berinteraksi dengan tiap job manakala job tsb dijalankan, dengan kala lain menciptakan interactive computing
l Response time harus < 1 second
l Each user has at least one program executing in memory [process
l If several jobs ready to run at the same time [ CPU scheduling
l If processes don’t fit in memory, swapping moves them in and out to run
l Virtual memory allows execution of processes not completely in memory
Operating-System Operations
n Interrupt driven by hardware
n Software error or request creates exception or trap
l Division by zero, request for operating system service
n Other process problems include infinite loop, processes modifying each other or the operating system
n Dual-mode operation allows OS to protect itself and other system components
l User mode and kernel mode
l Mode bit provided by hardware
4 Provides ability to distinguish when system is running user code or kernel code
4 Some instructions designated as privileged, only executable in kernel mode
4 System call changes mode to kernel, return from call resets it to user
Transition from User to Kernel Mode
n Timer to prevent infinite loop / process hogging resources
l Set interrupt after specific period
l Operating system decrements counter
l When counter zero generate an interrupt
l Set up before scheduling process to regain control or terminate program that exceeds allotted time
Process Management
n A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity.
n Process needs resources to accomplish its task
l CPU, memory, I/O, files
l Initialization data
n Process termination requires reclaim of any reusable resources
n Single-threaded process has one program counter specifying location of next instruction to execute
l Process executes instructions sequentially, one at a time, until completion
n Multi-threaded process has one program counter per thread
n Typically system has many processes, some user, some operating system running concurrently on one or more CPUs
l Concurrency by multiplexing the CPUs among the processes / threads
Process Management Activities
The operating system is responsible for the following activities in connection with process management:
n Creating and deleting both user and system processes
n Suspending and resuming processes
n Providing mechanisms for process synchronization
n Providing mechanisms for process communication
n Providing mechanisms for deadlock handling
Memory Management
n All data in memory before and after processing
n All instructions in memory in order to execute
n Memory management determines what is in memory when
l Optimizing CPU utilization and computer response to users
n Memory management activities
l Keeping track of which parts of memory are currently being used and by whom
l Deciding which processes (or parts thereof) and data to move into and out of memory
l Allocating and deallocating memory space as needed
Storage Management
n OS provides uniform, logical view of information storage
l Abstracts physical properties to logical storage unit - file
l Each medium is controlled by device (i.e., disk drive, tape drive)
4 Varying properties include access speed, capacity, data-transfer rate, access method (sequential or random)
n File-System management
l Files usually organized into directories
l Access control on most systems to determine who can access what
l OS activities include
4 Creating and deleting files and directories
4 Primitives to manipulate files and dirs
4 Mapping files onto secondary storage
4 Backup files onto stable (non-volatile) storage media
Mass-Storage Management
n Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time.
n Proper management is of central importance
n Entire speed of computer operation hinges on disk subsystem and its algorithms
n OS activities
l Free-space management
l Storage allocation
l Disk scheduling
n Some storage need not be fast
l Tertiary storage includes optical storage, magnetic tape
l Still must be managed
l Varies between WORM (write-once, read-many-times) and RW (read-write)
I/O Subsystem
n One purpose of OS is to hide peculiarities of hardware devices from the user
n I/O subsystem responsible for
l Memory management of I/O including buffering (storing data temporarily while it is being transferred), caching (storing parts of data in faster storage for performance), spooling (the overlapping of output of one job with input of other jobs)
l General device-driver interface
l Drivers for specific hardware devices
Protection and Security
n Protection – any mechanism for controlling access of processes or users to resources defined by the OS
n Security – defense of the system against internal and external attacks
l Huge range, including denial-of-service, worms, viruses, identity theft, theft of service
n Systems generally first distinguish among users, to determine who can do what
l User identities (user IDs, security IDs) include name and associated number, one per user
l User ID then associated with all files, processes of that user to determine access control
l Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file
l Privilege escalation allows user to change to effective ID with more rights
Computing Environments
n Traditional computer
l Blurring over time
l Office environment
4 PCs connected to a network, terminals attached to mainframe or minicomputers providing batch and timesharing
4 Now portals allowing networked and remote systems access to same resources
l Home networks
4 Used to be single system, then modems
4 Now firewalled, networked
Computing Environments (Cont.)
n Client-Server Computing
l Dumb terminals supplanted by smart PCs
l Many systems now servers, responding to requests generated by clients
4 Compute-server provides an interface to client to request services (i.e. database)
4 File-server provides interface for clients to store and retrieve files
Peer-to-Peer Computing
n Another model of distributed system
n P2P does not distinguish clients and servers
l Instead all nodes are considered peers
l May each act as client, server or both
l Node must join P2P network
4 Registers its service with central lookup service on network, or
4 Broadcast request for service and respond to requests for service via discovery protocol
l Examples include Napster and Gnutella
Web-Based Computing
n Web has become ubiquitous
n PCs most prevalent devices
n More devices becoming networked to allow web access
n New category of devices to manage web traffic among similar servers: load balancers
n Use of operating systems like Windows 95, client-side, have evolved into Linux and Windows XP, which can be clients and servers
Selesai Chapter 1