Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer...

101
Operating System Unit-I 1. What is an Operating system? An operating system is a program that manages the computer hardware. It also provides a basis for application programs and act as an intermediary between a user of a computer and the computer hardware. It controls and coordinates the use of the hardware among the various application programs for the various users. 2. Why is the Operating System viewed as a resource allocator & control program? A computer system has many resources – hardware & software that may be required to solve a problem, like CPU time, memory space, file- storage space, I/O devices & so on. The OS acts as a manager for these resources so it is viewed as a resource allocator. The OS is viewed as a control program because it manages the execution of user programs to prevent errors & improper use of the computer. 3. What is the Kernel? A more common definition is that the OS is the one program running at all times on the computer, usually called the kernel, with all else being application programs. 4. What are Batch systems? Batch systems are quite appropriate for executing large jobs that need little interaction. The user can submit jobs and return later for the results. It is not necessary to wait while the job is processed. Operators batched together jobs with similar needs and ran them through the computer as a group. 5. What is the advantage of Multiprogramming? Multiprogramming increases CPU utilization by organizing jobs so that the CPU always has one to execute. Several jobs are placed in the main memory and the processor is switched from job to job as needed to keep several jobs advancing while keeping the peripheral devices in use. Multiprogramming is the first instance where the

Transcript of Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer...

Page 1: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Operating System Unit-I

1. What is an Operating system?

 An operating system is a program that manages the computer hardware. It also provides a basis for application programs and act as an intermediary between a user of a computer and the computer hardware. It controls and coordinates the use of the hardware among the various application programs for the various users.

 2. Why is the Operating System viewed as a resource allocator & control program?

 A computer system has many resources – hardware & software that may be required to solve a problem, like CPU time, memory space, file-storage space, I/O devices & so on. The OS acts as a manager for these resources so it is viewed as a resource allocator.

The OS is viewed as a control program because it manages the execution of user programs to prevent errors & improper use of the computer.

 3. What is the Kernel?

 A more common definition is that the OS is the one program running at all times on the computer, usually called the kernel, with all else being application programs.

 4. What are Batch systems?

 Batch systems are quite appropriate for executing large jobs that need little interaction. The user can submit jobs and return later for the results. It is not necessary to wait while the job is processed. Operators batched together jobs with similar needs and ran them through the computer as a group.

 5. What is the advantage of Multiprogramming?

 Multiprogramming increases CPU utilization by organizing jobs so that the CPU always has one to execute. Several jobs are placed in the main memory and the processor is switched from job to job as needed to keep several jobs advancing while keeping the peripheral devices in use. Multiprogramming is the first instance where the Operating system must make decisions for the users. Therefore they are fairly sophisticated.

 6. What is an Interactive computer system?

 Interactive computer system provides direct communication between the user and the system. The user gives instructions to the operating system or to a program directly, using a keyboard or mouse ,and waits for immediate results.

Page 2: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 7. What do you mean by Time-sharing systems?

 Time-sharing or multitasking is a logical extension of multiprogramming. It allows many users to share the computer simultaneously. The CPU executes multiple jobs by switching among them, but the switches occur so frequently that the users can interact with each program while it is running.

8. What are multiprocessor systems & give their advantages?

 Multiprocessor systems also known as parallel systems or tightly coupled systems are systems that have more than one processor in close communication, sharing the computer bus, the clock and sometimes memory & peripheral devices. Their main advantages are

Increased throughput Economy of scale

Increased reliability

 9. What are the different types of multiprocessing?

 Symmetric multiprocessing (SMP): In SMP each processor runs an identical copy of the Os & these copies communicate with one another as needed. All processors are peers. Examples are Windows NT, Solaris, Digital UNIX, OS/2 & Linux.

Asymmetric multiprocessing: Each processor is assigned a specific task. A master processor controls the system; the other processors look to the master for instructions or predefined tasks. It defines a master-slave relationship. Example SunOS Version 4.

 10. What is graceful degradation?

In multiprocessor systems, failure of one processor will not halt the system, but only slow it down. If there are ten processors & if one fails the remaining nine processors pick up the work of the failed processor. This ability to continue providing service is proportional to the surviving hardware is called graceful degradation.

 11. What is Dual- Mode Operation?

 The dual mode operation provides us with the means for protecting the operating system from wrong users and wrong users from one another. User mode and monitor mode are the two modes. Monitor mode is also called supervisor mode, system mode or privileged mode. Mode bit is attached to the hardware of the computer to indicate the current mode. Mode bit is ‘0’ for monitor mode and ‘1’ for user mode.

 12. What are privileged instructions?

Page 3: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 Some of the machine instructions that may cause harm to a system are designated as privileged instructions. The hardware allows the privileged instructions to be executed only in monitor mode.

 13. How can a user program disrupt the normal operations of a system?

A user program may disrupt the normal operation of a system by Issuing illegal I/O operations

By accessing memory locations within the OS itself

Refusing to relinquish the CPU

 14. How is the protection for memory provided?

 The protection against illegal memory access is done by using two registers. The base register and the limit register. The base register holds the smallest legal physical address; the limit register contains the size of the range. The base and limit registers can be loaded only by the OS using special privileged instructions.

 15. What are the various OS components?

The various system components are

Process management Main-memory management

File management

I/O-system management

Secondary-storage management

Networking

Protection system

Command-interpreter system

16. What is a process?

A process is a program in execution. It is the unit of work in a modern operating system. A process is an active entity with a program counter specifying the next instructions to execute and a set of associated resources.It also includes the process stack, containing temporary data and a data section containing global variables.

17. What is a process state and mention the various states of a process?

Page 4: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

As a process executes, it changes state. The state of a process is defined in part by the current activity of that process. Each process may be in one of the following states:

New, Running, Waiting, Ready

Terminated

18. What is process control block (PCB)?

Each process is represented in the operating system by a process control block also called a task control block. It contains many pieces of information associated with a specific process. It simply acts as a repository for any information that may vary from process to process.

It contains the following information:

Process state Program counter

CPU registers

CPU-scheduling information

Memory-management information

Accounting information

I/O status information

19. What are the use of job queues, ready queues & device queues?

As a process enters a system, they are put into a job queue. This queue consists of all jobs in the system. The processes that are residing in main memory and are ready & waiting to execute are kept on a list called ready queue. The list of processes waiting for a particular I/O device is kept in the device queue.

20. What is meant by context switch?

Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process. This task is known as context switch. The context of a process is represented in the PCB of a process.

21. What is spooling?

Spooling-Simultaneous peripheral operations on line. It is a high-speed device like a disk is interposed between a running program and a low –speed device involved with the program in input/output. It disassociates a running program from the slow operation of devices like printers.

Page 5: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

22. What are System calls?

System calls provide the interface between a process and the Operating system. System Calls are also called as Monitor call or Operating-system function call. When a system call is executed, it is treated as by the hardware as software interrupt. Control passes through the interrupt vector to a service routine in the operating system, and the mode bit is set to monitor mode.

 23. List the services provided by an Operating System?

 

• Program execution

• I/O Operation

• File-System manipulation

• Communications

• Error detection

 24. What are the two types of real time systems?

 1.Hard real time system

2.Soft real time system

 25.What is the difference between Hard real time system and Soft real time system?

 A hard real time system guarantees that critical tasks complete on time. In a soft real time system, a critical real-time task gets priority over the other tasks, and retains that priority until it completes. Soft real time systems have more limited utility than do hard real-time systems.

26.Write the difference between multiprogramming and nonmultiprogramming?

The operating system picks and begins to execute one of the jobs in the memory. Eventually, the job may have to wait for some task, such as a tape to be mounted, or an I/O operation to complete. In a non-multiprogrammed system, the CPU would sit idle. In a multiprogramming system, the operating system simply switches to and executes another job. When that job needs to wait, the CPU is switched to another job, and so on. Eventually, the first job finishes waiting and gets the CPU back. As long as there is always some job to execute, the CPU will never be idle.

Page 6: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

27.What are the design goals of an operating system?

The requirements can be divided into two basic groups: User goals and System goals. Users desire that the system should be convenient and easy to use, easy to learn, reliable, safe and fast. The Operating system should be easy to design, implement, and maintain. Also it should be flexible, reliable, error free and efficient. These are some of the requirements, which are vague and have no general solution.

28.What are the five major categories of System Calls?

 

• Process Control

• File-management

• Device-management

• Information maintenance

• Communications

 

29.What is the use of fork and execve system calls?

 

Fork is a System calls by which a new process is created. Execve is also a System call, which is used after a fork by one of the two processes to replace the process memory space with a new program.

 

30. Define Elapsed CPU time and Maximum CPU time?

 

Elapsed CPU Time: Total CPU time used by a process to date.

Maximum CPU Time: Maximum amount of CPU time a process may use.

 

Page 7: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Unit II

1. What is a thread?

A thread otherwise called a lightweight process (LWP) is a basic unit of CPU utilization, it comprises of a thread id, a program counter, a register set and a stack. It shares with other threads belonging to the same process its code section, data section, and operating system resources such as open files and signals.

 

2. What are the benefits of multithreaded programming?

 

The benefits of multithreaded programming can be broken down into four major categories:

Responsiveness Resource sharing

Economy

Utilization of multiprocessor architectures

 

3.Compare user threads and kernel threads.

 

User threads Kernel threads

User threads are supported above the kernel and are implemented by a thread library at the user level Kernel threads are supported directly by the operating system

Thread creation & scheduling are done in the user space, without kernel intervention. Therefore they are fast to create and manage Thread creation, scheduling and management are done by the operating system. Therefore they are slower to create & manage compared to user threads

Blocking system call will cause the entire process to block If the thread performs a blocking system call, the kernel can schedule another thread in the application for execution

4.Define thread cancellation & target thread.

Page 8: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

The thread cancellation is the task of terminating a thread before it has completed. A thread that is to be cancelled is often referred to as the target thread. For example, if multiple threads are concurrently searching through a database and one thread returns the result, the remaining threads might be cancelled.

5.What are the different ways in which a thread can be cancelled?

 

Cancellation of a target thread may occur in two different scenarios:

Asynchronous cancellation: One thread immediately terminates the target thread is called asynchronous cancellation.

Deferred cancellation: The target thread can periodically check if it should terminate, allowing the target thread an opportunity to terminate itself in an orderly fashion.

 

6.Define CPU scheduling.

 

CPU scheduling is the process of switching the CPU among various processes. CPU scheduling is the basis of multiprogrammed operating systems. By switching the CPU among processes, the operating system can make the computer more productive.

 

7.What is preemptive and nonpreemptive scheduling?

 

Under nonpreemptive scheduling once the CPU has been allocated to a process, the process keeps the CPU until it releases the CPU either by terminating or switching to the waiting state.

Preemptive scheduling can preempt a process which is utilizing the CPU in between its execution and give the CPU to another process.

 

8.What is a Dispatcher?

 

Page 9: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

The dispatcher is the module that gives control of the CPU to the process selected by the short-term scheduler. This function involves:

Switching context Switching to user mode

Jumping to the proper location in the user program to restart that program.

 

9.What is dispatch latency?

 

The time taken by the dispatcher to stop one process and start another running is known as dispatch latency.

 

10.What are the various scheduling criteria for CPU scheduling?

 

The various scheduling criteria are

CPU utilization Throughput

Turnaround time

Waiting time

Response time

11.Define throughput?

 

Throughput in CPU scheduling is the number of processes that are completed per unit time. For long processes, this rate may be one process per hour; for short transactions, throughput might be 10 processes per second.

 

12.What is turnaround time?

Page 10: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

Turnaround time is the interval from the time of submission to the time of completion of a process. It is the sum of the periods spent waiting to get into memory, waiting in the ready queue, executing on the CPU, and doing I/O.

 

13.Define race condition.

 

When several process access and manipulate same data concurrently, then the outcome of the execution depends on particular order in which the access takes place is called race condition. To avoid race condition, only one process at a time can manipulate the shared variable.

 

14.What is critical section problem?

 

Consider a system consists of ‘n‘ processes. Each process has segment of code called a critical section, in which the process may be changing common variables, updating a table, writing a file. When one process is executing in its critical section, no other process can allowed to execute in its critical section.

 

15.What are the requirements that a solution to the critical section problem must satisfy?

 

The three requirements are

Mutual exclusion

Progress

Bounded waiting

 

16.Define entry section and exit section.

 

Page 11: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

The critical section problem is to design a protocol that the processes can use to cooperate. Each process must request permission to enter its critical section. The section of the code implementing this request is the entry section. The critical section is followed by an exit section. The remaining code is the remainder section.

 

 

 

 

 

 

17.Give two hardware instructions and their definitions which can be used for implementing mutual exclusion.

 

TestAndSet

 

boolean TestAndSet (boolean &target)

{

boolean rv = target;

target = true;

return rv;

}

Swap

 

void Swap (boolean &a, boolean &b)

{

boolean temp = a;

Page 12: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

a = b;

b = temp;

}

 

18.What is semaphores?

 

A semaphore ‘S’ is a synchronization tool which is an integer value that, apart from initialization, is accessed only through two standard atomic operations; wait and signal. Semaphores can be used to deal with the n-process critical section problem. It can be also used to solve various synchronization problems.

 

 

The classic definition of ‘wait’

wait (S)

{

while (S<=0)

;

S--;

}

The classic definition of ‘signal’

signal (S)

{

S++;

}

19.Define busy waiting and spinlock.

 

Page 13: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

When a process is in its critical section, any other process that tries to enter its critical section must loop continuously in the entry code. This is called as busy waiting and this type of semaphore is also called a spinlock, because the process while waiting for the lock.

 

20. How can we say the First Come First Served scheduling algorithm is non preemptive?

 

Once the CPU has been allocated to a process, that process keeps the CPU until it releases the CPU, either by terminating or by requesting I/O. So we can say the First Come First Served scheduling algorithm is non preemptive.

 

21.What is waiting time in CPU scheduling?

 

Waiting time is the sum of periods spent waiting in the ready queue. CPU scheduling algorithm affects only the amount of time that a process spends waiting in the ready queue.

 

22. What is Response time in CPU scheduling?

 

Response time is the measure of the time from the submission of a request until the first response is produced. Response time is amount of time it takes to start responding, but not the time that it takes to output that response.

 

23. Differentiate long term scheduler and short term scheduler

 

• The long-term scheduler or job scheduler selects processes from the job pool and loads them into memory for execution.

• The short-term scheduler or CPU scheduler selects from among the process that are ready to execute, and allocates the CPU to one of them.

 

Page 14: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

24. Write some classical problems of synchronization?

 

The Bounded-Buffer Problem

The Readers-Writers Problem

The Dining Philosophers Problem

 

25. When the error will occur when we use the semaphore?

 

i. When the process interchanges the order in which the wait and signal operations on the semaphore mutex.

ii. When a process replaces a signal (mutex) with wait (mutex).

iii. When a process omits the wait (mutex), or the signal (mutex), or both.

 

26.What is Mutual Exclusion?

 

A way of making sure that if one process is using a shared modifiable data, the other processes will be excluded from doing the same thing. Each process executing the shared data variables excludes all others from doing so simultaneously. This is called mutual exclusion.

 

27.Define the term critical regions?

 

Critical regions are small and infrequent so that system through put is largely unaffected by their existence. Critical region is a control structure for implementing mutual exclusion over a shared variable.

 

28.What are the drawbacks of monitors?

 

Page 15: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

1.Monitor concept is its lack of implementation most commonly used programming languages.

2.There is the possibility of deadlocks in the case of nested monitors calls.

 

29.What are the two levels in threads?

 

Thread is implemented in two ways.

 

1.User level

2.Kernel level

 

30. What is a Gantt chart?

 

A two dimensional chart that plots the activity of a unit on the Y-axis versus the time on the X-axis. The chart quickly represents how the activities of the units are serialized.

 

 

Unit-III

1.Define deadlock.

 

A process requests resources; if the resources are not available at that time, the process enters a wait state. Waiting processes may never again change state, because the resources they have requested are held by other waiting processes. This situation is called a deadlock.

Page 16: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

2.What is the sequence in which resources may be utilized?

 

Under normal mode of operation, a process may utilize a resource in the following sequence:

Request: If the request cannot be granted immediately, then the requesting process must wait until it can acquire the resource.

Use: The process can operate on the resource.

Release: The process releases the resource.

 

3.What are conditions under which a deadlock situation may arise?

 

A deadlock situation can arise if the following four conditions hold simultaneously in a system:

1. Mutual exclusion

2. Hold and wait

3. No pre-emption

4. Circular wait

 

4.What is a resource-allocation graph?

 

Deadlocks can be described more precisely in terms of a directed graph called a system resource allocation graph. This graph consists of a set of vertices V and a set of edges E. The set of vertices V is partitioned into two different types of nodes; P the set consisting of all active processes in the system and R the set consisting of all resource types in the system.

 

5.Define request edge and assignment edge.

Page 17: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

Rj; itA directed edge from process Pi to resource type Rj is denoted by Pi signifies that process Pi requested an instance of resource type Rj and is currently waiting for that resource. A directed edge from resource type Rj to Pi, it signifies that an instance of resource typeprocess Pi is denoted by Rj Rj is called a requesthas been allocated to a process Pi. A directed edge Pi Pi is called an assignment edge.edge. A directed edge Rj

 

 

 

6.What are the methods for handling deadlocks?

 

The deadlock problem can be dealt with in one of the three ways:

 

Use a protocol to prevent or avoid deadlocks, ensuring that the system will never enter a deadlock state.

Allow the system to enter the deadlock state, detect it and then recover.

Ignore the problem all together, and pretend that deadlocks never occur in the system.

 

7.Define deadlock prevention.

 

Deadlock prevention is a set of methods for ensuring that at least one of the four necessary conditions like mutual exclusion, hold and wait, no pre-emption and circular wait cannot hold. By ensuring that that at least one of these conditions cannot hold, the occurrence of a deadlock can be prevented.

 

8.Define deadlock avoidance.

 

An alternative method for avoiding deadlocks is to require additional information about how resources are to be requested. Each request requires the system

Page 18: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

consider the resources currently available, the resources currently allocated to each process, and the future requests and releases of each process, to decide whether the could be satisfied or must wait to avoid a possible future deadlock.

 

9.What are a safe state and an unsafe state?

 

A state is safe if the system can allocate resources to each process in some order and still avoid a deadlock. A system is in safe state only if there exists a safe sequence. A sequence of processes <P1,P2,….Pn> is a safe sequence for the current allocation state if, for each Pi, the resource that Pi can still request can be satisfied by the current available resource plus the resource held by all the Pj, with j<i. if no such sequence exists, then the system state is said to be unsafe.

 

10.What is banker’s algorithm?

 

Banker’s algorithm is a deadlock avoidance algorithm that is applicable to a resource-allocation system with multiple instances of each resource type. The two algorithms used for its implementation are:

 

Safety algorithm: The algorithm for finding out whether or not a system is in a safe state.

 

Resource-request algorithm: if the resulting resource-allocation is safe, the transaction is completed and process Pi is allocated its resources. If the new state is unsafe Pi must wait and the old resource-allocation state is restored.

 

11.Define logical address and physical address.

 

An address generated by the CPU is referred as logical address. An address seen by the memory unit that is the one loaded into the memory address register of the memory is commonly referred to as physical address.

 

Page 19: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

12.What is logical address space and physical address space?

 

The set of all logical addresses generated by a program is called a logical address space; the set of all physical addresses corresponding to these logical addresses is a physical address space.

 

13.What is the main function of the memory-management unit?

The runtime mapping from virtual to physical addresses is done by a hardware device called a memory management unit (MMU).

 

14.Define dynamic loading.

 

To obtain better memory-space utilization dynamic loading is used. With dynamic loading, a routine is not loaded until it is called. All routines are kept on disk in a relocatable load format. The main program is loaded into memory and executed. If the routine needs another routine, the calling routine checks whether the routine has been loaded. If not, the relocatable linking loader is called to load the desired program into memory.

 

15.Define dynamic linking.

 

Dynamic linking is similar to dynamic loading, rather that loading being postponed until execution time, linking is postponed. This feature is usually used with system libraries, such as language subroutine libraries. A stub is included in the image for each library-routine reference. The stub is a small piece of code that indicates how to locate the appropriate memory-resident library routine, or how to load the library if the routine is not already present.

 

16.What are overlays?

 

To enable a process to be larger than the amount of memory allocated to it, overlays are used. The idea of overlays is to keep in memory only those instructions and data that are needed at a given time. When other instructions

Page 20: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

are needed, they are loaded into space occupied previously by instructions that are no longer needed.

 

 

17.Define swapping.

 

A process needs to be in memory to be executed. However a process can be swapped temporarily out of memory to a backing store and then brought back into memory for continued execution. This process is called swapping.

18.What are the common strategies to select a free hole from a set of available holes?

 

The most common strategies are

5. First fit

6. Best fit

7. Worst fit

 

19.What do you mean by best fit?

 

Best fit allocates the smallest hole that is big enough. The entire list has to be searched, unless it is sorted by size. This strategy produces the smallest leftover hole.

 

20.What do you mean by first fit?

 

First fit allocates the first hole that is big enough. Searching can either start at the beginning of the set of holes or where the previous first-fit search ended. Searching can be stopped as soon as a free hole that is big enough is found.

 

Page 21: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

21.What are the methods for dealing the deadlock problem?

 

i. Use a protocol to ensure that the system will never enter a deadlock state.

ii. Allow the system to enter the deadlock state and then recover.

iii. Ignore the problem all together, and pretend that deadlocks never occur in the system.

 

22.Differentiate deadlock and starvation.

 

A set of processes is in deadlock state when every process in the set is waiting for an event that can be caused only by the other process in the set.

Starvation or indefinite blocking is a situation where processes wait indefinitely within the semaphore.

 

23.How is memory protected in a paged environment?

 

Protection bits that are associated with each frame accomplish memory protection in a paged environment. The protection bits can be checked to verify that no writes are being made to a read-only page.

 

 

24.What is external fragmentation?

 

External fragmentation exists when enough total memory space exists to satisfy a request, but it is not contiguous; storage is fragmented into a large number of small holes.

 

25.What is internal fragmentation?

Page 22: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

When the allocated memory may be slightly larger than the requested memory, the difference between these two numbers is internal fragmentation.

 

26. What do you mean by compaction?

 

Compaction is a solution to external fragmentation. The memory contents are shuffled to place all free memory together in one large block. It is possible only if relocation is dynamic, and is done at execution time.

 

27. What are pages and frames?

 

Paging is a memory management scheme that permits the physical-address space of a process to be non contiguous. In the case of paging, physical memory is broken into fixed-sized blocks called frames and logical memory is broken into blocks of the same size called pages.

 

28. What is the use of valid-invalid bits in paging?

 

When the bit is set to valid, this value indicates that the associated page is in the process’s logical address space, and is thus a legal page. If the bit is said to invalid, this value indicates that the page is not in the process’s logical address space. Using the valid-invalid bit traps illegal addresses.

 

29.What is the basic method of segmentation?

Segmentation is a memory management scheme that supports the user view of memory. A logical address space is a collection of segments. The logical address consists of segment number and offset. If the offset is legal, it is added to the segment base to produce the address in physical memory of the desired byte.

 

30. A Program containing relocatable code was created, assuming it would be loaded at address 0. In its code, the program refers to the following addresses:

Page 23: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

50,78,150,152,154. If the program is loaded into memory starting at location 250, how do those addresses have to be adjusted?

All addresses need to be adjusted upward by 250.So the adjusted addresses would be 300, 328, 400, 402, and 404.

 

16 Marks

1. Give a detailed description about deadlocks and its characterization

2. Explain about the methods used to prevent deadlocks

3. Write in detail about deadlock avoidance.

4. Explain the Banker’s algorithm for deadlock avoidance.

5. Give an account about deadlock detection.

6. What are the methods involved in recovery from deadlocks?

7. Explain about contiguous memory allocation.

8. Give the basic concepts about paging.

9. Write about the techniques for structuring the page table.

10. Explain the basic concepts of segmentation.

11. Describe the consequence of multiprogramming with fixed partitioning and variable partitioning. Also explain the swapping process.

12. Explain how memory can be dynamically allocated using first fit, best fit, and worst fit strategies.

13. Explain how sharing of pages can be achieved.

14. Define the deadlock problem. Explain in detail the prevention and recovery methods of deadlock.

15. Discuss the salient features and merits of multilevel paging and inverted page tables.

16. Explain in detail about External and Internal fragmentation.

17. Why paging and segmentation combined in one scheme for virtual memory.

18. What are the aspects for comparison of different MMV strategies?

Page 24: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

19. Explain the concept of inverted page-tables.

20. Write short notes on “working set” and “Degree of multiprogramming”.

 UNIT-IV

1.What is virtual memory?

 

Virtual memory is a technique that allows the execution of processes that may not be completely in memory. It is the separation of user logical memory from physical memory. This separation provides an extremely large virtual memory, when only a smaller physical memory is available.

 

2.What is Demand paging?

 

Virtual memory is commonly implemented by demand paging. In demand paging, the pager brings only those necessary pages into memory instead of swapping in a whole process. Thus it avoids reading into memory pages that will not be used anyway, decreasing the swap time and the amount of physical memory needed.

 

3.Define lazy swapper.

 

Rather than swapping the entire process into main memory, a lazy swapper is used. A lazy swapper never swaps a page into memory unless that page will be needed.

 

4.What is a pure demand paging?

 

When starting execution of a process with no pages in memory, the operating system sets the instruction pointer to the first instruction of the process, which is on a non-memory resident page, the process immediately faults for the page. After this page is brought into memory, the process continues to execute, faulting as necessary until every page that it needs is in memory. At that point, it can execute with no more faults. This schema is pure demand paging.

Page 25: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

5.Define effective access time.

 

1). The value of p is expectedpLet p be the probability of a page fault (0 to be close to 0; that is, there will be only a few page faults. The effective access time is

 

Effective access time = (1-p) * ma + p * page fault time.

ma : memory-access time

 

6.Define secondary memory.

 

This memory holds those pages that are not present in main memory. The secondary memory is usually a high speed disk. It is known as the swap device, and the section of the disk used for this purpose is known as swap space.

 

 

7.What is the basic approach of page replacement?

 

If no frame is free is available, find one that is not currently being used and free it. A frame can be freed by writing its contents to swap space, and changing the page table to indicate that the page is no longer in memory. Now the freed frame can be used to hold the page for which the process faulted.

 

8.What are the various page replacement algorithms used for page replacement?

 

FIFO page replacement

Optimal page replacement

Page 26: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

LRU page replacement

LRU approximation page replacement

Counting based page replacement

Page buffering algorithm.

 

9.What are the major problems to implement demand paging?

 

The two major problems to implement demand paging is developing

1.Frame allocation algorithm

2.Page replacement algorithm

 

10.What is a reference string?

 

An algorithm is evaluated by running it on a particular string of memory references and computing the number of page faults. The string of memory reference is called a reference string.

 

11.What is a file?

 

A file is a named collection of related information that is recorded on secondary storage. A file contains either programs or data. A file has certain “structure” based on its type.

File attributes: Name, identifier, type, size, location, protection, time, date

File operations: creation, reading, writing, repositioning, deleting, truncating, appending, renaming

File types: executable, object, library, source code etc.

 

Page 27: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

12.List the various file attributes.

 

A file has certain other attributes, which vary from one operating system to another, but typically consist of these: Name, identifier, type, location, size, protection, time, date and user identification

 

 

 

13.What are the various file operations?

 

The six basic file operations are

Creating a file

Writing a file

Reading a file

Repositioning within a file

Deleting a file

Truncating a file

 

14.What are the information associated with an open file?

 

Several pieces of information are associated with an open file which may be:

File pointer

File open count

Disk location of the file

Access rights

 

Page 28: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

15.What are the different accessing methods of a file?

 

The different types of accessing a file are:

Sequential access: Information in the file is accessed sequentially

Direct access: Information in the file can be accessed without any particular order.

Other access methods: Creating index for the file, indexed sequential access method (ISAM) etc.

 

16.What is Directory?

 

The device directory or simply known as directory records information- such as name, location, size, and type for all files on that particular partition. The directory can be viewed as a symbol table that translates file names into their directory entries.

 

17.What are the operations that can be performed on a directory?

 

The operations that can be performed on a directory are

Search for a file

Create a file

Delete a file

Rename a file

List directory

Traverse the file system

 

 

Page 29: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

 

18.What are the most common schemes for defining the logical structure of a directory?

 

The most common schemes for defining the logical structure of a directory

Single-Level Directory

Two-level Directory

Tree-Structured Directories

Acyclic-Graph Directories

General Graph Directory

 

19.Define UFD and MFD.

 

In the two-level directory structure, each user has her own user file directory (UFD). Each UFD has a similar structure, but lists only the files of a single user. When a job starts the system’s master file directory (MFD) is searched. The MFD is indexed by the user name or account number, and each entry points to the UFD for that user.

 

20.What is a path name?

 

A pathname is the path from the root through all subdirectories to a specified file. In a two-level directory structure a user name and a file name define a path name.

 

21. What is access control list (ACL)?

 

Page 30: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

The most general scheme to implement identity-dependent access is to associate with each file and directory an access control unit.

 

22. Define Equal allocation.

 

The way to split ‘m’ frames among ‘n’ processes is to give everyone an equal share, m/n frames. For instance, if there are 93 frames and 5 processes, each process will get 18 frames. The leftover 3 frames could be used as a free-frame buffer pool. This scheme is called equal allocation.

 

23. What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing, what can the system do to eliminate this problem?

 

Thrashing is caused by under allocation of the minimum number of pages required by a process, forcing it to continuously page fault. The system can detect thrashing by evaluating the level of CPU utilization as compared to the level of multiprogramming. It can be eliminated by reducing the level of multiprogramming.

 

 

 

 

 

23. If the average page fault service time of 25 ms and a memory access time of 100ns.Calculate the effective access time.

 

Effective access time = (1-p)*ma + p*page fault time

= (1-p)*100+p*25000000

= 100-100p+25000000*p

= 100 + 24999900p

Page 31: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

24.What is Belady’s Anomaly?

 

For some page replacement algorithms, the page fault rate may increase as the number of allocated frames increases.

 

25.What are the different types of access?

 

Different types of operations may be controlled in access type. These are

1.Read

2.Write

3.Execute.

4.Append

5.Delete

6.List

 

26.What are the types of path names?

 

Path names can be of two types.

 

a) Absolute path name.

b) Relative path name.

 

Absolute path name: Begins at the root and follows a path down to the specified file, giving the directory names on the path.

 

Page 32: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Relative path name: Defines a path from the current directory.

 

27.What is meant by Locality of Reference?

 

The locality model states that, as a process executes, it moves from locality to locality. Locality are of two types.

 

1) Spatial locality

2) Temporal locality.

 

Designed

Bbbbbbbbbbbbbbbbbbbbbbbbbb7

bbbbbbb

1. Explain Non-Recursive algorithms with suitable examples

 

Explain the algorithms

Max element

General Plan

Unique Elements

Matrix Multiplication

Binary Representation

 

Page 33: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

2. Explain Recursive algorithms with suitable examples

 

Explain the algorithms

• Factorial

• General Plan

• Towers of Hanoi

• Binary Representation

 

3. Discuss about the empirical analysis of algorithms

 

Explain

• General Plan

• Pseudo random numbers

 

4. Discuss briefly about Algorithmic visualization

 

Explain

• Static algorithm visualization

• Dynamic algorithm visualization

 

5. Discuss about the Fibonacci numbers

 

Explain about

Explicit formula

Computation

Page 34: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Iterative algorithm

 

2 Marks

1.What is cache memory?

The small and fast RAM units are called as caches. When the execution of an instruction calls for data located in the main memory, the data are fetched and a copy is placed in the cache. Later if the same data is required it is read directly from the cache.

 

2. What is the function of ALU?

Most of the computer operations (arithmetic and logic) are performed in ALU.The data required for the operation is brought by the processor and the operation is performed by the ALU.

 

3. What is the function of CU?

The control unit acts as the nerve center, that coordinates all the computer operations. It issues timing signals that governs the data transfer.

 

4. What are basic operations of a computer?

The basic operations are READ and WRITE.

 

5. What are the registers generally contained in the processor?

MAR-Memory Address Register

MDR-Memory Data Register

IR-Instruction Register

R0-Rn-General purpose Registers

PC-Program Counter

 

Page 35: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

6. What are the steps in executing a program?

1.Fetch

2.Decode

3.Execute

4.Store

 

 

 

 

7. Define interrupt and ISR?

An interrupt is a request from an I/O device for service by the processor. The processor provides the requested service by executing the interrupt service routine.

 

8. Define Bus?

A group of lines that serves as a connecting path for several devices is called a bus.

 

9. What is the use of buffer register?

The buffer register is used to avoid speed mismatch between the I/O device and the processor.

 

10. Compare single bus structure and multiple bus structure?

A system that contains only one bus(i.e only one transfer at a time) is called as a single bus structure. A system is called as multiple bus structure if it contains multiple buses.

 

11. What is a compiler?

Page 36: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

A system software program called a compiler translates the high-level language program into a suitable machine language program containing instructions such as the Add and Load instructions.

 

12. What is System Software? Give an example?

It is a collection of programs that are executed as needed to perform functions such as

• Receiving and interpreting user commands

• Entering and editing application programs and storing them as files in secondary storage devices. Ex: Assembler, Linker, Compiler etc

 

13.What is Application Software? Give an example?

Application programs are usually written in a high-level programming language, in which the programmer specifies mathematical or text-processing operations. These operations are described in a format that is independent of the particular computer used to

execute the program.

Ex: C, C++, JAVA

 

14. What is text editor?

It is used for entering and editing application programs. The user of this program interactively executes command that allow statements of a source program entered at a keyboard to be accumulated in a file.

 

 

15. Discuss about OS as system software?

OS is a large program,or actually a collection of routines,that is used to control the sharing of and interaction among various computer units as they execute application programs.The OS routines perform the tasks required to assign computer resources to individual application programs.

 

Page 37: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

16. What is multiprogrraming or multitasking?

 

The operating system manages the concurrent execution of several application programs to make the best possible uses of computer resources.this pattern of concurrent execution is called multiprogrraming or multitasking.

 

17.What is elapsed time of computer system?

The total time to execute the total program is called elapsed time.it is affected by the speed of the processor,the disk and the printer.

 

18. What is processor time of a program?

The periods during which the processor is active is called processor time of a programIt depends on the hardware involved in the execution of individual machine instructions.

 

19. Define clock rate?

The clock rate is given by,

R=1/P,where P is the length of one clock cycle.

 

20. Write down the basic performance equation?

T=N*S/R

T=processor time

N=no of instructions

S=no of steps

R=clock rate

21.What is pipelining?

The overlapping of execution of successive instructions is called pipelining.

Page 38: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

 

 

 

22. What is byte addressable memory?

The assignment of successive addresses to successive byte locations in the memory is called byte addressable memory.

 

23. What is big endian and little endian format?

The name big endian is used when lower byte addresses are used for the more significiant of the word. The name little endian is used for the less significiant bytes of the word.

 

24. What is a branch instruction?

Branch instruction is a type of instruction which loads a new value into the program counter.

 

25. What is branch target?

As a result of branch instructions , the processor fetches and executes the instruction at a new address called branch target, instead of the instruction at the location that follows the branch instruction in sequential address order.

 

26.What are condition code flags?

The processor keep track of information about the results of various operations for use by subsequent conditional branch instructions. This is accomplished by recording the required information in individual bits, often called condition code flags.

 

27.Define addressing mode.

Page 39: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

The different ways in which the location of an operand is specified in an instruction are referred to as addressing modes.

 

28.Define various addressing modes.

The various addressing modes are

1.Absolute addressing mode

2.Register addressing mode

3.Indirect addressing mode

4.Index addressing mode

5.Immediate addressing mode

6.Relative addressing mode

7.Autoincrement addressing mode

8.Autodecrement addressing mode

 

29. What are the basic functional units of a computer?

Input ,memory,arithmetic and logic unit,output and control units are the basic functional units of a computer

 

30. Define Response time and Throughput.

Response time is the time between the start and the completion of the event. Also referred to as execution time or latency.Throughput is the total amount of work done in a given amount of time

 

31. How will you compute the SPEC rating?

SPEC stands for system performance Evaluation Corporation

Running time on the reference computer

SPEC rating= _________________________________

Page 40: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Running time on the computer under test

 

32.Give the symbol of a full adder circuit for a single stage addition

 

 

33.Give the representation for n bit ripple carry adder

 

 

34. Write down the Booth’s algorithm

 

Multiplier Version of Multiplicand selected by bit i

Bit i Bit i-1

0 0 0 x M

0 1 +1 x M

1 0 -1 x M

1 1 0 x M

 

 

 

 

 

 

 

 

 

Page 41: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

35.What are the 2 ways to detect overflow in an n-bit adder?

Overflow can occur when the signs of two operands are the same. Overflow occurs when the carry bits Cn and Cn-1 are different.

 

36.What is the delay encountered for Cn-1, Sn-1 and Cn in the FA for a single stage

Cn-1 – 2(n-1)

Sn-1 – 2(n-1)+1

Cn – 2n

 

37.What is the delay encountered for all the sum bits in n-bit binary addition/subtraction logic unit?

 

The gate delays with and without overflow logic are 2n+2 and 2n respectively

 

38.Write down the basic generate and propagate functions for stage i

 

Gi = XiYi, Pi=Xi xor with Yi

 

39.Write down the general expression for Ci+1 using first level generate and propagate function

 

Ci+1 = Gi+PiGi-1+PiPi-1Gi-2+…+PiPi-1…P1G0+PiPi-1…P0G0

 

40.What are the two approaches to reduce delay in adders

• Fastest electronic technology in implementing the ripple carry logic design

Page 42: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

• Augmented logic gate network

 

41.What is the delay encountered in the path in an n x n array multiplier

 

The delay encountered in the path in an n x n array multiplier is 6(n-1)-1

 

42.What is skipping over of one’s in Booth decoding?

The Transformation 011… 110= +100…0 – 10 is called skipping over one’s.In his case multiplier has its ones grouped into a few contiguous blocks.

 

 

 

 

43.What are the two attractive features of Booth algorithm

• It handles both positive and negative multipliers uniformly

• It achieves some efficiency in the number of additions required when the multiplier has a few large blocks of ones

 

44. Give an example for the worst case of Booth algorithm

The worst case is shown as below

0 1 0 1 0 1 0 1 0

 

 

+1-1+1-1+1-1+1-1+1

 

Page 43: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

In the worst case each bit of the multiplier selects the summands. This results in more number of summands.

 

45. What are the two techniques for speeding up the multiplication operation?

• Bit Pair recoding

• CSA

 

46. How bit pair recoding of multiplier speeds up the multiplication process?

It guarantees that the maximum number of summands that must be added is n/2 for nbit operands.

 

47. How CSA speeds up multiplication?

It reduces the time needed to add the summands. Instead of letting the carries ripple along the rows, they can be saved and introduced into the next row, at the correct waited position.

 

48. Write down the levels of CSA steps needed to reduce k summands to two vectors in CSA

The number of levels can be shown by 1.7log2k-1.7

 

49.What is the advantage of non restoring over restoring division?

Non restoring division avoids the need for restoring the contents of register after

an successful subtraction.

 

 

 

 

Page 44: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

50. Write down the steps for restoring division and non-restoring division Non-Restoring:

Step1: Do the following n times

1.If the sign of A is 0, shift A and Q left one bit position and subtract M from A otherwise shift A and Q left and add M to A.

2.Now if the sign of A is 0, set Q0 to 1; otherwise set Q0 to 0

 

Step 2: If the sign of A is 1, add M to A

Restoring:

• Shift A and Q left one binary position

• Subtract M from A

• If the sign of A is one , set Q0 to 0, add M back to A otherwise set Q0 to 1

 

51.What is the need for adding binary 8 value to the true exponential in floating point numbers?

This solves the problem of negative exponent.Due to this the magnitude of the

numbers can be compared.The excess-x representation for exponents enables efficient

comparison of the relative sizes of the two floating point numbers.

 

52.Briefly explain the floating point representation with an example?

The floating point representation has 3 fields

1.sign bit

2.significiant bits

3.exponent

For example consider 1.11101100110 x 10^5,

Mantissa=11101100110

Page 45: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Sign=0

Exponent=5

 

53.What are the 2 IEEE standards for floating point numbers?

1.single

2.double

 

 

 

 

 

 

 

54.What is overflow, underflow case in single precision(sp)?

Underflow-In SP it means that the normalized representation requires an exponent

less than -126.

Overflow- In SP it means that the normalized representation requires an exponent

greater than +127.

 

55.What are the exceptions encounted for FP operation?

The exceptions encounted for FP operation are overflow,underflow,/0,inexact and invalid values.

 

56.What is guard bits?

Page 46: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Guard bits are extra bits which are produced during the intermediate steps to yield maximum accuracy in the final results.

 

57.What are the ways to truncate guard bits?

1.Chopping

2.Von Neumann rounding

3.Rounding procedure

 

16 Marks

1.Explain the various types of hazards in pipelining?

• Instruction hazard

• Data hazard

• Structural hazard

• Control hazard

 

2. Write notes on super scalar operation?

• Explanation

• Diagram

 

3. Explain the multiple bus organization?

• Explanation

• Diagram

 

4. Explain the techniques used to overcome the various hazards.

 

Page 47: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

• Structural hazard

• Duplicating resources

• Stalling

 

• Data hazards

o Stalling

o Duplicating

 

• Control hazard.

• Predicted taken branch scheme

• Predicted untaken branch scheme

• Flush or freeze technique

• Delayed branch scheme.

 

5.Explain the classification of data hazards in pipelining?

• RAW - Read After Write (also known as True Data Dependency)

• WAW - Write After Write (also known as Output Dependency)

• WAR - Write After Read (also known as Anti Data Dependency)

 

1. What is the maximum size of the memory that can be used in a 16-bit computer and 32 bit computer?

The maximum size of the memory that can be used in a 16-bit computer is 216=64K memory locations.

The maximum size of the memory that can be used in a 32-bit computer is

232 =4G memory locations.

 

Page 48: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

2. Define memory access time?

The time required to access one word is called the memory access time. Or it is the time that elapses between the initiation of an operation and the completion of that operation.

 

3. Define memory cycle time?

It is the minimum time delay required between the initiation of two successive memory operations. Eg. The time between two successive read operations.

 

4. When is a memory unit called as RAM?

A memory unit is called as RAM if any location can be accessed for a read or write operation in some fixed amount of time that is independent of the location’s address.

 

5. What is MMU?

MMU is the Memory Management Unit. It is a special memory control circuit used for implementing the mapping of the virtual address space onto the physical memory.

 

 

6. Define memory cell?

A memory cell is capable of storing one bit of information. It is usually organized in the form of an array.

 

7. What is a word line?

In a memory cell, all the cells of a row are connected to a common line called as word line.

 

8. Define static memories?

Page 49: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Memories that consists of circuits capable of retaining their state as long as power

is applied is called Static memories.

 

9.What are the Characteristics of semiconductor RAM memories?

They are available in a wide range of speeds. •

Their cycle time range from 100ns to less than 10ns. •

They replaced the expensive magnetic core memories. •

They are used for implementing memories. •

 

10.Why SRAMs are said to be volatile?

Because their contents are lost when power is interrupted. So SRAMs are said to be volatile.

 

11.What are the Characteristics of SRAMs?

• SRAMs are fast.

• They are volatile.

• They are of high cost.

• Less density.

 

12.What are the Characteristics of DRAMs?

• Low cost.

• High density.

• Refresh circuitry is needed.

 

 

Page 50: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

13.Define Refresh Circuit?

It is a circuit which ensures that the contents of a DRAM are maintained when each row of cells are accessed periodically.

 

14.Define Memory Latency?

It is used to refer to the amount of time it takes to transfer a word of data to or from the memory.

 

15.what are asynchronous DRAMs?

In asynchronous DRAMs, the timing of the memory device is controlled asynchronously. A specialised memory controller circuit provides the necessary control signals RAS and CAS that govern the timing.The processor must take into account the delay in the response of the memory. such memories are asynchronous DRAMs .

 

16.what are synchronous DRAMs?

Synchronous DRAMs are those whose operation is directly synchronized with a clock signal.

 

17.Define Bandwidth?

When transferring blocks of data, it is of interest to know how much time is needed to transfer an entire block. since blocks can be variable in size it is useful to define a performance measure in terms of number of bits or bytes that can be transferred in one second. This measure is often referred to as the memory bandwidth.

 

18. What is double data rate SDRAMs?

Double data rates SDRAMs are those which can transfer data on both edges of the clock and their bandwidth is essentially doubled for long burst transfers.

 

19.What is motherboard?

Page 51: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Mother Board is a main system printed circuit board which contains the processor. It will occupy an unacceptably large amount of space on the board.

 

 

 

20.What are SIMMs and DIMMs?

SIMMs are Single In-line Memory Modules. DIMMs are Dual In-line Memory Modules. Such modules are an assembly of several memory chips on a separate small board that plugs vertically into a single socket on the motherboard.

 

21.What is memory Controller?

A memory controller is a circuit which is interposed between the processor and the dynamic memory. It is used for performing multiplexing of address bits.It provides RAS-CAS timing. It also sends R/W and CS signals to the memory. When used with DRAM chips , which do not have self refreshing capability , the memory controller has to

provide all the information needed to control the refreshing process.

 

22. Differentiate static RAM and dynamic RAM?

Static RAM Dynamic RAM

They are fast They are slow

They are very expensive They are less expensive

They retain their state indefinitely They do not retain their state indefinitely

They require several transistors They require less no transistors.

Low density High density

 

23. What is Ram Bus technology?

The key feature of Ram bus technology is a fast signaling method used to transfer information between chips. Instead of using signals that have voltage levels of either 0 or V supply to represent the logic values, the signals consist of

Page 52: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

much smaller voltage swings around a reference voltage, vref. Small voltage swings make it possible to have short transition times, which allows for a high speed of transmission.

 

24.What are RIMMs?

RDRAM chips can be assembled in to larger modules called RIMMs. It can hold upto 16 RDRAMs.

 

 

 

25. What are RDRAMs?

RDRAMs are Rambus DRAMs. Rambus requires specially designed memory chips. These chips use cell arrays based on the standard DRAM technology. Multiple banks of cell arrays are used to access more than one word at atime. Circuitry needed to interface to the Rambus channel is included on the chip. Such chips are known as RDRAMs.

 

26.What are the special features of Direct RDRAMs?

It is a two channel Rambus.. •

It has 18 data lines intended to transfer two bytes of data at a time. •

There are no separate address lines. •

 

27. Define ROM?

It is a non-volatile memory. It involves only reading of stored data.

 

28.What are the features of PROM?

They are programmed directly by the user. •

Faster •

Page 53: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Less expensive •

More flexible. •

 

29.Why EPROM chips are mounted in packages that have transparent window?

Since the erasure requires dissipating the charges trapped in the transistors of memory cells. This can be done by exposing the chip to UV light .

 

30.What are the disadvantages of EPROM?

The chip must be physically removed from the circuit for reprogramming and its entire contents are erased by the ultraviolet light.

 

 

 

 

 

31.What are the advantages and disadvantages of using EEPROM?

The advantages are that EEPROMs do not have to be removed for erasure.Also it is possible to erase the cell contents selectively. The only disadvantage is that different voltages are needed for erasing, writing and reading the stored data.

 

32.What is cache memory?

It is a small, fast memory that is inserted between the larger, slower main memory and the processor. It reduces the memory access time.

 

 

33. Differentiate flash devices and EEPROM devices.

Flash devices EEPROM devices

Page 54: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

It is possible to read the contents

of a single cell, but it is only possible to write an entire block of cells. It is possible to read and write the contents of a single cell.

 

Greater density which leads to higher capacity. Relatively lower density

 

Lower cost per bit.

Relatively more cost.

 

Consumes less power in their operation and makes it more attractive for use in portable equipments that is battery driven. Consumes more power.

 

 

34.Define flash memory?

It is an approach similar to EEPROM technology. A flash cell is based on a single transistor controlled by trapped charge just like an EEPROM cell.

 

 

 

35. What is locality of reference?

Analysis of programs shows that many instructions in localized areas of the program are executed repeatedly during some time period., and the remainder of the program is accessed relatively infrequently. This is referred to as locality of reference. This property leads to the effectiveness of cache mechanism.

 

36. What are the two aspects of locality of reference?. Define them.

Page 55: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Two aspects of locality of reference are temporal aspect and spatial aspect. Temporal aspect is that a recently executed instruction is likely to be executed again very

soon. The spatial aspect is that instructions in close proximity to a recently executed instruction are also to be executed soon.

 

37. Define cache line.

Cache block is used to refer to a set of contiguous address locations of some size. Cache block is also referred to as cache line.

 

38.What are the two ways in which the system using cache can proceed for a write

operation?

Write through protocol technique.

Write-back or copy back protocol technique.

 

39. What is write through protocol?

For a write operation using write through protocol during write hit: the cache location and the main memory location are updated simultaneously. For a write miss: For a write miss, the information is written directly to the main memory.

 

40.When does a readmiss occur?

When the addressed word in a read operation is not in the cache, a read miss

occur.

 

 

 

 

Page 56: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

41. What is write-back or copy back protocol?

For a write operation using this protocol during write hit: the technique is to update only the cache location and to mark it as updated with an associated flag bit, often called the dirty or modified bit. The main memory location of the word is updated later, when the block containing this marked word is to be removed from the cache to make room for a new block. For a write miss: the block containing the addressed word is first brought into the cache, and then the desired word in the cache is overwritten with the new information.

 

42.What is load-through or early restart?

When a read miss occurs for a system with cache the required word may be sent to the processor as soon as it is read from the main memory instead of loading in to the cache. This approach is called load through or early restart and it reduces the processor’s waiting period.

 

43.What are the mapping technique?

• Direct mapping

• Associative mapping

• Set Associative mapping

 

44.What is a hit?

A successful access to data in cache memory is called hit.

 

45.Define hit rate?

The number of hits stated as a fraction of all attempted access .

 

46.What are the two ways of constructing a larger module to mount flash chips on a small card?

• Flash cards

• Flash drivers.

Page 57: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

 

 

 

47.Describe the memory hierarchy?

 

 

48.Define miss rate?

It is the number of misses stated as a fraction of attempted accesses.

 

49.Define miss penalty?

The extra time needed to bring the desired information into the cache.

 

50.Define access time for magnetic disks?

The sum of seek time and rotational delay is called as access time for disks. Seek time is the time required to move the read/write head to the proper track. Rotational delay or latency is the amount of time that elapses after the head is positioned over the correct track until the starting position of the addressed sector passes under the read/write head.

 

51.What is phase encoding or Manchestor encoding?

It is one encoding technique for combining clocking information with data. It is a scheme in which changes in magnetization occur for each data bit. It s disadvantage is poor bit-storage density.

 

 

 

Page 58: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

52.What is the formula for calculating the average access time experienced by the processor?

tave=hc +(1-h)M

Where

h =Hit rate

M=miss penalty

C=Time to access information in the cache.

 

53. What is the formula for calculating the average access time experienced by the processor in a system with two levels of caches?

tave =h1c1(1-h1)h2c2+(1-h1)(1-h2)M

where

h1=hit rate in L1 cache

h2=hit rate in L2 cache

C1=Time to access information in the L1 cache.

C2=Time to access information in the L2 cache.

 

54.What are prefetch instructions?

Prefetch Instructions are those instructions which can be inserted into a program either by the programmer or by the compiler.

 

55.Define system space?

Management routines are part of the operating system of the computer.It is convenient to assemble the OS routines into a virtual address space.

 

56.Define user space?

Page 59: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

The system space is separated from virtual address space in which the user application programs reside. The letter space is called user space.

 

57.What are pages?

All programs and data are composed of fixed length units called pages.each consists of blocks of words that occupies contiguous locations in main memory.

 

 

 

58.What is replacement algorithm?

When the cache is full and a memory word that is not in the cache is referenced, the cache control hardware must decide which block should be removed to create space for the new block that contains the reference word .The collection of rules for making this decision constitutes the replacement algorithm.

 

59.What is dirty or modified bit?

The cache location is updated with an associated flag bit called dirty bit.

 

60.What is write miss?

During the write operation if the addressed word is not in cache then said to be write miss.

 

61.What is associative research?

The cost of an associative cache is higher than the cost of a direct mapped cache because of the need to search all 128 tag patterns to determine whether a given block is in the cache. A search of this kind is called an associative search.

 

62.What is virtual memory?

Techniques that automatically move program and datablocks into the physical main memory when they are required for execution are called as virtual memory.

Page 60: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

63.What is virtual address?

The binary address that the processor used for either instruction or data called as virtual address.

 

64.What is virtual page number?

Each virtual address generated by the processor whether it is for an instruction fetchis interpreted as a virtual page.

 

 

 

 

 

65.What is page frame?

An area in the main memory that can hold one page is called as page frame.

 

66.What is Winchester technology?

The disk and the read/write heads are placed in a sealed air-filtered enclosure called Winchester technology.

 

67.What is a disk drive?

The electromechanical mechanism that spins the disk and moves the read/write heads called disk drive.

 

68.What is disk controller?

The electronic circuitry that controls the operation of the system called as disk controller.

Page 61: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

69.What is main memory address?

The address of the first main memory location of the block of words involved in the transfer is called as main memory address.

 

70.What is word count?

The number of words in the block to be transferred.

 

71.What is Error checking?

It computes the error correcting code (ECC)value for the data read from a given sector and compares it with the corresponding ECC value read from the disk.

 

72.What is booting?

When the power is turned on the OS has to be loaded into the main memory which takes place as part of a process called booting.To initiate booting a tiny part of main memory is implemented as a nonvolatile ROM.

 

 

 

 

73.What are the two states of processor?

Supervisor state •

User state. •

 

74.What is lockup-free?

A cache that can support multiple outstanding misses is called lockup-free.

 

Page 62: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

75.Draw the static RAM cell?

 

 

 

2 Marks & 16 Marks

Unit 1

 

1.Define a software engineering.

Software engineering is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software, and the study of these approaches; that is, the application of engineering to software

 

2.what are all  the different software engineering paradigms?

 

waterfall model prototyping model object oriented model spiral model WINWIN spiral model incremental model evolutionary model

Independent Verification and Validation\", or IV&V.

 

5. define Dynamic verification .Dynamic verification is performed during the execution of software, and dynamically checks its behaviour; it is commonly known as the Test phase. Verification is a Review Process. Depending on the scope of tests, we can categorize them in three families:

Page 63: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Test in the small: a test that checks a single function or class (Unit test)

Test in the large: a test that checks a group of classes, such as

o Module test (a single module)

o Integration test (more than one module)

o System test (the entire system)

Acceptance test: a formal test defined to check acceptance criteria for a software

o Functional test

o  Non functional test (performance, stress test)

6. define Static verification .Static verification is the process of checking that software meets requirements by doing a physical inspection of it. For example:

Code conventions verification Bad practices detection

Software metrics calculation

Formal verification

7. define a software life cycle. 

The software life cycle is a general model of the software development process, including all the activities and work products required to develop a software system. A software life cycle model is a particular abstraction representing a software life cycle. Such a model may be:

activity-centered -- focusing on the activities of software development

entity-centered -- focusing on the work products created by these activities

8. define a Waterfall Model.

Page 64: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

The waterfall model prescribes a sequential execution of a set of development and management processes, with no return to an earlier activity once it is completed. Some variants of the waterfall model allow revisiting the immediately preceding activity (\"feedback loops\") if inconsistencies or new problems are encountered during the current activity.

 

9.what is meant by RAD?

Rapid application development (RAD) is an approach rather than a model. Its proponents view formal life cycle models as inherently inefficient, due to the large amount of documentation and the number of reviews required. The formality of such models is seen as interfering with customer communication.

Instead, RAD focuses on developing a sequence of evolutionary prototypes which are reviewed with the customer, both to ensure that the system is developing toward the user\'s requirements and to discover further requirements.

10.define a system engineering concept.

Systems engineering (also known as Systems design engineering) is an interdisciplinary field of engineering that focuses on how complex engineering projects should be designed and managed. Issues such as logistics, the coordination of different teams, and automatic control of machinery become more difficult when dealing with large, complex projects. Systems engineering deals with work-processes and tools to handle such projects, and it overlaps with both technical and human-centered disciplines such as control engineering and project management.

 

11.what is computer based system?

A System is a collection of interrelated componets that work together  to achieve some objective.systems and their environment

        Two reasons why system engineers must understand the environment of a system :

Page 65: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

(1)   The reason for the existence of a system is to make some changes in its environment.

(2)   The functioning of a system can be very difficult to predict.

12.define  BPE.

The BPR involves significant organisational change and that managing the change process must therefore be critical to the success of such undertakings with all its major ramifications. In particular the role of organisational culture within the change process is explored. These explorations are initially conducted using a search of the literature and this is followed by a small primary research exercise into a particular hypothesis and issue arising.

 

13.what is meant by BPR? Structures StaffSkillsStrategyStyleShared Values

 Reengineering is the fundamental rethinking and radical redesign of business processes to achieve dramatic improvements in critical, contemporary measures of performance, such as cost, quality, service, and speed.

14.what are all the 7s models that can impact on the organization?

System Structures

StaffSkills

Strategy

Style

Shared Values

15. what are all the Problems that can arise during system installation?

(1)    Proposed changes  have  to  be analysed  very  carefully both  from  a  business and a technical perspective.

Page 66: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

(2)    Because sub-systems are  never independent, changes to one sub-system may adversely affect the performance of another sub-system.

(3)    The reasons for original design decisions are often unrecorded.

(4)    As  systems age, their structure  typically becomes corrupted  by change so the costs of additional changes increase.

 

16.define a V-Model

Another variant of the waterfall model -- the V-model -- associates each development activity with a test or validation at the same level of abstraction. Each development activity builds a more detailed model of the system than the one before it, and each validation tests a higher abstraction than its predecessor

17.what is meant by Project Management

The project manager initiates, monitors and controls the project throughout the software life cycle.

The project management plan is documented in the Software Project Management Plan (SPMP) during the Project Initiation process, and the plan is updated to reflect changes throughout the project.

 

18.what is meant by product engineering?

 

In the final phase a product X is being engineered. This product X uses the commonalities and variability from the Domain Engineering phase, so product X is being derived from the platform established in the Domain Engineering phase. It basically takes all common requirements and similarities from the preceding phase plus its own variable requirements. Using the base from the Domain Engineering phase and the individual requirements of the Product Engineering phase a

Page 67: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

complete and new product can be built. After that the product has been fully tested and approved, the product X can be delivered.

19. define aTest product

During this step the product is verified and validated against its specifications. A test report gives information about all tests that were carried out, this gives an overview of possible errors in the product. If the product in the next step is not accepted, the process will loop back to “Build Product”,

 

20.what is meant by  Deliver and Support of Product

The final step is the acceptance of the final product. If it has been successfully tested and approved to be complete, it can be delivered. If the product does not satisfy to the specifications, it has to be rebuilt and tested again.

The next figure shows the overall process of product family/line engineering as described above. It is a full process overview with all concepts attached to the different steps.

 

 

 

 

 

 

PART-B (16 MARKS)

 

1. Explain the linear software life cycle model with suitable illustration.

    Bring out the demerits of this model.

Page 68: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

2. (a) How do you differentiate software engineering from system engineering?

    (b) For each of the types of process models, identify the types of project suitable to

          Implement.

    (c) Distinguish between verification and validation process.

3. (a) What is meant by generic view of software engineering? Brief it.

    (b) Explain the process model, which is useful when staffing, is unavailable for

          Complete implementation.

4. (a) what is the difference between system and computer based system?

    (b)What is prototyping? Mention its types. Also explain this model with advantages

         and disadvantages.

5. Define Software process model? Explain any one of it with a neat diagram

6. Explain the hierarchy of Business process Engineering.

7. Explain Software Life cycle process

8. Explain Evolutionary process model

9. Explain the different layers of Software Engineering?

10. (a) Describe the process model which defines a network of activities?

      (b) Why the “first system’s throw away system? Explain the concept with

            advantages and disadvantages.

Page 69: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

11.(a) Draw a system engineering hierarchy diagram and explain the concept?

     (b) Explain the process model that combines the elements of waterfall and iterative

           fashion.

16 Marks

1. Explain the various types of computer systems.

2. Explain how protection is provided for the hardware resources by the operating system.

3. What are the system components of an operating system and explain them?

4. Define system calls. Write about the various system calls.

5. What are the various process scheduling concepts

6. Explain about interprocess communication.

7. Explain the essential properties of the following types of Operating System.

i) Multiprogrammed Systems

ii) Time-sharing Systems

8. Explain the following:

i) Real-time Systems

ii) Distributed Systems

9. What is a process? Explain the process control block and the various process states.

10. Explain process creation and process termination

11. What are the important issue involved in the Design and Implementation of operating systems?

12. Discuss the design issues of distributed operating system.

Page 70: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

13. Distinguish between multiprogramming (multi-tasking) and multiprocessing.

14. What are operating system services? Explain each one of them.

15. Explain Co-operating process with example.

 

16 Marks

1. Give an overview about threads.

2. Explain in detail about the threading issues.

3. a) Write about the various CPU scheduling algorithms.

b) Explain the various scheduling criteria used for comparing CPU scheduling algorithms.

4. Write notes about multiple-processor scheduling and real-time scheduling.

5. What is critical section problem and explain two process solutions and multiple process solutions?

6. Explain what semaphores are, their usage, implementation given to avoid busy waiting and binary semaphores.

7. Explain the classic problems of synchronization.

8. Write about critical regions and monitors.

9. Explain about Dining Philosopher’s problem of Synchronization

Explain- Dinning philosopher Problem, algorithm

10. Explain about Producer Consumer Problem

Explain- Producer Consumer Problem, algorithm.

11. What is the job of a scheduling algorithm? State the objective of a good scheduling algorithm. Explain round robin, priority and shortest job first scheduling algorithms.

Page 71: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

12. a) Explain the criteria for scheduling.

b) Describe in detail the Multi-level feedback queue scheduling.

13. What is the advantage of having different time-quantum size at different levels in Multi-level Feedback Queue (MFQ) based scheduling.

14. Explain the various CPU scheduling techniques with Gantt charts clearly as indicated by (process name, arrival time, process time) for the following

(A, 0, 4), (B, 2, 7), (C, 3, 2) and (D, 3, 2) for FCFS,SJF,SRT,RR with quantum 1 and 2.

15. A system uses the following preemptive priority-scheduling algorithm (processes with larger priority numbers have high priority). Processes enter the system with a priority of 0. While waiting on the ready queue, a process . While running, a process priority change at ratepriority changes at rate .

(1). What is the algorithm that results from >>0?

(2). What is the algorithm that results from <<0?

Justify your statement.

16. a) Explain process scheduler.

b) What is context switching? Explain briefly.

17. What are p-threads? Explain with the code.

 

16 Marks

1. What is demand paging and what is its use?

2. Explain the various page replacement strategies.

3. What is thrashing and explain the methods to avoid thrashing?

4. Explain about Access Methods.

Page 72: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

5. What are files and explain the access methods for files?

6. Explain the schemes for defining the logical structure of a directory.

7. Write notes about the protection strategies provided for files.

8. Explain in detail the WS clock page replacement algorithm.

9. What is page fault? Explain the procedure for handling the page fault using Demand paging?

10. Explain I/O Interlock.

11. Explain the following Page Replacement Algorithms:

 

i. Optimal Algorithm

ii. LRU approximation Algorithm

iii. Page Buffering Algorithm

iv. Counting Algorithm

 

12. Explain in thrashing in detail.

13. Explain Allocation of frames.

14. Give references to the following pages by a program,

0,9,0,1,8, 1,8,7,8,7, 1,2,8,2,7, 8,2,3,8,3.

 

How many page faults will occur if the program has three page frames available to it and uses:

(a). FIFO replacement? (8 Faults)

(b). LRU replacement? (9 Faults)

Page 73: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

(c). Optimal replacement? (7 Faults)

 

15. Consider the following page reference string:

1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.

How many page faults would occur for the following replacement algorithms, assuming one, two, three, four, five, six, or seven frames? Remember all frames are initially empty, so your first unique pages will all cost one fault each.

 

(a). LRU replacement

(b). FIFO replacement

(c). Optimal replacement

 

 

 

 

 

Answer:

 

Number of frames LRU FIFO Optimal

1 20 20 20

2 18 18 15

3 15 16 11

4 10 14 8

5 8 10 7

Page 74: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

6 7 10 7

7 7 7 7

 

16. A page-replacement algorithm should minimize the number of page faults. We can do this minimization by distributing heavily used pages evenly over all of memory, rather than having them compete for a small number of page frames. We can associate with each page frame a counter of the number of pages that are associated with that frame. Then, to replace a page, we search for the page frame with the smallest counter.

 

(a). Define a page-replacement algorithm using this basic idea. Specifically address the problems of (1) what the initial value of the counters is, (2) when counters are increased,(3) when counters are decreased, and (4) how the page to be replaced is selected.

 

(b). How many page faults occur for your algorithm for the following reference string, for four page frames?

1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2.

 

(c). What is the minimum number of page faults for an optimal page-replacement strategy for the reference string in part b with four page frames?

 

Answer:

 

(a). Define a page-replacement algorithm addressing the problems of:

 

Page 75: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

i. Initial value of the counters—0.

ii. Counters are increased—whenever a new page is associated with that frame.

iii. Counters are decreased—whenever one of the pages associated with that frame

is no longer required.

iv. How the page to be replaced is selected—find a frame with the smallest counter. Use FIFO for breaking ties.

 

(b). 14 page faults

 

(c). 11 page faults

 

16 Marks

1)      Explain in detail the critical characteristics of information

2)      Explain the components of an Information System.

3)      Explain How components are secured in an information system?

4)      Explain in detail the various phases of System Development Life Cycle(SDLC)?

5)      Explain in detail the Security System Development Life Cycle(SecSDLC)

6)      Explain the history of information security

7)      Explain the approaches used for implementing information security

8)      Explain the critical characrteristics of information

9)      Explain NSTISSC Security model

Page 76: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

10)  Describe the information security roles to be played by various professionals in a typical organization

11)  Write a note on balancing Security and Access

12)  Explain with examples various threats to Information Security.

16 Marks

1. For a given mechanical or electrical or electromechanical system

Derive the transfer Function.

2.Determination of the overall transfer function using Block diagram

Reduction technique.

Reduction of block diagram

Determination of Transfer function

3. Determination of the overall transfer function from the given signal flow

Graph using Mason’s gain formula.

Reduction of signal flow graph

Apply masons gain formula

4. Explain the working of Synchro transmitter and receiver.

. Diagram

. Working principle

5.Explain ac and dc servomotors

6.Write the procedure for constructing the block diagram of a given

Mechanical or electrical or electromechanical system.

Page 77: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Write the differential equation

Develop block diagram

7.Find the electrical analogical variables of a mechanical rotational

System.

Write the differential equation

Draw the equivalent electrical network

 

 

16 Marks

1.. Derive the expressions of the time domain specifications for a second

order system with unit step input.

. Time response of second order system

. Rise time

. Peak time

. Peak overshoot

. Settling time

2. Find the time response of a first order system for various standard inputs.

. Apply the input

. Solve using partial differential equation

. Apply inverse Laplace transform

3. Find the time response of a second order system for unit step input.

Page 78: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

. Apply the input

. Solve using partial differential equation

. Apply inverse Laplace transform

4..Problems using static error coefficients or generalized error coefficients.

. Find the error coefficient

. Apply in formula

5.Obtain the unit step response of an unity feed back system whose open loop transfer function is G(s) =5(s+20)/s(s+4.5)(s2+3.14s+16.35)

6.For a second order system whose open loop transfer function

G(s) =4 /s(s+2). Determine the maximum overshoot, and then time to reach the is given to the system. Findmaximum overshoot when a step displacement of 18 the rise time, time constant and the settling time for an error of 7%.

7.For the system shown in the figure determine the values of K and Kh so that the maximum overshoot in the unit step response is 0.2 and the peak time is 1 sec. With these values of K and Kh, obtain rise time and settling time

8. A unity feed back system is characterization by the open-loop transfer function G(s)=1/s(0.5s+1)(0.2s+1) a)Determine the steady state errors to unit step, unit ramp and unit parabolic inputs.(b) Determine rise time, peak time , peak overshoot and settling time of the unit-step response of the system.

9. For unity feedback system having open loop transfer function as

G(S)=K(s+2)/s2(s2+7s+12), determine (i)type of the system(ii) Error constants Kp,Kv,Ka (iii)Steady state error for parabolic input.

 

Page 79: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 1.What are the various layers of a file system?

 

The file system is composed of many different levels. Each level in the design uses the feature of the lower levels to create new features for use by higher levels.

Application programs

Logical file system

File-organization module

Basic file system

I/O control

Devices

 

2.What are the structures used in file-system implementation?

 

Several on-disk and in-memory structures are used to implement a file system

 

i. On-disk structure include

1. Boot control block

2. Partition block

3. Directory structure used to organize the files

4. File control block (FCB)

ii .In-memory structure include

1. In-memory partition table

2. In-memory directory structure

3. System-wide open file table

4. Per-process open table

Page 80: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

3.What are the functions of virtual file system (VFS)?

 

It has two functions

 

i. It separates file-system-generic operations from their implementation defining a clean VFS interface. It allows transparent access to different types of file systems mounted locally.

 

ii.VFS is based on a file representation structure, called a vnode. It contains a numerical value for a network-wide unique file .The kernel maintains one vnode structure for each active file or directory.

 

 

 

 

 

 

 

4.Define seek time and latency time.

 

The time taken by the head to move to the appropriate cylinder or track is called seek time. Once the head is at right track, it must wait until the desired block rotates under the read- write head. This delay is latency time.

 

5.What are the allocation methods of a disk space?

 

Three major methods of allocating disk space which are widely in use are

Page 81: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

Contiguous allocation

Linked allocation

Indexed allocation

 

6.What are the advantages of Contiguous allocation?

The advantages are

 

Supports direct access

Supports sequential access

Number of disk seeks is minimal.

 

7.What are the drawbacks of contiguous allocation of disk space?

The disadvantages are

 

Suffers from external fragmentation

Suffers from internal fragmentation

Difficulty in finding space for a new file

File cannot be extended

Size of the file is to be declared in advance

 

8.What are the advantages of Linked allocation?

 

The advantages are

No external fragmentation

Size of the file does not need to be declared

Page 82: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

9.What are the disadvantages of linked allocation?

 

The disadvantages are

Used only for sequential access of files.

Direct access is not supported

Memory space required for the pointers.

Reliability is compromised if the pointers are lost or damaged

 

 

 

 

10.What are the advantages of Indexed allocation?

 

The advantages are

No external-fragmentation problem

Solves the size-declaration problems.

Supports direct access

 

11.How can the index blocks be implemented in the indexed allocation scheme?

 

The index block can be implemented as follows

Linked scheme

Multilevel scheme

Combined scheme

Page 83: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

12.Define rotational latency and disk bandwidth.

 

Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head. The disk bandwidth is the total number of bytes transferred, divided by the time between the first request for service and the completion of the last transfer.

 

13.How free-space is managed using bit vector implementation?

 

The free-space list is implemented as a bit map or bit vector. Each block is represented by 1 bit. If the block is free, the bit is 1; if the block is allocated, the bit is 0.

 

14.Define buffering.

 

A buffer is a memory area that stores data while they are transferred between two devices or between a device and an application. Buffering is done for three reasons

To cope with a speed mismatch between the producer and consumer of a data stream

To adapt between devices that have different data-transfer sizes

To support copy semantics for application I/O

 

15.Define caching.

 

A cache is a region of fast memory that holds copies of data. Access to the cached copy is more efficient than access to the original. Caching and buffering are distinct functions, but sometimes a region of memory can be used for both purposes.

 

Page 84: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

 

 

 

16.Define spooling.

 

A spool is a buffer that holds output for a device, such as printer, that cannot accept interleaved data streams. When an application finishes printing, the spooling system queues the corresponding spool file for output to the printer. The spooling system copies the queued spool files to the printer one at a time.

 

 

17.What are the various disk-scheduling algorithms?

 

The various disk-scheduling algorithms are

First Come First Served Scheduling

Shortest Seek Time First Scheduling

SCAN Scheduling

C-SCAN Scheduling

LOOK scheduling

 

18.What is low-level formatting?

 

Before a disk can store data, it must be divided into sectors that the disk controller can read and write. This process is called low-level formatting or physical formatting. Low-level formatting fills the disk with a special data structure for each sector. The data structure for a sector consists of a header, a data area, and a trailer.

Page 85: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

 

19.What is the use of boot block?

 

For a computer to start running when powered up or rebooted it needs to have an initial program to run. This bootstrap program tends to be simple. It finds the operating system on the disk loads that kernel into memory and jumps to an initial address to begin the operating system execution. The full bootstrap program is stored in a partition called the boot blocks, at fixed location on the disk. A disk that has boot partition is called boot disk or system disk.

 

20.What is sector sparing?

 

Low-level formatting also sets aside spare sectors not visible to the operating system. The controller can be told to replace each bad sector logically with one of the spare sectors. This scheme is known as sector sparing or forwarding.

 

21. What are the techniques used for performing I/O.

 

1. Programmed I/O.

2. Interrupt driven I/O.

3. Direct Memory Access (DMA).

 

 

 

22. Give an example of an application in which data in a file should be accessed in the following order:

a. Sequentially

b. Randomly

Ans:

Page 86: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

a. Print the content of the file.

b. Print the content of record i. This record can be found using hashing or index techniques.

 

23. What problems could occur if a system allowed a file system to be mounted simultaneously at more than one location?

 

There would be multiple paths to the same file, which could confuse users or encourage mistakes. (Deleting a file with one path deletes the file in all the other paths.)

 

24.Why must the bit map for file allocation be kept on mass storage rather than in main memory?

 

In case of system crash (memory failure), the free-space list would not be lost as it would be if the bit map had been stored in main memory.

 

25. What criteria should be used in deciding which strategy is best utilized for a particular file?

 

Contiguous—if file is usually accessed sequentially, if file is relatively small.

Linked—if file is large and usually accessed sequentially.

Indexed—if file is large and usually accessed randomly.

 

16 Marks

1. Explain the allocation methods for disk space.

2. What are the various methods for free space management?

3. Write about the kernel I/O subsystem.

Page 87: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling

4. Explain the various disk scheduling techniques

5. Write notes about disk management and swap-space management.

6. Explain in detail the allocation and freeing the file storage space.

7. Explain the backup and recovery of files.

8. Discuss with diagrams the following three disk scheduling: FCFS, SSTF,

C-SCAN.

9. Compare and contrast the FREE SPACE and SWAP SPACE management.

10. Explain the disk scheduling algorithms

11. Discuss the file system organization and file system mounting.

12. Explain the merits and demerits of any one-file system allocation method.

13. Describe the most common schemes for defining the logical structure of a Directory.

14. Explain the life cycle of an I/O request with flowchart.

15. Discuss about the UNIX file system in detail.

16. Discuss briefly about Memory Management in UNIX.

17. Explain the process management under LINUX OS.

18. Compare and contrast “free-space management” and “swap-space management”.

19. What is meant by “symmetric multiprocessing” and “asymmetric multiprocessing” in LINUX OS.

20. In what ways the directory is implemented?

21. Explain linked allocation in detail.

22. Write the indexed allocation with its performance.

23. Explain the I/O hardware.

 

 

Page 88: Unit II - computerscience2ndyear | Just another · Web viewExplain about Producer Consumer Problem Explain- Producer Consumer Problem, algorithm. 11. What is the job of a scheduling