7

OPERATING SYSTEM

Contents

  • Objectives of OS
  • Types of OS—Single user and single task, single user and multitasking, multiuser, multiprocessing, real time, embedded OS
  • Functions of OS—Process management, memory management, file management, device management, protection and security, user interface
  • Process management
    • Process—Process states (new, ready, running, waiting, terminated)
    • CPU scheduling—Scheduler, scheduling algorithms (FCFS, SJF, RR)
    • Process synchronization—Concurrent processes, race condition
    • Deadlock—Deadlock conditions, deadlock prevention, deadlock avoidance
  • Memory management
    • Memory allocation—Multiple partition allocation, paging
    • Virtual memory—Demand paging
  • File management—Files, directory structure
  • Device management—Device drivers, I/O scheduling, buffering, spooling
  • Protection and security
  • User interface—CLI, GUI
  • Examples of operating systems—MS-DOS, Windows family of OS, Linux

Why this chapter

Any computer system you use has an operating system. The user interacts with the machine via the operating system. A software on the machine interacts with the hardware via the operating system. Operating system intermediates between the hardware and the user. The purpose of this chapter is to introduce you to the Operating System.

7.1 INTRODUCTION

The computer system comprises of a functional set of hardware, software, user and data. Hardware consists of the components of computer like memory, processor, storage devices, and Input/Output devices. The software may be of different kinds—application software and system softwa re. A computer system may be a single stand-alone system or may consist of several interconnected systems. The user uses the application software to perform various tasks, for example, the user uses word processing software for document preparation. While using the application software, the user uses the storage of a computer—to store a document on the hard disk, to execute a command on the CPU, to retrieve a document from a peripheral device or to print document on printer. For using the hardware, there is a need for software that interacts with both the hardware and the application software. Operating system (OS) is the software that provides an interface between the computer hardware, and the application programs or users (Figure 7.1).

In this chapter, we discuss about the components of operating system, the different types of operating system and the functions of operating system. A brief description of some operating systems is also given.

Figure 7.1 View of components of computer system

7.2 OBJECTIVES OF OPERATING SYSTEM

Operating system is system software that controls and coordinates the use of hardware among the different application software and users. OS intermediates between the user of computer and the computer hardware. The user gives a command and the OS translates the command into a form that the machine can understand and execute. OS has two main objectives—(1) to make the computer system convenient and easy to use, for the user, and—(2) to use the computer hardware in an efficient way, by handling the details of the operations of the hardware.

  • OS hides the working of the hardware from the user and makes it convenient for the user to use the machine. The application program used by the user requires the use of the hardware during processing. Some examples are—display of application∙s user interface, loading a program into memory, using I/O devices, allocating CPU to different processes during execution, and store or load data from hard disk. When using the machine, the user gives the command to perform the required actions to the OS and the OS handles all the operational steps. The user is not bothered about how these actions will be performed. This is the job of OS. OS provides an interface to the application programs to interact with the hardware. The user need not get into the details of this interaction.
  • At the other end, the different resources of computer hardware have to be managed and controlled. This includes managing the communication between different devices, controlling the sequence and execution of processes, allocating space on hard disk, providing error handling procedures etc. OS supervises and manages the hardware of the computer.

Some of the commonly used operating systems are Microsoft Disk Operating System (MS-DOS), Windows 7, Windows XP, Linux, UNIX, and Mac OS X Snow Leopard.

7.3 TYPES OF OS

OS are classified into different types depending on their capability of processing—(1) Single user, (2) Multiuser, (3) Multitasking, (4) Multiprocessing, (5) Real time, and (6) Embedded.

  • Single User and Single Task OS is for use by a single user for a standalone single computer for performing a single task (Figure 7.2). Operating system for Personal Computers (PC) are singleuser OS. For example, if the user is editing a document, then a document cannot be printed on the printer simultaneously. Single user OS are simple operating system designed to manage one task at a time. MS-DOS is an example of single user OS.

    Figure 7.2 A single user performing a single task

  • Single User and Multitasking OS allows execution of more than one task or process concurrently. For this, the processor time is divided amongst different tasks. This division of time is also called time sharing. The processor switches rapidly between processes. For example, the user can listen to music on the computer while writing an article using a word processor software. The user can switch between the applications and also transfer data between them (Figure 7.3). Windows 95 and all later versions of Windows are examples of multitasking OS.

    Figure 7.3 A single user performing multitasking (issuing print command and making drawings)

  • Multiuser OS is used in computer networks that allow same data and applications to be accessed by multiple users at the same time (Figure 7.4). The users can also communicate with each other. Linux, UNIX, and Windows 7 are examples of multiuser OS.
  • Multiprocessing OS have two or more processors for a single running process. Processing takes place in parallel and is also called parallel processing. Each processor works on different parts of the same task, or, on two or more different tasks. Since execution takes place in parallel, they are used for high speed execution, and to increase the power of computer. Linux, UNIX and Windows 7 are examples of multiprocessing OS.

    Figure 7.4 Multiple users working on connected computers

  • Real Time OS are designed to respond to an event within a predetermined time. These operating systems are used to control processes. Processing is done within a time constraint. OS monitors the events that affect the execution of process and respond accordingly. They are used to respond to queries in areas like medical imaging system, industrial control systems etc. LynxOS is an example of real time OS.
  • Embedded OS is embedded in a device in the ROM. They are specific to a device and are less resource intensive. They are used in appliances like microwaves, washing machines, traffic control systems etc.
7.4 FUNCTIONS OF OS

Operating system is a large and complex software consisting of several components. Each component of the operating system has its own set of defined inputs and outputs. Different components of OS perform specific tasks to provide the overall functionality of the operating system (Figure 7.5). Main functions of the operating system are as follows:

Figure 7.5 Functions of OS

  • Process Management—The process management activities handled by the OS are—(1) control access to shared resources like file, memory, I/O and CPU, (2) control execution of applications, (3) create, execute and delete a process (system process or user process), (4) cancel or resume a process (5) schedule a process, and (6) synchronization, communication and deadlock handling for processes.
  • Memory Management—The activities of memory management handled by OS are—(1) allocate memory, (2) free memory, (3) re-allocate memory to a program when a used block is freed, and (4) keep track of memory usage.
  • File Management—The file management tasks include—(1) create and delete both files and directories, (2) provide access to files, (3) allocate space for files, (4) keep back-up of files, and (5) secure files.
  • Device Management—The device management tasks handled by OS are—(1) open, close and write device drivers, and (2) communicate, control and monitor the device driver.
  • Protection and Security—OS protects the resources of system. User authentication, file attributes like read, write, encryption, and back-up of data are used by OS to provide basic protection.
  • User Interface or Command Interpreter—Operating system provides an interface between the computer user and the computer hardware. The user interface is a set of commands or a graphical user interface via which the user interacts with the applications and the hardware.
7.5 PROCESS MANAGEMENT
  • A process is a program in a state of execution. It is a unit of work for the operating system. A process can be created, executed, and stopped. In contrast, a program is always static and does not have any state. A program may have two or more processes running. A process and a program are, thus, two different entities.
  • To accomplish a task, a process needs to have access to different system resources like I/O devices, CPU, memory etc. The process management function of an operating system handles allocation of resources to the processes in an efficient manner. The allocation of resources required by a process is made during process creation and process execution.
  • A process changes its state as it is executed. The various states that a process changes during execution are as follows (Figure 7.6):

    Figure 7.6 Process states

    • New—process is in a new state when it is created,
    • Ready—process is in ready state when it is waiting for a processor,
    • Running—process is in running state if processor is executing the process,
    • Waiting—process is in waiting state when it waits for some event to happen (I/O etc), and
    • Terminated—process that has finished execution is in terminated state.
  • A system consists of collection of processes—(1) system process that execute system code, and (2) user process that execute user code. OS mainly handles the execution of user code, though it may also handle various system processes.

The concurrent execution of the process requires process synchronization and CPU scheduling. The CPU scheduling, process synchronization, communication, and deadlock situations are described in the following subsections.

7.5.1 CPU Scheduling

  • CPU or processor is one of the primary computer resources. All computer resources like I/O, memory, and CPU are scheduled for use.
  • CPU scheduling is important for the operating system. In a multiprogramming and time sharing system, the processor executes multiple processes by switching the CPU among the processes, so that no user has to wait for long for a program to execute. To enable running of several concurrent processes, the processor time has to be distributed amongst all the processes efficiently.
  • Scheduler is a component of the operating system that is responsible for scheduling transition of processes. At any one time, only one process can be in running state and the rest are in ready or waiting state. The scheduler assigns the processor to different processes in a manner so that no one process is kept waiting for long.
  • Scheduling can be non-pre-emptive scheduling or pre-emptive scheduling. In non-pre-emptive scheduling, the processor executes a process till termination without any interruption. Hence the system resources are not used efficiently. In pre-emptive scheduling, a running process may be interrupted by another process that needs to execute. Pre-emption allows the operating system to interrupt the executing task and handle any important task that requires immediate action. In pre-emptive scheduling, the system resources are used efficiently.
  • There are many different CPU scheduling algorithms that are used to schedule the processes. Some of the common CPU scheduling algorithms are as follows—
    • First Come First Served (FCFS) Scheduling: As the name says, the process that requests for the CPU first, gets the CPU first. A queue is maintained for the processes requesting the CPU. The process first in the queue is allocated the CPU first. FCFS scheduling is non-pre-emptive. The drawback of this scheduling algorithm is that the process that is assigned to the CPU may take long time to complete, keeping all other processes waiting in the queue, even if they require less CPU time.
    • Shortest Job First (SJF) Scheduling: The process that requires the least CPU time is allocated the CPU first. SJF scheduling is non-pre-emptive. The drawback of this scheduling is that a process that requires more CPU time may have to wait for long time, since processes requiring less CPU time will be assigned the CPU first.
    • Round Robin (RR) Scheduling: It is designed for time-sharing systems. RR scheduling is pre-emptive. In this scheduling, a small quantum of time (10—100 ms) is defined, and each process in the queue is assigned the CPU for this quantum of time circularly. New processes are added at the tail of the queue and the process that has finished execution is removed from the queue. RR scheduling overcomes the disadvantage of FCFS and SJF scheduling. A process does not have to wait for long, if it is not the first one in the queue, or, if it requires CPU for a long period of time.

Figure 7.7 shows the ready queue—P#1 with CPU time requirement of 5 units, P#2 with 7 units and P#3 with 4 units, are scheduled, using the different CPU scheduling algorithms.

7.5.2 Process Synchronization

  • In a computer, multiple processes are executing at the same time. The processes that share the resources have to communicate with one another to prevent a situation where one process disrupts another process.

    Figure 7.7 Illustrating CPU scheduling algorithms with an example

  • When two or more processes execute at the same time, independent of each other, they are called concurrent processes.
  • A situation where multiple processes access and manipulate the same data concurrently, in which the final result depends on the order of process execution, is called a race condition. To handle such situations, synchronization and coordination of the processes is required.

7.5.3 Deadlock

  • In a multiprogramming environment, multiple processes may try to access a resource. A deadlock is a situation when a process waits endlessly for a resource and the requested resource is being used by another process that is waiting for some other resource (Figure 7.8).
  • A deadlock arises when the four necessary conditions hold true simultaneously in a system. These conditions are as follows:

    Figure 7.8 Deadlock

    • Mutual Exclusion—Only one process at a time can use the resource. Any other process requesting the resource has to wait until the resource is released.
    • No Pre-emption—A process releases the resource by itself. A process cannot remove the resource from another process.
    • Hold and Wait—A process holds a resource while requesting another resource, which may be currently held by another process.
    • Circular Wait—In this situation, a process P1 waits for a resource held by another process P2, and the process P2 waits for a resource held by process P1.
  • Deadlock handling can be done by deadlock avoidance and deadlock prevention.
    • Deadlock Prevention is a set of method that ensures that at least one of the above four necessary conditions required for deadlock, does not hold true.
    • Deadlock Avoidance requires that the operating system be given information in advance regarding the resources a process will request and use. This information is used by the operating system to schedule the allocation of resources so that no process waits for a resource.
7.6 MEMORY MANAGEMENT

In a computer, there may be multiple processes executing at the same time. Every process that needs to execute, requires a certain amount of memory. Memory management is one of the tasks handled by the operating system. Memory management schemes handle the allocation of memory to different processes. On completion of process execution, the memory is de-allocated and made available to another process. Additionally, different processes that have been allocated memory should not interfere into each other∙s memory space. This requires some memory protection and sharing mechanism. Now we will discuss memory allocation, de-allocation, re-allocation of free memory, and memory protection and sharing.

7.6.1 Memory Allocation

  • In single-user and single-task operating system like MS-DOS, only one process can execute at a time. After the termination of the process, the allocated memory is freed and is made available to any other process.
  • In a multiprogramming system, in addition to allocation and de-allocation of memory, more tasks are involved like keeping track of processes allocated to the memory, memory protection and sharing etc.
  • There are different memory allocation schemes to allocate memory to the processes that reside in memory at the same time. The different memory allocation schemes are as follows:
    • Multiple Partition Allocation—The operating system keeps track of blocks of memory which are free and those which are unavailable. The single block of available memory is called a hole. When a process requires memory, a hole large enough for the process is allocated. As different processes release the memory, the released block of memory is placed in the set of holes. During allocation of memory, the set of holes is searched to determine which hole is to be allocated. For this, three hole allocation strategies are used—(1) first-fit (allocate the first hole that is big enough for the process, (2) best-fit (allocate the smallest hole that is big enough for the process, and (3) worst-fit (allocate the largest available hole). Memory allocated using any of these strategies results in fragmentation. When the processes are allocated memory and removed from memory, the free memory is broken into small pieces. These small pieces of fragmented memory lie unused. Paging scheme is used to overcome fragmentation. Figure 7.9 shows allocation of memory to a process requiring 8 KB of memory, using the first fit, best fit, and worst fit allocation strategies.

      Figure 7.9 Multiple partition memory allocation

    • Paging—In paging, the physical memory is broken into fixed size blocks called frames. This is the primary memory allocated to the process. The logical memory is broken into blocks of the same size called pages. Generally pages are of sizes varying from 1 KB to 8 KB. When a process is executed, its pages are loaded into the frames.

      An address generated by CPU has two parts—page number and page offset. A page table is maintained by the operating system that maps the page number to the frame number. The page number is used to index the page table and get the frame number. The page offset is added to the page frame number to get the physical memory address (Figure 7.10).

      Figure 7.10 Paging

      Paging handles the problem of fragmentation. The frames need not be contiguous and can reside anywhere in the memory. A process can be allocated memory from holes created by fragmentation, which may be anywhere in the memory.

7.6.2 Virtual Memory

  • In the memory management schemes discussed in the previous section, the whole process is kept in memory before the execution starts. However, for some applications, large memory is required to run the applications, and the whole program cannot be loaded into the memory.
  • Virtual memory allows the execution of those processes that are not completely in memory.
  • Virtual memory is commonly implemented by demand paging. Demand paging is similar to paging with swapping. Swapping is transferring of block of data from the on-line secondary storage like hard disk to the memory and vice versa.
  • In demand paging, the processes reside in the online secondary memory. When a process executes and a page is required, that page is swapped-in into the memory (Figure 7.11). This allows execution of large-sized programs without loading them completely into the memory.

    Figure 7.11 Virtual memory

7.7 FILE MANAGEMENT
  • The file management function of the operating system involves handling the file system which consists of two parts—a set of files, and a directory structure.
  • File is a collection of related information, has a name, and is stored on a secondary storage. It is the smallest named unit that can be written to a secondary storage device. Data cannot be stored on the secondary storage if it is not in the form of a file. A file has attributes like its name, location, size, type, time, and date of creation etc. (Figure 7.12). The information stored in a file can be accessed in different ways—sequential access (access is in a sequential order from start to end) and direct access (the file can be accessed in any order).

    Figure 7.12 Showing the file attributes

  • Directory structure provides information about the files stored on the secondary storage. Directory contains information about all the files within it. The information about the files is kept as entries in the directory of device. A directory further may have a sub-directory defined within it. Directory contains the name, location, size, and type of all the files defined on the device. The tree-structured directory (Figure 7.13) is the commonly used directory structure.

    Figure 7.13 Tree-structured directory in Windows XP

  • The operating system manages the storage media like the disk and implements the abstract concept of the file. System calls are an interface between the process and the operating system. Operating system provides system calls for creating, reading, writing, deleting, repositioning, and truncating a file. Some of the operations that can be performed on a directory are—search for a file, create, delete and rename a file, list a directory, and traverse the file system within the directory. The user simply uses the system calls like “dir”, “list” to perform operation on a file or directory, without going into the details of its working.
7.8 DEVICE MANAGEMENT
  • Several peripheral devices like mouse, hard disk, printer, plotter etc. are connected to the computer. The peripheral devices have varying characteristics like character or block device, sequential or random access device, and dedicated or shared device.
  • OS manages and controls the devices attached to the computer. OS provides appropriate functionality to the application programs for controlling different aspects of the devices. Figure 7.14 shows the device manager and system properties in Windows XP Professional.
  • OS handles the devices by combining both hardware and software techniques. The I/O hardware includes the ports, buses, and device controllers for the devices. The OS communicates with the I/O hardware via the device driver software. The device driver software comes along with each device.
  • A device communicates with the computer hardware via a port (for example, a serial port or a parallel port). Bus is a common set of wires used by one or more devices. The computer uses different kinds of buses like PCI bus for connecting processor or memory to the fast devices, expansion bus to connect to slow I/O devices and SCSI bus to connect disks. A device controller operates a port, bus, and a device. Device controller is just like a bridge between the device and the operating system. The device controller receives the data from a connected device, stores it temporarily, and then communicates the data to the device∙s device driver. Device driver is the software with which the device controller communicates with the operating system (Figure 7.15).

    Figure 7.14 Device manager and system properties in Windows XP Professional

    Figure 7.15 Devices interacting with OS

  • Operating system enables handling of the different I/O devices in a uniform way. The complexity of handling the different devices is abstracted and hidden in the device drivers of the devices. The device drivers hide the differences among the different device controllers and present a uniform interface to the operating system.
  • In addition to managing the peripheral devices, OS also provides various services related to I/O like I/O scheduling, buffering, spooling, and error handling.
  • Scheduling of I/O requests involves ordering the requests to improve performance of the system and provide fair access to all processes. For this, a queue of request is maintained for each device. The I/O scheduler re-arranges the queue to improve the efficiency of the overall system.
  • Buffer is a memory area that stores the data, while it is being transferred between two devices or between a device and an application. The speed at which the I/O device can transfer data is different from the speed at which the data is processed. Buffering handles the speed mismatch by storing the data in a buffer till the complete data has arrived and then writing it in a single write operation.
  • Spool (Simultaneous Peripheral Operation On-Line) is a buffer in memory area or disk. Spooling stores the jobs in a spool where the device can access it when it is ready. Spooling is commonly used for printers. Users may give several print commands, and continue working with other operations. However, the printer can print only one job at a time. The rest of the jobs are stored in the spool in a queue, and the printer accesses the spool when it is ready to print the next job.
7.9 PROTECTION AND SECURITY
  • The access of programs, processes, and users, to the resources defined by the computer are controlled by the protection mechanism.
  • Protection ensures that the resources of the computer are used in a consistent way.
  • Security mechanism prevents unauthorized access to the computer. Security concerns include— security of software, security of data stored in the computer, and security of physical resources of the computer.
  • In a personal computer, security can be ensured using—(1) user accounts—individual accounts for each user, (2) user authentication—using password protection (Figure 7.16), (3) access rights—define rights for access of different kind of information for different people, (4) data encryption—store data in computer in encrypted form, and (5) data backup—storing data on a peripheral device other than the hard disk. In a networked environment, only trusted computers should be able to share data. Some of the common security threats occur due to hacking, viruses etc.

    Figure 7.16 Create password and manage user account in Windows XP Professional

7.10 USER INTERFACE
  • The primary goal of operating system is to make the computer convenient for use by its user. It should allow users to easily access and communicate with the applications and the hardware.
  • The users can interact with the computer by using mainly two kinds of interfaces—(1) Command Line Interface (CLI), and (2) Graphical User Interface (GUI).
  • CLI requires the user to interact with operating system in the form of text keyed in from the keyboard. In this, the user has to learn and remember the different commands required for copying, deleting, opening a file or folder etc. (Figure 7.17). MS-DOS and Linux shell are examples of command line mode of interfaces.

    Figure 7.17 Command line interface

  • GUI use graphics to display the various commands. The interface consists of icons, menus, windows, and pointers. The user need not learn the commands, instead, the user can give instructions by moving the pointer on the screen using a mouse and pressing the mouse button (Figure 7.18). MS“Windows 7MS” and MS“Mac OS 10MS” are examples of graphical mode of interface. GUI interface for the Linux OS also exist like the GNU Object Model Environment (GNOME).

    Figure 7.18 Graphical user interface

7.11 EXAMPLES OF OPERATING SYSTEMS

MS-DOS, Windows family of operating systems, Unix OS, Linux OS, and Mac OS X are some of examples of commonly used OSs. Each operating system has specific characteristics. Here, we will discuss the features of the MS-DOS, Windows family of operating systems and Linux operating system.

7.11.1 MS-DOS

  • MS-DOS was the first widely-installed operating system for PCs in 1980s.
  • MS-DOS is easy to load and install. It neither requires much memory for the operating system, nor a very powerful computer to run on.
  • MS-DOS is a command line user interface operating system. This means that the user has to type single line commands through the command interface. So, user has to remember the different commands and their syntax.
  • It is a single-user and single-tasking operating system for the PC. Only one user can use it and only one task can be executed, at a given point of time. Also, it does not have a built-in support for networking.
  • MS-DOS is a 16-bit OS, meaning thereby that it can send or receive 16 bits of data at a time and can process 16 bits of data. It is not able to take the advantage of 32-bit processors.
  • To use MS-DOS, user must know where the programs and data are stored and how to interact with it. In the MS-DOS command mode, command.com routine interprets the typed in command from the keyboard.

To get the window of the command prompt in the Windows environment

  • <Start> <Run> Type “cmd” <Enter>, or
  • <Start> <All programs> <Accessories> <Command Prompt>

cmd.exe or command prompt is the command line interpreter on the current Windows-based OS. It is similar to command.com in MS-DOS. cmd.exe is a Windows program that acts as a DOS-like command line interpreter.

7.11.2 Windows Family of OS

  • Windows is a personal computer operating system from Microsoft.
  • The Windows family of OS which is currently in use includes the Windows 9x family (Windows 95, Windows 98 and Windows 2000), Windows XP, Windows Vista, and Windows 7 operating systems.
  • Windows family of OS is GUI-based operating system. Since GUI interfaces are easy to use and are user-friendly, these have become very popular.
  • Windows support multi-tasking. It means Windows OS allows simultaneous execution of multiple tasks (Figure 7.19).
  • Windows contains built-in networking, which allows users to share files and applications with each other, if their PCs are connected to a network.
  • Windows 7 comes in six different editions, Starter, Home Basic, Home Premium, Professional, Enterprise and Ultimate.
  • With each new version of the Windows OS, the user interface undergoes some changes and the user has to learn to use the new interface. This becomes troublesome for the user.

    Figure 7.19 Windows task manager

7.11.2.1 Brief History of Windows OS

The Windows OS has evolved from the Windows 1.0 in the 1985 to the Windows 7 in 2009. In this span of 24 years, several versions of the Windows OS have been released. Table 7.1 gives an overview of the history of the Windows OS, along with their significance.

Year Windows OS Released Comments
1985
Windows 1.0 It was not successful
1990
Windows 3.0 The first commercially successful version of Windows. It is an upgrade to the interface over Windows 1 and 2
1993
Windows NT 3.1 The first Microsoft OS not based in DOS. Separate versions of NT with their DOS counterparts are released
1995
Windows 95 The first native 32 bit OS. Microsoft plans to merge the NT and DOS platforms but are unsuccessful due to backward compatibility issues and lack of hardware support of NT.
1998
Windows 98 Microsoft integrates its web browser in the GUI and file manager. Hackers can use the Internet to infiltrate a computer or network.
2000
Windows 2000 As with Windows 95, Microsoft planned Windows 2000 to merge the NT and DOS based OS’s but was unsuccessful
2001
Windows XP Windows XP successfully merges the compatibility found in Windows 98 with the stability found in Windows NT/2000. It provides enhanced stability over Windows 98.
2005
Windows XP Professional x64 Edition OS was slow to take off due to the dearth of 64-bit software and drivers
2008
Windows Vista First 3D operating system
2009
Windows 7 Some of the new features included in Windows 7 are advancements in touch, speech, and handwriting recognition, support for virtual hard disks, support for additional file formats, improved performance on multi-core processors, improved boot performance, and kernel improvements.

Table 7.1 Windows OS overview

7.11.3 Linux OS

  • Linux is a Unix-like OS. Unix OS has a user interface called shell. The kernel provides interface for the programs to interact with the hardware, and provides services like process management and memory management. The shell interacts with the kernel through the system calls.
  • Linux was developed by Linus Torvalds in 1992. Linux is copyright under the GNU Public License. Linux is a “free” operating system that is easily available. Since Linux follows the open development model, it is being constantly upgraded by programmers across the globe.
  • Some organizations offer Linux with add-on features and capabilities. Red Hat, Mandrake, Debian and Novell are the popular vendors of Linux OS.
  • Tux, the Linux penguin is the official mascot of Linux.
  • Linux is a command line user interface OS. Linux has GUI interfaces called desktop environments like GNOME and K Desktop Environment (KDE). The GUI interface is convenient for the user to use.
  • Linux is a 32-bit, multi-tasking OS. It supports multiple users and multiple processors.
  • Linux is a reliable and secure OS, and is available almost for free. So, Linux is fast becoming very popular and powerful OS.
  • Linux OS is easily available, such as Redhat Linux ver. 9, and, Debian∙s—Ubuntu, Kubuntu, and Edubuntu.
SUMMARY
  • Operating system intermediates between the computer hardware and the computer user.
  • The objective of OS is to make the computer system convenient for the user to use, and to use the computer hardware efficiently.
  • Types of OS—Single user and single task OS is for use by a single user for a single task. Multitasking OS allow execution of more than one task concurrently. Multiuser OS allows concurrent access of same data and applications by multiple users. Multiprocessing OS have two or more processors for a single running process, which execute in parallel. Real time OS respond to an event within a predetermined time. Embedded OS is embedded in appliances like microwaves and washing machines.
  • Functions of OS are process management, memory management, file management, device management, protection and security, and user interface.
  • Process management includes handling the scheduling of processes, process synchronization and communication, and deadlock situations.
  • A process is a program in a state of execution. During execution, a process can be in a new, ready, running, waiting or terminated state.
  • CPU scheduler assigns the processor to different processes so that no process is kept waiting for long. Scheduling can be non-pre-emptive scheduling and pre-emptive scheduling.
  • FCFS, SJF and RR are CPU scheduling algorithms. In FCFS, process that requests for CPU first gets the CPU first. In SJF, process that requires least CPU time, is allocated the CPU first. In RR scheduling, each process in the queue gets CPU for a quantum of time circularly.
  • Process synchronization is required when multiple processes access and manipulate the same data, concurrently.
  • A deadlock arises when the four necessary condi- tions—mutual exclusion, no preemption, hold and wait, and circular wait, hold true simultaneously in a system.
  • Memory management includes memory allocation, de-allocation, re-allocation of free block, and memory protection and sharing.
  • Virtual memory is implemented by demand paging, which is paging with swapping.
  • The file manager handles the file system consisting of a set of files and a directory structure. OS provides system calls for performing operations on the file.
  • OS handles the devices using a combination of hardware and software techniques. The I/O hardware includes the ports, buses and device controllers for the devices. OS interacts with I/O hardware via the device driver software of the device.
  • Spooling stores the jobs in a spool (a buffer in memory area or disk) where the device can access it when it is ready.
  • Protection ensures that the resources of computer are used in a consistent way. Security mechanism prevents unauthorized access to a system.
  • CLI and GUI are the two kinds of user interfaces.
  • MS-DOS, Windows XP, UNIX, Linux, and Mac OS X are some examples of OSs.
KEYWORDS

Buffering

Concurrent processes

Deadlock avoidance

Command interpreter

CPU scheduling

Deadlock prevention

Command Line Interface (CLI)

Deadlock

Demand paging

Device driver

Multiple Partition

Real time OS

Device Management

Allocation

Round Robin (RR)

Directory structure

Multiprocessing

Scheduler

Embedded OS

Multitasking

Scheduling algorithms

File

Multiuser

Shortest Job First (SJF)

File Management

Non-pre-emptive

Single Task OS

First Come First Served

scheduling

Single user

(FCFS)

Operating System (OS)

Spooling

Fragmentation

Pages

Swapping

Frames

Page table

System calls

Graphical User Interface (GUI)

Paging

Time sharing

Hole

Parallel processing

Tree-structured directory

I/O scheduling

Pre-emptive scheduling

UNIX

Linux

Process

User Interface

Mac OS X

Process Management

Virtual memory

Memory allocation

Process states

Window XP

Memory Management

Process Synchronization

 

MicroSoft Disk Operating System

Protection and Security

 

(MS-DOS)

Race condition

 

QUESTIONS

Section 7.1–7.3

1. Explain the objective of OS.

2. “OS makes it convenient for the user to use the machine”. Explain.

3. “OS supervises and manages the hardware of the computer”. Explain.

4. Name any three operating systems.

5. Classify the OS into different types based on their processing capability.

6. What is Single user and Single Task OS?

7. What is Single user and Multitasking OS?

8. What is time sharing?

9. What is a Multiuser OS?

10. What is a Multiprocessing OS.

11. Define parallel processing.

12. What is the purpose of Real time OS?

13. What is the purpose of Embedded OS?

14. Give an example each of the following types of OS (i) Single user and Single Task, (ii) Single user and Multitasking, (iii) Multiuser, (iv) Multiprocessing, and (v) Real time.

Section 7.4

15. List the main function of the OS.

16. Describe in detail the main functions of the OS.

17. List the activities handled by each of the following functions of the OS (i) Process Management, (ii) Memory Management, (iii) File Management, (iv) Device Management, (v) Protection and Security, and (vi) User Interface.

Section 7.5–7.5.4

18. Define a process.

19. List the various states for a process in execution.

20. Why is CPU scheduling needed?

21. Define scheduler.

22. Define pre-emptive scheduling and non-pre- emptive scheduling.

23. List the CPU scheduling algorithms.

24. Explain the working of (i) FCFS, (ii) SJF, and (iii) RR scheduling algorithms.

25. What is the drawback of FCFS algorithm?

26. What is the drawback of SJF algorithm?

27. How does RR algorithm overcome the drawback of FCFS and SJF?

28. Define concurrent processes.

29. When does a race condition occur?

30. Define a deadlock.

31. List the necessary conditions for a deadlock.

32. Deadlock can be handled by deadlock _____ and deadlock _____.

33. What is deadlock avoidance?

34. What is deadlock prevention?

35. Explain the following in context of the deadlock: (i) Mutual Exclusion, (ii) No preemption, (iii) Hold and Wait, and (iv) Circular wait.

Section 7.6–7.6.2

36. What is the need of memory management?

37. Describe the multiple partition allocation memory management scheme.

38. Define a hole.

39. _____, _____ and _____ are the three hole allocation strategies.

40. Explain the three hole allocation strategies.

41. Define memory fragmentation.

42. How is memory fragmentation handled?

43. Describe the paging memory management scheme.

44. What is the use of a page table?

45. “Paging handles the problem of fragmentation”. Explain.

46. Describe demand paging in brief.

47. Define swapping.

Section 7.7–7.8

48. Describe a file.

49. What is the purpose of directory structure?

50. Define a system call.

51. _____is a commonly used structure for the directory.

52. What is the need of device management?

53. What is the purpose of a device driver?

54. Define buffering.

55. Why is buffering needed?

56. Define spooling.

57. Name a spooled device.

58. What is the purpose of spooling?

Section 7.9

59. How is protection different from security?

60. Name few techniques used for ensuring security of a stand-alone computer.

61. List the two kinds of user interfaces.

62. Give one example each of OS using CLI and GUI interfaces.

63. What do you mean by a CLI interface?

64. What do you mean by a GUI interface?

65. Write short note on MS-DOS, Windows family of OS, and Linux OS.

66. Describe briefly, the history of the Windows OS.

Extra Questions

67. Give full form of the following abbreviations:

  1. MS-DOS
  2. FCFS
  3. SJF
  4. RR
  5. CLI
  6. GUI
  7. GNOME
  8. KDE
  9. SPOOL

68. Write short notes on:

  1. Objectives of OS
  2. Types of OS
  3. Functions of OS
  4. Process Management
  5. Process
  6. CPU Scheduling
  7. Scheduling algorithms
  8. Process Synchronization
  9. Deadlock
  10. Memory Management
  11. Memory allocation
  12. Memory Fragmentation
  13. Paging
  14. Demand paging
  15. File Management
  16. Device Management
  17. Device drivers
  18. Protection and Security
  19. User Interface
  20. MS-DOS
  21. Windows family of OS
  22. Linux OS

69. Give differences between the following:

  1. Multitasking and Multiprocessing
  2. Program and Process
  3. Pre-emptive scheduling and Non-pre-emptive scheduling
  4. FCFS and SJF
  5. RR and FCFS
  6. Best fit and worst fit memory allocation
  7. CLI and GUI
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.90.182