Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Unit - 1 Operating System, Summaries of Operating Systems

according to syllabus of Rajasthan university notes have been prepared.

Typology: Summaries

2018/2019

Uploaded on 03/03/2019

cute_boy_1019_rahul
cute_boy_1019_rahul 🇮🇳

1

(2)

3 documents

1 / 14

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
UNIT – I NECESSITY OF OS & DEVICE MANAGEMENT
DEFINITION
An Operating System is an integrated set of system programs whose major function is
to manage resources (like CPU, Memory, Disks, etc.), control input and output,
schedule jobs, handle errors, provide security, acts an interface between the user and
machine.
Operating System is a layer of software that are basically a collection of programs that
is used to keep track and use correctly all the computer components such as memory,
printers, disks, keyboards, display, and network interfaces etc.
Operating System is the medium between the computer hardware/components and
users.
Example
Windows – (windows XP, windows 7, windows 8, windows 8.1, windows 10)
Linux – (Ubuntu, Backtrack, Kali Linux, Fedora, Linux Mint)
GOALS OF OPERATING SYSTEMS
Any Operating System should meet the following major jobs:
Optimize the use of computer resources so as to maximize its throughput.
Create a user-friendly computing environment for accessing the computer
resources.
OPERATING SYSTEM – SERVICE
An Operating System provides services to both the users and to the program:
It provides programs an environment to execute.
It provides users the services to execute the programs in a convenient manner.
Following are a few common services provided by an operating system –
Program Execution
I/O Operations
File System Manipulation
Communication
Error Detection
Resource Allocation
Protection
PROGRAM EXECUTION
Operating systems handle many kinds of activities from user programs to system
programs like printer spooler, name servers, file server, etc. Each of these activities is
encapsulated as a process.
A process includes the complete execution context (code to execute, data to
manipulate, registers, OS resources in use).
Following are the major activities of an operating system with respect to program
management: -
Loads a program into memory.
Executes the program.
Handles program’s execution.
Provides a mechanism for process synchronization.
Provides a mechanism for process communication.
Provides a mechanism for deadlock handling.
I/O OPERATIONS
I/O subsystem comprises of I/O devices and their corresponding driver software.
Drivers hide the peculiarities of specific hardware device from the users.
An Operating System manages the communication between user and device drivers.
I/O operation means read or write operation with any file or any specific I/O
device.
Operating System provides the access to the required I/O device when required.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Unit - 1 Operating System and more Summaries Operating Systems in PDF only on Docsity!

UNIT – I NECESSITY OF OS & DEVICE MANAGEMENT

• DEFINITION

  • An Operating System is an integrated set of system programs whose major function is to manage resources (like CPU, Memory, Disks, etc.), control input and output, schedule jobs, handle errors, provide security, acts an interface between the user and machine.
  • (^) Operating System is a layer of software that are basically a collection of programs that is used to keep track and use correctly all the computer components such as memory, printers, disks, keyboards, display, and network interfaces etc.
  • Operating System is the medium between the computer hardware/components and users.
  • Example ■ Windows – (windows XP, windows 7, windows 8, windows 8.1, windows 10) ■ Linux – (Ubuntu, Backtrack, Kali Linux, Fedora, Linux Mint)

• GOALS OF OPERATING SYSTEMS

  • Any Operating System should meet the following major jobs: ■ (^) Optimize the use of computer resources so as to maximize its throughput. ■ Create a user-friendly computing environment for accessing the computer resources.

• OPERATING SYSTEM – SERVICE

  • An Operating System provides services to both the users and to the program: ■ It provides programs an environment to execute. ■ It provides users the services to execute the programs in a convenient manner.
  • Following are a few common services provided by an operating system – ■ Program Execution ■ I/O Operations ■ (^) File System Manipulation ■ Communication ■ Error Detection ■ Resource Allocation ■ Protection

PROGRAM EXECUTION ✓ Operating systems handle many kinds of activities from user programs to system programs like printer spooler, name servers, file server, etc. Each of these activities is encapsulated as a process. ✓ A process includes the complete execution context (code to execute, data to manipulate, registers, OS resources in use). ✓ Following are the major activities of an operating system with respect to program management: - ♦ Loads a program into memory. ♦ Executes the program. ♦ (^) Handles program’s execution. ♦ Provides a mechanism for process synchronization. ♦ Provides a mechanism for process communication. ♦ Provides a mechanism for deadlock handling.

I/O OPERATIONS ✓ I/O subsystem comprises of I/O devices and their corresponding driver software. Drivers hide the peculiarities of specific hardware device from the users. ✓ An Operating System manages the communication between user and device drivers. ♦ I/O operation means read or write operation with any file or any specific I/O device. ♦ Operating System provides the access to the required I/O device when required.

FILE SYSTEM MANIPULATION

✓ A file represents a collection of related information. ✓ Examples of storage media include magnetic tape, magnetic disk and optical disk drivers like CD, DVD. ✓ Each of these media has its own properties like speed, capacity, data transfer rate and data access methods. ✓ A file system is normally organized into directories for easy navigation and usage. These directories may contain files and other directions. ✓ Following are the major activities of an activities of an operating system with respect to file management: - ♦ Program needs to read a file or write a file. ♦ The operating system gives the permission to program for operation on file. ♦ Permission varies from read-only, read-write, denied and so on. ♦ Operating System provides an interface to the user to create/delete files. ♦ Operating System provides an interface to the user to create/delete directories. ♦ Operating System provides an interface to create the backup of file system.

COMMUNICATION ✓ In case of distributed systems which are a collection of processors that do not share memory, peripheral devices, or a clock, the operating system manages communications between all the processes. ✓ Multiple processes communicate with one another through communication lines in the network. ✓ The Operating System handles routing and connection strategies, and the problems of contention and security. ✓ Following are the major activities of an operating system with respect to communication:

  • ♦ Two processes often require data to be transferred between them. ♦ Both the processes can be one computer or on different computers, but are connected through a computer network. ♦ Communication may be implemented by two methods, either by Shared Memory or by Message Passing.

ERROR HANDLING ✓ Errors can occur anytime and anywhere. An error may occur in CPU, in I/O devices or in the memory hardware. ✓ Following are the major activities of an operating system with respect to error handling - ♦ The Operating System constantly checks for possible errors. ♦ The Operating System takes an appropriate action to ensure correct and consistent computing.

RESOURCE MANAGEMENT ✓ In case of multi-user or multi-tasking environment, resources such as main memory, CPU cycles and file storage are to be allocated to each user or job. ✓ Following are the major activities of an operating system with respect to resource management – ♦ The Operating System manages all kinds of resources using schedulers. ♦ CPU scheduling algorithms are used for better utilization of CPU.

PROTECTION ✓ Protection refers to a mechanism or a way to control the access of programs, processes, or users to the resources defined by a computer system. ✓ Following are the major activities of an operating system with respect to protection – ♦ The Operating System ensures that all access to system resources is controlled. ♦ The Operating System ensures that external I/O devices are protected from invalid access attempts. ♦ The Operating System provides authentication features for each user by means of passwords.

✓ Each task has given some time to execute, so that all the tasks work smoothly. Each user gets time of CPU as they use single system. ✓ These systems are also known as Multitasking Systems. ✓ The task can be from single user or from different users also. The time that each task gets to execute is called quantum. After this time interval is over OS switches over to next task. ✓ Examples of Time-Sharing OSs are: Multics, Unix etc.

Advantages: ♦ Each task gets an equal opportunity ♦ Less chances of duplication of software ♦ CPU idle time can be reduced ✓ Disadvantages: ♦ Reliability problem ♦ (^) One must have to take care of security and integrity of user programs and data ♦ Data communication problem

DISTRIBUTED OPERATING SYSTEM ✓ These types of operating system are a recent advancement in the world of computer technology and are being widely accepted all-over the world and, that too, with a great pace. ✓ Various autonomous interconnected computers communicate each other using a shared communication network. Independent systems possess their own memory unit and CPU. ✓ These are referred as loosely coupled systems or distributed systems. ✓ These systems processors differ in sizes and functions. ✓ The major benefit of working with these types of operating system is that it is always possible that one user can access the files or software which are not actually present on his system but on some other system connected within this network i.e., remote access is enabled within the devices connected in that network. ✓ Examples of Distributed Operating System are: LOCUS etc.

✓ (^) Advantages: ♦ Failure of one will not affect the other network communication, as all systems are independent from each other. ♦ Electronic mail increases the data exchange speed. ♦ Since resources are being shared, computation is highly fast and durable. ♦ Load on host computer reduces.

♦ These systems are easily scalable as many systems can be easily added to the network. ♦ Delay in data processing reduces. ✓ Disadvantages: ♦ Failure of the main network will stop the entire communication. ♦ To establish distributed systems the language which are used are not well defined yet. ♦ These types of systems are not readily available as they are very expensive. Not only that the underlying software is highly complex and not understood well yet.

NETWORK OPERATING SYSTEM ✓ These systems run on a server and provides the capability to manage data, users, groups, security, applications, and other networking functions. ✓ (^) These types of operating systems allow shared access of files, printers, security, applications, and other networking functions over a small private network. ✓ One more important aspect of Network Operating Systems is that all the users are well aware of the underlying configuration, of all other users within the network, their individual connections etc. and that’s why these computers are popularly known as tightly coupled systems. ✓ Examples of Network Operating System are: Microsoft Windows Server 2003, Microsoft Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD etc.

Advantages: ♦ Highly stable centralized servers. ♦ Security concerns are handled through servers. ♦ New technologies and hardware up-gradation are easily integrated to the system. ♦ Server access are possible remotely from different locations and types of systems. ✓ Disadvantages: ♦ Servers are costly. ♦ User has to depend on central location for most operations. ♦ Maintenance and updates are required regularly.

REAL-TIME OPERATING SYSTEM ✓ These types of OS serve the real-time systems. The time interval required to process and respond to inputs is very small. This time interval is called response time. ✓ Real-time systems are used when there are time requirements are very strict like missile systems, air traffic control systems, robots etc. ✓ Two types of Real-Time Operating System which are as follows: ▲ Hard Real-Time Systems: These OSs are meant for the applications where time constraints are very strict and even the shortest possible delay is not acceptable. These systems are built for saving life like automatic parachutes or air bags which are required to be readily available in case of any accident. Virtual memory is almost never found in these systems. ▲ Soft Real-Time Systems: These OSs are for applications where for time-constraint is less strict.

✓ Operating system provides the set of system calls that define the interface between the user programs and the operating system. ✓ The system calls available in the interface vary from OS to OS (Operating System to Operating System). Operating System Commands – ✓ OS commands are the commands that are directly run from the prompt. ✓ For example, to list files or sub-directories in MS-DOS, we use dir command.

  • FUNCTIONS OF OPERATING SYSTEM
    • (^) Maintenance Provides an interface for computer interaction
    • Control of inputs and outputs
    • Interrupt handling
    • Management of hardware and peripherals
    • Error handling
    • Management and loading of software
    • Management of user accounts
    • File utilities (copy, save, sort, delete)
    • Processor management for multitasking
    • Memory management
    • Security (access rights, firewalls etc)
  • OPERATING SYSTEM STRUCTURE
    • Layered Structure Approach ✓ The Operating System architecture based on LAYERED APPROACH consist of numbers of layers, each built on top level layers.

✓ The bottom layer is the hardware and the highest layer is the user interface. ✓ As shown, lowest layer deals with hardware. The Higher-Level Layer handle allocation of jobs to processor. The next layer implemented memory management. It deals with memory including virtual memory. ✓ The Device Driver Layer contains the device drivers for the operator’s console. ✓ Upper layer for I/O buffering and then device buffers placed in virtual memory. The Top Layer is the User’s Program to run the application. ✓ Main Difficulty with the Layered Approach is definition of a new level that is how to differentiate one level from another since a layer can use services of a layer below it.

  • Kernel Approach ✓ Kernel is that part of operating system which directly makes interface with hardware system.

✓ Kernel Approach functions are: ■ To provide a mechanism for creation and deletion of processes. ■ To provide processor scheduling, memory management and input output management. ■ To provide a mechanism for synchronization of processor so that processes synchronize their actions. ■ To provide mechanism for inter process communications. ✓ The Linux operating system is based on Kernel Approach. ✓ A Kernel is between system program and hardware. The Kernel supports the file system processor scheduling, memory management and other O/ S functions through system calls. ✓ Linux OS supports a large number of systems calls for process management and other OS functions, through these system calls program utilises the services of OS.

  • OPERATING SYSTEM INPUT/OUTPUT
    • The operating system must issue the commands to the input/output devices, catch the interrupts and handle the errors.
    • The operating system should also provide an interface between the input/output devices and the rest of the computer system. This interface must be simple device independence (where possible) and easy to use. INPUT/OUTPUT DEVICES ✓ Input/output devices are the devices that are responsible for the input/output operations in a computer system. ✓ Basically, there are following two types of input/output devices: - Block devices - Character devices Block Device – ■ It stores information in block with fixed-size and own-address. ■ It is possible to read/write each and every block independently. ■ (^) Common Block Devices: Hard disk, USB Camera, etc. Character Device – ■ It accepts/delivers a stream of characters without regarding to any block structure. ■ It isn’t addressable and doesn’t have any seek operation. ■ Common Character Devices: Printer, Mice, Network Interfaces, etc. ✓ Examples of Input/output Devices - Keyboard - Mouse - Monitor - Modem - Scanner - Laser Printer - Ethernet - Disk

DEVICE CONTROLLER

✓ Device Controller are also called as Adapter. ✓ The Device Controller works like an interface between a device and a device driver. I/O units (Keyboard, mouse, printer, etc.) typically consist of a mechanical component and an electronic component where electronic component is called the device controller.

DEVICE DRIVER

✓ Device drivers are software modules that can be plugged into an OS to handle a particular device. Operating System takes help from device drivers to handle all I/O devices.

✓ DMA is used for high-speed input output devices. The Device Controller transfer an entire block of data directly to or from its local buffer to memory without any intervention of CPU. ✓ Only one interrupt is generated per block rather than one interrupt per byte generated for low speed device.

  • STORAGE STRUCTURE ✓ It consists of registers, main memory, magnetic disk is only one of many possible storage systems. ✓ There are also cache CD ROM, magnetic tapes and so on. ♦ MAIN MEMORY ♦ MEMORY IN SYSTEM PARTITION ♦ MEMORY IN APPLICATION PARTITION ♦ TEMPORARY MEMORY

MAIN MEMORY ✓ Main memory and register built into the processor itself are the only storage that the CPU can access directly. ✓ As Operating System starts up, it divided the RAM into two broad sections:

  • System Partition.
  • Application Partition. SYSTEM PARTITION ■ Main Memory reserves for itself a zone/partition of memory known as the SYSTEM PARTITION. ■ (^) The System Partition always begins at the lowest addressable byte of memory (memory address O) and extends upward. The System Partition contains a system leap and a set of global variables. APPLICATION PARTITION ■ All memory outside the system partition is available for allocation to applications or other software components. ■ When an application is launched, the Operating System assigns it a section of memory known as the APPLICATION PARTITION. ■ An Application uses only the memory contained in its own application partition.

MEMORY IN SYSTEM PARTITION

✓ Your System Partition is divided into two major parts:

  • The System Heap.
  • The System Global Variable. The System Heap ■ The main part of system partition is an area of memory known as the SYSTEM HEAP. ■ The System Heap is reserved for exclusive use by the Operating System and other system software components, which load into its various items such as system resources, system code segments, and system data structures. ■ All system buffers and queues – allocated in the system heap. ■ Most applications do not need to load anything in the system heap.

The System Global Variable ■ The lowest part of memory is occupied by a collection of global variables called SYSTEM GLOBAL VARIABLES. ■ The Operating System uses these variables to maintain different kinds of information about the Operating Environment. ■ Global Variable are of used to contain information that is generally useful only to the Operating System or other system software component. It also contains information about current application.

MEMORY IN APPLICATION PARTITION ✓ When your application is launched, the Operating System allocates for it a partition of memory called its Application Partition. ✓ Your Application Partition is divided into three major parts:

  • The Application Stack.
  • The Application Heap.
  • (^) The Application Global Variables.
  • This pointer is used by the DMA hardware to locate the target block in primary memory.
  • STORAGE HIERARCHY ✓ In the Computer System Design, Memory Hierarchy is an enhancement to organize the memory such that it can minimize the access time. ✓ The Memory Hierarchy was developed based on a program behaviour known as locality of references. ✓ The figure below clearly demonstrates the different levels of memory hierarchy:

✓ The following characteristics of Memory Hierarchy Design from above figure: ♦ Capacity: It is the global volume of information the memory can store. As we move from top to bottom in the Hierarchy, the capacity increases. ♦ Access Time: It is the time interval between the read/write request and the availability of the data. As we move from top to bottom in the Hierarchy, the access time increases. ♦ Performance: Earlier when the computer system was designed without Memory Hierarchy design, the speed gap increases between the CPU registers and Main Memory due to large difference in access time. This results in lower performance of the system and thus, enhancement was required. This enhancement was made in the form of Memory Hierarchy Design because of which the performance of the system increases. One of the most significant ways to increase system performance is minimizing how far down the memory hierarchy one has to go to manipulate data. ♦ Cost per bit: As we move from bottom to top in the Hierarchy, the cost per bit increases i.e. Internal Memory is costlier than External Memory.

  • GENERAL DEVICE CHARACTERISTICS
    • (^) Character Stream/Block ■ A character-stream device transfer byte in one by one manner/

■ A Block device transfer a complete unit of bytes.

  • Sequential/Random Access ■ A Sequential Device transfers data in a fixed order determined by the device. ■ Random Access Device can be instructed to seek position to any of the available data storage location.
  • Synchronous/Asynchronous ■ A Synchronous Device perform data transfer with known response time. ■ An Asynchronous Device shows irregular or unpredictable response time.
  • Sharable/Dedicated ■ A Sharable Device can be used concurrently by several processes or threads but a Dedicated Device cannot be used.
  • Speed of Operation ■ Device speeds may range from a few bytes per second to a few gigabytes per second.
  • Read-write: read only or write only ■ Some Devices perform both input and output, but others support only one.
  • Efficiency ■ (^) Most input output devices are extremely show compared with the processor and the main memory and buffering is one way to deal with this issue.
  • Generality ■ It is desirable to handle all devices in a uniform and consistent manner. It applies for both the way the user processes see the devices and the way the operating system manages the input output devices and operation.

UNIT – II PROCESS MANAGEMENT

• DEFINITION