0% found this document useful (0 votes)
3 views36 pages

Module 1.2

The document provides an overview of system calls and the structure of operating systems, detailing how system calls allow programs to request services from the OS kernel. It describes various types of system calls, the functions of the kernel, and different kernel architectures such as monolithic, microkernel, hybrid, and nano kernels. Additionally, it covers the concept of virtual machines and their advantages and disadvantages in managing hardware resources.

Uploaded by

habeeb512g3
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)
3 views36 pages

Module 1.2

The document provides an overview of system calls and the structure of operating systems, detailing how system calls allow programs to request services from the OS kernel. It describes various types of system calls, the functions of the kernel, and different kernel architectures such as monolithic, microkernel, hybrid, and nano kernels. Additionally, it covers the concept of virtual machines and their advantages and disadvantages in managing hardware resources.

Uploaded by

habeeb512g3
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

Module 1

System Calls,
Structure of OS
System Call
• In computing, a system call is the programmatic way in which a
computer program requests a service from the kernel of the
operating system it is executed on. A system call is a way for
programs to interact with the operating system.
• A computer program makes a system call when it makes a
request to the operating system’s kernel. System
call provides the services of the operating system to the user
programs via Application Program Interface(API).
System Call
• It provides an interface between a process and operating
system to allow user-level processes to request services of the
operating system.
• System calls are the only entry points into the kernel system.
• All programs needing resources must use system calls.
Services Provided by System Calls
[Link] creation and management
[Link] memory management
[Link] Access, Directory and File system management
[Link] handling(I/O)
[Link]
[Link]
Types of System Calls
[Link] control: end, abort, create, terminate, allocate and
free memory.
[Link] management: create, open, close, delete, read file etc.
[Link] management
[Link] maintenance
[Link]
Process control
• end, abort
• load, execute
• create process, terminate process
• get process attributes, set process attributes
• wait for time
• wait event, signal event
• allocate and free memory
File management Information maintenance
• create file, delete file • get time or date, set time or date
• open, close • get system data, set system data
• read, write, reposition • get process, file, or device
• get file attributes, set file attributes attributes
Device management • set process, file, or device
attributes
• request device, release device
Communications
• read, write, reposition
• create, delete communication
• get device attributes, set device connection
attributes
• send, receive messages
• logically attach or detach devices
• transfer status information
• attach or detach remote devices
Examples of Windows and Unix System
Calls Windows Unix
CreateProcess() fork()
Process Control ExitProcess() exit()
WaitForSingleObject() wait()

CreateFile() open()
ReadFile() read()
File Manipulation
WriteFile() write()
CloseHandle() close()

SetConsoleMode() ioctl()
Device Manipulation ReadConsole() read()
WriteConsole() write()

GetCurrentProcessID() getpid()
Information Maintenance SetTimer() alarm()
Sleep() sleep()

CreatePipe() pipe()
Communication CreateFileMapping() shmget()
MapViewOfFile() mmap()

SetFileSecurity() chmod()
Protection InitlializeSecurityDescriptor() umask()
SetSecurityDescriptorGroup() chown()
System Structure
• An OS Contains a kernel, command processor or shell & graphical user
interface.
• Kernel
• Shell
• Command Processor
• Graphical User Interface
Kernel
• Kernel is central component of an operating system that
manages operations of computer and hardware. It basically
manages operations of memory and CPU time. It is core
component of an operating system. Kernel acts as a bridge
between applications and data processing performed at
hardware level using inter-process communication and system
calls.
• Kernel loads first into memory when an operating system is
loaded and remains into memory until operating system is shut
down again. It is responsible for various tasks such as disk
management, task management, and memory management.
Kernel
• It decides which process should be allocated to processor to
execute and which process should be kept in main memory to
execute. It basically acts as an interface between user
applications and hardware. The major aim of kernel is to
manage communication between software i.e. user-level
applications and hardware i.e., CPU and disk memory.
Objectives of Kernel
• To establish communication between user level application and
hardware.
• To decide state of incoming processes.
• To control disk management.
• To control memory management.
• To control task management.
Monolithic Kernel
• It is one of types of kernel where all operating system services
operate in kernel space. It has dependencies between systems
components. It has huge lines of code which is complex.
Example :
• Unix, Linux, Open Vms, XTS-400
• Advantage :
It has good performance.
• Disadvantage :
It has dependencies between system component and lines of
code in millions.
Micro Kernel
• It is kernel types which has minimalist approach. It has virtual
memory and thread scheduling. It is more stable with less
services in kernel space. It puts rest in user space.
Example :
• Mach, L4, AmigaOS, Minix, K42 etc
• Advantage :
It is more stable.
• Disadvantage :
There are lots of system calls and context switches.
Hybrid Kernel
• It is the combination of both monolithic kernel and mircrokernel.
It has speed and design of monolithic kernel and modularity and
stability of microkernel.
Example :
• Window NT, Netware, BeOS
• Advantage :
It combines both monolithic kernel and microkernel.
• Disadvantage :
It is still similar to monolithic kernel.
Exo Kernel
• It is the type of kernel which follows end-to-end principle. It has
fewest hardware abstractions as possible. It allocates physical
resources to applications.
• Eg: Nemesis, ExOS etc
• Advantage :
It has fewest hardware abstractions.
• Disadvantage :
There is more work for application developers.
Nano Kernel
• It is the type of kernel that offers hardware abstraction but
without system services. Micro Kernel also does not have
system services therefore the Micro Kernel and Nano Kernel
have become analogous.
• Advantage :
It offers hardware abstractions without system services.
• Disadvantage :
It is quite same as Micro kernel hence it is less used.
Shell
• A Shell provides you with an interface to the Unix system. It
gathers input from you and executes programs based on that
input. When a program finishes executing, it displays that
program's output.
• Shell is an environment in which we can run our commands,
programs, and shell scripts. There are different flavors of a
shell, just as there are different flavors of operating systems.
Each flavor of shell has its own set of recognized commands
and functions.
Shell Prompt
• The prompt, $, which is called the command prompt, is issued
by the shell. While the prompt is displayed, you can type a
command.
• Shell reads your input after you press Enter. It determines the
command you want executed by looking at the first word of your
input. A word is an unbroken set of characters. Spaces and tabs
separate words.
Shell Types
• In Unix, there are two major types of shells −
• Bourne shell − If you are using a Bourne-type shell, the $ character is the default
prompt.
• C shell − If you are using a C-type shell, the % character is the default prompt.
• The Bourne Shell has the following subcategories −
• Bourne shell (sh)
• Korn shell (ksh)
• Bourne Again shell (bash)
• POSIX shell (sh)
• The different C-type shells follow −
• C shell (csh)
• TENEX/TOPS C shell (tcsh)
Operating System Architectures
• Today’s operating systems tend to be complex
• Provide many services
• Support variety of hardware and software
• Operating system architectures help manage this complexity
• Organize operating system components
• Specify privilege with which each component executes
Monolithic Architecture
• Monolithic operating system
• Every component contained in kernel
• Any component can directly communicate with any other
• Tend to be highly efficient
• Disadvantage is difficulty determining source of subtle errors
Monolithic Architecture
Monolithic Architecture
• Unorganized Modules
• Single Layer between Kernel & User
• No Information Hiding Concept
• Less Portable
Limitations:
• Difficult modify
• Failure of Single program crashes the whole system.
• Modules are not organized.
• Eg: MS DOS & Novell
Layered Architecture
Layered Architecture
• Layered approach to operating systems
• Tries to improve on monolithic kernel designs
• Groups components that perform similar functions into layers
• Each layer communicates only with layers immediately above and below it
• Processes’ requests might pass through many layers before completion
• System throughput can be less than monolithic kernels
• Additional methods must be invoked to pass data and control
Layered Architecture
• Well organized in layers
• Each Layer has clearly defined functionality.
• Layer can access only above & Below layer
• Modularity
• Information Hiding Implemented
Limitations:
• Processing Time high
• Less Efficient
• Designing will be difficult
• Eg: Unix & VAX/VMS
Microkernel Architecture
• Microkernel operating system architecture
• Provides only small number of services
• Attempt to keep kernel small and scalable
• High degree of modularity
• Extensible, portable and scalable
• Increased level of intermodule communication
• Can degrade system performance
Microkernel Architecture
Networked and Distributed Operating Systems

• Network operating system


• Runs on one computer
• Allows its processes to access resources on remote computers
• Distributed operating system
• Single operating system
• Manages resources on more than one computer system
• Goals include:
• Transparent performance
• Scalability
• Fault tolerance
• Consistency
Networked and Distributed Operating Systems
Virtual Machines in Operating System
• Virtual Machine abstracts the hardware of our personal computer
such as CPU, disk drives, memory, NIC (Network Interface Card)
etc, into many different execution environments as per our
requirements, hence giving us a feel that each execution
environment is a single computer. For example, VirtualBox.
• When we run different processes on an operating system, it creates
an illusion that each process is running on a different processor
having its own virtual memory, with the help of CPU scheduling and
virtual-memory techniques. There are additional features of a
process that cannot be provided by the hardware alone like system
calls and a file system. The virtual machine approach does not
provide these additional functionalities but it only provides an
interface that is same as basic hardware. Each process is provided
with a virtual copy of the underlying computer system.
Virtual Machines in Operating System
• We can create a virtual machine for several reasons, all of
which are fundamentally related to the ability to share the same
basic hardware yet can also support different execution
environments, i.e., different operating systems simultaneously.
• The main drawback with the virtual-machine approach involves
disk systems. Let us suppose that the physical machine has
only three disk drives but wants to support seven virtual
machines. Obviously, it cannot allocate a disk drive to each
virtual machine, because virtual-machine software itself will
need substantial disk space to provide virtual memory and
spooling. The solution is to provide virtual disks.
Virtual Machines in Operating System
• Users are thus given their own virtual machines. After which
they can run any of the operating systems or software packages
that are available on the underlying machine. The virtual-
machine software is concerned with multi-programming multiple
virtual machines onto a physical machine, but it does not need
to consider any user-support software. This arrangement can
provide a useful way to divide the problem of designing a multi-
user interactive system, into two smaller pieces.
• Advantages: • Disadvantages:
[Link] are no protection [Link] multiple virtual
problems because each machines are simultaneously
virtual machine is completely running on a host computer,
isolated from all other virtual one virtual machine can be
machines. affected by other running
[Link] machine can provide virtual machines, depending
an instruction set architecture on the workload.
that differs from real [Link] machines are not as
computers. efficient as a real one when
[Link] maintenance, accessing the hardware.
availability and convenient
recovery.
Thank You

You might also like