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

OS Structure

Uploaded by

ABDUL QUDOOS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

OS Structure

Uploaded by

ABDUL QUDOOS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Duration: 1 Hour Degree: BSCS Course Code: BCS- Semester: 4th

2411
1

Chapter 2
OS Structure
Operating Systems
Lecturer: Sana Rehman
2 Simple Structure
 Many operating systems do not have well-defined structures.
 Such systems started as small, simple, and limited systems and then grew beyond
their original scope.
Example
 MS-DOS is an example of such a system.
 It was originally designed and implemented by a few people who had no idea that it
would become so popular.
 It was written to provide the most functionality in the least space, so it was not
carefully divided into modules.
3 Continued….
4 Continued….
 In MS-DOS, the interfaces and levels of functionality are not well separated.
 For instance, application programs are able to access the basic I/O routines to write
directly to the display and disk drives.
5 Unix OS
 Another example of limited structuring is the original UNIX operating system.
 Like MS-DOS, UNIX initially was limited by hardware functionality.
 It consists of two separable parts: the kernel and the system programs.
 The kernel is further separated into a series of interfaces and device drivers, which have
been added and expanded over the years as UNIX has evolved.
 We can view the traditional UNIX operating system as being layered to some extent
 Everything below the system-call interface and above the physical hardware is the
kernel.
6 Continued…
7 Layered Approach
 With proper hardware support, operating systems can be broken into pieces that are
smaller and more appropriate than those allowed by the original MS-DOS and UNIX
systems.
 A system can be made modular in many ways.
 One method is the layered approach, in which the operating system is broken into a
number of layers (levels).
 The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface.
 The layers in between (operating system layer) consists of numerous data structures and
operations.
8 Continued…
9 Continued…
Advantages
 The main advantage of the layered approach is simplicity of construction and debugging.
 The first layer can be debugged without any concern for the rest of the system, because, by
definition, it uses only the basic hardware (which is assumed correct) to implement its
functions.
 Once the first layer is debugged, its correct functioning can be assumed while the second
layer is debugged, and so on.
 If an error is found during the debugging of a particular layer, the error must be on that
layer, because the layers below it are already debugged.
 Thus, the design and implementation of the system are simplified.
10 Continued…
Disadvantage
 The major difficulty with the layered approach involves appropriately defining the
various layers.
 Layered implementation is that they tend to be less efficient than other types.
Example
 When a user program executes an I/O operation, it executes a system call that is trapped to
the I/O layer, which calls the memory-management layer, which in turn calls the CPU-
scheduling layer, which is then passed to the hardware.
 At each layer, the parameters may be modified, data may need to be passed, and so on.
 Each layer adds overhead to the system call.
 The net result is a system call that takes longer than does one on a nonlayered system.
11 Microkernels
 As UNIX expanded, the kernel became large and difficult to manage
 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 system and user-level programs.
 The result is a smaller kernel.
 There is little consensus regarding which services should remain in the kernel and which
should be implemented in user space.
12 Continued…
 Tru64 UNIX (formerly Digital UNIX) provides a UNIX interface to the user, but it is
implemented with a Mach kernel.
 The Mach kernel maps UNIX system calls into messages to the appropriate user-level
services.
 The Mac OS X kernel (also known as Darwin) is also partly based on the Mach micro
kernel.
13 Continued…
14 Benefits of Microkernels
 One benefit of the microkernel approach is that it makes extending the operating system
easier.
 All new services are added to user space and consequently do not require modification of
the kernel.
 When the kernel does have to be modified, the changes tend to be fewer, because the
microkernel is a smaller kernel.
 The resulting operating system is easier to port from one hardware design to another.
 The microkernel also provides more security and reliability, since most services are
running as user—rather than kernel— processes.
 If a service fails, the rest of the operating system remains untouched.
15 Modules
 Perhaps the best current methodology for operating-system design involves using
loadable kernel modules.
 Here, the kernel has a set of core components and links 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 Solaris,
Linux, and Mac OS X, as well as Windows.
 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.
 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.
 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.
16 Continued…
17 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, both Linux and Solaris are monolithic, because having the operating system
in a single address space provides very efficient performance.
 However, they are also modular, so that new functionality can be dynamically added to
the kernel.
 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.
18 a. Mac OS X
 Unix operating system developed by apple.
 Designed for mac apple computers
 The Apple Mac OS X operating system uses a hybrid structure.
19 Continued…
 It is a layered system.
 The top layers include the Aqua user interface and a set of application environments and
services.
 Notably, the Cocoa environment specifies an API (Application Programming Interface) for
the Objective-C programming language, which is used for writing Mac OS X applications.
 Below these layers is the kernel environment, which consists primarily of the Mach
microkernel and the BSD UNIX kernel.
20 b. iOs (Iphone Operating Systems)
 iOS is a mobile operating system designed by Apple to run its smartphone, the iPhone, as
well as its tablet computer, the iPad.
 iOS is structured on the Mac OS X operating system, with added functionality pertinent to
mobile devices, but does not directly run Mac OS X applications.
21 Continued…
 Cocoa Touch is an API for Objective-C that provides several frameworks for developing
applications that run on iOS devices.
 The fundamental difference between Cocoa, mentioned earlier, and Cocoa Touch is that
the latter provides support for hardware features unique to mobile devices, such as touch
screens.
 The media services layer provides services for graphics, audio, and video.
 The core services layer provides a variety of features, including support for cloud
computing and databases.
 The bottom layer represents the core operating system, which is based on the kernel
environment
22 c. Android
 The Android operating system was designed by the Open Handset Alliance (led primarily
by Google) and was developed for Android smartphones and tablet computers.
 Whereas iOS is designed to run on Apple mobile devices and is close-sourced,
 Android runs on a variety of mobile platforms and is open-sourced, partly explaining its
rapid rise in popularity.
23 Continued…
24 Continued…
 Android is similar to iOS in that it is a layered stack of software that provides a rich set of
frameworks for developing mobile applications.
 At the bottom of this software stack is the Linux kernel, although it has been modified by
Google and is currently outside the normal distribution of Linux releases.
 The Android runtime environment includes a core set of libraries as well as the Dalvik
virtual machine.
 Software designers for Android devices develop applications in the Java language.
 The Dalvik virtual machine was designed for Android and is optimized for mobile devices
with limited memory and CPU processing capabilities.
25 Continued…
 The set of libraries available for Android applications includes frameworks for developing
web browsers (webkit), database support (SQLite), and multimedia.
 The libc library is similar to the standard C library but is much smaller and has been
designed for the slower CPUs that characterize mobile devices.

You might also like