Biyani's Think Tank Concept based notes Operating Systems M.Sc. (IT)

Poonam Sharma, Ekta Sharma MCA, M.Sc.(IT) Lecturer Deptt. of Information Technology Biyani Girls College, Jaipur

2

Published by : Think Tanks Biyani Group of Colleges

Concept & Copyright : Biyani Shikshan Samiti Sector-3, Vidhyadhar Nagar, Jaipur-302 023 (Rajasthan) Ph : 0141-2338371, 2338591-95 Fax : 0141-2338007 E-mail : [email protected] Website :www.gurukpo.com; www.biyanicolleges.org

First Edition : 2009

While every effort is taken to avoid errors or omissions in this Publication, any mistake or omission that may have crept in is not intentional. It may be taken note of that neither the publisher nor the author will be responsible for any damage or loss of any kind arising to

anyone in any manner on account of such errors and omissions.

Leaser Type Setted by : Biyani College Printing Department Operating Systems 3

Preface

I am glad to present this book, especially designed to serve the needs of the students. The book has been written keeping in mind the general weakness in understanding the fundamental concepts of the topics. The book is self- explanatory and adopts the “Teach Yourself” style. It is based on question- answer pattern. The language of book is quite easy and understandable based on scientific approach. This book covers basic concepts related to the microbial understandings about diversity, structure, economic aspects, bacterial and viral reproduction etc. Any further improvement in the contents of the book by making corrections, omission and inclusion is keen to be achieved based on suggestions from the readers for which the author shall be obliged. I acknowledge special thanks to Mr. Rajeev Biyani, Chairman & Dr. Sanjay Biyani, Director (Acad.) Biyani Group of Colleges, who are the backbones and main concept provider and also have been constant source of motivation throughout this Endeavour. They played an active role in coordinating the various stages of this Endeavour and spearheaded the publishing work. I look forward to receiving valuable suggestions from professors of various educational institutions, other faculty members and students for improvement of the quality of the book. The reader may feel free to send in their comments and suggestions to the under mentioned address. Author

4

Syllabus M.Sc. (IT) (Sem.-I) Operating Systems

Computer Software and Languages : Types of Software (System/Application), Programming Languages [Level (SGL/4GL/3L/2GL/1GL/OGL), Translators (Interpreters/Compilers), OGL (Registers, Switches, Cycles, Interrupt). : Functions of Operating System, Characteristics of Operating System (Single/Multi-user, Single/Multi-tasking, Portability), Information Management (File System, Device Drivers, Terminal I/O), Process Management (Process Definition, Control, Interacting Processes, Implementation of Interacting Processes, Threads, Scheduling), Memory Management (Contiguous, Non- contiguous, Paging, Segmentation, Virtual Memory), Deadlocks, Security and Protection, Parallel Processing. DOS : Booting Sequence, System Files and Commands, Files and Directories, Overview of MS DOS Commands, and DISK Organization. Windows : Graphical User Interfaces, Windows 98 Installation, Scan Disk, Task Bars, Toolbars, Settings, Control Panel and all features there in, Files and Folder Management, Windows Explorer, Installing and Running Programs, Backing up Files, Configuring Keyboard and Mouse adding and removing Hardware, Setting up Printers and Fonts, Working with Sound, Graphics and Video, Configuring Windows by using the Accessibility Wizard, Configuring Modem, Connecting to PPP and SLIP Accounts, Creating Windows Peer to Peer Network, Connecting Windows 98PC to Novell Netware and Windows NT Networks, Sharing Drivers and Printers, Compressing Disks and Partitions, Tuning Operating Systems 5

Windows 98 for Maximum Performance, Registering Programs and File Types, Troubleshooting Windows 98. UNIX : Logging In and Out, Directory, Redirecting Input and Output cat vi, Editor, Shell Scripts, Shell and Sub-shell Variables, Meta- characters, Commands – sort, head, tail, split, cut, paste, , tr, dd, Gripping and Seeding UUPC, UNIX and Networking, Accessing the Internet, UNIX System Administration. □ □ □

6

Content

S. No. Name of Topic 1. Computer Software

2. Operating System

3. Information Management

4. Process Management

5. Memory Management

6. Deadlocks

7. Security and Protection

8. Parallel Processing

9. DOS Operating System

10. Commands of DOS

11. UNIX Operating System

12. Commands of UNIX

13. Difference between DOS, UNIX & WINDOWS

14. Windows Operating System

□ □ □ Operating Systems 7

Chapter-1

Computer Software

Q.1. Define Computer Software and its types. Ans.: Computer Software is a general term used to describe a collection of computer programs, procedures and documentation that perform some tasks on a computer system. "Software" is sometimes used in a broader context to mean anything which is not hardware but which is used with hardware, such as film, tapes and records. Practical computer systems divide software systems into three major classes: system software, programming software and application software, although the distinction is arbitrary, and often blurred. System Software helps run the computer hardware and computer system. It includes operating systems, device drivers, diagnostic tools, servers, windowing systems, utilities and . The purpose of systems software is to insulate the applications programmer hardware features, and such as accessory devices as communications, printers, readers, displays, keyboards, etc. as much as possible from the details of the particular computer complex being used, especially memory and other Programming Software usually provides tools to assist a programmer in writing computer programs, and software using different programming languages in a more convenient way. The tools include text editors, compilers, interpreters, linkers, debuggers, and so on. An Integrated development environment (IDE) merges those tools into a software bundle, and a programmer may not need to multiple commands for compiling, interpreting, debugging, tracing, and etc., because the IDE usually

8

has an advanced graphical user interface, or GUI. Application Software allows end users to accomplish one or more specific (non-computer related) tasks. Typical applications include industrial automation, business software, educational software, medical software, databases, and computer games. Businesses are probably the biggest users of application software, but almost every field of human activity now uses some form of application software.

Q.2 Define the various levels of Programming Languages. Ans.: Levels of Programming Languages : The different levels of programming languages are defined as follows : (i) 1GL or First-Generation language : It is machine language or the level of instructions and data that the processor is actually given to work on (ii) 2GL or Second-Generation Language : It is also called "assembly" language. An assembler is required to converts the assembly language statements into machine language. (iii) 3GL or Third-Generation Language : It is a "high-level" programming language, such as PL/I, C, or Java. Java language. A compiler is required to converts the statements of a specific high- level programming language into machine language. (iv) 4GL or Fourth-Generation Language : It is designed to be closer to natural language than a 3GL language. Languages for accessing databases are often described as 4GLs. (v) 5GL or Fifth-Generation Language : It is language that uses a visual or graphical development interface to create source language that is usually compiled with a 3GL or 4GL language compiler. (v) 0GL or Hardware Level : This is the level which we want to study the actual computer architecture.

Operating Systems 9

Q.3. Define Interpreter and Compiler and give their differences. Ans.: Definition of Compiler : Compiler is a program that translates a computer program written on one computer language to another computer language. A "compiler" is primarily used for programs that translate source code from a high level language to a lower level language (e.g., assembly language or machine language). A program that translates from a low level language to a higher level one is a decompiler. A compiler for a relatively simple language written by one person might be a single, monolithic, piece of software. When the source language is large and complex, and high quality output is required the design may be split into a number of relatively independent phases, or passes. Having separate phase‘s means development can be parceled up into small parts and given to different people. It also becomes much easier to a single phase by an improved one, or to insert new phases later. Definition of Interpreter : Interpreter is a program that translates an instruction into a machine language and executes it before proceeding to the next instruction..... A high-level programming language translator that translates and runs the program at the same . It translates one program statement into machine language, executes it, and then proceeds to the next statement. This differs from regular executable programs that are presented to the computer as binary-coded instructions. Interpreted programs remain in the source language the programmer wrote in, which is human readable text. Interpreted programs run slower than their compiler counterparts. Whereas the compiler translates the entire program before it is run, interpreters translate a line at a time while the program is being run. However, it is very convenient to write an interpreted program, since a single line of code can be tested interactively. Difference between Compiler and Interpreter : Interpreter translate the program line by line and compiler translate the entire program interpreter requires less memory and compiler requires more memory. E.g. of Compiler – Java E.g. of Interpreter – PHP

10 Q.4 Write the short note on Registers, Switches, Cycles and Interrupts. Ans.: Registers : In computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than storage available elsewhere. Processor registers are at the top of the memory hierarchy, and provide the fastest way for a CPU to access data. Switches : They are used to separate bus and Register to make it possible the data transfer from registers to the bus or vice versa . They are also acts as latches: - data once deposited in a register does not get mixed up with the signals or the data in the bus. Cycles : An Instruction cycle can be defined as the sum of an instruction fetch time and the instruction execution time. Interrupts : Interrupt is the ability of the hardware to stop the currently running program and turn the system‘s attention to something else.

Q.5. Write short notes on following : Ans. Registers : Registers are fast memory, almost always connected to circuitry that allows various arithmetic, logical, control, and other manipulations, as well as possibly setting internal flags. Most early computers had only one data register that could be used for arithmetic and logic instructions. Often there would be additional special purpose registers set aside either for temporary fast internal storage or assigned to logic circuits to implement certain instructions. Some early computers had one or two address registers that pointed to a memory location for memory accesses (a pair of address registers typically would act as source and destination pointers for memory operations). Computers soon had multiple data registers, address registers, and sometimes other special purpose registers. Some computers have general purpose registers that can be used for both data and address operations. Every digital computer using a von Neumann architecture has a register (called the program counter) that points to the next executable instruction. Many computers have additional control registers for implementing various control capabilities. Often some or all of the internal flags are combined into a flag or status register. Operating Systems 11

There are different types of registers. These are : Accumulators : Accumulators are registers that can be used for arithmetic, logical, shift, rotate, or other similar operations. The first computers typically only had one accumulator. Many times there were related special purpose registers that contained the source data for an accumulator. Accumulators were replaced with data registers and general purpose registers. Accumulators reappeared in the first microprocessors. Address Registers : Address registers store the addresses of specific memory locations. Often many integer and logic operations can be performed on address registers directly (to allow for computation of addresses).Sometimes the contents of address register(s) are combined with other special purpose registers to compute the actual physical address. This allows for the hardware implementation of dynamic memory pages, virtual memory, and protected memory. General Purpose Registers : General purpose registers can be used as either data or address registers. Constant Registers : Constant registers are special read-only registers that store a constant. Attempts to write to a constant register are illegal or ignored. In some RISC processors, constant registers are used to store commonly used values (such as zero, one, or negative one) — for example, a constant register containing zero can be used in register to register data moves, providing the equivalent of a clear instruction without adding one to the instruction set. Constant registers are also often used in floating point units to provide such value as pi or e with additional hidden bits for greater accuracy in computations. Floating Point Registers : Floating point registers are special registers set aside for floating point math. Index Registers : Index registers are used to provide more flexibility in addressing modes, allowing the programmer to create a memory address by combining the contents of an address register with the contents of an index register (with displacements, increments, decrements, and other options). In some processors,

12

there are specific index registers (or just one index register) that can only be used only for that purpose. In some processors, any data register, address register, or general register (or some combination of the three) can be used as an index register. Base Registers : Base registers or segment registers are used to segment memory. Effective addresses are computed by adding the contents of the base or segment register to the rest of the effective address computation. In some processors, any register can serve as a base register. In some processors, there are specific base or segment registers (one or more) that can only be used for that purpose. In some processors with multiple base or segment registers, each base or segment register is used for different kinds of memory accesses (such as a segment register for data accesses and a different segment register for program accesses). Control Registers : Control registers control some aspect of processor operation. The most universal control register is the program counter. Program Counter : Almost every digital computer ever made uses a program counter. The program counter points to the memory location that stores the next executable instruction. Branching is implemented by making changes to the program counter. Some processor designs allow software to directly change the program counter, but usually software only indirectly changes the program counter (for example, a JUMP instruction will insert the operand into the program counter). An assembler has a location counter, which is an internal pointer to the address (first byte) of the next location in storage (for instructions, data areas, constants, etc.) while the source code is being converted into object code. Processor Flag : Processor flags store information about specific processor functions. The processor flags are usually kept in a flag register or a general status register. This can include result flags that record the results of certain kinds of testing, information about data that is moved, certain kinds of information about the results of compations or transformations, and information about some processor states. Closely related and often stored in the same processor word or status register (although often in a Operating Systems 13 privileged portion) are control flags that control processor actions or processor states or the actions of certain instructions. Stack Pointer : Stack pointers are used to implement a processor stack in memory. In many processors, address registers can be used as generic data stack pointers and queue pointers. A specific stack pointer or address register may be hardwired for certain instructions. The most common use is to store return addresses, processor state information, and temporary variables for subroutines. Subroutine Return Pointer : One RISC processors include a special subroutine return pointer rather than using a stack in memory. The return address for subroutine calls is stored in this register rather than in memory. More than one level of subroutine calls requires storing and saving the contents of this register to and from memory.

□ □ □

14

Multiple Questions

Q1. Operating System is a :

a. Hardware b. System Software c. Application Software d. None

Q2. Which of the following is not an example of Operating System? a. Windows 95 b. DOS c. UNIX d. MS Word

Q3. Operating System is required to manage- a. Hardware b. various resources c. memory d. All

Q4. Factors important for designing of Operating systems are a. Maintainability b. Portability c. security d. All above

Q5. Which one is a sequential storage device:: A. Hard disk B. Magnetic disk C. Magnetic tape D. None of the above

Operating Systems 15

Q6. System in which different part of a single program can run concurrently is: A. Real time B. Multitasking C. Multithreading D. None of the above

Q7. Which of the following is not an operating system? A. WINDOWS B. UNIX C. PASCAL D. MS-DOS

Q8. Which of the following is also known as “Light weight process”? A. Function B. Application module C. Kernel D. Thread

Q9. The………. Is a computer program that runs when you first the computer; A. FAT B. Record C. Boot record D. Root directory

Q10. Thrashing is related to : A. Cache Memory B. Main Memory C. Secondary memory D. Virtual memory

16

Chapter-2

Operating System

Q.1. What is Operating System? Give its examples. Ans.: An operating system (commonly abbreviated OS and O/S) is the software component of a computer system that is responsible for the management and coordination of activities and the sharing of the resources of the computer. The operating system acts as a host for application programs that are run on the machine. As a host, one of the purposes of an operating system is to handle the details of the operation of the hardware. This relieves application programs from having to manage these details and makes it easier to write applications. Almost all computers, including hand-held computers, desktop computers, supercomputers, and even modern video game consoles, use an operating system of some type. Some of the oldest models may however use an embedded OS, that may be contained on a compact disk or other storage device. Windows, Mac OS X, Linux and Solaris are examples of operating system.

Q. 2. Write short note on services provide by operating systems. Ans. Following are the five services provided by operating systems to the convenience of the users : (1) Program Execution : The purpose of a computer systems is to allow the user to execute programs. So the operating systems provides an environment where the user can conveniently run programs. The user does not have to worry about the memory allocation or multitasking or anything. These things are taken care of by the operating systems. Operating Systems 17

Running a program involves the allocating and deallocating memory, CPU scheduling in case of multiprocess. These functions cannot be given to the user-level programs. So user-level programs cannot the user to run programs independently without the help from operating systems. (2) I/O Operations : Each program requires an input and produces output. This involves the use of I/O. The operating systems hides the user the details of underlying hardware for the I/O. All the user sees is that the I/O has been performed without any details. So the operating systems by providing I/O makes it convenient for the users to run programs. For efficiently and protection users cannot control I/O so this service cannot be provided by user-level programs. (3) File System Manipulation : The output of a program may need to be written into new files or input taken from some files. The operating systems 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 systems makes it easier for user programs to accomplished their task. This service involves secondary storage management. The speed of I/O that depends on secondary storage management is critical to the speed of many programs and hence I think it is best relegated to the operating systems to manage it than giving individual users the control of it. It is not difficult for the user-level programs to provide these services but for above mentioned reasons it is best if this service s left with operating system. (4) Communications : There are instances where processes need to communicate with each other to exchange information. It may be between processes running on the same computer or running on the different computers. By providing this service the operating system relieves the user of the worry of passing messages between processes. In case where the messages need to be passed to processes on the other computers through a network it can be done by the user programs. The user program may be customized to the

18

specifics of the hardware through which the message transits and provides the service interface to the operating system. (5) 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. This service cannot allowed to be handled by user programs because it involves monitoring and in cases altering area of memory or deallocation of memory for a faulty process. Or may be relinquishing the CPU of a process that goes into an infinite loop. These tasks are too critical to be handed over to the user programs. A user program if given these privileges can interfere with the correct (normal) operation of the operating systems.

Q.3. What are the functions of Operating System? Ans.: Functions of Operating System : Main functions of Operating systems are : (1) Processor Management (2) Memory Management (3) Device I/O Management (4) File Management (5) Disk Management

Q.4. Explain characteristics of Operating System. Ans.: Multi-user : Multi-user is a term that defines an operating system or application software that allows concurrent access by multiple users of a computer. Time-sharing systems are multi-user systems. Most batch processing systems for mainframe computers may also be considered "multi-user", to avoid leaving the CPU idle while it waits for I/O operations to complete. However, the term "multitasking" is more common in this context. Operating Systems 19

An example is a Unix server where multiple remote users have access (such as via Secure Shell) to the Unix shell prompt at the same time. Another example uses multiple X Window sessions spread across multiple terminals powered by a single machine - this is an example of the use of thin client. Management systems are implicitly designed to be used by multiple users, typically one system administrator or more and an end-user community. Multitasking : Multitasking is a method by which multiple tasks, also known as processes, share common processing resources such as a CPU. In the case of a computer with a single CPU, only one task is said to be running at any point in time, meaning that the CPU is actively executing instructions for that task. Multitasking solves the problem by scheduling which task may be the one running at any given time, and when another waiting task gets a turn. The act of reassigning a CPU from one task to another one is called a context switch. When context switches occur frequently enough the illusion of parallelism is achieved. Even on computers with more than one CPU (called multiprocessor machines), multitasking allows many more tasks to be run than there are CPUs. Multiprograming : Multiprogramming is a rudimentary form of parallel processing in which several programs are run at the same time on a uniprocessor. Since there is only one processor , there can be no true simultaneous execution of different programs. Instead, the operating system executes part of one program, then part of another, and so on. To the user it appears that all programs are executing at the same time. If the machine has the capability of causing an interrupt after a specified time interval, then the operating system will execute each program for a given length of time, regain control, and then execute another program for a given length of time, and so on. In the absence of this mechanism, the operating system has no choice but to begin to execute a program with the expectation, but not the certainty, that the program will eventually return control to the operating system. Time Sharing : Time-sharing refers to sharing a computing resource among many users by multitasking. Because early mainframes and minicomputers were extremely expensive, it was rarely possible to allow a single user exclusive access to the

20

machine for interactive use. But because computers in interactive use often spend much of their time idly waiting for user input, it was suggested that multiple users could share a machine by allocating one user's idle time to service other users. Similarly, small slices of time spent waiting for disk, tape, or network input could be granted to other users. Portability : Portability is a characteristic attributed to a computer program if it can be used in an operating systems other than the one in which it was created without requiring major rework. Porting is the task of doing any work necessary to make the computer program run in the new environment. In general, programs that adhere to standard program interfaces such as the X/Open Unix 95 standard C language interface are portable. Ideally, such a program needs only to be compiled for the operating system to which it is being ported. Portability has usually meant some work when moving an application program to another operating system. Recently, the Java programming language and runtime environment has made it possible to have programs that run on any operating system that supports the Java standard (from Sun Microsystems) without any porting work. Java applets in the form of precompiled bytecode can be sent from a server program in one operating system to a client program (your Web browser) in another operating system without change. □ □ □ Operating Systems 21

Multiple Choice Questions Q1. Real time operating systems are mainly used in : A. EDP Processing B. Office automation C. Industry D. Day-to-day life

Q2. CPU resource management is also known as: A. Scheduling B. I/O Management C. Swapping D. All of the above

Q3. The minimum number of bits required to represent 34 is: A. 6 B. 8 C. 5 D. 7

Q4. The typical RAM capacity of a PC is of the order of: A. 64 KB B. 64 MB C. 1 TB D. 16 GB

22 Q5. OSI model has got: A. 4 layers B. 6 layers C. 7 Layers D. 3 Layers

Q6.The operating system which the IBM-PC uses: A. CP/M B. MS/DOS C. UNIX D. AT-DOS

Q7. Netware is a: A. Protocol B. C. Network operating system D. None of the above

Q8.Disadvantege of distributed system are: A. Complex software B. Costly networking C. Complex security D. All of the above

Operating Systems 23 Q9: Device driver is a: A. Hardware B. Software C. A & b Both D. None of the above

Q10.LAN speed are measured in: A. Bps B. Kbps C. Gbps D. mbps

24

Chapter-3

Information Management

Q.1. What is File System. Explain different file attributes. Ans.: In computing, a file system (often also written as filesystem) is a method for storing and organizing computer files and the data they contain to make it easy to find and access them. File systems may use a data storage device such as a hard disk or -ROM and involve maintaining the physical location of the files, they might provide access to data on a file server by acting as clients for a network protocol (e.g., NFS, SMB, or 9P clients), or they may be virtual and exist only as an access method for virtual data (e.g., procfs). Different File Attributes : A file‘s attributes vary from one operating system to another but typically consist of these : Name : The symbolic file name is the only information kept in human readable form. Identifier : This unique tag, usually a number , identifies the file within the file system; it is non-human-readable name for the file. Type : This information is needed for systems that support different types of files. Location : This information is a pointer to a device and to the location of the file on that device. Size : The current size of the file and possibly the maximum allowed size are included in this attribute. Protection : Access-control information determines who can do reading, writing, executing and so on. Time ,Date, and user identification : This information may be kept for creation, last modification, and last use.

Operating Systems 25

Q.2. What is Device Driver? Explain it’s purpose. Ans.: A device driver, or software driver, is a computer program allowing higher-level computer programs to interact with a device. A driver typically communicates with the device through the computer bus or communications subsystem to which the hardware is connected. When a calling program invokes a routine in the driver, the driver issues commands to the device. Once the device sends data back to the driver, the driver may invoke routines in the original calling program. Drivers are hardware-dependent and operating-system-specific. They usually provide the interrupt handling required for any necessary asynchronous time- dependent hardware interface. Purpose : A device driver simplifies programming by acting as a translator between a device and the applications or operating systems that use it. The higher-level code can be written independently of whatever specific hardware device it may control. Every version of a device, such as a printer, requires its own specialized commands. In contrast, most applications access devices(such as sending a file to a printer)by using high-level, generic commands, such as PRINTLN. The driver accepts these generic statements and converts them into the low-level commands required by the device.

Q.3. What is the use of Device Controller? Ans.: Device Controller : Each device uses a device controller to connect devices to computer data and address bus. The controller provides a set of physical components that CPU instruction can manipulate to perform I/O operations. Generally Operating system is deals with the controller and not the device

Q.4 Explain various Disk Scheduling Algorithms in brief. OR Explain various I/O Optimization Techniques. Ans.: I/O Optimization Techniques : The various disk scheduling algorithm in order to minimize total service time and wait time are as follows :

26

(1) First-In-First-Served : The simplest form of scheduling is first-in- first-out (FIFS) scheduling, which processes items from the queue in sequential order. (2) Shortest Seek Time First : The SSTF policy is to select the disk I/O request that requires the least movement of the disk arm from its current position. (3) Scan : In this scheme, the read/write keeps moving from one end to another end and when it reaches to the other end, the direction of head movement is reserved and servicing continues. (4) C-Scan : The C-SCAN policy restricts scanning to one direction only. Thus, when the last track has been visited in one direction, the arm is returned to the opposite end of the disk and the scan begins again.

Q.5 Define the strategies of Contiguous, Linked and Indexed Allocation in File System. Ans.: (i) Contiguous Allocation : The contiguous allocation method requires each file to occupy a set of contiguous blocks on the disk. Disk addresses define a linear ordering on the disk. The directory entry for each file indicates the address of the starting block and the length of the area allocate for this file. Accessing a file that has been allocated contiguously is easy. (ii) Linked Allocation : With link allocation, each file is a linked list disk blocks; the disk blocks may be scattered anywhere on the disk and any free block on the free-space list can be used to satisfy a request ,there is no need to declare the size of a file when that file is created. A file can continue to grow as long as there are free blocks. (iii) Indexed Allocation : The problem with Linked allocation is that, the pointers to the blocks are scattered with the blocks themselves all over the disk and need to be retrieved in order, while in Indexed allocation all the pointers bring together into one location: the index block. These types of allocation supports direct access.

Operating Systems 27

Q.6 What is the use of Directories? Ans.: Directories : The Directories are treated as files which keep track of all other files. The directory contain information about the files such as location and owner of the file etc. the directory is itself a file, owned by the operating system and accessible by various file management routines.

Q.7 Explain the various types of Directory Systems. Ans.: Type of Directories : Directories can be organized in following ways : (1) Single-Level Directory : In a single-level directory system, all the files are placed in one directory. This is very common on single- user OS's. Even with a single-user, as the number of files increases, it becomes difficult to remember the names of all the files in order to create only files with unique names. (2) Two-Level Directory : In the two-level directory system, the system maintains a master block that has one entry for each user. This master block contains the addresses of the directory of the users. (3) -Structured Directory : In the tree-structured directory, the directory themselves are files. This leads to the possibility of having sub-directories that can contain files and sub-subdirectories. (4) Acyclic-Graph Directory : The acyclic directory structure is an extension of the tree-structured directory structure. In the acyclic structure a directory or file under directory can be owned by several users. Thus an acyclic graph structure allows directories to have shared subdirectories and files. (5) General Graph Directory : One problem with using an acyclic graph structure is ensuring that there is no cycle. However to avoid traversing shared sectors of an acyclic graph twice, we can allow cycles to exist. If cycles are allowed to exist in the directory, we generally, want to avoid searching any component twice, for reason of correctness and performance. □ □ □

28 Multiple Choice Question

Q1. The major security threats are A. Unauthorized use of service B. Unauthorized disclosure of information C. Unauthorized alteration of information D. All of the above

Q2. Remote Procedure Call (RPC) is A. Communication in centralized system B. Communication in distributed system C. Both (a) and (b) both D. None of the above

Q3. A file can have following states:- A. closed B. opened C. achieved D. All above

Q4. The operation performed on directory is A. creation B. deletion C. open D. all

Q5. DBMS is used because of A. consistency B. data independency C. controlled redundancy D. all

Q6.Multimedia application can involves a. audio b. video c. text d. all

Q7. The advantage of distributed system is- a. more computing power b. Reliability c. Resource sharing d. All

Operating Systems 29

Q8. RPC stands for a. Remote Programming center b. Remote Procedure Call c. Right Program Call d. None

Q9.In the batch processing system the task are submitted in: A. one by one B. similar task in batches C. different task in batches D. none of the above

Q10.Which type of file organization aresupported by magnetic tape: A. Random file B. Contiguous sequential file C. Indexed sequential file D. All of the above

30 Chapter-4

Process Management

Q.1. What is Process? Define different Process states. Ans.: The term "process" was first used by the designers of the MULTICS in 1960's. Since then, the term process, used somewhat interchangeably with 'task' or 'job'. The process has been given many definitions for instance A program in Execution. An asynchronous activity. The 'animated sprit' of a procedure in execution. The entity to which processors are assigned. The 'dispatch able' unit. and many more definitions have given. As we can see from above that there is no universally agreed upon definition, but the definition "Program in Execution" seem to be most frequently used. And this is a concept are will use in the present study of operating systems. Now that we agreed upon the definition of process, the question is what is the relation between process and program. It is same beast with different name or when this beast is sleeping (not executing) it is called program and when it is executing becomes process. Well, to be very precise. Process is not the same as program. In the following discussion we point out some of the difference between process and program. As we have mentioned earlier. Process is not the same as program. A process is more than a program code. A process is an 'active' entity as oppose to program which consider to be a 'passive' entity. As we all know that a program is an algorithm expressed in some suitable notation, (e.g., programming language). Being a passive, a program is only a part of process. A process is the unit of work in a system. Operating Systems 31

The process state consist of everything necessary to resume the process execution if it is somehow put aside temporarily. The process state consists of at least following : Code for the program. Program's static data. Program's dynamic data. Program's procedure call stack. Contents of general purpose registers. Contents of program counter (PC) Contents of program status word (PSW). Operating Systems resource in use.

New Terminated

Interrupt

Admitted

Ready Running

I/O or Event Scheduler I/O or Completion Dispatch Event Wait

Waiting

Diagram of Process State

A process goes through a series of discrete process states : New State : The process being created. Running State : A process is said to be running if it has the CPU, that is, process actually using the CPU at that particular instant.

32

Blocked or Waiting State : A process is said to be blocked if it is waiting for some event to happen such that as an I/O completion before it can proceed. Note that a process is unable to run until some external event happens. Ready State : A process is said to be ready if it use a CPU if one were available. A ready state process is runable but temporarily stopped running to let another process run. Terminated State : The process has finished execution.

Q.3 Explain the Process Control Block (PCB) with diagram. Ans.: Process Control Block (PCB) : To control the various processes the Operating System maintains a table called the process table. The process table contains one entry per process. These entries are referred to as ―Process Control Block‖. It contains many piece of information related with a specific process including the:- Process Number, Process State, Program Counter, CPU Registers, CPU Scheduling Information, Memory management Information, Accounting Information, and I/O Status Information.

Q.4 What do you mean by Interacting Processes? Ans.: Interacting Processes : In single CPU systems, by the multiprogramming several processes may permit to be executing concurrently. The processes of n application interact with one another to co-ordinate their activities or to share some data. These processes are called interacting processes.

Q.5. What are Threads? Ans.: A thread is a single sequence stream within in a process. Because threads have some of the properties of processes, they are sometimes called lightweight processes. In a process, threads allow multiple executions of streams. In many respect, threads are popular way to improve application through parallelism. The CPU switches rapidly back and forth among the threads giving illusion that the threads are running in parallel. Q.6. What is the similarities and difference between a Process and Thread? Ans.: Similarities : Operating Systems 33

Like processes threads share CPU and only one thread active (running) at a time. Like processes, threads within processes, threads within processes execute sequentially. Like processes, thread can create children. And like process, if one thread is blocked, another thread can run. Differences : Unlike processes, threads are not independent of one another. Unlike processes, all threads can access every address in the task. Unlike processes, threads are design to assist one other. Note that processes might or might not assist one another because processes may originate from different users.

Q.7. What is Process Scheduling? Define its objectives. Ans.: The assignment of physical processors to processes allows processors to accomplish work. The problem of determining when processors should be assigned and to which processes is called processor scheduling or CPU scheduling. When more than one process is run able, the operating system must decide which one first. The part of the operating system concerned with this decision is called the scheduler, and algorithm it uses is called the scheduling algorithm. Goals of Scheduling (Objectives) : In this section we try to answer following question: What the scheduler try to achieve? Many objectives must be considered in the design of a scheduling discipline. In particular, a scheduler should consider fairness, efficiency, response time, turnaround time, throughput, etc., Some of these goals depends on the system one is using for example batch system, interactive system or real-time system, etc. but there are also some goals that are desirable in all systems. General Goals :

34

Fairness : Fairness is important under all circumstances. A scheduler makes sure that each process gets its fair share of the CPU and no process can suffer indefinite postponement. Note that giving equivalent or equal time is not fair. Think of safety control and payroll at a nuclear plant. Policy Enforcement : The scheduler has to make sure that system's policy is enforced. For example, if the local policy is safety then the safety control processes must be able to run whenever they want to, even if it means delay in payroll processes. Efficiency : Scheduler should keep the system (or in particular CPU) busy cent percent of the time when possible. If the CPU and all the Input/Output devices can be kept running all the time, more work gets done per second than if some components are idle. Response Time : A scheduler should minimize the response time for interactive user. Turnaround : A scheduler should minimize the time batch users must wait for an output. Throughput : A scheduler should maximize the number of jobs processed per unit time. A little thought will show that some of these goals are contradictory. It can be shown that any scheduling algorithm that favors some class of jobs hurts another class of jobs. The amount of CPU time available is finite, after all.

Q.8. What are the different types of Scheduling Queues? Ans.: The Scheduling Queues in the systems are : (1) Job Queue : As processes enters in the system they are put into a job queue. (2) Ready Queue : The processes that are residing in the main memory and are ready and waiting to execute are kept in the ready queue. (3) Device Queue : This queue contain a list processes waiting for I/O devices. Q.9. Write about the different types of Schedulers. Operating Systems 35

Ans.: Types of Schedulers : There are basically three types of schedulers : (1) Long Term Scheduler : This scheduler determines which job will be submitted for immediate processing. It selects from the job pool and loads them into memory. (2) Short Term Scheduler : It is also called a CPU scheduler. It allocates processes belonging to ready queue to CPU for immediate processing. (3) Medium Term Scheduler : It is also called as memory scheduler. During the execution processes are swapped- out and swapped -in by the Medium term scheduler.

Q.10. Differentiate between Non-preemptive and Preemptive Scheduling Mechanism. Ans.: Non-preemptive Scheduling Mechanism : A Non-Preemptive scheduling algorithm selects a process to run and just let it run, until it blocks or until it voluntarily release the CPU. Preemptive Scheduling Mechanism : In this category, suspension or preemption is allowed based on priority.

Q.11. Explain various Non- preemptive Scheduling Mechanisms. Ans.: Non-preemptive Scheduling Mechanisms : Non- preemptive scheduling mechanisms are : (1) First Come First Served (FCFS) Scheduling : With this scheme, the process that requests the CPU first is allocated the CPU first. (2) Shortest-Job First (SJF) Scheduling : In this scheme, job requiring the minimal CPU time is selected first for CPU allocation. (3) Priority Scheduling : In this scheme a priority is associated with each process and the CPU is allocated to the process with the highest priority. (4) Deadline Scheduling : With this scheduling algorithm the process with earliest deadline is given the highest priority for execution. Q.12. Explain various Preemptive Scheduling Mechanisms.

36

Ans.: Preemptive Scheduling Mechanisms : Preemptive scheduling mechanisms are : (1) Round-Robin Scheduling : In This algorithm a small time slice is assigned to each process. The CPU scheduler goes around the ready queue, and allocating the CPU to each process for a time interval of one time quantum. (2) Two Queue Scheduling : In this approach, the processes are classified into two different groups. One queue is allocated to CPU bound processes and other is allocated to I/O bound processes. (3) Multilevel Queue Scheduling : A multilevel queue scheduling algorithm partition the ready queue in to separate queues and each queues has its own scheduling algorithms.

□ □ □ Operating Systems 37

Multiple Choice Questions

Q1. Process Manager is responsible for A. Scheduling of process B. Synchronization C. deadlock handling D. All

Q2. PCB stands for A. Program Control Block B. Process Control Bus C. Program Control Bus D. Process Control Block

Q3. Process is a A. Program B. Hardware C. Program under execution D. None

Q4. The various states of process are: A. New, Ready B. New, Ready, Running C. New, Running, Terminated D. New, Ready, Running, waiting, Terminated

Q5. The various queues are- A. Job Queue B. Ready queue C. Device queue D. All

Q6. CPU resource management is known as A. Scheduling B. I/O Management C. Swapping D. None

38

Q6. Different way of creating and deleting process are A. FORK B. JOIN C. QUIT D. All

Q7. Which of the following is also called as lightweight processes:- A. Function B. Application Module C. Kernel D. Thread

Q8. Thrashing is related to: A. Cache memory B. Main memory C. Secondary memory D. Virtual memory

Q9. Which of the following is not a system utility? A. Compiler B. Interpreter C. Operating system D. Internet explorer

Q10.FSCAN is a: A. Disk checking mechanism B. Disk clearing mechanism C. Disk formatting mechanism D. Disk scheduling mechanism

Operating Systems 39

Chapter-5

Memory Management

Q.1. What is Memory Management? Explain its goals. Ans.: Memory Management is the act of managing computer memory. In its simpler forms, this involves providing ways to allocate portions of memory to programs at their request, and freeing it for reuse when no longer needed. The management of main memory is critical to the computer system. Goals of Memory Management : Historically, a number of different memory management techniques have been used, and improved upon, in the operating system. The principal goals of the operating system's memory management are : To provide memory space to enable several processes to be executed at the same time To provide a satisfactory level of performance for the system users To protect each program's resources To share (if desired) memory space between processes To make the addressing of memory space as transparent as possible for the programmer.

Q.2. What is Virtual Memory? Ans.: An imaginary memory area supported by some operating systems (for example, Windows but not DOS) in conjunction with the hardware. You can think of virtual memory as an alternate set of memory addresses.

40

Programs use these virtual addresses rather than real addresses to store instructions and data. When the program is actually executed, the virtual addresses are converted into real memory addresses. The purpose of virtual memory is to enlarge the address space, the set of addresses a program can utilize. For example, virtual memory might contain twice as many addresses as main memory. A program using all of virtual memory, therefore, would not be able to fit in main memory all at once. Nevertheless, the computer could execute such a program by copying into main memory those portions of the program needed at any given point during execution. To facilitate copying virtual memory into real memory, the operating system divides virtual memory into pages, each of which contains a fixed number of addresses. Each page is stored on a disk until it is needed. When the page is needed, the operating system copies it from disk to main memory, translating the virtual addresses into real addresses. The process of translating virtual addresses into real addresses is called mapping. The copying of virtual pages from disk to main memory is known as paging or swapping.

Q.3. What is Paging? Ans.: When a program is selected for execution, the system brings it into virtual storage, divides it into pages of four kilobytes, transfers the pages into central storage for execution. To the programmer, the entire program appears to occupy contiguous space in storage at all times. Actually, not all pages of a program are necessarily in central storage, and the pages that are in central storage do not necessarily occupy contiguous space. Operating Systems 41

The pieces of a program executing in virtual storage must be moved between real and auxiliary storage. To allow this, z/OS® manages storage in units, or blocks, of four kilobytes. The following blocks are defined : A block of central storage is a frame. A block of virtual storage is a page. A block of auxiliary storage is a slot. A page, a frame, and a slot are all the same size: Four kilobytes. An active virtual storage page resides in a central storage frame. A virtual storage page that becomes inactive resides in an auxiliary storage slot (in a paging data set). Figure 1 shows the relationship of pages, frames, and slots. In Figure 1, z/OS is performing paging for a program running in virtual storage. The lettered boxes represent parts of the program. In this simplified view, program parts A, E, F, and H are active and running in central storage frames, while parts B, C, D, and G are inactive and have been moved to auxiliary storage slots. All of the program parts, however, reside in virtual storage and have virtual storage addresses.

Figure : Frames, Pages, and Slots

Q.4. What are Preemptable and Nonpreemptable Resources. Ans.: Resources come in two flavors: preemptable and nonpreemptable. A preemptable resource is one that can be taken away from the process with no ill effects. Memory is an example of a preemptable resource. On the other hand, a nonpreemptable resource is one that cannot be taken away from process (without causing ill effect). For example, CD resources are not preemptable at an arbitrary moment.

42

Reallocating resources can resolve deadlocks that involve preemptable resources. Deadlocks that involve nonpreemptable resources are difficult to deal with.

Q.5 What is difference between Logical and Physical Addresses? Ans.: Logical versus Physical Address Space : An address generated by the CPU is commonly referred to as a logical address, whereas an address seen by the memory unit is commonly referred to as a physical address. The set of all logical addresses generated by a program is referred to as a logical address space; the set of all physical addresses corresponding to these logical addresses is referred to as a physical address space. The user program deals with logical addresses. The memory-mapping hardware converts logical addresses into physical addressed.

Q.6 What is the difference between Contiguous and Non-contiguous Allocation Techniques. Ans.: Contiguous and Non-contiguous Allocation Techniques : Contiguous memory management scheme expect the program to be loaded in the contiguous memory locations. While non-contiguous system removes this restriction. They allow the program to be divided into different chunks and loaded at the different portion of memory.

Q.7 Explain the difference between Internal and External Fragmentation. Ans.: External and Internal Fragmentation : As processes are loaded and removed from memory, the free memory space is broken into little pieces. External fragmentation exists when enough to the memory space exists to satisfy a request, but it is not contiguous; storage is fragmented into a large number of small holes. While internal fragmentation means memory that is internal to partition, but is not being used. Operating Systems 43

Q.8 What do you mean by Swapping? Ans.: Swapping : In case of Round robin CPU-scheduling or priority-based scheduling it is required to a process, that it can be swapped temporarily out of memory to a backing store, and then brought back into memory for continued execution. This technique is called swapping. A process is swapped out will be swapped back into the same memory space that it occupies previously. Swapping requires a backing store. The backing store is commonly a fast disk.

Q.9 Explain the Segmentation technique in brief. Ans.: Segmentation : Segmentation is a memory management scheme. It assumes that logical address is a collection of segment. Each segment has a name and a length. The address specifies both the segment number and the offset thus the logical address consists of two parts :

Q.10 What do you understand by Demand Paging? Ans.: Demand Paging : A demand paging is similar to a paging system with swapping. When we want to execute a process, we swap it into memory. Rather than swapping the entire process into memory. When a process is to be swapped in, the pager guesses which pages will be used before the process is swapped out again Instead of swapping in a whole process; the pager brings only those necessary pages into memory. Thus, it avoids reading into memory pages that will not be used in anyway, decreasing the swap time and the amount of physical memory needed.

Q.11 What are the various methods of Page Replacement? Ans.: Page Replacement Algorithm : There are many different page replacement algorithms. Some are :

44

(1) FIFO Algorithm : The simplest page-replacement algorithm is a FIFO algorithm. A FIFO replacement algorithm associates with each page the time when that page was brought into memory. When a page must be replaced, the oldest page is chosen. (2) Optimal Algorithm : An optimal page-replacement algorithm has the lowest page-fault rate of all algorithms. It is simply replace the page that will not be used for the longest period of time. (3) LRU Algorithm : The LRU replaces the page that has not been used for the longest period of time. LRU replacement associates with each page the time of that page's last use. When a page must be replaced, LRU chooses that page that has not been used for the longest period of time. Operating Systems 45

Multiple Choice Questions Q1. To bring program again from disk into the main memory is called: A. Swapping in B. Swapping out C. A and B both D. None of the above

Q2. A job may be: A. CPU bound B. I/O bound C. Both a & b D. None of the above

Q3. Ready state means a process has: A. All required resources except memory B. All required resources except CPU C. All required resources except I/O devices D. None of the above

Q4.Default file system of linux: A. Ext3 B. NTFS C. CDFS D. RAID

46

Q5. Default file system of Windows 2003: A. Ext3 B. NTFS C. CDFS D. RAID

Q6.Which of the following is a non-preemptive CPU scheduling policy: A. Shortest job first B. First come first served C. Shortest remaining time D. Both A & B Q7. Banker‘s algorithm is used for deadlock: A. Avoidance B. Detection C. Prevention D. Banking transaction on computer

Q8.Which of the following is a place replacement strategy? A. FIFO B. Second Chance C. Clock Page D. None of the above

Operating Systems 47

Q9. In paging, can the total address spaceexceed the size of the physical memory? A. Yes B. No C. Sometimes D. Depends on process

Q10. Interleaved execution of more than one programs at a time is known as: A. Multiprogramming B. Multitasking C. Multiprocessing D. GUI

48

Chapter-6

Deadlocks

Q.1. What are Deadlocks? Ans.: A set of process is in a deadlock state if each process in the set is waiting for an event that can be caused by only another process in the set. In other words, each member of the set of deadlock processes is waiting for a resource that can be released only by a deadlock process. None of the processes can run, none of them can release any resources, and none of them can be awakened. It is important to note that the number of processes and the number and kind of resources possessed and requested are unimportant. The resources may be either physical or logical. Examples of physical resources are Printers, Tape Drivers, Memory Space, and CPU Cycles. Examples of logical resources are Files, Semaphores, and Monitors. The simplest example of deadlock is where process 1 has been allocated non-shareable resources A, say, a tap drive, and process 2 has be allocated non-sharable resource B, say, a printer. Now, if it turns out that process 1 needs resource B (printer) to proceed and process 2 needs resource A (the tape drive) to proceed and these are the only two processes in the system, each is blocked the other and all useful work in the system stops. This situation ifs termed deadlock. The system is in deadlock state because each process holds a resource being requested by the other process neither process is willing to release the resource it holds. Operating Systems 49

Q.2. What are the Necessary and Sufficient Deadlock Conditions. Ans.: Four (4) conditions that must hold simultaneously for there to be a deadlock : (1) Mutual Exclusion Condition : The resources involved are non- shareable. Explanation : At least one resource (thread) must be held in a non- shareable mode, that is, only one process at a time claims exclusive control of the resource. If another process requests that resource, the requesting process must be delayed until the resource has been released. (2) Hold and Wait Condition : Requesting process hold already, resources while waiting for requested resources. Explanation: There must exist a process that is holding a resource already allocated to it while waiting for additional resource that are currently being held by other processes. (3) No-Preemptive Condition : Resources already allocated to a process cannot be preempted. Explanation : Resources cannot be removed from the processes are used to completion or released voluntarily by the process holding it. (4) Circular Wait Condition : The processes in the system form a circular list or chain where each process in the list is waiting for a resource held by the next process in the list.

Q.3 What are the necessary conditions to produce a Deadlock? Ans.: Necessary Conditions for Deadlock : A deadlock situation can arise if the following four conditions hold simultaneously in a system: (1) Mutual Exclusion : At least one resource must be held in a non- sharable mode; that is, only one process at a time can use the resource. (2) Hold and Wait : There must exist a process that is holding at least one resource and is waiting to acquire additional resources that are currently being held by other processes.

50

(3) No Preemption : Resources cannot be preempted; that is, a resource can be released only voluntarily by the process holding it, after that process, has completed its task. (4) Circular Wait : There must exist a set {P0, P1, ..., P2} of waiting processes such that P0 is waiting for a resource that is held by P1, P1 is waiting for a resource that is held by P2, ., Pn-1 is waiting for a resource that is held by Pn, and Pn is waiting for a resource that is held by P0.

Q.4 What are the methods of handling a Deadlock? Ans.: Methods of Handling Deadlocks : There are three different methods for dealing with the deadlock problem :  We can use a protocol to ensure that the system will never enter a deadlock state.  We can allow the system to enter a deadlock state and then .  We can ignore the problem all together, and pretend that deadlocks never occur in the system. Q.5 Write the methods to prevent a Deadlock Situation. Ans.: Methods to Prevent a Deadlock Situation : For a deadlock to occur, each of the four necessary-conditions must hold. By ensuring that at least on one these conditions cannot hold, we can prevent the occurrence of a deadlock. (1) Mutual Exclusion : The mutual-exclusion condition must hold for non-sharable resources. Sharable resources, on the other hand, do not require mutually exclusive access, and thus cannot be involved in a deadlock. (2) Hold and Wait : Whenever a process requests a resource, it does not hold any other resources. An alternative protocol allows a process to request resources only when the process has none. (3) No Preemption : If a process that is holding some resources requests another resource that can not be immediately allocated to it, then all resources currently being held are released implicitly. Operating Systems 51

Then the preempted resources are added to the list of resources for which the process is waiting. (4) Circular Wait : Circular-wait condition never holds is to impose a total ordering of all resource types, and to require that each process requests resources in an increasing order of enumeration.

Q.6 How can a Deadlock Situation be avoided? Ans.: Deadlock Avoidance : Avoiding deadlocks is to require additional information about how resources are to be requested. A deadlock- avoidance algorithm dynamically examines the resource-allocation state to ensure that there can never be a circular wait condition. The resource allocation state is defined by the number of available and allocated resources, and the maximum demands of the processes. There are various methods used for the purpose of deadlock avoidance : (1) Safe State : A state is safe if the system can allocate resources to each process (up to its maximum) in some order and still avoid a deadlock. More formally, a system is in a safe state only if there exists a safe sequence. If no such sequence exists, then the system state is said to be unsafe. (2) Resource-Allocation Graph Algorithm : Suppose that process Pi requests resource Rj. The request can be granted only if Converting the request edge Pi  Rj to an assignment edge Rj  Pi does not result in the formation of a cycle in the resource- allocation graph. (3) Banker's Algorithm : This resource-allocation graph algorithm is applicable to a resource-allocation system with multiple instances of each resource type. This algorithm is commonly known as the banker's algorithm.

Q.7 Write the methods for detect a Deadlock. Ans.: Deadlock Detection : If a system does not employ either a deadlock- prevention or a deadlock avoidance algorithm, then a deadlock situation may occur. In this environment

52

 An algorithm that examines the state of the system to determine whether a deadlock has occurred.  An algorithm to recover from the deadlock. Single Instance of Each Resource Type : If all resources have only a single instance, then we can define a deadlock detection algorithm that uses a variant of the resource-allocation graph, called a wait-for graph. We obtain this graph from the resource-allocation graph by removing the nodes of type resource and collapsing the appropriate edges. Several Instances of a Resource Type : The wait-for graph scheme is not applicable to a resource-allocation system with multiple instances of each resource type. The algorithm used are :  Available  Allocation  Request

Q.8 Write the methods of recovery from Deadlock. Ans.: Recovery from Deadlock : When a detection algorithm determines that a deadlock exists, several alternatives exist for recovery. One possibility is to inform the operator that a deadlock has occurred, and to let the operator deal with the deadlock manually. The other possibility is to let the system recover from the deadlock automatically. There are two options for breaking a deadlock. One solution is simply to abort one or more processes to break the circular wait. The second option is to preempt some resources from one or more of the deadlocked processes. Operating Systems 53 Multiple Choice Question

Q1. SIGNAL and WAIT operation are related to A. Multiprogramming B. Semaphores C. Pre-emptive scheduling of processes D. None of the above

Q2. Messages are very much required for A. synchronization B. inter process communication C. both (a) and (b) D. None

Q3. IPC stands for: A. Inter- Process communication B. Intra-Process communication C. In-Program cooperation D. None

Q4. Mutual Exclusion problem occurs between A. two disjoint processes that do not interact B. processes that share resources C. processes that do not use the same resource D. None

Q5. Which of the following is not a direct function of operating system A. I/O operation B. Memory management C. Resource management D. DBMS

Q6. Which of the following condition is not responsible for a deadlock to occur? A. Mutual Exclusion B. Hold and Wait C. No-Preemption D. Semaphore

54 Q7. A situation where two or more processes get into a state whereby each is holding a resource while other is requesting A. Page Fault B. Debugging C. Deadlock D. I/O management

Q8.If bankers algorithem is to deadlock,Paging is to: A. Memory management B. Scheduling C. Threads D. None of the above

Q9. In UNIX,the command to terminate execution of a program is: A. B. Fork C. Stop D. End

Q10. An operating system works as: A. An extended machine B. A resource manager C. A & b both D. None of the above

□ □ □ Operating Systems 55

Chapter-7

Security and Protection

Q.1 Define various Security Threats in context of Computer System. Ans.: Security Threats : The major security threats perceived by user and providers of computer-based systems are - (1) Unauthorized disclosure of information (2) Unauthorized alteration or destruction of information (3) Unauthorized use of service (4) Denial of service to legitimate users.

Q.2 Write the difference between Viruses and Worms. Ans.: Viruses and Worms : A computer virus is a code that attached itself to other programs in order to alter their behavior, in an harmful way. Viruses normally cause direct harm to the system. While a computer worm is a program written in such a way that is spread to other computers over a network and it also consume the network recourses to very large extent. But it does not harm any other computer program or data.

Q.3 Define various Security Design Principles. Ans.: Security Design Principles : The general design principles for protection mechanisms are : (1) Public Design

56

(2) Least Privilege (3) Explicit Demand (4) Continuous Verification (5) Simple Design (6) User Acceptance (7) Multiple Conditions.

Q.4 What is the goal of Authentication? Ans.: Authentication : Authentication is a process of verifying whether a person is a legitimate user or not. The primary goal of authentication is to allow access to legitimate system users and to deny access to unauthorized parties. The password is the most commonly used authentication scheme which is also easy to implement.

Q.5 Define various Protection Mechanisms used for protecting files. Ans.: Protection Mechanisms : There are a number of mechanisms that are employed to protect the system resources. For various objects, the operating system allows different Access Rights for different subjects. An Access Control Matrix (ACM) has to be stored by operating systems in order to decide to which user to grant what access rights for which file. Basically there are three methods used for storing the ACM : o Access Control List o Capability List o Combined Scheme

Q.6 What do you mean by Encryption? Ans.: Encryption : In technical terms, the process of encoding messages is called as Encryption. In it the original text is called as plain text but when it is encrypted, it is called Cipher text. The recipient understands the meaning and decodes the message to extract to correct meaning out of it. This process is called decryption. Operating Systems 57

Multiple choice Question

Q1. The operating system which the IBM –PC uses: A. CP/M B. MS-DOS C. UNIX D. AT-DOS

Q2.Most operating system are designed to run with a specific: A. Type of processor B. Manufacturer‘s printer C. Brand of computer D. Style of keyboard

Q3.A technique that can be used when a very long program exceeds the storages capacity of memory is called: A. Windowing B. Time sharing C. Linkage editing D. Virtual memory

Q4.An operating system designed for uase on both PC‘s at home andon serversin business is: A. Windows XP B. Windows ME C. Windows NT D. Windows CE

58

Q5. The address, which CPU ,generates is called as: A. Physical address B. Actual address C. Logical address D. None of the above

Q6.Conditions for deadlock are: A. Mutual exclusion and partial allocation B. Non-preemption and circular wait C. Both A & B D. None of the above

Q7. DMA stands for: A. Direct memory access B. Direct memory assigned C. Digital memory access D. All of the above

Q8. In UNIX dead nlock is handled considering: A. Ignore the problem B. By resource preemption C. Solve the problem D. none of the above

Q9. The two important characteristics of I/o devices are: A. Asynchronous operation B. Speed gap Operating Systems 59

C. A and B both D. None of the above

Q10. The addressing scheme used for I/O devices is: A. Memory mapped I/O B. I/O mapped I/O C. A and B both D. None of the above

□ □ □

60

Chapter-8

Parallel Processing

Q.1. What is Parallel Processing? Ans.: The simultaneous use of more than one CPU to execute a program. Ideally, parallel processing makes a program run faster because there are more engines (CPUs) running it. In practice, it is often difficult to divide a program in such a way that separate CPUs can execute different portions without interfering with each other. Most computers have just one CPU, but some models have several. There are even computers with thousands of CPUs. With single-CPU computers, it is possible to perform parallel processing by connecting the computers in a network. However, this type of parallel processing requires very sophisticated software called distributed processing software. Parallel processing differs from multitasking, in which a single CPU executes several programs at once. Parallel processing is also called parallel computing.

Q.2 What are the advantages of Parallel Processing? Ans.: Advantages of Parallel Processing : The main advantages of parallel processing are : (1) Performance (2) Fault Tolerance (3) Incremental Growth (4) Cost Performance □ □ □ Operating Systems 61

Chapter-9

DOS Operating System

Q.1. What is Booting? Explain DOS Boot Process. Ans.: Booting may be defined as the process of loading the Operating System onto the RAM. Once the computer system is turned on, the BIOS perform a series of activities called Power on Self Test (POST) that checks to see whether the peripherals in the system are in perfect order. This Pre Boot Sequence consists of a series of steps that starts with the execution of software stored in the ROM called firmware. These activities are actually known as POST. After the BIOS is done with the pre boot activities, it searches for the Master Boot Record in the first physical sector of the bootable disk. Note that a floppy disk cannot be partitioned and hence does not contain the MBR. Hence, if the bootable disk is floppy, this process is skipped and the boot strap loader is loaded in the memory. If the bootable disk is not the floppy, the MBR finds and searches the partition table to load and scan all the extended partitions to find the primary partition that is marked as “active―. When it finds one, it implies that it is the bootable partition, and, the Operating System loader, also called the boot strap loader is loaded from that partition onto the memory. A boot strap loader is a special program that is present in the boot sector of the bootable drive. MS DOS Operating system comprises of the following files : (1) IO.Sys

62

(2) MSDOS.Sys (3) Command.Com (4) Config.Sys (5) Autoexec.bat Note that the first three files are mandatory while the rest two are optional. Further, the first three files should be present in the bootable drive of the disk and in the same sequence as shown above for the operating system to function properly. If any of these three files are not found, then the message, “"Non-system disk or disk error - Replace and press any key when ready" is displayed in the console, else the boot process continues. The boot strap loader first loads the IO.Sys file. The IO.Sys file as the name suggests, is responsible for Input Output in the DOS environment. The next file that is loaded is the MSDOS. which is the core of the DOS operating system. The MSDOS.Sys file is mainly responsible for Memory management and Processor Management in the DOS environment. The MSDOS.Sys file now searches to find the name of the command interpreter in the Config.Sys file and when it finds one, it loads the same onto the memory. If no command interpreter is specified in the Config.Sys file, the Command.Com file is loaded as it is the default command interpreter of DOS Operating system. You can load a different command interpreter by specifying the following in the Config.Sys file. Command = C:\Test.com Here, Test.com is a command interpreter that would be used as the command interpreter in lie of the default command interpreter Command.Com. The last file to be loaded and executed is the Autoexec.bat file that contains a sequence of DOS commands. Now, the prompt is displayed and you can see the drive letter of the bootable drive displayed on your screen indicative of the fact that the Operating System has been loaded successfully from that drive.

Operating Systems 63

Q.2. Define BIOS? Ans.: The process begins with the BIOS (Basic Input Output System), which is a series of instructions that are contained on a ROM (read-only memory) chip. In addition to the ROM BIOS there are settings that are held on a bettery-powered chip. This chip is frequently made of a special material called CMOS (complementary metal oxide semiconductor). These settings are configurable by the user, and can be accessed at the beginning of the boot process by pressing a special key, such as F1 or Delete. The settings held in the CMOS tell the computer which disk drives are present, and the order in which these disks should be checked for boot information.

Q.3 What are the features of Disk Operating System? Ans.: Features of Disk Operating System : The main features of MS DOS are : o MS DOS provides command based interface to user. o It provides a number of commands for file management o MS DOS uses the concept of directory to organize the stored files o It provides the facility of taking backup of files. o MS DOS treats all devices as files and this simplifies the use of devices.

Q.4 What do you mean by Internal and External DOS Commands? Ans.: Internal and External DOS Commands : The programs related to frequently used DOS commands are loaded into main memory at the time of booting itself. These commands are called Internal DOS commands. While the programs corresponding to DOS commands which are used less frequently reside in the secondary memory and are loaded in primary memory, when needed. These commands are called External DOS commands.

64 Q.5 What do you mean by Internal and External DOS Commands? Ans.: Internal and External DOS Commands : The programs related to frequently used DOS commands are loaded into main memory at the time of booting itself. These commands are called Internal DOS commands. While the programs corresponding to DOS commands which are used less frequently reside in the secondary memory and are loaded in primary memory, when needed. These commands are called External DOS commands. □ □ □ Operating Systems 65

Chapter-10

Commands of DOS

Q.1. Give Overview of DOS Commands. Ans.: Below is a listing of each of the MS-DOS commands currently listed on Computer Hope and a brief explanation of what each of the commands do. The below commands are all MS-DOS commands, which means not all the below commands will work in your version of MS-DOS and/or Windows command line.

Command Description

Defines functions that change display graphics, Aansi.sysNSI.SYS control cursor movement, and reassign keys.

Causes MS-DOS to look in other directories when append editing a file or running a command.

Displays, adds, and removes arp information from arp network devices.

assign Assign a drive letter to an alternate letter.

assoc View the file associations.

at Schedule a time to execute commands or programs.

66

Command Description

Lists connections and addresses seen by Windows atmadm ATM call manager.

Display and change file attributes.

Recovery console command that executes a series of batch commands in a file.

Recovery console command that allows a user to view, modify, and rebuild the boot.ini

break Enable / disable CTRL + C feature.

View and modify file ACL's.

call Calls a batch file from another batch file.

cd Changes directories.

Supplement the International keyboard and chcp character set information.

chdir Changes directories.

chdsk Check the hard disk drive running FAT for errors.

chkntfs Check the hard disk drive running NTFS for errors.

Specify a listing of multiple options within a batch choice file.

Clears the screen.

cmd Opens the command interpreter. Operating Systems 67

Command Description

Easily change the foreground and background color color of the MS-DOS window. command Opens the command interpreter. Compares files. compact Compresses and uncompress files.

Open Control Panel icons from the MS-DOS control prompt. Convert FAT to NTFS. Copy one or more files to an alternate location. ctty Change the computers input/output devices. date View or change the systems date.

Debug utility to create assembly programs to modify hardware settings.

Re-arrange the hard disk drive to help with loading defrag programs. Deletes one or more files. delete Recovery console command that deletes a file. deltree Deletes one or more files and/or directories. List the contents of one or more directory.

68

Command Description

Recovery console command that disables Windows disable system services or drivers.

Compare a disk with another disk.

Copy the contents of one disk and place them on another disk.

Command to view and execute commands that have been run in the past.

dosshell A GUI to help with early MS-DOS users.

drivparm Enables overwrite of original device drivers.

Displays messages and enables and disables echo.

edit View and edit files.

View and edit files.

emm386 Load extended Memory Manager.

Recovery console command to enable a disable ename service or driver.

Stops the localization of the environment changes endlocal enabled by the setlocal command.

erase Erase files from computer.

exit Exit from the command interpreter.

Expand a file back to it's expand original . Operating Systems 69

Command Description extract Extract files from the Microsoft Windows cabinets.

Displays a listing of MS-DOS commands and fasthelp information about them. fc Compare files.

Utility used to create partitions on the hard disk fdisk drive. find Search for text within a file. Searches for a string of text within a file. fixboot Writes a new boot sector. fixmbr Writes a new boot record to a disk drive. for Boolean used in batch files. format Command to erase and prepare a disk drive. ftp Command to connect and operate on a FTP server.

Displays or modifies file types used in file extension associations. goto Moves a batch file to a specific or location. graftabl Show extended characters in graphics mode.

Display a listing of commands and brief help explanation.

70

Command Description

Allows for batch files to perform conditional if processing.

ifshlp.sys 32-bit file manager.

Network command to view network adapter settings and assigned values.

keyb Change layout of keyboard.

label Change the label of a disk drive.

lh Load a device driver in to high memory.

Recovery console command that displays the listsvc services and drivers.

loadfix Load a program above the first 64k.

loadhigh Load a device driver in to high memory.

lock Lock the hard disk drive.

logoff Logoff the currently profile using the computer.

Recovery console command to list installations and logon enable administrator login.

map Displays the device name of a drive.

md Command to create a new directory.

mem Display memory on system. Operating Systems 71

Command Description Command to create a new directory. mode Modify the port or display settings. more Display one page at a time.

Move one or more files from one directory to another directory. msav Early Microsoft Virus scanner. msd Diagnostics utility.

Utility used to load and provide access to the CD- msdex ROM.

Displays protocol statistics and current TCP/IP nbtstat connections using NBT

Update, fix, or view the network or network settings

Configure dynamic and static network information from MS-DOS.

Display the TCP/IP network protocol statistics and information. nlsfunc Load country specific information.

Look up an IP address of a domain or host on a network. path View and modify the computers path location.

72

Command Description

View and locate locations of network latency.

Command used in batch files to stop the processing pause of a command.

Test / send information to another network ping computer or network device.

Changes to the directory or network path stored by popd the pushd command.

power Conserve power with computer portables.

Prints data to a printer port.

prompt View and change the MS-DOS prompt.

Stores a directory or network path in memory so it pushd can be returned to at any time.

Open the QBasic.

rd Removes an empty directory.

Renames a file or directory.

rename Renames a file or directory.

Removes an empty directory.

route View and configure windows network route tables.

Enables a user to execute a program on another computer. Operating Systems 73

Command Description scandisk Run the scandisk utility. scanreg Scan registry and recover registry from errors. set Change one variable or string to another.

Enables local environments to be changed without setlocal affecting anything else.

Change MS-DOS version to trick older MS-DOS setver programs.

Installs support for file sharing and locking share capabilities.

Changes the position of replaceable parameters in a shift batch program. Shutdown the computer from the MS-DOS prompt.

Create a disk cache in conventional memory or smartdrv extended memory.

Sorts the input and displays the output to the sort screen.

Start a separate window in Windows from the MS- start DOS prompt.

Substitute a folder on your computer for another drive letter. switches Remove add functions from MS-DOS.

74

Command Description

sys Transfer system files to disk drive.

Telnet to another computer / device from the telnet prompt.

time View or modify the .

Change the title of their MS-DOS window.

Visually view a network packets route across a tracert network.

tree View a visual tree of the hard disk drive.

type Display the contents of a file.

undelete Undelete a file that has been deleted.

unformat Unformat a hard disk drive.

unlock Unlock a disk drive.

Display the version information.

Enables or disables the feature to determine if files verify have been written properly.

Displays the volume information about the designated drive.

Copy multiple files, directories, and/or drives from one location to another. Operating Systems 75

Q.2. What is an External / Internal Command in DOS and give their examples. Ans.: In MS-DOS there are two types of commands. An Internal command, which is a command embedded into the command.com file, and an external command, which is not embedded into command.com and therefore requires a separate file to be used. For example, if your computer does not have fdisk.exe and you try using the fdisk command, you would receive an error "Bad command or file name." Fdisk is an external command that will only work if fdisk.exe, or in some cases, fdisk.com, is present. However, as long as MS-DOS is running on your computer internal commands such as the cd command will always be available and does not require any other files to run.

Examples of internal commands :

break buffers call cd

chcp chdir choice cls

copy country ctty date

del device devicehigh dir

dos drivparm echo erase

errorlevel exist exit fcbs

files for goto if

include install lastdrive lh

loadfix loadhigh md menucolor

menudefault menuitem mkdir move

not numlock path pause

prompt rd rem ren

76

rename rmdir set shell

shift stacks submenu switches

time truename type ver

verify vol

Examples of External Commands :

append assign attrib backup

command comp dblspace

debug defrag deloldos deltree

diskcomp diskcopy doskey dosshell

edit emm386 expand

fasthelp fastopen fc fdisk

find format graftabl graphics

help himem interlnk intersvr

join keyb label mem

memmaker mirror mode more

msav msbackup msd

nlsfunc power print replace

restore scandisk select setver

share sort subst sys

tree undelete unformat vsafe

xcopy Operating Systems 77

Q.3. Explain DOS System Files. Ans.: The files in the following chapter are system files. These files are created and maintained by the operating system and are necessary for the system to perform its many functions. System files are used by many commands and subroutines to perform operations. These files can only be changed by a user with root authority. The modern DOS operating system is distributed on 3-5 high density floppy disks. It comes with backup utilities and (depending on how the lawyers feel) disk compression drivers. However, all the stuff that goes into C:\DOS and its subdirectories are programs and utilities. The core DOS operating system consists of six files : The boot sector is a 512 byte record placed at the beginning of the C: drive when DOS was installed, or placed there subsequently using the "sys c:" command. Two "hidden" files are stored in the root directory of the C: drive. They do not show up in a DIR listing unless the /A switch is used. On IBM PC DOS systems, they are IBMBIO.SYS and IBMDOS .SYS. On MS DOS systems, they are called IO.SYS and MSDOS.SYS. These files form the kernel of the DOS system. COMMAND.COM is the "shell" or command interpreter. It prints out the "C:\> " prompt and reads user commands. It also supports BAT files. The user configuration files are CONFIG.SYS and AUTOEXEC.BAT. The reader is assumed to be familiar with these files. COMMAND.COM is initially stored in the C:\ root directory. The problem is that OS/2 and Windows NT have their own versions of COMMAND.COM. To avoid confusion, each COMMAND.COM should be stored in the subdirectory that belongs to its particular operating system. In normal use, this means that the DOS version should be in C:\DOS. To relocate it, two statements must be added to the user configuration files: "SHELL=C:\DOS\COMMAND.COM" is added to CONFIG.SYS. "SET COMSPEC=C:\DOS\COMMAND.COM" is added to AUTOEXEC.BAT.

78

The hidden files IBMBIO, IBMDOS, IO, or MSDOS have names that do not conflict with each other or with any system file belonging to any other operating system. They can stay in the C:\ root directory no matter what gets added to the system. This means that the volatile part of the DOS system consists of the boot record, C:\CONFIG.SYS, and C:\AUTOEXEC.BAT.

Q.4. Define DOS Files and Directories. Ans.: DOS Files : This operating system allows you to work with DOS files on your system. Copy to a diskette the DOS files you want to work with. With the right commands, your system can read these files into a base operating system directory in the correct format and back onto the diskette in DOS format. Note: The wildcard characters * and ? (asterisk and question mark) do not work with these commands (although they do with the base operating system shell). If you do not specify a file name extension, the file name is matched as if you had specified a blank extension. This section describes : Copying DOS Files to Base Operating System Files. Copying Base Operating System Files to DOS Files. Deleting DOS Files. Listing Contents of a DOS Directory .  Copying DOS Files to Base Operating System Files : The dosread command copies the specified DOS file to the specified base operating system file. Note : DOS file-naming conventions are used with one exception. Because the backslash (\) character can have special meaning to the base operating system, use a slash (/) character as the delimiter to specify subdirectory names in a DOS path name. For example, to copy a text file named chap1.doc from a DOS diskette to the base operating file system, type : dosread -a chap1.doc chap1 Operating Systems 79

Press Enter. This copies the DOS text file \CHAP1.DOC on default device /dev/fd0 to the base operating system file chap1 in the current directory. For example, to copy a binary file from a DOS diskette to the base operating file system, type: dosread -D/dev/fd1 /survey/test.dta /home/fran/testdata Press Enter. This copies the DOS data file \SURVEY\TEST.DTA on /dev/fd1 to the base operating system file /home/fran/testdata. See the dosread command in the AIX 5L Version 5.1 Commands Reference for the exact syntax.  Copying Base Operating System Files to DOS Files : The doswrite command copies the specified base operating system file to the specified DOS file. Note : DOS file-naming conventions are used with one exception. Because the backslash (\) character can have special meaning to the base operating system, use a slash (/) character as the delimiter to specify subdirectory names in a DOS path name. For example, to copy a text file named chap1 from the base operating file system to a DOS diskette, type: doswrite -a chap1 chap1.doc Press Enter. This copies the base operating system file chap1 in the current directory to the DOS text file \CHAP1.DOC on /dev/fd0. For example, to copy a binary file named /survey/test.dta from the base operating file system to a DOS diskette, type: doswrite -D/dev/fd1 /home/fran/testdata /survey/test.dta Press Enter. This copies the base operating system data file /home/fran/ testdata to the DOS file \SURVEY\TEST.DTA on /dev/fd1.

80

See the doswrite command in the AIX 5L Version 5.1 Commands Reference for the exact syntax.  Deleting DOS Files : The dosdel command deletes the specified DOS file. Note : DOS file-naming conventions are used with one exception. Because the backslash (\) character can have special meaning to the base operating system, use a slash (/) character as the delimiter to specify subdirectory names in a DOS path name. The dosdel command converts lowercase characters in the file or directory name to uppercase before it checks the disk. Because all file names are assumed to be full (not relative) path names, you need not add the initial slash (/). For example, to delete a DOS file named file.ext on the default device (/dev/fd0), type: dosdel file.ext Press Enter. See the dosdel command in the AIX 5L Version 5.1 Commands Reference for the exact syntax.  Listing Contents of a DOS Directory : The dosdir command displays information about the specified DOS files or directories. Note : DOS file-naming conventions are used with one exception. Because the backslash (\) character can have special meaning to the base operating system, use a slash (/) character as the delimiter to specify subdirectory names in a DOS path name. The dosdir command converts lowercase characters in the file or directory name to uppercase before it checks the disk. Because all file names are assumed to be full (not relative) path names, you need not add the initial / (slash). For example, to read a directory of the DOS files on /dev/fd0, type: dosdir Press Enter. Operating Systems 81

The command returns the names of the files and disk-space information. PG3-25.TXT PG4-25.TXT PG5-25.TXT PG6-25.TXT Free space: 312320 bytes DOS Directories : DOS directories are hierarchical in structure. The starting point is the root directory. A subdirectory is a directory that is subordinate to (below, or attached to) another directory.  Creating a Stand-Alone Directory : A stand-alone directory is one attached to the root. To create stand-alone directory KAREN, type : C:\ANYWHERE>cd \ go to the root C:\>md karen make directory off the root C:\> you're still in the root To go to that directory, type : C:\>cd karen change directories C:\KAREN> prompt changed to Karen  Removing a Directory : First, be sure all files in the directory have been erased. Second, move back a level to the directory before it. The following example switches to the KAREN directory, deletes all files, moves back one level and removes the KAREN directory : C:\>cd karen go to KAREN C:\KAREN>del *.* delete all files C:\KAREN>cd .. move back one level C:\>rd karen remove KAREN directory

82

 Creating a Subdirectory : To create a subdirectory called BUDGET that is located within the KAREN directory, type: * C:\ANYWHERE>cd \karen go to KAREN C:\KAREN>md budget make subdirectory ** C:\KAREN>cd budget go to budget C:\KAREN\BUDGET> prompt has changed * Going to KAREN requires a backslash in front of KAREN, because the first backslash means ROOT directory, and KAREN is off the root. ** Going to BUDGET does not use the backslash, because BUDGET is off KAREN, not off the root. More on this in a moment.

□ □ □ Operating Systems 83

Chapter-11

UNIX Operating System

Q.1 Write the process of Log-in and Log-out in UNIX System. Ans.: Log-in and Log-out : To access your UNIX system, you must have a user ID and password. To login press Enter on the terminal or workstation until you see the message : Login : And cursor immediately after it. Now type your user id and press Enter. Now the system asks for your password by displaying. Password : Now Enter your password and press Enter. Once you have logged- in, a prompt will displayed, indicating that it is ready to take your command. To log-out, type the command : Logout : When log-out is successful, a login message is displayed on the screen to indicate that it is free for next person.

Q.2. Write short notes on Kernel Shell Ans.: Kernel : The kernel of UNIX is the hub of the operating system: it allocates time and memory to programs and handles the filestore and communications in response to system calls.

84

As an illustration of the way that the shell and the kernel work together, suppose a user types rm myfile (which has the effect of removing the file myfile). The shell searches the filestore for the file containing the program rm, and then requests the kernel, through system calls, to execute the program rm on myfile. When the process rm myfile has finished running, the shell then returns the UNIX prompt % to the user, indicating that it is waiting for further commands. Shell : The shell acts as an interface between the user and the kernel. When a user logs in, the login program checks the username and password, and then starts another program called the shell. The shell is a command line interpreter (CLI). It interprets the commands the user types in and arranges for them to be carried out. The commands are themselves programs: when they terminate, the shell gives the user another prompt (% on our systems). The adept user can customise his/her own shell, and users can use different shells on the same machine. Staff and students in the school have the tcsh shell by default. The tcsh shell has certain features to help the user inputting commands. Filename Completion - By typing part of the name of a command, filename or directory and pressing the [Tab] key, the tcsh shell will complete the rest of the name automatically. If the shell finds more than one name beginning with those letters you have typed, it will beep, prompting you to type a few more letters before pressing the tab key again. History - The shell keeps a list of the commands you have typed in. If you need to repeat a command, use the cursor keys to scroll up and down the list or type history for a list of previous commands.

Q.3 What do you mean by Redirecting Input and Output? Ans.: Redirecting Input and Output : Most of the commands take input from standard input and send the output to standard output. But you can direct the shell so that input for a command comes from a file and its output also goes to a file instead of standard I/O devices. This is called redirecting of input and output. Operating Systems 85

Q.4 What is the use of CAT Command? Ans.: CAT Command : This is one of the filter commands. This command can used to read file, create new files and copy existing files. Thus CAT is used to perform many useful operations on the files.

Q.5 What is the use of Editors in UNIX System? Ans.: Editors : Editor is a program using which you can process textual information. With the help of an editor, you can perform the following tasks : (1) You can create new file. (2) You can see the contents of an existing file. (3) You can modify the existing file.

Q.6 What do you mean by Shell Script?

Ans.: Shell Script : The programs written in shell language are known as shell scripts, which are just a sequence of commands in a file. Shell script can save your lot of time, if you want to repeat a sequence of commands over and over. The shell script also provides variables, control structures etc.

Q.7 What is the use of Meta Characters in UNIX? Ans.: Meta Characters : The Meta Characters are similar to wild card characters in DOS. Shell allows a user to perform file processing operations on a group of files, with a single command through the use of file name and meta characters. The commonly used meta characters are:- ―?‖, ―*‖ and ―[ ]‖.

Q.8 What do you mean by Gripping and Seeding? Ans.: Gripping : The grip utility is the standard file searching and selection utility in UNIX. The user specifies a pattern to guide grip‘s search through

86

a file. This examines the input file line by line, checking each one to see if it contains the pattern. Seeding : Seed is non- interactive editor that can be used to edit large files. The seed reads lines one by one from an input file and applies a set of editing commands to the lines and send the edited lines to the standard output.

Q.9. Explain Directory Structure of UNIX Operating System. Ans.: All the files are grouped together in the directory structure. The file- system is arranged in a hierarchical structure, like an inverted tree. The top of the hierarchy is traditionally called root (written as a slash /)

In the diagram above, we see that the home directory of the undergraduate student "ee51vn" contains two sub-directories (docs and pics) and a file called report.doc. The full path to the file report.doc is "/home/its/ug1/ee51vn/report.doc"

Operating Systems 87

Q.10. Explain Standard Input/Output facility in UNIX.

Ans.: The standard I/O facility provides some simple defaults for managing Input/Output. There are three default I/O streams: standard input, standard output, and standard error. By convention, standard output (abbreviated stdout) consists of all "normal" output from your program, while standard error (stderr) consists of error messages. It is often a convenience to be able to handle error messages and standard output separately. If you don't do anything special, programs will read standard input from your keyboard, and they will send standard output and standard error to your terminal's display. Standard input (stdin) normally comes from your keyboard. Many programs ignore stdin; you name files directly on their command line - for instance, the command cat file1 file2 never reads its standard input; it reads the files directly. But, without filenames on the command line, UNIX commands that need input will usually read stdin. Standard input normally comes from your keyboard, but the shell can redirect stdin from a file. This is handy for UNIX commands that can't open files directly - for instance, mail (1.33). To mail a file to joan, use < filename-to tell the shell to attach the file, instead of your keyboard, to mail's standard input: % mail joan < myfile The real virtue of standard I/O is that it allows you to redirect input or output away from your terminal to a file. As we said, UNIX is file-based (1.29). Because terminals and other I/O devices are treated as files, a program doesn't care or even know [2] if it is sending its output to a terminal or to a file. For example, if you want to run the command cat file1 file2, but you want to place the output in file3 rather than sending it to your terminal, give the command : [2] A program can find out. % cat file1 file2 > file3

88

This is called redirecting standard output to file3. If you give this command and look at file3 afterward, you will find the contents of file1, followed by file2-exactly what you would have seen on your screen if you omitted the > file3 modifier. One of the best-known forms of redirection in UNIX is the pipe. The shell's vertical bar (|) operator makes a pipe. For example, to send both file1 and file2 together in a mail message for joan, type: % cat file1 file2 | mail joan The pipe says "connect the standard output of the process at the left (cat) to the standard input of the process at the right (mail)." □ □ □

Operating Systems 89

Multiple Choice Questions Q1. ―,‖, ―[]‖, ―?‖ are called………….. in UNIX operating system: A. Meta characters B. Meta data C. A and B both D. None of the above

Q2. Programs written in shell language is known as: A. Shell script B. VB script C. Java script D. None of the above

Q3. CAT command is used for: A. used to read file B. create new file C. copy existing files D. All of the above

Q4.Editors in Unix are: A. Single line editor B. multi line editor C. A and B both

90

D. None of the above

Q5. Which of the following command is used for creating a file: A. Mkdir B. Rmdir C. Cd D. None of the above

Operating Systems 91

Chapter-12

Commands of UNIX

Q.1. Write short notes on the following UNIX Commands. Ans.:  mkdir (make directory) : We will now make a subdirectory in your home directory to hold the files you will be creating and using in the course of this tutorial. To make a subdirectory called unixstuff in your current working directory type % mkdir unixstuff To see the directory you have just created, type % ls  cd (change directory) : The command cd directory means change the current working directory to 'directory'. The current working directory may be thought of as the directory you are in, i.e. your current position in the file-system tree. To change to the directory you have just made, type % cd unixstuff Type ls to see the contents (which should be empty)  head : Use this command to look at the head of a file. For example, % head essay.001 displays the first 10 lines of the file essay.001 To see a specific number of lines, do this: % head -n 20 essay.001 This displays the first 20 lines of the file.  sort : Use this command to sort a file. For example, suppose we have a file dict with contents red rojo

92

green verde blue azul white blanco black negro Then we can do this: % sort dict black negro blue azul green verde red rojo white blanco Here the output of sort went to the screen. To store the output in file we do this: % sort dict >dict.sorted You can check the contents of the file dict.sorted using cat , more , or emacs.  tail : Use this command to look at the tail of a file. For example, % tail essay.001 displays the last 10 lines of the file essay.001 To see a specific number of lines, do this: % tail -n 20 essay.001 This displays the last 20 lines of the file.  grep : Use this command to search for information in a file or files. For example, suppose that we have a file dict whose contents are red rojo green verde blue azul white blanco Operating Systems 93

black negro Then we can look up items in our file like this; % grep red dict red rojo % grep blanco dict white blanco % grep brown dict % Notice that no output was returned by grep brown. This is because "brown" is not in our dictionary file. Grep can also be combined with other commands. For example, if one had a file of phone numbers named "ph", one entry per line, then the following command would give an alphabetical list of all persons whose name contains the string "Fred". % grep Fred ph | sort Alpha, Fred: 333-6565 Beta, Freddie: 656-0099 Frederickson, Molly: 444-0981 Gamma, Fred-George: 111-7676 Zeta, Frederick: 431-0987 The symbol "|" is called "pipe." It pipes the output of the grep command into the input of the sort command.  cp -- Copy a file : You can copy a file to another name or to another directory without deleting the original file. The "source" file comes first, followed by the "target" file: in other words, cp file1 file2 will take file1 and create a new file called file2 that contains the same information as file1, and is in the same directory. cp file1 Texts

94

will copy file1 into the subdirectory called Texts, keeping the same name: in other words, it will create a new file called Texts/file1. You can also copy into another directory with a different name: cp file1 Texts/file2 will create a new file called Texts/file2 that contains the same information as file1.  cut -- Look at part of each line : "cut" lets you select just part of the information from each line of a file. If, for instance, you have a file called "file1" with data in this format: 0001 This is the first line 0002 This is the second and so on, you can look at just the numbers by typing cut -c1-4 file1 The "-c" flag means "columns"; it will display the first four columns of each line of the file. You can also look at everything but the line numbers: cut -c6-100 file1 will display the sixth through one hundredth column (if the line is less than a hundred characters -- and most will be -- you'll see up to the end of the line).  Find : The find command searches through directories for files that match the specified criteria. It can take full pathnames and relative pathnames on the command line. To display the output on screen the –print option must be specified  tr : The tr command is used to translate characters. tr [-option] [string1 [string2]]

□ □ □ Operating Systems 95

Multiple Choice Questions Q1. Which command is used to copy a file: A. cp B. cd C. A and B both D. None of the above

Q2. Which command is used to look the last lines of the file: A. Tail B. Head C. None of the above D. All of the above

Q3. Which command is used to look the first lines of the file: A. Head B. Tail C. Cd D. None of the above Q4. Which command is used to create a directory: A. Mkdir B. Rmdir

96 C. Tail D. Head

Q5. Which command is used to sort the content of a file : A. Sort B. Tail C. Cd D. mkdir Operating Systems 97

Chapter-13

Difference between DOS, UNIX & Windows

Q.1. What is the difference between Windows and DOS Operating System. Ans.: MS DOS is the oldest OS from Microsoft. It is a single user command line operating system. While Windows (latest version) is multi-user and feature a user friendly GUI(Graphical User Interface). DOS programs generally expect themselves to be the only program running on your computer, so they will directly manipulate the hardware, such as writing to the disk or displaying graphics on the screen. They may also be dependent on timing, since the computer won't be doing anything else to slow them down. Many games fall into this category. Windows programs, on the other hand, realize that they must share your computer with other Windows programs.

Q.2. What is the difference between Windows and UNIX Operating System. Ans.: Windows is a Graphical User interface while Unix offering a GUI interface as well as command line. UNIX offers greater flexibility than Windows operating systems; furthermore, it is more stable and it does not crash as much as much as

98

Windows. UNIX is quite a bit more reliable than Windows, and less administration and maintenance is needed in maintaining a UNIX system. UNIX uses daemons, Windows has service processes.

Unix is safe, preventing one program from accessing memory or storage space allocated to another, and enables protection, requiring users to have permission to perform certain functions, i.e. accessing a directory, file, or disk drive. Also, UNIX is more secure than Windows on a network because Windows is more vulnerable than UNIX. For example, if you leave a port open in Windows it can be easily used by a hacker to introduce a virus in your environment.

Q.3. What is the difference between UNIX and DOS Operating System.

Ans.: The main difference between UNIX and DOS is that DOS was originally designed for single-user systems, while UNIX was designed for systems with many users. DOS is a command line interface while Unix offering a GUI interface as well as command line. Display file contents � UNIX has the � cat� command� and DOS uses the � type� command.

Setting file permissions � DOS uses the � attrib� command while UNIX uses the � chmod� command to change file permissions. Copying files � DOS uses the � copy� command, while UNIX uses the � cp� command. Comparing two files � UNIX uses the � diff� command and DOS has the � fc� command. Printing files � UNIX uses the � lp� command while DOS uses the � print� command. Operating Systems 99

Moving files � DOS uses the � rename� command and UNIX uses the � mv� command. Make a directory � UNIX uses the � mkdir� command while DOS has the � md� command. Display directory contents � UNIX uses the � ls� command and DOS has the � dir� command. Delete files � DOS uses the � del� command while UNIX has the � rm� command. Display the OS version � DOS uses the � ver� command while UNIX has the � uname � a� command.

□ □ □

100

Multiple Choice Questions Q1. DOS is a command line interface while Unix offering a ______as well as command line:

A. GUI interface B. CUI interface C. None of the above D. All of the above

Q2. DOS was originally designed for______, while UNIX was designed for systems with many users.

A. single-user systems B. multiuser system C. A and B both D. None of the above

Q3. MS DOS is the oldest OS from ______.

A. Microsoft B. Sunsoft C. Sun microsoft D. None of the above Q4. Display file contents UNIX has the cat command and DOS uses the ______command.

A. TYPE B. Cat Operating Systems 101

C. Copy con D. None of the above

Q5. Delete files DOS uses the del command while UNIX has the ______command. A. RM command B. Md command C. A and B both D. None of the above

102

Chapter-14

Windows Operating System

Q.1. What is Graphical User Interface? Ans.: A graphical user interface (GUI) is a type of user interface which allows people to interact with electronic devices like computers, hand-held devices (MP3 Players, Portable Media Players, Gaming devices), household appliances and office equipment. A GUI offers graphical icons, and visual indicators as opposed to text-based interfaces, typed command labels or text navigation to fully represent the information and actions available to a user. The actions are usually performed through direct manipulation of the graphical elements.

Q.2. Write Short notes on - a) Scan Disk b) Task Bars c) Toolbars Ans.: Scan Disk : ScanDisk is a Windows utility used to check your hard disk for errors and to correct problems that are found. These errors often occur when Windows locks up and must be restarted. To run ScanDisk in Windows 95 and NT, click the Start button, select Programs, then Accessories, then System Tools, and then Scandisk. It is recommended that you run ScanDisk at least once per month. In OSR2 (a later release of Windows 95) and in Windows 98, ScanDisk is initiated for you automatically following system restarts in which shutdown was not complete. Operating Systems 103

Tool Bars : In a graphical user interface on a computer monitor a toolbar is a panel on which onscreen buttons, icons, menus or other input or output elements are placed. Earlier forms of toolbars were defined by the programmer and had set functions, and thus there was no difference between a toolbar with buttons or just a row of buttons. Most modern programs and operating systems however, allow the end user to modify and customize toolbars to fit their personal needs. Some applications, e.g. graphics editors, allow their toolbars to be detached and moved between windows and other toolbars.

Q.3. What is Control Panel in Windows? Ans.: Control Panel can adjust and Windows' appearance, performance, network connections, hardware settings and a whole lot more. While many of the settings in the Control Panel are also accessible in other ways – for instance, you can change the desktop appearance by right- clicking the desktop and choosing Properties from the pop-up menu or by opening the Display applet in the Control Panel – the Control Panel makes it easy to keep tabs on all your Windows settings. From the Control Panel you can adjust and tweak Windows' appearance, performance, network connections, hardware settings and a whole lot more. While many of the settings in the Control Panel are also accessible in other ways – for instance, you can change the desktop appearance by right- clicking the desktop and choosing Properties from the pop-up menu or by opening the Display applet in the Control Panel – the Control Panel makes it easy to keep tabs on all your Windows settings

Q.4. How can we create a File and Folder in Windows. Ans.: Creating a Folder : To create a new folder on the desktop (or in any window within the Windows Explorer for that matter), right-click on an empty space on the desktop (or within the window you want the folder to be in), then click on "New" and then on "Folder." A new folder will be created which you can then rename accordingly.

104

Creating a File : To create a new file on the desktop (or in any window within the Windows Explorer for that matter), right-click on an empty space on the desktop (or within the window you want the file to be saved in), then click on "New" and then select the kind of file you wish to create. A new file will be created which you can then rename and open.

Q.5. How can we Copy and Moving Information. Ans.: Selecting the Items to Copy : To copy or move files or folders in Windows, click once on the item you want to run the operation on, then click on the "Edit" menu and select either "Copy" or "Cut" (you can also use the Copy or Cut icons on the toolbar to accomplish this). Hold down the "Ctrl" key as you select items to run this operation on multiple items simultaneously. Pasting the Selected Items : Open up the folder or disk where you want to copy (or move) the selected items. Click on the "Edit" menu and then on "Paste." Since the items you selected are still on the , you could paste them in other locations without having to copy them again, as long as the clipboard isn't cleared by another operation.

Q.6 What are the general features of MS-Windows 98? Ans.: The General Features of MS-Windows : The general features of MS- Windows are : (1) Graphical User Interface (GUI) (2) CLIPBOARD (CUT and PASTE) (3) Object Linking and Embedding (OLE) (4) Multitasking (5) What You See Is What You Get (WYSIWYG)

Q.7 Write the steps for installing Windows 98 in your Computer. Ans.: Installing Windows 98 : After you partition and format your hard disk, you can install Windows 98: (1) Insert the Windows 98 CD-ROM in the CD-ROM drive, type the following command at a command prompt, and then press ENTER Operating Systems 105

X:\setup Where X is the drive letter that is assigned to your CD-ROM drive. (2) Press ENTER, and then follow the instructions on the screen to complete the Setup procedure: (3) Please wait while the Setup initializes. Setup is now going to perform a routine check on your system. To continue press Enter. (4) Windows 98 Operating system gets installed in the computer by following the instructions of the setup.

Q.8 What is the use of Scan Disk in your Computer? Ans.: SCAN Disk : SCAN Disk looks for and repairs the physical defects in the various drives of computer. A program called SCAN Disk is available in the windows to perform this job.

Q.9 Write about the options available for Taskbar Settings in Taskbar Properties Dialog Box.

Ans.: Taskbar Settings : The taskbar is displayed at the bottom of the desktop. To specify the taskbar settings select Start button-> Settings-> Taskbar The taskbar properties dialog box displayed which includes two tabs - Taskbar Options and Start Menu Programs. Under the taskbar options tab following options are available to change the settings of taskbar : (1) Always on Top (2) Auto Hide (3) Show Small Icons in Start Menu (4) Show Clock/ Date and Time

106 Q.10 Write the methods of setting up the Windows Toolbars. Ans.: Setting Up the Windows Toolbars : To make changes in the windows toolbar settings, Right click on a blank area of taskbar and choose Toolbars. Then click the toolbar you want to add. You can resize the toolbar or move it to another location on the taskbar by dragging it to left or right.

Q.11 Write about the use of Control Panel and their features. Ans.: Control Panel and its Features : Control Panel is powerful tools to customize your computer. It‘s the place to go to install new hardware, add and remove programs, change the look of your screen, and much more. To open Control Panel, click Start and then click Control Panel. If your computer is set up in Classic view using the more familiar Start menu, click Start, point to Settings, and then click Control Panel. Some of the tools available in control panel are:- 1- Accessibility Options 8- Mouse 2- Add New Hardware 9- Power 3- Add/Remove Programs 10- Printers 4- Date and Time 11-Sounds 5- Display 12- Modems 6- Font 13- Passwords 7- Keyboard 14- Network

Q.12 How can you manage the Files and Folders in your Computer? Ans.: File and Folder Management : Every Windows folder provides easy access to common file and folder management tasks. When you open any folder on your computer, a list of hyperlinked tasks is displayed next to the folder contents. You can select a file or folder, and then click a task to rename, copy, move, or delete it. You can also send a file in e-mail or publish it to the Web. In addition to the basic file and folder tasks provided in all Windows folders, there are several folders that provide links to specialized tasks. Operating Systems 107

Q.13 Write a short note on Windows Explorer.

Ans.: Windows Explorer : Windows Explorer displays the hierarchical structure of files, folders, and drives on your computer. It also shows any network drives that have been mapped to drive letters on your computer. Using Windows Explorer, you can copy, move, rename, and search for files and folders. For example, you can open a folder that contains a file you want to copy or move, and then drag the file to another folder or drive. To open Windows Explorer, click Start, point to All Programs, point to Accessories, and then click Windows Explorer. □ □ □

108

Keywords BIOS (basic input/output system) - BIOS (basic input/output system) is the program a personal computer's microprocessor uses to get the computer system started after you turn it on.

CPU bound-A property of a process in which processor use is high, and I/O requests are low.

ASCII- A 7 bit code for representing American English characters and device controls.

Direct Memory Access- The transfer of data between memory and a peripheral directly, without passing through the CPU.

FIFO scheduling-A scheduling policy which schedules tasks in the same order in which they enter the ready state.

I/O bound-A property of a process in which processor use is low, and I/O requests are high.

LFU Page Replacement- A strategy which replaces the page which has been used least often.

Round Robin scheduling- A scheduling policy which scheduleses tasks in a fixed circular order.

SCAN disk scheduling- A disk scheduling strategy which satisfies the pending disk request which is physically closest to the current position of the access arm in the current direction of motion, reversing direction when the first and last cylinders are reached.

SRAM- Semiconductor read-write memory in which individual bit cells stable as long as power is maintained.

Unicode- A 16 bit code for representing characters. base register- A register which contains a value which is added to virtual memory addresses to produce a memory address.

Operating Systems 109 batch process- A process which executes without user interaction. best fit- A placement strategy which selects the smallest space from the free list which is large enough. binary semaphore- A semaphore that can only have the values 0 and 1. blocked list- An operating system data structure which contains all of the blocked processes in the system. blocked state- A process state entered by a task which is waiting for some event or action to occur. born state- The tread state in which a new thread begins life.

Bus- A communication pathway that connects two or more of the major components of a computer system, including CPU, memory, and device controllers. busy wait-A situation in which a process, while not blocked, continuously checks for a condition which will allow it to proceed.

Byte- The smallest addressable part of memory.

Cache- Solid state memory used to buffer and store data temporarily.

Compiler- A translator from a high level language to a low level language. dead state- The state of a thread after it has been terminated. demand paging- A paging policy which reads in a page only when it is referenced.

Dispatcher- The operating system component which transitions a process to the running state. information hiding- A program style which which masks implementation details of a module from the rest of the code. interactive process- A process which requires user interaction while executing.

110 Interpreter- A program expressed in one language which executes programs expressed in another language. Interrupt- An asynchronous service request from hardware or software to the CPU. interrupt handler- A software routine which processes interrupts.

Join- Thread operation in which the calling thread is blocked until the thread it joins terminates.

Middleware- Software that sits between two or more types of software and translates information between them. mutual exclusion- A situation in which at most one process can be engaged in a specified activity at a time. noncontiguous memory allocation- Allocation in which the address space is separated into nonadjacent regions.

Nonpreemptive- Not having the capability of preempting running tasks.

Page-A fixed size block of contiguous memory addresses in a virtual address space which is managed as a unit. page fault-An interrupt generated when a program references a page that is not currently resident. process control block- An operating system data structure that characterizes a proce process state- The status of a process as running, ready, blocked, etc. process table- An operating system data structure which pointers to all of the processes in the system.

Producer- A process or thread that creates data and places it into a shared object.

Program-A (static) set of instructions which can be used as the basis for a process. race condition-A situation where the (uncontrolled) ordering of events can affect the outcome of the situation.

Operating Systems 111 ready list- An operating system data structure which contains all of the ready processes in the system. ready state- A process state in which all resources except the processor are available.

112

M.Sc.(INFORMATION TECHNOLOGY) (FIRST SEMESTER)EXAMINATION, 2012 (Held in February 2013) (New Scheme) OPERATING SYSTEM PAPER: T-101 TIME ALLOWED: THREE HOURS Maximum Marks—80

(1) No supplementary answer-book will be given to any candidate. Hence the candidates should write the answers precisely in the Main answer-book only.

(2) All the parts of question should be answered at one place in the answer-book. One complete question should not be answered at different places in the answer – book.

Attempt FIVE questions in out of nine All question carry equal marks

1. (a) Discuss the role of operating system as resource managers. (b) Write components of operating system.

2. What is virtual memory? Discuss the two key techniques of virtual implantation, paging and segmentation.

3. (a) Define the process Control Block (PCB) (b) Define the direct Memory Access(DMA) (c) Define the FCFS and SJF

4. (a) What is meant by term scheduler? What are different types of Schedulers. Explain with example. Operating Systems 113

(b) What is the objective of scheduling? Explain the priority scheduling and round robbing scheduling.

5. (a) Explain operating systems like Unix provide services both for programs and users. (b) Explain the Unix architecture , the role played by the kernel and shell in sharing the workload.

6. (a) Explain Window 98 installation. (b) What is deadlock? Explain deadlock avoidance and deadlock detection.

7. Compare the following:- (a) Tightly coupled and Loosely coupled system (b) Spooling and Buffering (c) Process and Thread (d) DOS and Windows.

8. Write short notes on :- (a) Remote Processor Control (b) Virons and Worms (c) Windows Explorer (d) Taskbar and Toolbar. ------

114 M.Sc.(Information Technology) (FIRST SEMESTER)EXAMINATION, 2011 (Held in Jan,2011) (New Scheme) OPERATING SYSTEMS PAPER: 114 TIME ALLOWED: THREE HOURS Maximum Marks—80 Note:- (1) No supplementary answer-book will be given to any candidate. Hence the candidates should write the answers precisely in the Main answer-book only.

(2) All the parts of question should be answered at one place in the answer-book. One complete question should not be answered at different places in the answer – book.

Attempt FIVE questions in out of nine All question carry equal marks

1. Differentiate between : (a) Single user OS and Multiuser OS (b) Paging and Segmmentation (c) Multitasking and Multiprogramming (d) Program and Process

2. Explain the following DOS commands. (a) COPY (b) FORMAT (c) DIR (d) CHKDSK

Operating Systems 115

3. (a) Discuss various page replacement strategies (b) Write a note on Interrupts.

4. Explain the flowing UNIX commands :- (a) Is (b) Man (c) Mv (d) Cat (e) Sort (f) Chmod (g) Wc (h) Cal

5. Write short notes on (any two) (a) Control Panel (b) Windows Explorer (c) Adding and Removing Hardware in Window‘s 98

6. What is file management ? Explain various file access methods.

7. (a) Describe the process life cycle with the help of a process state diagrams (b) Explain different steps of windows 98 installation.

8. Describe various pre-emptive and non-preemptive scheduling algorithms.

116 M.Sc.(Information Technology) (FIRST SEMESTER)EXAMINATION, 2009 (Held in Jan,2010) (New Scheme) OPERATING SYSTEMS PAPER: 114 TIME ALLOWED: THREE HOURS Maximum Marks—80 Note:- (1) No supplementary answer-book will be given to any candidate. Hence the candidates should write the answers precisely in the Main answer-book only.

(2) All the parts of question should be answered at one place in the answer-book. One complete question should not be answered at different places in the answer – book.

Attempt FIVE questions in out of nine All question carry equal marks

1. (a) What do you mean by Application Software and System Software? On what basis you can differentiate and Application Software from a System Software ? Explain with the suitable example. (b) How an end user, an application programmer and OS programmer use different aspects (software and hardware ) of a computer? 2. (a) What do you mean by Generation of Languages? Explain with suitable examples the different generation of language. (b) What do you mean by a compiler and an interpreter? What for they are used? How will you differentiate them? 3. (a) What is an operating system? What do you mean by characteristics of an operating system? Discuss and describe various characteristics of operating systems. Operating Systems 117

4. What are process schedulers? Describes different types of schedulers. What do you mean by the term ‗Good Process Mix‘? 5. (a) How DOS is different from Windows and UNIX operating systems? (b) What do you mean by booting sequence, commands, directory and file with repect to DOS.? 6. (a) How will you configure modem in Windows? (b) Describe the procedure of connecting to PPP and SLIP account in Windows. 7. Explain the following:- (a) Creating Windows peer-to-peer Network (b) Compressing disks and partitions in Windows. (c) Configuring keyboard and mouse in Windows 8. (a) What do you understand by shell script, shell and sub-shell variable. (b) Write a shell script to print all prime numbers from 1 to 100.

------