Os 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

SYSTEM CALLS

O P E R AT I N G S Y S T E M
SYSTEM CALL

• The system call provides an interface to the operating system services.

• Application developers often do not have direct access to the system calls, but can access them
through an application programming interface (API).The functions that are included in the API
invoke the actual system calls. By using the API, certain benefits can be gained:
– Portability: as long a system supports an API, any program using that API can compile and run.
– Ease of Use: using the API can be significantly easier than using the actual system call.
EXAMPLE OF SYS CALL USAGE
TYPES OF SYSTEM CALLS
• There are 5 different categories of system calls: process control, file manipulation, device
manipulation, information maintenance, and communication.
• Process control : A running program needs to be able to stop execution either normally or
abnormally. When execution is stopped abnormally, often a dump of memory is taken and can be
examined with a debugger.
– 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 : Some common system calls are create, delete, read, write, reposition, or close. Also,
there is a need to determine the file attributes – get and set file attribute. Many times the OS
provides an API to make these system calls.
– create file, delete file
– open, close
– read, write, reposition
– get file attributes, set file attributes
• Device Management: Process usually require several resources to execute, if these resources are
available, they will be granted and control returned to the user process. These resources are also
thought of as devices. Some are physical, such as a video card, and others are abstract, such as a
file. User programs request the device, and when finished they release the device. Similar to files,
we can read, write, and reposition the device.
• Information Management: some system calls exist purely for transferring information between the
user program and the operating system. An example of this is time, or date. The OS also keeps
information about all its processes and provides system calls to report this information.
• Communication : There are two models of interprocess communication, the message-passing
model and the shared memory model.
– Message-passing uses a common mailbox to pass messages between processes.
– Shared memory use certain system calls to create and gain access to create and gain access to
regions of memory owned by other processes. The two processes exchange information by reading
and writing in the shared data.
• Protection provides a mechanism for controlling access to the resources provided by a
computer system. Historically, protection was a concern only on multiprogrammed computer
systems with several users. However, with the advent of networking and the Internet, all
computer systems, must be concerned with protection.
– System calls providing protection include set permission() and get permission(), which manipulate the
permission settings of resources such as files and disks.
– The allow user() and deny user() system calls specify whether particular users can—or cannot—be
allowed access to certain resources.
WINDOWS VS UNIX SYSTEM CALLS
OS STRUCTURE

• In MS-DOS, the interfaces and levels of functionality are not well separated. For instance,
application programs are able to access the basic I/O routines to write directly to the display
and disk drives. Such freedom leaves MS-DOS vulnerable to errant (or malicious) programs,
causing entire system crashes when user programs fail. Of course, MS-DOS was also limited by
the hardware of its era.
• Like MS-DOS, UNIX initially was limited by hardware functionality. It consists of two separable
parts: the kernel and the system programs. The kernel is further separated into a series of
interfaces and device drivers, which have been added and expanded over the years as UNIX
has evolved. Everything below the system-call interface and above the physical hardware is the
kernel. The kernel provides the file system, CPU scheduling, memory management, and other
operating-system functions through system calls.
WHAT ABOUT WINDOWS 10?

You might also like