Top Banner
Sistem Operasi - 2 Sistem operasi Miracle God Answers Prayer in 3 Ways : 1. God Say YES and Gives You What U Want. 2. God Say No n Gives You Something Better Or 3. God Say WAIT n Gives You the Best
49

Sistem Operas i

Nov 25, 2015

Download

Documents

Desti Fitriani
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • Sistem Operasi - 2Sistem operasiMiracle God Answers Prayer in 3 Ways : 1. God Say YES and Gives You What U Want.2. God Say No n Gives You Something Better Or3. God Say WAIT n Gives You the Best

  • Definisi SODari sudut pandang userSistem Operasi sebagai alat untuk mempermudah penggunaan KomputerSistem Operasi sebagai alat untuk memaksimalkan penggunaan sumber daya komputer (dalam lingkungan multi-user)Dari sudut pandang sistemSistem Operasi sebagai alat yang menempatkan sumber daya secara efisien (Resource Allocator)Sistem Operasi sebagai alat yang mangatur eksekusi aplikasi dan operasi dari alat I/O (Control Program)Sistem Operasi sebagai sebuah program yang selalu berjalan setiap saat pada komputer (Kernel)

  • Layanan SOMenyediakan layanan kepada user:User interface - hampir semua SO ada GUI-nyaVaries between Command-Line (CLI), Graphics User Interface (GUI), BatchProgram execution - SO harus bisa meload program ke memory dan mengeksekusinya, menghentikan eksekusi program, baik normal maupun tidak normal (abnormal exit)I/O operations - Program yang sedang berjalan butuh I/O, baik mengakses file ataupun I/O deviceFile-system manipulation - Programs butuh read dan write baik file atau directories, create dan delete, search file/dir, list file information, dan permission management.

  • Layanan SOCommunications - proses harus berkomunikasi antar proses dalam komputer yang sama atau antar komputer dalam jaringanMenggunakan shared memory atau menggunakan message passingError detection - harus mampu menangani errorDalam terjadi pada CPU, memory hardware, dalam I/O devices, dan dalam user programUntuk setiap error, OS harus menanganinya dengan aksi yang sesuai, benar, dan konsistenHarus adanya fasilitas debugging

  • Layanan SOResource alocation - ketika multiple users atau multiple jobs berjalan bersama-sama (concurent), resources harus dialokasikanAccounting - menentukan berapa banyak dan berapa lama users menggunakan sumber daya sistemProtection and securityProtection menyakinkan hak akses yang diperbolehkanSecurity sistem, baik program atau I/O dari pihak luar menggunakan autentikasi.

  • Sejarah SOGenerasi ke-0 (1940)Tabung hampa; blm ada sistem operasi; plug boardGenerasi ke-1 (1950)Komponen utama transistor; sistem batch; punch cardGenerasi ke-2 (1960)Komponen utama IC; konsep: multi programming, multi processing, spooling, real timeGenerasi ke-3 (1970)VLSI (very larga scalable integrated circuit)General purposeGenrasi ke-4 (1970 now)PC; sistem operasi jaringan; cloud computing; GUI friendly

  • Command Line Interpreter Sistem Operasi menunggu instruksi dari pengguna (command driven). Sometimes commands built-in, sometimes just names of programsIf the latter, adding new features doesnt require shell modificationCLI: Program yang membaca instruksi dan mengartikan control statements (keinginan user) umumnya disebut: control-card interpretercommand-line interpreterUNIX shell.

  • User Operating System Interface - GUIUser-friendly desktop metaphor interfaceMenggunakan mouse, keyboard, and monitorIcons merepresentasikan files, programs, actions, dllMenggunakan directory = folderInvented at Xerox PARCSO sekarang menggunakan antara CLI dan GUI interfacesMicrosoft Windows is GUI with CLI command shellApple Mac OS X as Aqua GUI interface with UNIX kernel underneath and shells availableSolaris is CLI with optional GUI interfaces (Java Desktop, KDE)

  • Sistem Calls System calls menyediakan interface antara proses (program yang sedang dijalankan) dan sistem operasi.Biasanya dibuat menggunakan bahasa tingkat tinggi (C or C++)Diakses menggunakan Application Program Interface (API) daripada pemanggilan langsung3 API yang umum adalah: Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), Java API for the Java virtual machine (JVM)

  • Example of System CallsSystem call sequence to copy the contents of one file to another file

  • Example of Standard APIConsider the ReadFile()function in theWin32 APIa function for reading from a file

    A description of the parameters passed to ReadFile()HANDLE filethe file to be readLPVOID buffera buffer where the data will be read into and written fromDWORD bytesToReadthe number of bytes to be read into the bufferLPDWORD bytesReadthe number of bytes read during the last readLPOVERLAPPED ovlindicates if overlapped I/O is being used

  • System Call implementationThe caller need know nothingabout how the system call is implementedJust needs to obey APIand understand what OS will do as a result callMost details of OS interface hiddenfrom programmer by API Managed by run-time support library(set of functions built into libraries included with compiler)

  • API - System Call - OS Relationship

  • Standard C Library ExampleC program invoking printf() library call, which calls write() system call

  • System CallsTiga metode umum yang digunakan dalam memberikan parameter kepada sistem operasiMelalui registersIn some cases, may be more parameters than registersMenyimpan parameter dalam block atau tabel pada memori dan alamat block tsb diberikan sebagai parameter dalam registerThis approach taken by Linux and SolarisMenyimpan parameter (push) ke dalam stack (oleh program), dan melakukan pop off pada stack (oleh sistem operasi)

  • Parameter Passing via Table

  • Jenis System Calls - System ProgramProcess ControlManajemen fileManajemen Device Information MaintenanceKomunikasiProteksiBiasanya digunakan pada system program

  • Process ControlSelesai, abortLoad, eksekusiMembuat dan men-terminate prosesMengambil dan men-set process attributes Wait for timeWait event, signal eventAllocate and free memory

  • MS - DOS execution

  • FreeBSD Running Multiple Programs

  • Manajemen FileMembuat dan menghapus fileMembuka dan menutup fileRead, write, reposition Mengambil dan men-set file attributes

  • Manajemen DeviceMeminta device, melepaskan deviceRead, write, repositionMengambil dan men-set device attributesLogically attach or detach device (mount / umount)

  • Information MaintenanceMengambil dan men-set waktu dan tanggalMen-set proses, file, or device attributes

  • KomunikasiMenciptakan, menghapus hubungan komunikasiMengirim dan menerima pesanMentransfer status informasiAttach atau detach remote deviceKomunikasi dapat dilakukan melalui message passing atau shared memory

  • Operating System Design & Implementation Design and Implementation of OS not solvable, but some approaches have proven successfulInternal structure of different Operating Systems can vary widelyStart by defining goalsand specificationsAffected by choice of hardware, type of systemUsergoals and SystemgoalsUser goalsoperating system should be convenient to use, easy to learn, reliable, safe, and fastSystem goalsoperating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient

  • Operating System Design & Implementation Important principle to separate

    Policy: What will be done?Mechanism: How to do it?

    Mechanisms determine how to do something, policies decide what will be done

  • Struktur Sistem OperasiStruktur SederhanaTidak dibagi dalam modul-modulContoh : Struktur sistem MS-DOS:disusun untuk mendukung fungsi yang banyak pada space yang kecilMetode pendekatan Layer / LevelContoh: UNIX, terdiri dari kernel (berisi device driver dan interface) dan programMikrokernelMenyusun sistem operasi dengan menghapus semua komponen yang tidak esensial dari kernel, dan mengimplementasikannya sebagai sistem program pada user-levelModular

  • MS DOS Structure Layer

  • Traditional UNIX System Structure

  • Layered Operating System Layer adalah implementasi dari object abstrak yang merupakan enkapsulasi dari data dan operasi yang bisa memanipulasi data tersebut Layer paling bawah : hardware Layer paling atas : user interface

  • Layered OSKeuntungan: Modularitasmempermudah debug dan verifikasi sistemlayer pertama bisa didebug tanpa mengganggu sistem yang lainKesulitan:hanya bisa menggunakan layer dibawahnya

  • MikrokernelFungsi utama: mendukung fasilitas komunikasi antara program user dan bermacam-macam layanan yang juga berjalan di user-spaceKernel menjadi lebih kecilKomunikasi melalui message passingKeuntungan:ketika layanan baru akan ditambahkan ke user-space, kernel tidak perlu di modifmendukung keamanan reliabilitas lebih, karena sebagian besar pada level pengguna, SO jadi terjagaContoh sistem operasi :Tru64 UNIX, MacOSX, QNX

  • Monolithic vs Microkernel

  • Mac OS X Structure

  • ModulesMost modern operating systems implement kernel modulesUses object-oriented approachEach core component is separateEach talks to the others over known interfacesEach is loadable as needed within the kernelOverall, similar to layers but with more flexible

  • Solaris Modular Approach

  • Virtual MachineMesin virtual mengambil pendekatan layer secara logika. Mesin virtual memperlakukan hardware dan sistem operasi seolah-olah berada pada level yang sama sebagai hardware. Pendekatan Mesin virtual menyediakan sebuah interface yang identik dengan seluruh hardware yang ada.Sistem Operasi host membuat ilusi dari banyak proses, masing-masing dieksekusi pada prosesornya sendiri dengan virtual memorinya sendiri. Setiap guest menyediakan sebuah (virtual) copy dari semua hal yang ada pada komputer.VM dibuat dengan pembagian sumber daya oleh physical computer

    VM ada 2: system VM dan application VM

  • Virtual Machine (2)Sumber daya dari fisik dibagi untuk membuat VM:Penjadwalan CPU bisa menciptakan penampilan seakan user mempunyai prosesor sendiriSpooling bisa menyediakan virtual card readers dan virtual line printersSebuah time-sharing terminal,yang dapat melayani user dengan tepatVM software membutuhkan disk space untuk menyediakan Virtual memory dan spooling, yaitu sebuah virtual disk

  • Virtual Machines History and BenefitsFirst appeared commercially in IBM mainframes in 1972Fundamentally, multiple execution environments (different operating systems) can share the same hardwareProtect from each otherSome sharing of file can be permitted, controlledCommutate with each other, other physical systems via networkingUseful for development, testingOpen Virtual Machine Format, standard format of virtual machines, allows a VM to run within many different virtual machine (host) platforms

  • Keuntungan VMKeamanan bukanlah masalahVM mempunyai pelindungan lengkap pada berbagai sistem sumber dayaTidak ada pembagian sumber daya secara langsungVM sistem adalah kendaraan yang sempurna untuk penelitian dan pengembangan sistem operasiDengan VM perubahan suatu bagian tidak akan mempengaruhi komponen yang lain

  • Kerugian VMVM sulit diimplementasikan karena banyak syarat yang dibutuhkan untuk menyediakan duplikat yang tepat dari mesin hostHarus punya virtual-user mode dan virtual-monitor mode yang keduanya berjalan di pysichal mode. Akibatnya, saat instruksi yang hanya membutuhkan virtual monitor mode dijalankan, register berubah dan bisa berefek pada virtual user mode, bahkan bisa me-restart VM Waktu yang dibutuhkan I/O bisa lebih cepat(karena ada spooling), tapi bisa lebih lambat (karena diinterpreted)

  • Virtual Machines ( Cont)

  • VMware Architecture

  • VMWare

  • Java Virtual MachineProgram Java yang telah dicompile adalah platform-neutral bytecodes yang dieksekusi oleh Java Virtual Machine(JVM)JVM terdiri dari:Class loaderClass verificatierruntime interpreterJust In-Time(JIT) compilers meningkatkan performance

  • The Java Virtual Machine

  • System Generation / FirmwareSistem operasi dirancang untuk dapat dijalankan pada berbagai jenis mesin, sistemnya harus dikonfigurasikan untuk setiap komputer.Program Sysgen mendapatkan informasi mengenai konfigurasi khusus tentang sistem hardware dari sebuah data, antara lain sebagai berikut:CPU apa yang digunakan, opsi yang adaBerapa banyak memori yang tersediaPeralatan yang tersediaSistem operasi opsi apa yang diinginkan atau parameter apa yang digunakan

  • Operating-System DebuggingDebugging is finding and fixing errors, or bugsOSgenerate log files containing error informationFailure of an application can generate core dump file capturing memory of the processOperating system failure can generate crash dump file containing kernel memoryBeyond crashes, performance tuning can optimize system performanceKernighans Law: Debugging is twice as hard as writing the code in the firstplace. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.DTracetool in Solaris, FreeBSD, Mac OS X allows live instrumentation on production systemsProbes fire when code is executed, capturing state data and sending it to consumers of those probes

  • System BootOperating system must be made available to hardware, so hardware can start itSmall piece of code bootstrap loader, locates the kernel, loads it into memory, and starts itbootblock atfixed location loads bootstrap loaderWhen power initialized on system, execution starts at a fixed memory locationFirmware used to hold initial boot code