1 / 49

Sistem Operasi 2

Sistem Operasi 2. “Sistem operasi”. Definisi SO. Dari sudut pandang user Sistem Operasi sebagai alat untuk mempermudah penggunaan Komputer Sistem Operasi sebagai alat untuk memaksimalkan penggunaan sumber daya komputer (dalam lingkungan multi-user) Dari sudut pandang sistem

owen-clark
Download Presentation

Sistem Operasi 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sistem Operasi 2 “Sistem operasi”

  2. Definisi SO • Dari sudut pandang user • Sistem Operasi sebagai alat untuk mempermudah penggunaan Komputer • Sistem Operasi sebagai alat untuk memaksimalkan penggunaan sumber daya komputer (dalam lingkungan multi-user) • Dari sudut pandang sistem • Sistem 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)

  3. Layanan SO • Menyediakan layanan kepada user: • User interface – hampir semua SO ada GUI-nya • Varies between Command-Line (CLI), Graphics User Interface (GUI), Batch • Program 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 device • File-system manipulation - Programs butuh read dan write baik file atau directories, create dan delete, search file/dir, list file information, dan permission management.

  4. Layanan SO • Communications – proses harus berkomunikasi antar proses dalam komputer yang sama atau antar komputer dalam jaringan • Menggunakan shared memory atau menggunakan message passing • Error detection – harus mampu menangani error • Dalam terjadi pada CPU, memory hardware, dalam I/O devices, dan dalam user program • Untuk setiap error, OS harus menanganinya dengan aksi yang sesuai, benar, dan konsisten • Harus adanya fasilitas debugging

  5. Layanan SO Resource allocation – ketika multiple users atau multiple jobs berjalan bersama-sama (concurent), resources harus dialokasikan Accounting – menentukan berapa banyak dan berapa lama users menggunakan sumber daya sistem Protection and security Protection menyakinkan hak akses yang diperbolehkan Security sistem, baik program atau I/O dari pihak luar menggunakan autentikasi.

  6. Sejarah SO • Generasi ke-0 (1940) • Tabung hampa; blm ada sistem operasi; plug board • Generasi ke-1 (1950) • Komponen utama transistor; sistem batch; punch card • Generasi ke-2 (1960) • Komponen utama IC; konsep: multi programming, multi processing, spooling, time sharing, real time • Generasi ke-3 (1970) • VLSI (very larga scalable integrated circuit) • General purpose • Genrasi ke-4 (1970 – now) • PC; sistem operasi jaringan; cloud computing; GUI friendly

  7. Command Line Interpreter • Sistem Operasi menunggu instruksi dari pengguna (command driven). • Sometimes commands built-in, sometimes just names of programs • If the latter, adding new features doesn’t require shell modification • CLI: Program yang membaca instruksi dan mengartikan control statements (keinginan user) umumnya disebut: • control-card interpreter • command-line interpreter • UNIX shell.

  8. User Operating System Interface - GUI User-friendly desktop metaphor interface Menggunakan mouse, keyboard, and monitor Icons merepresentasikan files, programs, actions, dll Menggunakan directory = folder Invented at Xerox PARC SO sekarang menggunakan antara CLI dan GUI interfaces Microsoft Windows is GUI with CLI “command” shell Apple Mac OS X as “Aqua” GUI interface with UNIX kernel underneath and shells available Solaris is CLI with optional GUI interfaces (Java Desktop, KDE)

  9. 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 langsung • 3 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)

  10. System Call implementation • The caller need know nothing about how the system call is implemented • Just needs to obey API and understand what OS will do as a result call • Most details of OS interface hidden from programmer by API • Managed by run-time support library (set of functions built into libraries included with compiler)

  11. Example of System Calls System call sequence to copy the contents of one file to another file

  12. Example of Standard API Consider the ReadFile() function in the Win32 API—a function for reading from a file A description of the parameters passed to ReadFile() HANDLE file—the file to be read LPVOID buffer—a buffer where the data will be read into and written from DWORD bytesToRead—the number of bytes to be read into the buffer LPDWORD bytesRead—the number of bytes read during the last read LPOVERLAPPED ovl—indicates if overlapped I/O is being used

  13. API – System Call – OS Relationship

  14. Standard C Library Example C program invoking printf() library call, which calls write() system call

  15. System Calls • Tiga metode umum yang digunakan dalam memberikan parameter kepada sistem operasi • Melalui registers • Menyimpan parameter dalam block atau tabel pada memori dan alamat block tsb diberikan sebagai parameter dalam register • Menyimpan parameter (push) ke dalam stack (oleh program), dan melakukan pop off pada stack (oleh sistem operasi)

  16. Parameter Passing via Table

  17. Tipe System Calls • Process Control • Manajemen file • Manajemen Device • Information Maintenance • Komunikasi • Proteksi • Biasanya digunakan dalam system program

  18. Process Control • Selesai, abort • Load, eksekusi • Membuat dan men-terminate proses • Mengambil dan men-set process attributes • Wait for time • Wait event, signal event • Allocate and free memory

  19. MS-DOS execution (a) At system startup (b) running a program

  20. FreeBSD Running Multiple Programs

  21. Manajemen File • Membuat dan menghapus file • Membuka dan menutup file • Read, write, reposition • Mengambil dan men-set file attributes

  22. Manajemen Device • Meminta device, melepaskan device • Read, write, reposition • Mengambil dan men-set device attributes • Logically attach or detach device (mount / umount)

  23. Information Maintenance • Mengambil dan men-set waktu dan tanggal • Men-set proses, file, or device attributes

  24. Komunikasi • Menciptakan, menghapus hubungan komunikasi • Mengirim dan menerima pesan • Mentransfer status informasi • Attach atau detach remote device • Komunikasi dapat dilakukan melalui message passing atau shared memory

  25. Operating System Design & Implementation Design and Implementation of OS not “solvable”, but some approaches have proven successful Internal structure of different Operating Systems can vary widely Start by defining goals and specifications Affected by choice of hardware, type of system User goals and System goals User goals – operating system should be convenient to use, easy to learn, reliable, safe, and fast System goals – operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient

  26. 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 The separation of policy from mechanism is a very important principle, it allows maximum flexibility if policy decisions are to be changed later

  27. Struktur Sistem Operasi • Struktur Sederhana • Tidak dibagi dalam modul-modul • Contoh : Struktur sistem MS-DOS: • disusun untuk mendukung fungsi yang banyak pada space yang kecil • Metode pendekatan Layer / Level • Contoh: UNIX, terdiri dari kernel (berisi device driver dan interface) dan program • Mikrokernel • Menyusun sistem operasi dengan menghapus semua komponen yang tidak esensial dari kernel, dan mengimplementasikannya sebagai sistem program dan user-level • Modular

  28. MS-DOS Layer Structure

  29. Traditional UNIX System Structure

  30. 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

  31. Layered OS • Keuntungan: • modularitas • mempermudah debug dan verifikasi sistem • layer pertama bisa didebug tanpa mengganggu sistem yang lain • Kesulitan: • hanya bisa menggunakan layer dibawahnya

  32. Mikrokernel • Fungsi utama: mendukung fasilitas komunikasi antara program klien dan bermacam-macam layanan yang juga berjalan di user-space • Kernel menjadi lebih kecil • Komunikasi melalui message passing • Keuntungan: • ketika layanan baru akan ditambahkan ke user-space, kernel tidak perlu di modif • mendukung keamanan reliabilitas lebih, karena sebagian besar pada level pengguna, SO jadi terjaga • Contoh sistem operasi : • Tru64 UNIX, MacOSX, QNX

  33. Mac OS X Structure

  34. Modules Most modern operating systems implement kernel modules Uses object-oriented approach Each core component is separate Each talks to the others over known interfaces Each is loadable as needed within the kernel Overall, similar to layers but with more flexible

  35. Solaris Modular Approach

  36. Virtual Machine • Mesin 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 guestmenyediakan 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

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

  38. Virtual Machines History and Benefits First appeared commercially in IBM mainframes in 1972 Fundamentally, multiple execution environments (different operating systems) can share the same hardware Protect from each other Some sharing of file can be permitted, controlled Commutate with each other, other physical systems via networking Useful for development, testing “Open Virtual Machine Format”, standard format of virtual machines, allows a VM to run within many different virtual machine (host) platforms

  39. Keuntungan VM • Keamanan bukanlah masalah • VM mempunyai pelindungan lengkap pada berbagai sistem sumber daya • Tidak ada pembagian sumber daya secara langsung • VM sistem adalah kendaraan yang “sempurna” untuk penelitian dan pengembangan sistem operasi • Dengan VM perubahan suatu bagian tidak akan mempengaruhi komponen yang lain

  40. Kerugian VM • VM sulit diimplementasikan karena banyak syarat yang dibutuhkan untuk menyediakan duplikat yang tepat dari mesin host • Harus 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)

  41. Virtual Machines (Cont) Non-virtual Machine Virtual Machine (a) Nonvirtual machine (b) virtual machine

  42. VMware Architecture

  43. VMWare

  44. Java Virtual Machine • Program Java yang telah dicompile adalah platform-neutral bytecodes yang dieksekusi oleh Java Virtual Machine(JVM) • JVM terdiri dari: • Class loader • Class verificatier • runtime interpreter • Just In-Time(JIT) compilers meningkatkan performance

  45. The Java Virtual Machine

  46. System Generation • Sistem 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 ada • Berapa banyak memori yang tersedia • Peralatan yang tersedia • Sistem operasi opsi apa yang diinginkan atau parameter apa yang digunakan

  47. Operating-System Debugging • Debugging is finding and fixing errors, or bugs • OS generate log files containing error information • Failure of an application can generate core dump file capturing memory of the process • Operating system failure can generate crash dump file containing kernel memory • Beyond crashes, performance tuning can optimize system performance • Kernighan’s Law: “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” • DTrace tool in Solaris, FreeBSD, Mac OS X allows live instrumentation on production systems • Probes fire when code is executed, capturing state data and sending it to consumers of those probes

  48. System Boot Operating system must be made available to hardware, so hardware can start it Small piece of code – bootstrap loader, locates the kernel, loads it into memory, and starts it boot block at fixed location loads bootstrap loader When power initialized on system, execution starts at a fixed memory location Firmware used to hold initial boot code

  49. NEXT • Process

More Related