ch1 os last
ch1 os last
System Calls
• System calls: The mechanism used by an application program to
request service from the operating system.
• System call is how a program requests a service from an operating
system. This may include hardware related services (e.g. accessing the
hard disk), creating and executing new processes, and communicating
with integral kernel services (like scheduling).
• System calls provide an essential interface between a process and
the operating system.
The Shell
• The shell manages the interaction between user and the operating
system by prompting the user for input, interpreting that input for the
operating system, and then handling any resulting output from the
operating system.
• Shell is an interface to kernel, hiding complexity of kernel's functions
from users. Takes commands from user and executes kernel's
functions.
Kernel ‐ Core component of Operating System, interacts directly with
hardware, provides low level services to upper layer components.
Typical services provided by OS
• Program development: OS provides a variety of facilities and services, such as
editors and debuggers, to assist the programmer in creating programs. These are
supplied with the OS and are referred to as application program development
tools.
• Program execution: Instructions and data must be loaded into main memory,
I/O devices and files must be initialized, and other resources must be prepared.
The OS handles these scheduling duties for the user.
• Access to I/O devices: Each I/O device requires its own peculiar set of
instructions The OS provides a uniform interface that hides these details so that
programmers can access such devices using simple reads and writes.
• Controlled access to files: For file access, the OS must reflect a detailed
understanding of not only the nature of the I/O device (disk drive, tape drive) but
also the structure of the data contained in the files on the storage medium. In the
case of a system with multiple users, the OS may provide protection mechanisms
to control access to the files.
• System access: For shared or public systems, the OS controls access to the system as a
whole and to specific system resources.The access function must provide protection of
resources and data from unauthorized users and must resolve conflicts for resource
contention.
• Error detection and response: Internal and external hardware errors, such as a
memory error, or a device failure or malfunction; and various software errors, such
as division by zero, attempt to access forbidden memory location, and inability of
the OS to grant the request of an application can occur. In each case, the OS must
provide a response that clears the error condition with the least impact on running
applications. The response may range from ending the program that caused the
error, to retrying the operation, to simply reporting the error to the application.
Accounting: A good OS will collect usage statistics for various resources and monitor
performance parameters such as response time. On any system, this information is
useful in anticipating the need for future enhancements and in tuning the system to
improve performance. On a multiuser system, the information can be used for billing
purposes.
The End