Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
C program invoking printf() library call, which calls 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
Types of System Calls
System calls are roughly grouped into 5 major categories. They are:
Process control
File management (manipulation)
Device management (manipulation)
Information maintenance
Communications
Summary of Types of system calls by OS
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
Contd..
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 regions
transfer status information
attach and detach remote devices
Examples of Windows and UNIX System Calls
Process Control
i. end, abort
ii. load, execute
iii. create process, terminate process
iv. get process attributes, set process attributes
v. wait for time
vi. wait event, signal event
vii. allocate and free memory
MS-DOS execution