SlideShare a Scribd company logo
1 of 28
OPERATING SYSTEM
(R18 II(II Sem))
Department of computer science and engineering (AI & ML)
LEC 5
by
Asst.Prof.M.Gokilavani
VITS
6/11/2023 Department of CSE (AI/ML) 1
Syllabus
6/11/2023 Department of CSE (AI/ML) 2
6/11/2023 Department of CSE (AI/ML) 3
TEXTBOOK:
• Operating System Principles- Abraham Silberchatz, Peter B. Galvin, Greg
Gagne 7th Edition, John Wiley.
• Advanced programming in the UNIX environment, W.R. Stevens, Pearson
education.
REFERENCES:
• Operating Systems – Internals and Design Principles Stallings, Fifth Edition–
2005, Pearson Education/PHI.
• Operating System A Design Approach- Crowley, TMH.
• Modern Operating Systems, Andrew S. Tanenbaum 2nd edition, Pearson/PHI.
• UNIX programming environment, Kernighan and Pike, PHI/ Pearson Education.
• UNIX Internals -The New Frontiers, U. Vahalia, Pearson Education
6/11/2023 Department of CSE (AI/ML) 4
Topics covered in Lec 5
6/11/2023 Department of CSE (AI/ML) 5
UNIT – I: Operating System - Introduction, Structures - Simple Batch,
Multiprogrammed, Time-shared, Personal Computer, Parallel, Distributed
Systems, Real-Time Systems, System components, Operating System
services, System Calls.
System calls in OS
• A system call is a way for a user program to interface with the
operating system.
• The program requests several services, and the OS responds by
invoking a series of system calls to satisfy the request.
• A system call can be written in assembly language or a high-level
language like C or Pascal.
• System calls are predefined functions that the operating system may
directly invoke if a high-level language is used.
6/11/2023 Department of CSE (AI/ML) 6
What is a System Call?
• A system call is a method for a computer program to request a service from
the kernel of the operating system on which it is running.
• A system call is a method of interacting with the operating system via
programs.
• A system call is a request from computer software to an operating system's
kernel.
• The Application Program Interface (API) connects the operating system's
functions to user programs.
• It acts as a link between the operating system and a process, allowing user-
level programs to request operating system services.
• The kernel system can only be accessed using system calls.
• System calls are required for any programs that use resources.
6/11/2023 Department of CSE (AI/ML) 7
How are system calls made?
• When a computer software needs to access the operating system's kernel, it makes a system call.
• The system call uses an API to expose the operating system's services to user programs.
• It is the only method to access the kernel system.
• All programs or processes that require resources for execution must use system calls, as they serve
as an interface between the operating system and user programs.
Below are some examples of how a system call varies from a user function.
• A system call function may create and use kernel processes to execute the asynchronous
processing.
• A system call has greater authority than a standard subroutine. A system call with kernel-mode
privilege executes in the kernel protection domain.
• System calls are not permitted to use shared libraries or any symbols that are not present in the
kernel protection domain.
• The code and data for system calls are stored in global kernel memory.
6/11/2023 Department of CSE (AI/ML) 8
Example of System Calls
• System call sequence to copy the contents of one file to another file.
6/11/2023 Department of CSE (AI/ML) 9
Example of Standard API
6/11/2023 Department of CSE (AI/ML) 10
Why do you need system calls in Operating System?
There are various situations where you must require system calls in the
operating system. Following of the situations are as follows:
• It is must require when a file system wants to create or delete a file.
• Network connections require the system calls to sending and receiving
data packets.
• If you want to read or write a file, you need to system calls.
• If you want to access hardware devices, including a printer, scanner,
you need a system call.
• System calls are used to create and manage new processes.
6/11/2023 Department of CSE (AI/ML) 11
How System call works?
• Typically, a number associated with each system call
• System-call interface maintains a table indexed according to these
numbers
• The system call interface invokes the intended system call in OS kernel and
returns status of the system call and any return values
• The caller need know nothing about how the system call is implemented
• Just needs to obey API and understand what OS will do as a result call
• Most details of OS interface hidden from programmer by API
• Managed by run-time support library (set of functions built into
libraries included with compiler)
6/11/2023 Department of CSE (AI/ML) 12
API – System Call – OS Relationship
6/11/2023 Department of CSE (AI/ML) 13
System Call Parameter Passing
• Often, more information is required than simply identity of desired system
call
• Exact type and amount of information vary according to OS and call
• Three general methods used to pass parameters to the OS
• Simplest: pass the parameters in registers
• In some cases, may be more parameters than registers
• Parameters stored in a block, or table, in memory, and address of block
passed as a parameter in a register
• This approach taken by Linux and Solaris
• Parameters placed, or pushed, onto the stack by the program and
popped off the stack by the operating system
• Block and stack methods do not limit the number or length of
parameters being passed
6/11/2023 Department of CSE (AI/ML) 14
Parameter Passing via Table
6/11/2023 Department of CSE (AI/ML) 15
Types of System Calls
6/11/2023 Department of CSE (AI/ML) 16
Types of System Calls
• Process control
• create process, terminate process
• end, abort
• load, execute
• get process attributes, set process attributes
• wait for time
• wait event, signal event
• allocate and free memory
• Dump memory if error
• Debugger for determining bugs, single step execution
• Locks for managing access to shared data between processes
6/11/2023 Department of CSE (AI/ML) 17
Types of System Calls
• File management
• create file, delete file
• open, close file
• read, write, reposition
• get and set file attributes
• Device management
• request device, release device
• read, write, reposition
• get device attributes, set device attributes
• logically attach or detach devices
• Protection
• Control access to resources
• Get and set permissions
• Allow and deny user access
6/11/2023 Department of CSE (AI/ML) 18
Types of System Calls (Cont.)
• Information maintenance
• get time or date, set time or date
• get system data, set system data
• get and set process, file, or device attributes
• Communications
• create, delete communication connection
• send, receive messages if message passing model to host name or process
name
• From client to server
• Shared-memory model create and gain access to memory regions
• transfer status information
• attach and detach remote devices
6/11/2023 Department of CSE (AI/ML) 19
Examples of Windows and Unix System Calls
6/11/2023 Department of CSE (AI/ML) 20
Standard C Library Example
• C program invoking printf() library call, which calls write() system
call.
6/11/2023 Department of CSE (AI/ML) 21
Example: MS-DOS
6/11/2023 Department of CSE (AI/ML) 22
• Single-tasking
• Shell invoked when system booted
• Simple method to run program
• No process created
• Single memory space
• Loads program into memory, overwriting all but the kernel
• Program exit -> shell reloaded
System Programs
• System programs provide a convenient environment for program development and
execution.
• They can be divided into:
• File manipulation
• Status information sometimes stored in a File modification
• Programming language support
• Program loading and execution
• Communications
• Background services
• Application programs
• Most users’ view of the operation system is defined by system programs, not the
actual system calls
6/11/2023 Department of CSE (AI/ML) 23
System program
6/11/2023 Department of CSE (AI/ML) 24
System Programs
• Provide a convenient environment for program development and execution
• Some of them are simply user interfaces to system calls; others are
considerably more complex.
• File management - Create, delete, copy, rename, print, dump, list, and
generally manipulate files and directories.
• Status information
• Some ask the system for info - date, time, amount of available memory,
disk space, number of users.
• Others provide detailed performance, logging, and debugging information
• Typically, these programs format and print the output to the terminal or
other output devices.
• Some systems implement a registry - used to store and retrieve
configuration information.
6/11/2023 Department of CSE (AI/ML) 25
System Programs
• File modification
• Text editors to create and modify files
• Special commands to search contents of files or perform transformations of the
text
• Programming-language support - Compilers, assemblers, debuggers and
interpreters sometimes provided
• Program loading and execution- Absolute loaders, relocatable loaders, linkage
editors, and overlay-loaders, debugging systems for higher-level and machine
language
• Communications - Provide the mechanism for creating virtual connections
among processes, users, and computer systems
• Allow users to send messages to one another’s screens, browse web pages,
send electronic-mail messages, log in remotely, transfer files from one
machine to another.
6/11/2023 Department of CSE (AI/ML) 26
System Programs
• Background Services
• Launch at boot time
• Some for system startup, then terminate
• Some from system boot to shutdown
• Provide facilities like disk checking, process scheduling, error logging,
printing
• Run in user context not kernel context
• Known as services, subsystems, daemons
• Application programs
• Don’t pertain to system
• Run by users
• Not typically considered part of OS
• Launched by command line, mouse click, finger poke
6/11/2023 Department of CSE (AI/ML) 27
Topics to be covered in next Lec 6
•Operating System Structure
6/11/2023 Department of CSE (AI/ML) 28
Thank you!!!

More Related Content

What's hot

Primary Memory: RAM, ROM and their Types
Primary Memory: RAM, ROM and their TypesPrimary Memory: RAM, ROM and their Types
Primary Memory: RAM, ROM and their TypesHem Pokhrel
 
Free space managment46
Free space managment46Free space managment46
Free space managment46myrajendra
 
Sensor node hardware and network architecture
Sensor node hardware and network architectureSensor node hardware and network architecture
Sensor node hardware and network architectureVidhi603146
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
MEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROLMEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROLjunnubabu
 
Multicast routing protocols in adhoc networks
Multicast routing protocols in adhoc networksMulticast routing protocols in adhoc networks
Multicast routing protocols in adhoc networksPradeep Kumar TS
 
Lecture 2
Lecture 2Lecture 2
Lecture 2Mr SMAK
 
Circuit Partitioning for VLSI Layout presented by Oveis Dehghantanha
Circuit Partitioning for VLSI Layout presented by Oveis DehghantanhaCircuit Partitioning for VLSI Layout presented by Oveis Dehghantanha
Circuit Partitioning for VLSI Layout presented by Oveis Dehghantanhaoveis dehghantanha
 
Mac protocols
Mac protocolsMac protocols
Mac protocolsjuno susi
 
Programming TCP/IP with Sockets
Programming TCP/IP with SocketsProgramming TCP/IP with Sockets
Programming TCP/IP with Socketselliando dias
 
Communication systems v4
Communication systems v4Communication systems v4
Communication systems v4babak danyal
 
Data communication and networks by B. Forouzan
Data communication and networks by B. ForouzanData communication and networks by B. Forouzan
Data communication and networks by B. ForouzanPreethi T G
 
Computer network switches & their structures
Computer network switches & their structuresComputer network switches & their structures
Computer network switches & their structuresSweta Kumari Barnwal
 
Packet radio protocol
Packet radio protocolPacket radio protocol
Packet radio protocolPriya Kaushal
 

What's hot (16)

Primary Memory: RAM, ROM and their Types
Primary Memory: RAM, ROM and their TypesPrimary Memory: RAM, ROM and their Types
Primary Memory: RAM, ROM and their Types
 
Free space managment46
Free space managment46Free space managment46
Free space managment46
 
Sensor node hardware and network architecture
Sensor node hardware and network architectureSensor node hardware and network architecture
Sensor node hardware and network architecture
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Remote Login
Remote LoginRemote Login
Remote Login
 
MEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROLMEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROL
 
Multicast routing protocols in adhoc networks
Multicast routing protocols in adhoc networksMulticast routing protocols in adhoc networks
Multicast routing protocols in adhoc networks
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Circuit Partitioning for VLSI Layout presented by Oveis Dehghantanha
Circuit Partitioning for VLSI Layout presented by Oveis DehghantanhaCircuit Partitioning for VLSI Layout presented by Oveis Dehghantanha
Circuit Partitioning for VLSI Layout presented by Oveis Dehghantanha
 
Mac protocols
Mac protocolsMac protocols
Mac protocols
 
Programming TCP/IP with Sockets
Programming TCP/IP with SocketsProgramming TCP/IP with Sockets
Programming TCP/IP with Sockets
 
Communication systems v4
Communication systems v4Communication systems v4
Communication systems v4
 
Data communication and networks by B. Forouzan
Data communication and networks by B. ForouzanData communication and networks by B. Forouzan
Data communication and networks by B. Forouzan
 
Computer network switches & their structures
Computer network switches & their structuresComputer network switches & their structures
Computer network switches & their structures
 
Packet radio protocol
Packet radio protocolPacket radio protocol
Packet radio protocol
 
Medium access control unit 3-33
Medium access control  unit 3-33Medium access control  unit 3-33
Medium access control unit 3-33
 

Similar to CS403: Operating System : Lec 5 System calls.pptx

Operating system 11 system calls
Operating system 11 system callsOperating system 11 system calls
Operating system 11 system callsVaibhav Khanna
 
CS403: Operating System : Lec 4 OS services.pptx
CS403: Operating System : Lec 4 OS services.pptxCS403: Operating System : Lec 4 OS services.pptx
CS403: Operating System : Lec 4 OS services.pptxAsst.prof M.Gokilavani
 
CS403: Operating System : Lec 1 Introduction.pptx
CS403: Operating System : Lec 1 Introduction.pptxCS403: Operating System : Lec 1 Introduction.pptx
CS403: Operating System : Lec 1 Introduction.pptxAsst.prof M.Gokilavani
 
Ch2 operating-system structures
Ch2   operating-system structuresCh2   operating-system structures
Ch2 operating-system structuresWelly Dian Astika
 
CS403: Operating System :Lec 2 Function of OS.pptx
CS403: Operating System :Lec 2 Function of OS.pptxCS403: Operating System :Lec 2 Function of OS.pptx
CS403: Operating System :Lec 2 Function of OS.pptxAsst.prof M.Gokilavani
 
CS403: Operating System : Lec 3 Types of OS (1) .pptx
CS403: Operating System : Lec 3 Types of OS (1) .pptxCS403: Operating System : Lec 3 Types of OS (1) .pptx
CS403: Operating System : Lec 3 Types of OS (1) .pptxAsst.prof M.Gokilavani
 
Services and system calls
Services and system callsServices and system calls
Services and system callssangrampatil81
 
2 operating system structures
2 operating system structures2 operating system structures
2 operating system structuresDr. Loganathan R
 
Operating System Structure Part-I.pdf
Operating System Structure Part-I.pdfOperating System Structure Part-I.pdf
Operating System Structure Part-I.pdfHarika Pudugosula
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System CallsVandana Salve
 
OS Services, System call, Virtual Machine
OS Services, System call, Virtual MachineOS Services, System call, Virtual Machine
OS Services, System call, Virtual MachineDivya S
 
CS403 Operating system Lec 8 - Process concepts.pptx
CS403 Operating system Lec 8 - Process concepts.pptxCS403 Operating system Lec 8 - Process concepts.pptx
CS403 Operating system Lec 8 - Process concepts.pptxAsst.prof M.Gokilavani
 
1. Unit 1_Introduction to OS.pptx
1. Unit 1_Introduction to OS.pptx1. Unit 1_Introduction to OS.pptx
1. Unit 1_Introduction to OS.pptxAishwarya .
 
cs-intro-os.ppt
cs-intro-os.pptcs-intro-os.ppt
cs-intro-os.pptinfomerlin
 
Operating Systems 1 (3/12) - Architectures
Operating Systems 1 (3/12) - ArchitecturesOperating Systems 1 (3/12) - Architectures
Operating Systems 1 (3/12) - ArchitecturesPeter Tröger
 

Similar to CS403: Operating System : Lec 5 System calls.pptx (20)

Operating system 11 system calls
Operating system 11 system callsOperating system 11 system calls
Operating system 11 system calls
 
CS403: Operating System : Lec 4 OS services.pptx
CS403: Operating System : Lec 4 OS services.pptxCS403: Operating System : Lec 4 OS services.pptx
CS403: Operating System : Lec 4 OS services.pptx
 
CS403: Operating System : Lec 1 Introduction.pptx
CS403: Operating System : Lec 1 Introduction.pptxCS403: Operating System : Lec 1 Introduction.pptx
CS403: Operating System : Lec 1 Introduction.pptx
 
Ch2 operating-system structures
Ch2   operating-system structuresCh2   operating-system structures
Ch2 operating-system structures
 
CS403: Operating System :Lec 2 Function of OS.pptx
CS403: Operating System :Lec 2 Function of OS.pptxCS403: Operating System :Lec 2 Function of OS.pptx
CS403: Operating System :Lec 2 Function of OS.pptx
 
CS403: Operating System : Lec 3 Types of OS (1) .pptx
CS403: Operating System : Lec 3 Types of OS (1) .pptxCS403: Operating System : Lec 3 Types of OS (1) .pptx
CS403: Operating System : Lec 3 Types of OS (1) .pptx
 
Os unit 1(cont)
Os unit 1(cont)Os unit 1(cont)
Os unit 1(cont)
 
chapter2.pptx
chapter2.pptxchapter2.pptx
chapter2.pptx
 
Unit 4
Unit  4Unit  4
Unit 4
 
Services and system calls
Services and system callsServices and system calls
Services and system calls
 
2 operating system structures
2 operating system structures2 operating system structures
2 operating system structures
 
Operating System Structure Part-I.pdf
Operating System Structure Part-I.pdfOperating System Structure Part-I.pdf
Operating System Structure Part-I.pdf
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
System calls
System callsSystem calls
System calls
 
OS Services, System call, Virtual Machine
OS Services, System call, Virtual MachineOS Services, System call, Virtual Machine
OS Services, System call, Virtual Machine
 
CS403 Operating system Lec 8 - Process concepts.pptx
CS403 Operating system Lec 8 - Process concepts.pptxCS403 Operating system Lec 8 - Process concepts.pptx
CS403 Operating system Lec 8 - Process concepts.pptx
 
1. Unit 1_Introduction to OS.pptx
1. Unit 1_Introduction to OS.pptx1. Unit 1_Introduction to OS.pptx
1. Unit 1_Introduction to OS.pptx
 
Os unit i
Os unit iOs unit i
Os unit i
 
cs-intro-os.ppt
cs-intro-os.pptcs-intro-os.ppt
cs-intro-os.ppt
 
Operating Systems 1 (3/12) - Architectures
Operating Systems 1 (3/12) - ArchitecturesOperating Systems 1 (3/12) - Architectures
Operating Systems 1 (3/12) - Architectures
 

More from Asst.prof M.Gokilavani

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfAsst.prof M.Gokilavani
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesAsst.prof M.Gokilavani
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfAsst.prof M.Gokilavani
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfAsst.prof M.Gokilavani
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAsst.prof M.Gokilavani
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAsst.prof M.Gokilavani
 

More from Asst.prof M.Gokilavani (20)

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdf
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notes
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
 
GE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdfGE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdf
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdf
 
GE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _NotesGE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _Notes
 
GE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_NotesGE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_Notes
 
GE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_NotesGE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_Notes
 
GE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_NotesGE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_Notes
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptx
 
AI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptx
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptx
 

Recently uploaded

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 

Recently uploaded (20)

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 

CS403: Operating System : Lec 5 System calls.pptx

  • 1. OPERATING SYSTEM (R18 II(II Sem)) Department of computer science and engineering (AI & ML) LEC 5 by Asst.Prof.M.Gokilavani VITS 6/11/2023 Department of CSE (AI/ML) 1
  • 3. 6/11/2023 Department of CSE (AI/ML) 3
  • 4. TEXTBOOK: • Operating System Principles- Abraham Silberchatz, Peter B. Galvin, Greg Gagne 7th Edition, John Wiley. • Advanced programming in the UNIX environment, W.R. Stevens, Pearson education. REFERENCES: • Operating Systems – Internals and Design Principles Stallings, Fifth Edition– 2005, Pearson Education/PHI. • Operating System A Design Approach- Crowley, TMH. • Modern Operating Systems, Andrew S. Tanenbaum 2nd edition, Pearson/PHI. • UNIX programming environment, Kernighan and Pike, PHI/ Pearson Education. • UNIX Internals -The New Frontiers, U. Vahalia, Pearson Education 6/11/2023 Department of CSE (AI/ML) 4
  • 5. Topics covered in Lec 5 6/11/2023 Department of CSE (AI/ML) 5 UNIT – I: Operating System - Introduction, Structures - Simple Batch, Multiprogrammed, Time-shared, Personal Computer, Parallel, Distributed Systems, Real-Time Systems, System components, Operating System services, System Calls.
  • 6. System calls in OS • A system call is a way for a user program to interface with the operating system. • The program requests several services, and the OS responds by invoking a series of system calls to satisfy the request. • A system call can be written in assembly language or a high-level language like C or Pascal. • System calls are predefined functions that the operating system may directly invoke if a high-level language is used. 6/11/2023 Department of CSE (AI/ML) 6
  • 7. What is a System Call? • A system call is a method for a computer program to request a service from the kernel of the operating system on which it is running. • A system call is a method of interacting with the operating system via programs. • A system call is a request from computer software to an operating system's kernel. • The Application Program Interface (API) connects the operating system's functions to user programs. • It acts as a link between the operating system and a process, allowing user- level programs to request operating system services. • The kernel system can only be accessed using system calls. • System calls are required for any programs that use resources. 6/11/2023 Department of CSE (AI/ML) 7
  • 8. How are system calls made? • When a computer software needs to access the operating system's kernel, it makes a system call. • The system call uses an API to expose the operating system's services to user programs. • It is the only method to access the kernel system. • All programs or processes that require resources for execution must use system calls, as they serve as an interface between the operating system and user programs. Below are some examples of how a system call varies from a user function. • A system call function may create and use kernel processes to execute the asynchronous processing. • A system call has greater authority than a standard subroutine. A system call with kernel-mode privilege executes in the kernel protection domain. • System calls are not permitted to use shared libraries or any symbols that are not present in the kernel protection domain. • The code and data for system calls are stored in global kernel memory. 6/11/2023 Department of CSE (AI/ML) 8
  • 9. Example of System Calls • System call sequence to copy the contents of one file to another file. 6/11/2023 Department of CSE (AI/ML) 9
  • 10. Example of Standard API 6/11/2023 Department of CSE (AI/ML) 10
  • 11. Why do you need system calls in Operating System? There are various situations where you must require system calls in the operating system. Following of the situations are as follows: • It is must require when a file system wants to create or delete a file. • Network connections require the system calls to sending and receiving data packets. • If you want to read or write a file, you need to system calls. • If you want to access hardware devices, including a printer, scanner, you need a system call. • System calls are used to create and manage new processes. 6/11/2023 Department of CSE (AI/ML) 11
  • 12. How System call works? • Typically, a number associated with each system call • System-call interface maintains a table indexed according to these numbers • The system call interface invokes the intended system call in OS kernel and returns status of the system call and any return values • The caller need know nothing about how the system call is implemented • Just needs to obey API and understand what OS will do as a result call • Most details of OS interface hidden from programmer by API • Managed by run-time support library (set of functions built into libraries included with compiler) 6/11/2023 Department of CSE (AI/ML) 12
  • 13. API – System Call – OS Relationship 6/11/2023 Department of CSE (AI/ML) 13
  • 14. System Call Parameter Passing • Often, more information is required than simply identity of desired system call • Exact type and amount of information vary according to OS and call • Three general methods used to pass parameters to the OS • Simplest: pass the parameters in registers • In some cases, may be more parameters than registers • Parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register • This approach taken by Linux and Solaris • Parameters placed, or pushed, onto the stack by the program and popped off the stack by the operating system • Block and stack methods do not limit the number or length of parameters being passed 6/11/2023 Department of CSE (AI/ML) 14
  • 15. Parameter Passing via Table 6/11/2023 Department of CSE (AI/ML) 15
  • 16. Types of System Calls 6/11/2023 Department of CSE (AI/ML) 16
  • 17. Types of System Calls • Process control • create process, terminate process • end, abort • load, execute • get process attributes, set process attributes • wait for time • wait event, signal event • allocate and free memory • Dump memory if error • Debugger for determining bugs, single step execution • Locks for managing access to shared data between processes 6/11/2023 Department of CSE (AI/ML) 17
  • 18. Types of System Calls • File management • create file, delete file • open, close file • read, write, reposition • get and set file attributes • Device management • request device, release device • read, write, reposition • get device attributes, set device attributes • logically attach or detach devices • Protection • Control access to resources • Get and set permissions • Allow and deny user access 6/11/2023 Department of CSE (AI/ML) 18
  • 19. Types of System Calls (Cont.) • Information maintenance • get time or date, set time or date • get system data, set system data • get and set process, file, or device attributes • Communications • create, delete communication connection • send, receive messages if message passing model to host name or process name • From client to server • Shared-memory model create and gain access to memory regions • transfer status information • attach and detach remote devices 6/11/2023 Department of CSE (AI/ML) 19
  • 20. Examples of Windows and Unix System Calls 6/11/2023 Department of CSE (AI/ML) 20
  • 21. Standard C Library Example • C program invoking printf() library call, which calls write() system call. 6/11/2023 Department of CSE (AI/ML) 21
  • 22. Example: MS-DOS 6/11/2023 Department of CSE (AI/ML) 22 • Single-tasking • Shell invoked when system booted • Simple method to run program • No process created • Single memory space • Loads program into memory, overwriting all but the kernel • Program exit -> shell reloaded
  • 23. System Programs • System programs provide a convenient environment for program development and execution. • They can be divided into: • File manipulation • Status information sometimes stored in a File modification • Programming language support • Program loading and execution • Communications • Background services • Application programs • Most users’ view of the operation system is defined by system programs, not the actual system calls 6/11/2023 Department of CSE (AI/ML) 23
  • 25. System Programs • Provide a convenient environment for program development and execution • Some of them are simply user interfaces to system calls; others are considerably more complex. • File management - Create, delete, copy, rename, print, dump, list, and generally manipulate files and directories. • Status information • Some ask the system for info - date, time, amount of available memory, disk space, number of users. • Others provide detailed performance, logging, and debugging information • Typically, these programs format and print the output to the terminal or other output devices. • Some systems implement a registry - used to store and retrieve configuration information. 6/11/2023 Department of CSE (AI/ML) 25
  • 26. System Programs • File modification • Text editors to create and modify files • Special commands to search contents of files or perform transformations of the text • Programming-language support - Compilers, assemblers, debuggers and interpreters sometimes provided • Program loading and execution- Absolute loaders, relocatable loaders, linkage editors, and overlay-loaders, debugging systems for higher-level and machine language • Communications - Provide the mechanism for creating virtual connections among processes, users, and computer systems • Allow users to send messages to one another’s screens, browse web pages, send electronic-mail messages, log in remotely, transfer files from one machine to another. 6/11/2023 Department of CSE (AI/ML) 26
  • 27. System Programs • Background Services • Launch at boot time • Some for system startup, then terminate • Some from system boot to shutdown • Provide facilities like disk checking, process scheduling, error logging, printing • Run in user context not kernel context • Known as services, subsystems, daemons • Application programs • Don’t pertain to system • Run by users • Not typically considered part of OS • Launched by command line, mouse click, finger poke 6/11/2023 Department of CSE (AI/ML) 27
  • 28. Topics to be covered in next Lec 6 •Operating System Structure 6/11/2023 Department of CSE (AI/ML) 28 Thank you!!!