Beruflich Dokumente
Kultur Dokumente
MODULE 1
Operating system
• An operating system is a program that manages the computer hardware. It also
provides a basis for application programs and acts as an intermediary between the
computer user and the computer hardware
Resource allocator
Manager-memory,process,files,security,ect..
• Goals:
Primary Goal: Convenience
Secondary Goal: Efficiency
Computer System Structure
Computer system can be divided into four components:
Hardware – provides basic computing resources CPU, memory, I/O devices
Operating system Controls and coordinates use of hardware among various
applications and users
Application programs – define the ways in which the system resources are used
to solve the computing problems of the users Word processors, compilers, web
browsers, database systems, video games
Users People, machines, other computers
Four Components of a computer system
Operating systems from two viewpoints: user and system.
User View
• Users want convenience, ease of use and good performance
• Don’t care about resource utilization
• User sits at a terminal connected to a mainframe or minicomputer- Other users
are accessing the same computer through other terminals.
• These users share resources and may exchange information. operating system in
such cases is designed to maximize resource utilization
• Users sit at workstations connected to networks of other workstations and
servers.
• These users have dedicated resources at their disposal, but they also share
resources such as networking and servers—file,compute, and print servers.
• Therefore, their operating system is designed to compromise between individual
usability and resource utilization.
• Some computers have little or no user view.
• For example, embedded computers in home devices and automobiles.
System View
• OS is a resource allocator
• Manages all resources
• Decides between conflicting requests for efficient and fair resource use
• OS is a control program
Controls execution of programs to prevent errors and improper use of the computer
File Management
• A file system is normally organized into directories for easy navigation and usage.
These directories may contain files and other directions.
• Keeps track of information, location, uses, status etc. The collective facilities are
often known as file system.
• Decides who gets the resources.
• Allocates the resources.
• De-allocates the resources.
• Jobs with similar needs are batched together and executed through processor as
a group
• Operator starts job as a deck of punch cards into batch with similar needs
Eg:FORTRAN batch, COBOL batch etc
• Batch processing is the most primitive type of operating system.
• Batch processing generally requires the program, data, and appropriate system
commands to be submitted together in the form of a job.
• Batch operating systems usually allow little or no interaction between users and
executing programs.
• Due to turnaround delays and offline debugging, batch is not very convenient for
program development.
• Examples of such programs include payroll, forecasting, statistical analysis, and
large scientific number-crunching programs.
Scheduling in batch is very simple. Jobs are typically processed in order of their
submission, that is, first-come first-served fashion
• Memory management in batch systems is also very simple. Memory is usually
divided into two areas.
• The resident portion of the Operating System permanently occupies one of them,
and the other is used to load transient programs for execution.
• When a transient program terminates, a new program is loaded into the same
area of memory.
System Calls
• Programming interface to the services provided by the OS
• Mostly accessed by programs via a high-level Application Programming Interface
(API) rather than direct system call use
• 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)
System Call Implementation
• Typically, a number associated with each system call
• System-call interface maintains a table indexed according to these
numbers
• The system call interface invokes the intended system call in OS kernel and
returns status of the system call and any return values
• The caller need know nothing about how the system call is implemented
• Just needs to obey API and understand what OS will do as a result call
• Most details of OS interface hidden from programmer by API
Example of System Calls
• System call sequence to copy the contents of one file to another file
• C program invoking printf() library call, which calls write() system call