Kernel and its categories
computer start up
Architecture of Operating system(Monolithic ,Layered,Micro kernel,Network and distributed O.S)
Interrupt and its function
System calls
System boot
O.S services(for system, for user)
2. Kernel
The kernel is a computer program that is the core of a computer's
operating system, with complete control over everything in the
system. The kernel facilitates interactions between hardware and
software components. On most systems, it is one of the first programs
loaded on start-up (after the bootloader). It handles the rest of start-
up as well as input/output requests from software, translating them
into data-processing instructions for the central processing unit. It
handles memory and peripherals like keyboards, monitors, printers,
and speakers.
The critical code of the kernel is usually loaded into a separate area of
memory, which is protected from access by application programs or
other, less critical parts of the operating system. The kernel performs
its tasks, such as running processes, managing hardware devices such
as the hard disk, and handling interrupts, in this protected kernel
space. In contrast, application programs like browsers, word
processors, or audio or video players use a separate area of memory,
user space. This separation prevents user data and kernel data from
interfering with each other and causing instability and slowness, as
well as preventing malfunctioning application programs from crashing
the entire operating system.
3. The kernel's interface is a low-level abstraction layer.
When a process makes requests of the kernel, it is
called a system call. Kernel designs differ in how they
manage these system calls and resources. A
monolithic kernel runs all the operating system
instructions in the same address space for speed. A
microkernel runs most processes in user space, for
modularity.
This central component of a computer system is
responsible for running or executing programs. The
kernel takes responsibility for deciding at any time
which of the many running programs should be
allocated to the processor or processors.
4. Four broad categories of kernels:
Monolithic kernels provide rich and powerful
abstractions of the underlying hardware.
Microkernels provide a small set of simple hardware
abstractions and use applications called servers to
provide more functionality.
Exokernels provide minimal abstractions, allowing low-
level hardware access. In exokernel systems, library
operating systems provide the abstractions typically
present in monolithic kernels.
Hybrid (modified microkernels) are much like pure
microkernels, except that they include some additional
code in kernel space to increase performance.
5. Random-access memory (RAM)
Random-access memory is used to store both program
instructions and data. Typically, both need to be present in
memory in order for a program to execute. Often multiple
programs will want access to memory, frequently
demanding more memory than the computer has
available. The kernel is responsible for deciding which
memory each process can use, and determining what to do
when not enough memory is available.
Input/output (I/O) devices
I/O devices include such peripherals as keyboards, mice,
disk drives, printers, USB devices, network adapters, and
display devices. The kernel allocates requests from
applications to perform I/O to an appropriate device and
provides convenient methods for using the device
7. Computer Startup
• Bootstrap program is loaded at power-up or reboot
• Typically stored in ROM or EPROM,
• Initializes all aspects of the system
• Locate and Load operating system kernel and
starts execution
• Kernel runs and make the system ready for running
applications
• Kernel is always ready to run (always in
memory)
8. Architecture of Operating System
• Monolithic Operating System
• Layered Operating System
• Microkernel Operating system
• Networked and Distributed Operating System
9. Monolithic OS
A monolithic OS is an operating system architecture
where the entire operating system is working in
kernel space and is alone in supervisor mode. The
kernel has unrestricted access to all of the resources
on the system. In monolithic systems, each
component of the operating system could
communicate directly with any other component,
and had unrestricted system access. While this made
the operating system very efficient, it also meant
that errors were more difficult to isolate, and there
was a high risk of damage due to erroneous or
malicious code.
11. Layered OS
As operating systems became larger and more complex, this
approach was largely abandoned in favor of a modular approach
which grouped components with similar functionality into layers to
help operating system designers to manage the complexity of the
system. In this kind of architecture, each layer communicates only
with the layers immediately above and below it, and lower-level
layers provide services to higher-level ones using an interface that
hides their implementation.
The modularity of layered operating systems allows the
implementation of each layer to be modified without requiring any
modification to adjacent layers. Although this modular approach
imposes structure and consistency on the operating system,
simplifying debugging and modification, a service request from a
user process may pass through many layers of system software
before it is serviced and performance compares unfavorably to
that of a monolithic kernel. Also, because all layers still have
unrestricted access to the system, the kernel is still susceptible to
errant or malicious code. Many of today’s operating systems,
including Microsoft Windows and Linux, implement some level of
layering.
13. Microkernel
A microkernel architecture includes only a very small
number of services within the kernel in an attempt to keep
it small and scalable. The services typically include low-
level memory management, inter-process communication
and basic process synchronization to enable processes to
cooperate. In microkernel designs, most operating system
components, such as process management and device
management, execute outside the kernel with a lower level
of system access.
Microkernels are highly modular, making them extensible,
portable and scalable. Operating system components
outside the kernel can fail without causing the operating
system to fall over. Once again, the downside is an
increased level of inter-module communication which can
degrade system performance.
15. Network Operating System
A network operating system enables its processes to
access resources (e.g., files) that reside on other
independent computers on a network.
The structure of many networked and distributed
operating systems is often based on the client/server
model.
The client computers in such a network request
resources—such as files and processor time—via the
appropriate network protocol. The servers respond with
the appropriate resources.
A distributed operating system is a single operating system
that manages resources on more than one computer
system.
16. Interrupt
In digital computers, an interrupt is an input signal to the
processor indicating an event that needs immediate attention.
An interrupt signal alerts the processor and serves as a request
for the processor to interrupt the currently executing code, so
that the event can be processed in a timely manner. If the
request is accepted, the processor responds by suspending its
current activities, saving its state, and executing a function
called an interrupt handler (or an interrupt service routine, ISR)
to deal with the event. This interruption is temporary, and,
unless the interrupt indicates a fatal error, the processor
resumes normal activities after the interrupt handler finishes.
Interrupts are commonly used by hardware devices to indicate
electronic or physical state changes that require attention.
Interrupts are also commonly used to implement computer
multitasking, especially in real-time computing. Systems that
use interrupts in these ways are said to be interrupt-driven
17.
18. Common Functions of
Interrupts
• Interrupt transfers control to the interrupt service
routine generally, through the interrupt vector, which
contains the addresses of all the service routines.
• Interrupt architecture must save the address of the
interrupted instruction.
• Incoming interrupts are disabled while another
interrupt is being processed to prevent a lost interrupt.
• A trap is a software-generated interrupt caused either
by an error or a user request.
• An operating system is interrupt driven.
19. Interrupt-Driven OS
Kernel Code
Devices
Applications or System Programs running in CPU
hardware interrupt
software interrupt / trap
(due to system service requests or errors)
disk, keyboard, timer, network adapter…
20. Interrupt Handling
• The operating system preserves the state of the
CPU by storing registers and the program counter.
• Determines which type of interrupt has occurred:
• polling
• vectored interrupt system
• Separate segments of code determine what action
should be taken for each type of interrupt
21. System Boot
Bootstrap program (loader) locates the kernel, loads it and
starts the kernel. Boot program loads the kernel
Then control is given to kernel.
Kernel starts the environment and makes the computer ready
to interact with the user (via a GUI or command shell).
Details depend on the system
22. Operating System Services
• For user
• Providing a nice and convenient
environment for user applications.
• User Interface
• Visible to users
• Program execution
• I/O operations
• File-system manipulation
• Communication
• Error detection and handling
• For System:
• Resource allocation and
Management
• Accounting
• Protection and security
• Not much visible to users
There are two major tasks of an operating system.
24. [User - Operating System] Interface - CLI
• CLI: Command Line Interface (CLI) or
command interpreter (shell)
• Part of a kernel or as a system
program,
• Fetches a command from user and
executes it
• GUI: User-friendly desktop interface
• Icons represent files, programs,
actions, etc.
25. System Calls
Programming interface to the services provided by the
OS
i.e., interface provided to applications
Printf, Scanf, Cin, Cout are library routines call some system calls
of an I/O operation
Typically written in a high-level language (C or C++)
Are called by a running program to get services.
Mostly accessed by programs via high level Application
Program Interface (API) rather than direct system call
use.
Even a simple program may make a lot of calls per
second.
26. Example of System Calls
• System call sequence to copy the contents of one file to
another file