0% found this document useful (0 votes)
235 views7 pages

Lecture Notes On Operating Systems

The document discusses the structure and components of operating systems. It describes the key components as process management, memory management, file management, I/O management, secondary storage management, networking, protection systems, and command interpreters. It also outlines the major services operating systems provide including program execution, I/O operations, file system manipulation, and error detection. Finally, it states that system calls provide the interface between processes and the operating system.

Uploaded by

rrrollrox
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
235 views7 pages

Lecture Notes On Operating Systems

The document discusses the structure and components of operating systems. It describes the key components as process management, memory management, file management, I/O management, secondary storage management, networking, protection systems, and command interpreters. It also outlines the major services operating systems provide including program execution, I/O operations, file system manipulation, and error detection. Finally, it states that system calls provide the interface between processes and the operating system.

Uploaded by

rrrollrox
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

2009-2010

Lecture Notes on Operating Systems

١
3. Operating Systems Structure

An operating system provides the environment within which programs are


executed. Internally, operating systems vary greatly in their makeup, being
organized along many different lines. The design of a new operating system is a
major task. It is important that the goals of the system be well defined before the
design begins. The type of system desired is the foundation for choices among
various algorithms and strategies that will be necessary.

There are several vantage points from which to view an operating system.
One is by examining the services it provides. Another is by looking at the interface
it makes available to users and programmers. A third is by disassembling the
system into its components and their interconnections. In this lecture, we explore
all three aspects of operating systems, to show them from the viewpoints of users,
programmers, and operating-system designers.

3.1 System Components


Even though, not all systems have the same structure. However, many
modern operating systems share the same goal of supporting the following types of
system components.

Process Management

The operating system manages many kinds of activities ranging from user
programs to system programs like printer spooler, name servers, file server etc.
Each of these activities is encapsulated in a process. A process includes the
complete execution context (code, data, PC, registers, OS resources in use etc.).

It is important to note that a process is not a program. A process is only ONE


instant of a program in execution. There are many processes can be running the
same program.

٢
The five major activities of an operating system in regard to process management
are:

 Creation and deletion of user and system processes.


 Suspension and resumption of processes.
 A mechanism for process synchronization.
 A mechanism for process communication.
 A mechanism for deadlock handling.

Main-Memory Management

Main-Memory is a large array of words or bytes. Each word or byte has its
own address. Main memory is a repository of quickly accessible data shared by the
CPU and I/O devices. The central processor reads instructions from main memory
during the instruction-fetch cycle, and both reads and writes data from main
memory during the data-fetch cycle. The I/O operations implemented via DMA
also read and write data in main memory. The main memory is generally the only
large storage device that the CPU is able to address and access directly.

To improve both the utilization of CPU and the speed of the computer's
response to its users, we must keep several programs in memory. There are many
different memory-management schemes. The major activities of an operating
system in regard to memory-management are:

 Keep track of which part of memory are currently being used and by whom.
 Decide which processes are loaded into memory when memory space
becomes available.
 Allocate and deallocate memory space as needed.

٣
File Management

A file is a collected of related information defined by its creator. Computer


can store files on the disk (secondary storage), which provide long term storage.
Some examples of storage media are magnetic tape, magnetic disk and optical
disk. Each of these media has its own properties like speed, capacity, data transfer
rate and access methods.

A file system normally organized into directories to ease their use. These
directories may contain files and other directions. The five main major activities of
an operating system in regard to file management are:

1. The creation and deletion of files.


2. The creation and deletion of directions.
3. The support of primitives for manipulating files and directions.
4. The mapping of files onto secondary storage.
5. The backup of files on stable storage media.

I/O System Management

One of the purposes of an operating system is to hide the peculiarities of


specific hardware devices from the user. Only the device driver knows the
peculiarities of the specific device to which it is assigned.

Secondary-Storage Management

Generally speaking, systems have several levels of storage, including


primary storage, secondary storage and cache storage. Instructions and data must
be placed in primary storage or cache to be referenced by a running program.
Because main memory is too small to accommodate all data and programs, and its
data are lost when power is lost, the computer system must provide secondary
storage to back up main memory. Secondary storage consists of tapes, disks, and
other media designed to hold information that will eventually be accessed in
primary storage (primary, secondary, cache) is ordinarily divided into bytes or
words consisting of a fixed number of bytes. Each location in storage has an
address; the set of all addresses available to a program is called an address space.
٤
The three major activities of an operating system in regard to secondary storage
management are:

1. Managing the free space available on the secondary-storage device.


2. Allocation of storage space when new files have to be written.
3. Scheduling the requests for memory access.

Networking

A distributed system is a collection of processors that do not share memory,


peripheral devices, or a clock. The processors communicate with one another
through communication lines called network. The communication-network design
must consider routing and connection strategies, and the problems of contention
and security.

Operating systems usually generalize network access as a form of file


access, with the details of networking being contained in the network interface's
device driver.

Protection System

If a computer system has multiple users and allows the concurrent execution
of multiple processes, then the various processes must be protected from one
another's activities. Protection refers to mechanism for controlling the access of
programs, processes, or users to the resources defined by a computer system. This
mechanism must provide a means for specification of the controls to be imposed,
together with a means of enforcement.

Command Interpreter System

A command interpreter is an interface of the operating system with the user.


The user gives commands with are executed by operating system (usually by
turning them into system calls). The main function of a command interpreter is to
get and execute the next user specified command.

٥
3.2 Operating Systems Services
An operating system provides an environment for the execution of programs.
The operating system provides certain services to programs and to the users of
those programs. The specific services provided will, of course, differ from one
operating system to another, but there are some common classes that we can
identify. These operating-system services are provided for the convenience of the
programmer, to make the programming task easier.

Program Execution

The system must be able to load a program into memory and to run it. The
program must be able to end its execution, either normally or abnormally
(indicating error).

I/O Operations

A running program may require I/O. This I/O may involve a file or an I/O
device. For specific devices, special functions may be desired (such as rewind a
tape drive, or blank the screen on a CRT). For efficiency and protection, users
usually cannot control I/O devices directly. Therefore, the operating system must
provide some means to do I/O.

File System Manipulation

The output of a program may need to be written into new files or input taken
from some files. The operating system provides this service. The user does not
have to worry about secondary storage management. User gives a command for
reading or writing to a file and sees his/her task accomplished. Thus operating
system makes it easier for user programs to accomplish their task.

Error Detection

An error is one part of the system may cause malfunctioning of the complete
system. To avoid such a situation the operating system constantly monitors the
system for detecting the errors. This relieves the user of the worry of errors
propagating to various part of the system and causing malfunctioning.
٦
3.3 System Calls and System Programs

System calls provide the interface between a process and the operating
system. These calls are generally available as assembly-language instructions, and
are usually listed in the manuals used by assembly-language programmers. Some
systems may allow system calls to be made directly from a higher-level language
program, in which case the calls normally resemble predefined function or
subroutine calls. They may generate a call to a special run-time routine that makes
the system call, or the system call may be generated directly in-line.

You might also like