0% found this document useful (0 votes)
44 views

05 OS System Structure

The document discusses different structures for organizing operating systems, including monolithic, layered, microkernel, and hybrid structures. A monolithic structure places all OS functionality in a single program, while layered structures divide the OS into separate layers. Microkernel structures move most functionality to userspace processes. Modern OSes often use hybrid structures that combine approaches for performance, flexibility, and other benefits. Loadable kernel modules allow dynamic addition of functionality similar to microkernels but with better performance.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

05 OS System Structure

The document discusses different structures for organizing operating systems, including monolithic, layered, microkernel, and hybrid structures. A monolithic structure places all OS functionality in a single program, while layered structures divide the OS into separate layers. Microkernel structures move most functionality to userspace processes. Modern OSes often use hybrid structures that combine approaches for performance, flexibility, and other benefits. Loadable kernel modules allow dynamic addition of functionality similar to microkernels but with better performance.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Operating Systems

Structures
Operating Systems Structures
• A system as large and complex as a modern operating system must be engineered
carefully if it is to function properly and be modified easily
• Structure/Organization/Layout of OSs:
• Monolithic Structure(one unstructured program)
• Layered Approach
• Microkernels
• Hybrid systems
Monolithic Structure
• The simplest structure for organizing an operating system is no structure at all.
• That is, place all of the functionality of the kernel into a single, static binary file
that runs in a single address space.
• Eg: Traditional UNIX System Structure
• Everything below the system-call interface and above the physical hardware is
the kernel.
• The kernel provides the file system, CPU scheduling, memory management, and
other operating system functions through system calls.
• Taken in sum, that is an enormous amount of functionality to be combined into
one single address space.
Traditional UNIX System Structure
Traditional UNIX System Structure
• UNIX – limited by hardware functionality, the original UNIX OS had limited
structuring.
• The UNIX OS consists of two separable parts:
• Systems Programs:
• The Kernel:
• Consists of everything below the system-call interface and above the
physical hardware.
• Provides the file system, CPU scheduling, memory management, and
other operating-system functions; a large number of functions for one
level.
Linux system structure
• The Linux operating system is based on UNIX and is structured similarly, as shown
in below Figure.
• Applications typically use the glibc standard C library when communicating with
the system call interface to the kernel.
• The Linux kernel is monolithic in that it runs entirely in kernel mode in a single
address space, but as we shall see later that, it does have a modular design that
allows the kernel to be modified during run time.
Linux system structure
Monolithic Structure
• Despite the apparent simplicity of monolithic kernels, they are difficult to
implement and extend.
• Despite the drawbacks of monolithic kernels, their speed and efficiency explains
why we still see evidence of this structure in the UNIX, Linux, and Windows
operating systems.
Layered Approach
• The monolithic approach is often known as a tightly coupled system because
changes to one part of the system can have wide-ranging effects on other parts.
• Alternatively, we could design a loosely coupled system.
• Such a system is divided into separate, smaller components that have specific and
limited functionality.
• All these components together comprise the kernel.
• The advantage of this modular approach is that changes in one component affect
only that component, and no others, allowing system implementers more
freedom in creating and changing the inner workings of the system.
Layered Approach
• The operating system is divided into a number of layers (levels), each built on top
of lower layers.
• The bottom layer (layer 0) is the hardware; the highest (layer N) is the user
interface.
• With modularity, layers are selected such that each uses functions (operations)
and services of only lower-level layers.
• Hence, each layer hides the existence of certain data structures, operations, and
hardware from higher-level layers.
Layered Operating System
Layered Approach
• Relatively few operating systems use a pure layered approach.
• One reason involves the challenges of appropriately defining the functionality of
each layer.
• In addition, the overall performance of such systems is poor due to the overhead
of requiring a user program to traverse through multiple layers to obtain an
operating-system service.
• Generally, these systems have fewer layers with more functionality, providing
most of the advantages of modularized code while avoiding the problems of layer
definition and interaction.
Microkernel System Structure
• We have already seen that the original UNIX system had a monolithic structure.
• As UNIX expanded, the kernel became large and difficult to manage.
• In the mid-1980s, researchers at Carnegie Mellon University developed an
operating system called Mach that modularized the kernel using the microkernel
approach.
• This method structures the operating system by removing all nonessential
components from the kernel and implementing them as user-level programs that
reside in separate address spaces.
Microkernel System Structure
• Move as much functionality as possible from the kernel into “user” space.
• Only a few essential functions in the kernel:
• primitive memory management (address space)
• I/O and interrupt management
• Inter-Process Communication (IPC)
• basic scheduling
• Other OS services are provided by processes running in user mode (vertical
servers):
• device drivers, file system, virtual memory…
Architecture of a typical microkernel
Layered vs. Microkernel Architecture
Microkernel System Structure
• Communication takes place between user modules using message passing.
• More flexibility, extensibility, portability and reliability.
• But performance overhead caused by replacing service calls with message
exchanges between processes.
Benefits of a Microkernel Organization
• Extensibility/Reliability
• easier to extend a microkernel
• easier to port the operating system to new architectures
• more reliable (less code is running in kernel mode)
• more secure
• small microkernel can be rigorously tested.
• Portability
• changes needed to port the system to a new processor is done in the
microkernel, not in the other services.
Benefits of Microkernel Organization
• Distributed system support
• message are sent without knowing what the target machine is.
• Object-oriented operating system
• components are objects with clearly defined interfaces that can be
interconnected to form software.
Disadvantages of Microkernel Structure
• Unfortunately, the performance of microkernels can suffer due to increased
system-function overhead.
• When two user-level services must communicate, messages must be copied
between the services, which reside in separate address spaces.
• In addition, the operating system may have to switch from one process to the
next to exchange the messages.
• The overhead involved in copying messages and switching between processes has
been the largest impediment to the growth of microkernel-based operating
systems.
Modules
• The best current methodology for operating-system design involves using
loadable kernel modules (LKMs).
• Here, the kernel has a set of core components and can link in additional services
via modules, either at boot time or during run time.
• This type of design is common in modern implementations of UNIX, such as
Linux, macOS, and Solaris, as well as Windows.
• The idea of the design is for the kernel to provide core services, while other
services are implemented dynamically, as the kernel is running.
Modules
• Linking services dynamically is preferable to adding new features directly to the
kernel, which would require recompiling the kernel every time a change was
made.
• Thus, for example, we might build CPU scheduling and memory management
algorithms directly into the kernel and then add support for different file systems
by way of loadable modules.
• The overall result resembles a layered system in that each kernel section has
defined, protected interfaces; but it is more flexible than a layered system,
because any module can call any other module.
Modules
• The approach is also similar to the microkernel approach in that the primary module
has only core functions and knowledge of how to load and communicate with other
modules; but it is more efficient, because modules do not need to invoke message
passing in order to communicate.
• Linux uses loadable kernel modules, primarily for supporting device drivers and file
systems.
• LKMs can be “inserted” into the kernel as the system is started (or booted) or during
run time, such as when a USB device is plugged into a running machine.
• If the Linux kernel does not have the necessary driver, it can be dynamically loaded.
• LKMs can be removed from the kernel during run time as well.
• For Linux, LKMs allow a dynamic and modular kernel, while maintaining the
performance benefits of a monolithic system.
Hybrid Systems
• In practice, very few operating systems adopt a single, strictly defined structure.
• Instead, they combine different structures, resulting in hybrid systems that
address performance, security, and usability issues.
• For example, Linux is monolithic, because having the operating system in a single
address space provides very efficient performance.
• However, it also modular, so that new functionality can be dynamically added to
the kernel.
Hybrid Systems
• Windows is largely monolithic as well (again primarily for performance reasons),
but it retains some behavior typical of microkernel systems, including providing
support for separate subsystems (known as operating-system personalities) that
run as user-mode processes.
• Windows systems also provide support for dynamically loadable kernel modules.

You might also like