System Structures
System Structures
eTc
ACRONYMS USED
OS – OPERATING SYSTEM(S)
HW – HARDWARE
SYSGEN – SYSTEM GENERATION
eTc
2 Operating system structures
eTc
Program Execution: The OS must be able to load a program into RAM, run the
program and terminate the program, either normally or abnormally.
I/O Operation: Each program requires an input and produces output. This
involves the use of I/O. So the operating systems are providing I/O makes it
convenient for the users to run programs.
File System Manipulation: In addition to raw data storage, the OS is
responsible for maintaining directory and sub directory structures, mapping
filenames and providing tools to navigate and utilize the file system.
Communications: Inter-Process Communication, IPC, between all applications
running in a machine at the moment.
Error Detection: Both hardware and software errors must be detected and
handled appropriately. It is for this reason that some systems have Complex
error avoidance or recovery systems.
Resource allocation: When multiple users are logged on the system or multiple
jobs are running at the same time, resources must be allocated to each of them.
Many different types of resources are managed by the operating system.
Accounting: The operating systems keep track of which users use how many and
which kinds of computer resources. This record keeping may be used for
accounting (so that users can be billed) or simply for accumulating usage statistic
Protection and Security: When several disjointed processes execute
concurrently, it should not be possible for one process to interfere with the others,
or with the operating system itself. Protection involves ensuring that all access to
system resources is controlled. Security of the system from outsiders is also
important. Such security starts with each user having to authenticate him to the
system, usually by means of a password, to be allowed access to the resources.
eTc
2.2 User Operating System Interfaces
eTc
2.2.2 Graphical User Interface (GUI):
The Windows, Interfaces, Menus, and Pointing device (WIMP) GUI
Commonly referred to as “Desktop” in the PC world, and “Home” in the mobile
device world comes with file folders, trash cans, application and resource icons.
*An Icon is a representation of a some item on the system and different icons
respond differently when activated/interfaced.*
The very first GUI was developed in the early 1970’s at Xerox PARC which was
later followed by the Quantel Paintbox by an imaging company Quantel, GEM,
Apple Lisa, and Windows 1.0 which was released in 1985.
In some systems GUI is just a front end for activating the traditional CLI for example
Ubuntu, and many Debian based OSes while in others the GUI is a true graphical shell
on its own, for example in Microsoft Windows, Android OS among others
eTc
2.3 System Calls
System calls provide an interface between the User or application Programs and
the Operating system, system calls are generally written in C or C++, although
some are written in assembly for optimal performance.
System calls allow user-level processes to request some services from the
operating system which process itself is not allowed to do. For example, for I/O
a process involves a system call telling the operating system to read or write
particular area and this request is satisfied by the operating system.
eTc
Communications:
• create, delete communication • transfer status information
connections
• attach or detach remote device
• send, receive messages
Protection ad Security:
• get security attributes • initialize security descriptors
• set security attributes
Protection provides mechanisms for controlling which users / processes have
access to which system resources. System calls allow the access mechanisms
to be adjusted as needed, and for non-privileged users to be granted elevated
access permissions under carefully controlled temporary circumstances. Once
only of concern on multi-user systems, protection is now important on all
systems, in the age of ubiquitous network connectivity.
eTc
➔ File Modification: Text editors and other tools which can change file content
➔ Programming language support: Compilers, linkers, debuggers,
profilers, assemblers, library archive management, interpreters for
common languages and support for make
➔ Program loading and Execution: Loaders , dynamic loaders, overlay
loaders, etc as well as interactive debuggers.
➔ Communications: Programs for providing connectivity between
processes and users, including mail, web browsers, remote logins, file
transfers and remote command execution.
➔ Background Services: System daemons that are commonly started
when a system is booted, and run as long as the system is running,
handling necessary services. For example network daemons, print
servers, process schedulers, and system error monitoring services.
Most operating systems today also come complete with a set of application
programs to provide additional services, such as copying files or checking the time
and date. Most users' views of the system is determined by their command
interpreter and the application programs. Most never make system calls, even
through the API, ( with the exception of simple ( file ) I/O in user-written programs.)
eTc
2.5 Operating System Design and
Implementation.
Operating systems are design and Implementation entails the step taken while
designing an operating System. In collaboration with all the good habits in
regards to system Design and implementation, Designing Operating systems
Focus with more on the Following Aspects;
eTc
2.5.2 Mechanisms and Policies
Policies determine what is to be done. Mechanisms determine how it is to be
implemented. If properly separated and implemented, policy changes can be
easily adjusted without re-writing the code, just by adjusting parameters or
possibly loading new data / configuration files. For example the relative priority
of background versus foreground tasks.
2.5.3 Implementation
Traditionally OSes were written in assembly language. This provided direct control
over hardware-related issues, but inextricably tied a particular OS to a particular HW
platform. Recent advances in compiler efficiencies mean that most modern OSes are
written in C, or more recently, C++. Critical sections of code are still written in
assembly language, ( or written in C, compiled to assembly, and then fine-tuned and
optimized by hand from there). Operating systems may be developed using emulators
of the target hardware, particularly if the real hardware is unavailable for instance if the
HW is not built yet , or not a suitable platform for development, such as smartphones,
game consoles, or other similar devices. That may brick after multiple test runs.
eTc
2.6 Operating System Structures
The operating system can be implemented with the help of various structures. The
structure of the OS depends mainly on how the various standard components of
the operating system are interconnected and melded into the kernel.
A design known as an operating system enables user application programs to
communicate with the machine’s hardware. Given its complex design and need to be
easy to use and modify, the operating system should be constructed with the utmost
care. A straightforward way to do this is to supernaturally develop the operating
system. These parts must each have unique inputs, outputs, and functionalities.
Examples of Structures used to implement Operating systems include:
• Simple/Monolithic Structure
• Micro-Kernel Structure
• Hybrid-Kernel Structure
• Exo-Kernel Structure
• Layered Structure
• Modular Structure
• Virtual Machines
eTc
ILLUSTRATION OF MS-DOS layer Structure
eTc
the first and most widely known micro-kernel, and now forms a major
component of Mac OS.
Illustration of a typical Micro-kernel
eTc
more flexible than a layered structure as a module can call any other module.
For example Solaris OS is organized as shown in the figure.
eTc
2.6.4 Layered Approach
An OS can be broken into pieces and retain much more control over the system. In this
structure, the OS is broken into a number of layers (levels). The bottom layer (layer 0) is
the hardware, and the topmost layer (layer N) is the user interface. These layers are so
designed that each layer uses the functions of the lower-level layers. This simplifies the
debugging process, if lower-level layers are debugged and an error occurs during
debugging, then the error must be on that layer only, as the lower-level layers have
already been debugged. This approach allows each layer to be developed and debugged
independently, with the assumption that all lower layers have already been debugged and
are trusted to deliver proper services. The problem is deciding what order in which to
place the layers, as no layer can call upon the services of any higher layer, and so many
chicken-and-egg situations may arise.
The main disadvantage of this structure is that at each layer, the data needs to
be modified and passed on which adds overhead to the system. Moreover,
careful planning of the layers is necessary, as a layer can use only lower-level
layers. UNIX is an example of this structure.
eTc
2.6.5 Exo-Kernel Structure
Exo-Kernel is an operating system developed at MIT to provide application-level
management of hardware resources. By separating resource management from
protection, the exokernel architecture aims to enable application-specific customization.
Due to its limited interoperability, exokernel size typically tends to be minimal.
The OS will always have an impact on the functionality, performance, and scope of
the apps that are developed on it because it sits in between the software and the
hardware. The exokernel operating system makes an attempt to address this
problem by rejecting the notion that an operating system must provide abstractions
upon which to base applications. The objective is to limit developers use of
abstractions as little as possible while still giving them freedom.
Advantages of Exo-kernel
Support for improved application control.
Separates management from security.
It improves the performance of the application.
A more efficient use of hardware resources is made possible by accurate
resource allocation and revocation.
It is simpler to test and create new operating systems.
Each user-space program is allowed to use a custom memory management system.
Disadvantages of Exo-kernel
A decline in consistency
Exokernel interfaces have a complex architecture.
eTc
Advantages of Hybrid-Kernel Structure
It offers good performance as it implements the advantages of both structure in it.
It supports a wide range of hardware and applications.
It provides better isolation and security by implementing micro-kernel approach.
It enhances overall system reliability by separating critical functions into micro-
kernel for debugging and maintenance.
Disadvantages of Hybrid-Kernel Structure
It increases overall complexity of system by implementing both structure
(monolithic and micro) and making the system difficult to understand. The layer
of communication between micro-kernel and other component increases time
complexity and decreases performance compared to monolithic kernel
eTc
Illustration of a non virtual machines besides a virtual machine implementation
eTc
2.7 System Generation
Operating systems are designed to run on any of a class of machines at a variety of
sites with a variety of peripheral configurations. The system must then be configured
or generated for each specific computer site, a process sometimes known as system
generation (SYSGEN). SYSGEN program obtains information concerning the specific
configuration of the hardware system. To generate a system, we use a special
program. The SYSGEN program reads from a given file, or asks the operator of the
system for information concerning the specific configuration of the hardware system,
or probes the hardware directly to determine what components are there.
The following kinds of information must be determined, What CPU will be used?
What options (extended instruction sets, floating point arithmetic, and so on) are
installed? For multiple-CPU systems, each CPU must be described. How much
memory is available? Some systems will determine this value themselves by
referencing memory location after memory location until an "illegal address" fault
is generated. This procedure defines the final legal address and hence the
amount of available memory. What devices are available? The system will need
to know how to address each device (the device number), the device interrupt
number, the device's type and model, and any special device characteristics.
At one extreme the OS source code can be edited, re-compiled, and linked into a
new kernel. More commonly configuration tables determine which modules to link
into the new kernel, and what values to set for some key important parameters.
This approach may require the configuration of complicated makefiles, which can
be done either automatically or through interactive configuration programs; Then
make is used to actually generate the new kernel specified by the new parameters.
At the other extreme a system configuration may be entirely defined by table
data, in which case the "rebuilding" of the system merely requires editing data
tables. Once a system has been regenerated, it is usually required to reboot the
system to activate the new kernel. Because there are possibilities for errors,
most systems provide some mechanism for booting to older or alternate kernels.
eTc
2.8 System Boot
The procedure of starting a computer by loading the kernel is known as booting the
system. Most computer systems have a small piece of code, stored in ROM, known
as the bootstrap program or bootstrap loader. This code is able to locate the
kernel, load it into main memory, and start its execution. Some computer systems,
such as PCs, use a two-step process in which a simple bootstrap loader fetches a
more complex boot program from disk, which in turn loads the kernel.
2. The ROM bootstrap program first runs hardware checks, determining what physical
resources are present and doing power-on self tests (POST) of all HW for which
this is applicable. Some devices, such as controller cards may have their own on-
board diagnostics, which are called by the ROM bootstrap program.
3. The user generally has the option of pressing a special key during the
POST process, which will launch the ROM BIOS configuration utility if
pressed. This utility allows the user to specify and configure certain
hardware parameters as where to look for an OS and whether or not to
restrict access to the utility with a password.
• Some hardware may also provide access to additional configuration
setup programs, such as for a RAID disk controller or some special
graphics or networking cards.
4. Assuming the utility has not been invoked, the bootstrap program then looks for a
non-volatile storage device containing an OS. Depending on configuration, it may
eTc
look for a floppy drive, CD ROM drive, or primary or secondary hard
drives, in the order specified by the HW configuration utility.
5. Assuming it goes to a hard drive, it will find the first sector on the hard drive and
load up the fdisk table, which contains information about how the physical hard
drive is divided up into logical partitions, where each partition starts and ends,
and which partition is the "active" partition used for booting the system.
There is also a very small amount of system code in the portion of the first disk
block not occupied by the fdisk table. This bootstrap code is the first step that is
not built into the hardware, i.e. the first part which might be in any way OS-
specific. Generally this code knows just enough to access the hard drive, and to
load and execute a ( slightly ) larger boot program.
✗ For a single-boot system, the boot program loaded off of the hard disk will
then proceed to locate the kernel on the hard drive, load the kernel into
memory, and then transfer control over to the kernel. There may be some
opportunity to specify a particular kernel to be loaded at this stage, which
may be useful if a new kernel has just been generated and doesn't work, or if
the system has multiple kernels available with different configurations for
different purposes. ( Some systems may boot different configurations
automatically, depending on what hardware has been found in earlier steps.)
✗ For dual-boot or multiple-boot systems, the boot program will give the
user an opportunity to specify a particular OS to load, with a default choice
if the user does not pick a particular OS within a given time frame. The
boot program then finds the boot loader for the chosen single-boot OS,
and runs that program as described in the previous point.
eTc
Refercences
Abraham Silberschatz, Greg Gagne, and Peter Baer Galvin, "Operating
eTc