Structure and Design of Operating Systems
Structure and Design of Operating Systems
DESIGN OF
OPERATING SYSTEMS
Ass.Lecturer: Ezekiel Ogakhan Nyamu
United African University of Tanzania
[email protected]
•An operating system serves as the environment in which programs
run. Internally, operating systems differ significantly in structure and
organization, as they can be designed in various ways. Developing a
new operating system is a substantial project, requiring that the system's
goals be clearly defined before design work begins. These goals guide
the selection of algorithms and strategies used within the system.
•There are multiple ways to examine an operating system. One
perspective emphasizes the services it offers; another focuses on the
user and programmer interface; and a third considers its
components and how they interact. In this lectuer, we explore these
aspects to provide insights from the perspectives of users,
programmers, and OS designers. We look at the services an OS offers,
the methods used to deliver these services, debugging processes, and the
design methodologies employed.
1. OPERATING SYSTEM SERVICES
The operating system, in various forms, delivers specific services to the
computer system. One group of these services offers functions that are
beneficial to the user.
User Interface
Program Execution
I/O Operations
File System Manipulation
Communications
Error Detection
Resource Allocation
Accounting
Protection and Security
User Interface
Almost all operating systems have a user interface (UI). Two types
of User Interface are Command Based Interface and Graphical User
Interface
Command Based Interface
Requires a user to enter the commands to perform different tasks like
creating, opening, editing or deleting a file, etc. The user has to
remember the names of all such programs or specific commands
which the operating system supports. The primary input device used
by the user for command based interface is the keyboard. Command-
based interface is often less interactive and usually allows a user to
run a single program at a time. Examples of operating systems with
command-based interfaces include MS-DOS and Unix.
Graphical User Interface (GUI)
The interface is a window system with a mouse that serves as a pointing device to direct
I/O, choose from menus, and make selections and a keyboard to enter text. Mobile
systems such as phones and tablets provide a touch-screen interface, enabling users to
slide their fingers across the screen or press buttons on the screen to select choices.
Program Execution:
The OS is in charge of running all types of programs,
whether they are user or system programs. The
operating system makes use of a variety of resources to
ensure that all types of functions perform smoothly.
Input/Output Operations:
The operating system is in charge of handling various
types of inputs, such as those from the keyboard, mouse,
and desktop. Regarding all types of inputs and
outputs, the operating system handles all interfaces in
the most appropriate manner
For instance, the nature of all types of peripheral devices, such as mice or keyboards,
differs, and the operating system is responsible for transferring data between them.
File System Manipulation:
The OS is in charge of deciding where data or files should be stored, such as on
a floppy disk, hard disk, or pen drive. The operating system determines how data
should be stored and handled.
Communications :
There are many circumstances in which one process needs to exchange
information with another process. Such communication may occur between
processes that are executing on the same computer or between processes that
are executing on different computer systems tied together by a network.
Communications may be implemented via shared memory, in which two or more
processes read and write to a shared section of memory, or message passing, in
which packets of information in predefined formats are moved between processes
by the operating system.
Error Detection:
The operating system needs to be detecting and correcting errors
constantly. Errors may occur in the CPU and memory hardware (such as a
memory error or a power failure), in I/O devices (such as a parity error on
disk, a connection failure on a network, or lack of paper in the printer), and in
the user program (such as an arithmetic overflow or an attempt to access an
illegal memory location). For each type of error, the operating system
should take the appropriate action to ensure correct and consistent
computing. Sometimes, it has no choice but to halt the system. At other
times, it might terminate an error-causing process or return an error code to a
process for the process to detect and possibly correct.
Resource Allocation:
The operating system guarantees that all available resources are properly
utilized by determining which resource should be used by whom and for
how long. The operating system makes all of the choices
Accounting:
The operating system keeps track of all the functions
that are active in the computer system at any one time.
The operating system keeps track of all the facts, including
the types of mistakes that happened.
Protection and Security :
The operating system is in charge of making the most
secure use of all the data and resources available
on the machine. Any attempt by an external resource to
obstruct data or information must be foiled by the
operating system.
2. USER AND OPERATING SYSTEM INTERFACE
•
Kernel
The kernel is the core, fundamental part of an operating system that directly manages the
hardware and system resources. It is responsible for ensuring that applications and services
can access system resources, such as the CPU, memory, and I/O devices, safely and
efficiently. The kernel operates in a highly privileged mode, often called kernel mode, with
full access to all system resources
Core Activities of the Kernel
1. Process Management: Manages process creation, scheduling, and termination;
handles multitasking and inter-process communication.
2. Memory Management: Allocates memory to processes, manages virtual memory, and
ensures isolation between processes.
3. Device Management: Manages input/output devices through drivers, handles data
transfer, and prioritizes device access.
4. File System Management: Manages file operations (read, write, create, delete) and
controls file access and permissions.
5. Security and Protection: Enforces access controls, user authentication, and process
isolation to ensure security.
6. Error Detection and Handling: Monitors and handles system errors, ensuring stability
and performance.
•
•
Step 1) The processes executed in the user mode till the time a system call
interrupts it.
Step 2) After that, the system call is executed in the kernel-mode on a priority basis.
Step 3) Once system call execution is over, control returns to the user mode.,
Step 4) The execution of user processes resumed in Kernel mode
.software components that provide basic functions and services to both users and applications. These
programs act as intermediaries between the user or application software and the hardware by providing
essential functionalities to operate and manage the system effectively. Special software which give us
facility to manage and control the computer’s hardware and resources
The best approach for an OS. It involves designing of a modular kernel. The kernel
has only set of core components and other services are added as dynamically loadable
modules to the kernel either during run time or boot time. It resembles layered
structure due to the fact that each kernel has defined and protected interfaces but it is
more flexible than the layered structure as a module can call any other module. For
example Solaris OS
Solaris modular approach
Hybrid system