System Calls and Parameter Passing, Summaries of Operating Systems

The concept of system calls, which are programming interfaces to the services provided by the operating system. It describes the three most common APIs and how system calls are implemented. The document also covers system call parameter passing, including the three general methods used to pass parameters to the OS. It lists the types of system calls, including file management, device management, information maintenance, communications, and protection.

Typology: Summaries

2020/2021

Available from 04/15/2023

kishore-16
kishore-16 🇮🇳

5 documents

1 / 14

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download System Calls and Parameter Passing and more Summaries Operating Systems in PDF only on Docsity!

SYSTEM CALLS

d Programming interface to the services provided by the OS d Typically written in a high-level language (C or C++) d Mostly accessed by programs via a high-level rather than direct system call use d Three most common APIs are Win 32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM)

SYSTEM CALL IMPLEMENTATION

U Typically, a number associated with each system call

. maintains a table indexed

according to these numbers

U The system call interface invokes the intended

system call in OS kernel and returns status of the

system call and any return values

API – SYSTEM CALL – OS RELATIONSHIP

SYSTEM CALL PARAMETER PASSING

U Often, more information is required than simply identity of

desired system call

. Exact type and amount of information vary according to

OS and call

U Three general methods used to pass parameters to the OS

. Simplest: pass the parameters in registers

. Parameters stored in a block , or table, in memory, and

address of block passed as a parameter in a register

. Parameters placed, or , onto the by

the program and off the stack by the

operating

system

PARAMETER PASSING VIA TABLE

TYPES OF SYSTEM CALLS

U File management

. create file, delete file

. open, close file

. read, write, reposition

. get and set file attributes

U Device management

. request device, release device

. read, write, reposition

. get device attributes, set device attributes

. logically attach or detach devices

TYPES OF SYSTEM CALLS (CONT.)

U Information maintenance

. get time or date, set time or date . get system data, set system data . (^) get and set process, file, or device attributes U Communications . create, delete communication connection . send, receive messages if to or U From to . create and gain access to memory regions . transfer status information . attach and detach remote devices

EXAMPLES OF WINDOWS AND UNIX SYSTEM CALLS

STANDARD C LIBRARY EXAMPLE

d C program invoking printf() library call, which calls write() system call