Showing posts with label CS1252. Show all posts
Showing posts with label CS1252. Show all posts

Thursday, March 27, 2014

operating system

1. Explain the various types of computer systems. 
Mainframe systems
Desktop systems
Multiprocessor systems
Distributed systems
Clustered systems
Real-time systems
Handheld systems
2. Explain how protection is provided for the hardware resources by the operating system. 
Dual mode operation
I/O protection with diagram
Memory protection with diagram
CPU protection
3. What are the system components of an operating system and explain them? 
Process management
Main-memory management
File management
I/O management
Secondary storage management
Networking
Protection system
Command-interpreter system
4. Write about the various system calls. 
Process control
File management
Device management
Information maintenance
Communication
5. What are the various process scheduling concepts 
Scheduling queues with diagram
Queueing diagram
Schedulers

Context switch with diagram
6. Explain about interprocess communication. 
Message-passing system
Naming
Direct communication
Indirect communication
Synchronization
Buffering
7. Give an overview about threads. 
Thread definition
Motivation
Diagram
Benefits
User and kernel threads
8. Explain in detail about the threading issues. 
The fork and exec system calls
Cancellation
Signal handling
Threads pools
Thread-specific data
9. Write about the various CPU scheduling algorithms. 
First-come, first-served scheduling
Shortest-job-first scheduling
Priority Scheduling
Round-robin scheduling
Multilevel queue scheduling
Multilevel feedback queue scheduling
10.Write notes about multiple-processor scheduling and real-time scheduling. 
Homogeneous systems
Load sharing
Self-scheduling
Resource reservation
Priority inversion
Priority inheritance protocol
Dispatch latency with diagram
11.What is critical section problem and explain two process solutions and multiple process solutions? 
Critical section problem definition
Two process solutions
Algorithm 1, 2 & 3
Multiple-process solution with algorithm
12.Explain what semaphores are, their usage, implementation given to avoid busy waiting and binary semaphores.
Semaphore definition
Usage for mutual exclusion and process synchronization
Implementation to avoid spinlock using block and wakeup
Binary semaphores
13.Explain the classic problems of synchronization. 
The bounded-buffer problem with structure
The readers-writers problem with structure
The dining-philosophers problem with structure
14.Write about critical regions and monitors. 
Critical region definition
Implementation of the conditional-region construct
Monitor definition
Syntax of monitor
Schematic view of monitors
Monitor with condition variables
Monitor solution to dining-philosopher problem
15.Give a detailed description about deadlocks and its characterization 
Deadlock definition
Deadlock conditions
Mutual exclusion
Hold and wait
No pre-emption
Circular wait
Resource allocation graph
16.Explain about the methods used to prevent deadlocks 
Ensure that at least one of the following does not hold
Mutual exclusion
Hold and wait
No pre-emption
Circular wait
17.Write in detail about deadlock avoidance. 
Safe state and safe sequence
Diagram for safe, unsafe & deadlock states
Resource-allocation graph algorithm
18.Explain the Banker's algorithm for deadlock avoidance. 
Deadlock avoidance definition
Data structures used

Safety algorithm
Resource request algorithm
19.Give an account about deadlock detection. 
Single instance of each resource type
Wait-for graph
Several instances of a resource type
Detection-algorithm usage
20.What are the methods involved in recovery from deadlocks? 
Process termination
Resource pre-emption
21.Explain about contiguous memory allocation. 
Contiguous allocation
Memory protection with diagram
Memory allocation
First fit
Best fit
Worst fit
Fragmentation
22.Give the basic concepts about paging. 
Paging definition
Basic method-page, frame, page table, page number & page offset
Paging hardware diagram
TLB with diagram
Protection-protection bits & valid-invalid bits

Wednesday, March 26, 2014

Operating System

91.How can the index blocks be implemented in the indexed allocation scheme? 
The index block can be implemented as follows 
a. Linked scheme 
b. Multilevel scheme 
c. Combined scheme 

92.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. 

93.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. 

94.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 
a. To cope with a speed mismatch between the producer and consumer of a data stream 
b. To adapt between devices that have different data transfer sizes 
c. To support copy semantics for application I/O 


95.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. 

Tuesday, March 25, 2014

Operating System

81.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 

82.What are the structures used in file-system implementation? 
Several on-disk and in-memory structures are used to implement a file system 
a. On-disk structure include 
· Boot control block 
· Partition block 
· Directory structure used to organize the files 

· File control block (FCB) 
b. In-memory structure include 
· In-memory partition table 
· In-memory directory structure 
· System-wide open file table 
· Per-process open table 

83.What are the functions of virtual file system (VFS)? 
It has two functions 
a. 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. 
b. 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. 

84.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. 

85.What are the allocation methods of a disk space? 
Three major methods of allocating disk space which are widely in use are 
a. Contiguous allocation 
b. Linked allocation 

c. Indexed allocation 

Monday, March 24, 2014

Operating System

71.What is a file? 
A file is a named collection of related information that is recorded on secondary storage.  A file contains either programs ordata. 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.

72.List the various file attributes. 
A file has certain other attributes, which vary from one operating system to another, buttypically consist of these:Name, identifier, type, location, size, protection, time, date and user identification

73.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

74.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

75.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.

Sunday, March 23, 2014

Operating System

61.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 eparation of user logical memory from physical memory. This separation providesan extremely large virtual memory, when only a smaller physical memory is available.

62.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.

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

64.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. Afterthis page is brought into memory, the process continues to execute, faulting as necessary until every page that it needs isin memory. At that point, it can execute with no more faults. This schema is pure demand paging.

65.Define effective access time. 
Let p be the probability of a page fault (0£p£1). The valueof p is expected to be close to 0; that is, there will be only afew page faults. The effective access time isEffective access time = (1-p) * ma + p * page fault time.ma : memory-access time

Saturday, March 22, 2014

Operating System

51.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.

52.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.

53.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).

54.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.

55.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.

Friday, March 21, 2014

Operating System

41.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.

42.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.

43.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:
a. Mutual exclusion
b. Hold and wait
c. No pre-emption

44.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.

Thursday, March 20, 2014

Operating System

21.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. 

22.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 

23.Compare user threads and kernel threads. 
User threads 
User threads are supported above the kernel and are implemented by a thread library at the user level. Thread creation & scheduling are done in the user space, without kernel intervention. Therefore they are fast to create and manage blocking system call will cause the entire process to block 
Kernel threads 
Kernel threads are supported directly by the operating system .Thread creation, scheduling and management are done by the operating system. Therefore they are slower to create & manage compared to user threads. If the thread performs a blocking system call, the kernel can schedule another thread in the application for execution 

24.What is the use of fork and exec system calls? 
Fork is a system call by which a new process is created. Exec 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. 

25.Define thread cancellation & target thread. 
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. 

Wednesday, March 19, 2014

Operating System


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' formonitor mode and '1' for user mode. 

12.What are privileged instructions? 
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 

Tuesday, March 18, 2014

Operating System

 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.  

Saturday, March 1, 2014

Operating System

31.What are the various scheduling criteria for CPU scheduling? 
The various scheduling criteria are 
• CPU utilization 
• Throughput 
• Turnaround time 
• Waiting time 
• Response time 

32.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. 

33.What is turnaround time? 
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. 

34.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. 

35.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.