0% found this document useful (0 votes)
18 views20 pages

LEC 6 System Call

Uploaded by

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

LEC 6 System Call

Uploaded by

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

Course Name-Operating System

Course Code- COM-302


Lecture No- 1.6

Topic – Interrupts and System Call

Model Institute of Engineering & Technology


Text Books & Reference Books

Text Books (to be acquired by the Students)


Operating System by P. Galvin and A. Silberschatz.
Operating System by A.S. Tannenbaum.
Reference Books
Operating System concepts & design by Milan Milencovic.
Operating System Principles by H.D. Deitel.
Operating System Principles by William Stallings.
Course Outcomes

PO
S. No. DESCRIPTION
MAPPING
Demonstrate understanding of the concepts, structure and 1, 2, 3, 6 ,7, 12
1 design of operating systems

Articulate the general architecture of modern computer operating 1,2,3,5,6


2 systems including its impact on application design and
performance
Understand and analyze complex design choices and 1,3,4,5,7,11
implementation details of: processes, resource control with
3 concurrency, physical and virtual memory, scheduling, I/O and
files.
Develop understanding of Interprocess 2,3,4,5,9,10

4 communication and Synchronization mechanisms.

Analyze the interplay and conflicts in resource 1,3,5,7,9,12


5 usage in a multi-user, multi-tasking environment
with an understanding of the trade-offs involved.
Assessment and Evaluation Plan

Assessment Tools ❑Evaluation


✔ Online Quizzes ▪ Internal Examination
✔ Tutorial Sheets ✔ Assignment = 20
✔ MST= 20
✔ ATTENDANCE= 10
▪ External Examination= 100
Course Outcome 1-Delivery Plan

Course Outcomes Topics Blooms Taxonomy

System calls, system programs Understanding

CO1 Virtual Machines and Spooling Understanding


System calls:

 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).
 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.
Windows vs Unix

FUNCTION WINDOWS UNIX


Process Control CreateProcess() fork()
ExitProcess() exit()
WaitForSingleObject() wait()
File Manipulation CreateFile() open()
ReadFile() read()
WriteFile() write()
CloseHandle() close()
SetConsoleMode() ioctl()
Device Manipulation ReadConsole() read()
WriteConsole() write()
Windows vs Unix

FUNCTION WINDOWS UNIX


Information Maintenance GetCurrentProcessID() getpid()
SetTimer() alarm()
Sleep() sleep()
Communication CreatePipe() pipe()
CreateFileMapping() shmget()
MapViewOfFile() mmap()

Protection SetFileSecurity() chmod()


InitlializeSecurityDescriptor() umask()
SetSecurityDescriptorGroup() chown()
System Programs

 The system programs are used to program the operating system software.
While application programs provide software that is used directly by the
user, system programs provide software that are used by other systems
such as SaaS applications, computational science applications etc.
 The attributes of system programming are:
 Using system programming, a programmer can make assumptions about
the hardware of the system that the program runs on.
 A low level programming language is used in system programming
normally. This is so that the programs can operate in low resource
environments easily.

Reference Link : https://m.youtube.com/watch?v=UWDzhz8MVqc


System Programs

 Most system programs are created to have a low runtime overhead. These
programs may have small runtime library.
 Some parts of the system programs may be directly written in assembly
language by the programmers.
 A debugger cannot be used on system programs mostly. This problem can
be solved by running the programs in a simulated environment.
 Some examples of system programs are operating system, networking
system, web site server, data backup server etc.
Operating System Design structure and Implementation

 An operating system is a construct that allows the user application programs to


interact with the system hardware. Operating system by itself does not provide
any function but it provides an atmosphere in which different applications and
programs can do useful work.

 There are many problems that can occur while designing and implementing an
operating system. These are covered in operating system design and
implementation.
Contd…
Layered Operating System Design
Contd…

Operating System Design Goals

 It is quite complicated to define all the goals and specifications of the operating
system while designing it. The design changes depending on the type of the
operating system i.e if it is batch system, time shared system, single user
system, multi user system, distributed system etc.
 There are basically two types of goals while designing an operating system.
These are:
 User Goals
 The operating system should be convenient, easy to use, reliable, safe and fast
according to the users. However, these specifications are not very useful as there
is no set method to achieve these goals.
 System Goals
 The operating system should be easy to design, implement and maintain. These
are specifications required by those who create, maintain and operate the
operating system. But there is not specific method to achieve these goals as
well.
Contd…

Operating System Implementatio

 The operating system needs to be implemented after it is


designed. Earlier they were written in assembly language but now
higher level languages are used.
 Advantages of Higher Level Language
 There are multiple advantages to implementing an operating
system using a higher level language such as: the code is written
more fast, it is compact and also easier to debug and understand.
Also, the operating system can be easily moved from one
hardware to another if it is written in a high level language.
 Disadvantages of Higher Level Language
 Using high level language for implementing an operating system
leads to a loss in speed and increase in storage requirements.
However in modern systems only a small amount of code is
needed for high performance, such as the CPU scheduler and
memory manager. Also, the bottleneck routines in the system can
be replaced by assembly language equivalents if required.
Virtual Machine
Virtual Machines
 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.
 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.
Spooling
 It is a kind of buffering mechanism or a process in which data is
temporarily held to be used and executed by a device, program or the
system.
 Data is sent to and stored in memory or other volatile storage until the
program or computer requests it for execution.
Spooling

 In a computer system peripheral equipments, such as printers and


punch card readers etc (batch processing), are very slow relative to the
performance of the rest of the system.
 Getting input and output from the system was quickly seen to be a
bottleneck. Here comes the need for spool.
Spooling

 where data, instructions and processes from multiple sources are


accumulated for execution later on. Generally, it is maintained on
computer’s physical memory, buffers or the I/O device-specific
interrupts.
 The spool is processed in FIFO manner i.e. whatever first instruction is
there in the queue will be popped and executed.
Thank You

You might also like