Lec 2
Lec 2
OPERATING-SYSTEM STRUCTURES
DR.HEND MANCY
LECTURE OUTLINE
• System call offers the services of the operating system to the user
programs.
• System calls are the only entry points for the kernel system.
• 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), and Java API for the Java virtual machine (JVM).
TYPES OF SYSTEM CALLS (6)
• Process Control
• File Management
• Device Management
• Information Maintenance
• Communications
• Protection
IMPORTANT SYSTEM CALLS USED IN OS
EXAMPLE OF STANDARD API
HOW SYSTEM CALL WORKS?
API – SYSTEM CALL – OS RELATIONSHIP
SYSTEM CALL PARAMETER PASSING
• 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
TYPES OF SYSTEM CALLS (CONT.)
• 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
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
SYSTEM PROGRAMS
System programs provide a convenient environment for program
development and execution. Some of them are simply user interfaces others are
considerably more complex.
❑ Systems programs
❑ The kernel
Example of following
XEventsQueued system call
move from libc library to
kernel and back
DTRACE (CONT.)