1 / 10

CENG334 Introduction to Operating Systems

Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY. URL: http://kovan.ceng.metu.edu.tr/~erol/Courses/CENG334. Operating System Design and Implementation Topics OS structures. CENG334 Introduction to Operating Systems.

Download Presentation

CENG334 Introduction to Operating Systems

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. Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL: http://kovan.ceng.metu.edu.tr/~erol/Courses/CENG334 Operating System Design and Implementation Topics • OS structures CENG334Introduction to Operating Systems Some of the following slides are adapted from Matt Welsh, Harvard Univ.

  2. OS design and implementation • There is no ultimate OS that would satisfy all requirements: • Trade-offs have to made at each level and for all aspects. • 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

  3. Operating Systems Structure(What is the organizational Principle?)‏ • Simple • Only one or two levels of code • Layered • Lower levels independent of upper levels • Microkernel • OS built from many user-level processes • Modular • Core kernel with Dynamically loadable modules

  4. Simple Structure • MS-DOS – written to provide the most functionality in the least space • Not divided into modules • Interfaces and levels of functionality not well separated

  5. Monolithic Kernels • Most common OS kernel design (used in UNIX and Linux)‏ • Kernel code is privileged and lives in its own address space • User applications are unprivileged and live in their own separate address spaces • All kernel functions loaded into memory as one large, messy program • Pros and cons??? User application User application User application System call Protection boundary Kernel Memory management Process management Filesystem TCP/IP stack Accounting CPU support Device drivers Disk I/O

  6. Monolithic Kernels • Most common OS kernel design • Kernel code is privileged and lives in its own address space • User applications are unprivileged and live in their own separate address spaces • All kernel functions loaded into memory as one large, messy program • Pros and cons • Pro: Overhead of module interactions within the kernel is low (function call)‏ • Pro: Kernel modules can directly share memory • Con: Very complicated and difficult to organize • Con: A bug in any part of the kernel can crash the whole system! User application User application User application System call Protection boundary Kernel Memory management Process management Filesystem TCP/IP stack Accounting CPU support Device drivers Disk I/O

  7. Layered kernels • Operating system is divided many layers (levels) • Each built on top of lower layers • Bottom layer (layer 0) is hardware • Highest layer (layer N) is the user interface • Each layer uses functions (operations) and services of only lower-level layers • Advantage: modularity  Easier debugging/Maintenance • Not always possible: Does process scheduler lie above or below virtual memory layer? • Need to reschedule processor while waiting for paging • May need to page in information about tasks • Important: Machine-dependent vs independent layers • Easier migration between platforms • Easier evolution of hardware platform

  8. User application User application User application Memory management Process management Filesystem TCP/IP stack Accounting CPU support Device drivers Disk I/O Microkernel Microkernels • Use a very small, minimal kernel, and implement all other functionality as user level “servers” • Kernel only knows how to perform lowest-level hardware operations • Device drivers, filesystems, virtual memory, etc. all implemented on top • Use inter-process procedure call (IPC) to communicate between applications and servers • Pros and Cons??? Inter-process procedure call Protection boundary

  9. Microkernels - 2 • Pros and cons • Pro: Kernel is small and simple, servers are protected from each other • Con: Overhead of invoking servers may be very high • e.g., A user process accessing a file may require inter-process communication through 2 or 3 servers! • Microkernels today • Lots of research in late 80's and early 90's • Windows NT uses “modified microkernel”: • Monolithic kernel for most things, OS APIs (DOS, Win3.1, Win32, POSIX) implemented as user-level services • Mac OS X has reincarnated the microkernel architecture as well: • Gnarly hybrid of Mach (microkernel) and FreeBSD (monolithic)

  10. Modules-based Structure • Most modern operating systems implement 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 more flexible

More Related