SlideShare a Scribd company logo
1 of 14
System Calls, Types
 The mechanism used by an application program to request
service from the operating system.
 System calls causes the processor to change mode (e.g. to
"supervisor mode" or "protected mode").
 This allows the OS to perform restricted actions such as
accessing hardware devices or the memory management unit.
System Calls
 Systems calls are the programming interface to the services
provided by the OS
 Typically written in a high-level language (C or C++)
Application
System Calls
System Calls
(OS functions)
Each has a name/number, set of parameters
Application
(a process, a
running program)
….
Kernel/OS
Other kernel functions
other kernel functions can be called by system calls
System Call Interface
 System call sequence to copy the contents of one file to another
file
Example of System Calls
System Call Implementation and Calling
 Typically,
 a number associated with each
system call
 Number used as an index to a
table: System Call table
 Table keeps addresses of system
calls (routines)
 System call runs and returns
 Caller does not know system call
implementation
 Just knows interface
Standard C Library Example
 C program invoking printf() library call, which calls
the write() system call
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
Parameter Passing via Table
Accessing and executing System
Calls
 System calls typically not accessed directly
by programs
 Mostly accessed by programs via a high-level
Application Program Interface (API) (i.e. a
library) rather than direct system call use
 Three most common APIs are :
 Win32 API for Windows,
 POSIX API for POSIX-based systems
(including virtually all versions of UNIX,
Linux, and Mac OS X),
 Java API for the Java virtual machine
(JVM)
API (std lib)
Program
Sys Calls
Rest of Kernel
OS
Example of Standard API
 Consider the ReadFile() function in the Win32 API — a function for reading
from a file
 A description of the parameters passed to ReadFile()
 HANDLE file—the file to be read
 LPVOID buffer—a buffer where the data will be read into and written
from
 DWORD bytesToRead—the number of bytes to be read into the buffer
 LPDWORD bytesRead—the number of bytes read during the last read
 LPOVERLAPPED ovl—indicates if overlapped I/O is being used
Types of System Calls
 System calls can be grouped into six major categories:
 Process control
 Load, execute, end, abort, create process, get/set process
attributes, wait for time/signal, allocate/free memory
 File management (manipulation)
 Create/delete/open/close/read/write a file, get/set file attributes
 Device management
 Request/release device, read/write data, get/set attributes
 Information maintenance
 Get/set time or date, get/set system data, get/set attributes for
process/file/device
 Communications
 Create/delete connection, send/receive messages, attach/detach
devices
Protection:Protection provides a mechanism for controlling access
to the resources provided by a computer system
Types of System Calls
 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
 create file, delete file
 open, close file
 read, write, reposition
 get and set file attributes
Types of System Calls
 Device management
 request device, release device
 read, write, reposition
 get device attributes, set device attributes
 logically attach or detach devices
 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
 transfer status information
 attach and detach remote devices
Examples of Windows and
Unix System Calls

More Related Content

Similar to 2_System Calls.pptx

OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURESOPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURESpriyasoundar
 
Operating-System Structures
Operating-System StructuresOperating-System Structures
Operating-System StructuresCloudbells.com
 
OS Services, System call, Virtual Machine
OS Services, System call, Virtual MachineOS Services, System call, Virtual Machine
OS Services, System call, Virtual MachineDivya S
 
Operating system
Operating systemOperating system
Operating systemHaripritha
 
MELJUN CORTES operating_system_structure
MELJUN CORTES operating_system_structureMELJUN CORTES operating_system_structure
MELJUN CORTES operating_system_structureMELJUN CORTES
 
OS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxOS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxPRABAVATHIH
 
ch3 - operating system structures.ppt
ch3 - operating system structures.pptch3 - operating system structures.ppt
ch3 - operating system structures.pptdivyang32
 
W5 system call, DD, OS structure.ppt
W5 system call, DD, OS structure.pptW5 system call, DD, OS structure.ppt
W5 system call, DD, OS structure.pptiqrayounus5
 
16. Computer Systems Basic Software 2
16. Computer Systems   Basic Software 216. Computer Systems   Basic Software 2
16. Computer Systems Basic Software 2New Era University
 
System calls operating system ppt by rohit malav
System calls operating system  ppt by rohit malavSystem calls operating system  ppt by rohit malav
System calls operating system ppt by rohit malavRohit malav
 
Ch2 operating-system structures
Ch2   operating-system structuresCh2   operating-system structures
Ch2 operating-system structuresWelly Dian Astika
 
Understanding operating systems 5th ed ch16
Understanding operating systems 5th ed ch16Understanding operating systems 5th ed ch16
Understanding operating systems 5th ed ch16BarrBoy
 
operating system structure
operating system structureoperating system structure
operating system structureHAMZA AHMED
 

Similar to 2_System Calls.pptx (20)

OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURESOPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
 
System call
System callSystem call
System call
 
Operating-System Structures
Operating-System StructuresOperating-System Structures
Operating-System Structures
 
System call
System callSystem call
System call
 
App A
App AApp A
App A
 
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
 
Operating system
Operating systemOperating system
Operating system
 
System calls
System callsSystem calls
System calls
 
MELJUN CORTES operating_system_structure
MELJUN CORTES operating_system_structureMELJUN CORTES operating_system_structure
MELJUN CORTES operating_system_structure
 
OS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxOS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptx
 
1.7 system calls
1.7 system calls1.7 system calls
1.7 system calls
 
ch3 - operating system structures.ppt
ch3 - operating system structures.pptch3 - operating system structures.ppt
ch3 - operating system structures.ppt
 
W5 system call, DD, OS structure.ppt
W5 system call, DD, OS structure.pptW5 system call, DD, OS structure.ppt
W5 system call, DD, OS structure.ppt
 
System calls
System callsSystem calls
System calls
 
16. Computer Systems Basic Software 2
16. Computer Systems   Basic Software 216. Computer Systems   Basic Software 2
16. Computer Systems Basic Software 2
 
System calls operating system ppt by rohit malav
System calls operating system  ppt by rohit malavSystem calls operating system  ppt by rohit malav
System calls operating system ppt by rohit malav
 
Ch2 operating-system structures
Ch2   operating-system structuresCh2   operating-system structures
Ch2 operating-system structures
 
Understanding operating systems 5th ed ch16
Understanding operating systems 5th ed ch16Understanding operating systems 5th ed ch16
Understanding operating systems 5th ed ch16
 
operating system structure
operating system structureoperating system structure
operating system structure
 

Recently uploaded

Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
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
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
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
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
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
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 

Recently uploaded (20)

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
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
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
 
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
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
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
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
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
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 

2_System Calls.pptx

  • 1. System Calls, Types  The mechanism used by an application program to request service from the operating system.  System calls causes the processor to change mode (e.g. to "supervisor mode" or "protected mode").  This allows the OS to perform restricted actions such as accessing hardware devices or the memory management unit.
  • 2. System Calls  Systems calls are the programming interface to the services provided by the OS  Typically written in a high-level language (C or C++)
  • 3. Application System Calls System Calls (OS functions) Each has a name/number, set of parameters Application (a process, a running program) …. Kernel/OS Other kernel functions other kernel functions can be called by system calls System Call Interface
  • 4.  System call sequence to copy the contents of one file to another file Example of System Calls
  • 5. System Call Implementation and Calling  Typically,  a number associated with each system call  Number used as an index to a table: System Call table  Table keeps addresses of system calls (routines)  System call runs and returns  Caller does not know system call implementation  Just knows interface
  • 6. Standard C Library Example  C program invoking printf() library call, which calls the write() system call
  • 7. 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
  • 9. Accessing and executing System Calls  System calls typically not accessed directly by programs  Mostly accessed by programs via a high-level Application Program Interface (API) (i.e. a library) rather than direct system call use  Three most common APIs are :  Win32 API for Windows,  POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X),  Java API for the Java virtual machine (JVM) API (std lib) Program Sys Calls Rest of Kernel OS
  • 10. Example of Standard API  Consider the ReadFile() function in the Win32 API — a function for reading from a file  A description of the parameters passed to ReadFile()  HANDLE file—the file to be read  LPVOID buffer—a buffer where the data will be read into and written from  DWORD bytesToRead—the number of bytes to be read into the buffer  LPDWORD bytesRead—the number of bytes read during the last read  LPOVERLAPPED ovl—indicates if overlapped I/O is being used
  • 11. Types of System Calls  System calls can be grouped into six major categories:  Process control  Load, execute, end, abort, create process, get/set process attributes, wait for time/signal, allocate/free memory  File management (manipulation)  Create/delete/open/close/read/write a file, get/set file attributes  Device management  Request/release device, read/write data, get/set attributes  Information maintenance  Get/set time or date, get/set system data, get/set attributes for process/file/device  Communications  Create/delete connection, send/receive messages, attach/detach devices Protection:Protection provides a mechanism for controlling access to the resources provided by a computer system
  • 12. Types of System Calls  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  create file, delete file  open, close file  read, write, reposition  get and set file attributes
  • 13. Types of System Calls  Device management  request device, release device  read, write, reposition  get device attributes, set device attributes  logically attach or detach devices  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  transfer status information  attach and detach remote devices
  • 14. Examples of Windows and Unix System Calls