Professional Documents
Culture Documents
OPERATING SYSTEMS
When scheduling takes place only under circumstances I and IV , we say that the
scheduling is nonpreemptive or cooperative; otherwise is preemptive.
c. Priority Scheduling
a) SJF Scheduling
b) Priority Scheduling
c) Round-Robin scheduling
a) FCFS Scheduling
b) SJF Scheduling
c) Priority Scheduling
1. Whenever the CPU becomes idle, the operating System must select one of the
processes in the ready queue to be executed. The selection process is carried out
by short-term scheduler (or CPU Scheduler)
1.
b) External fragmentation
b) A write to the file causes the free-space management to find a free block,& this new
block is linked to the end of the file.
c) To read a file, we simply read blocks by following the pointer from block to block
d) No external fragmentation
Disadvantages:
1. Each file has its own index block, which is an array of disk-block addresses. The
ith entry in the index block points to the ith bock of the file. The directory
contains the addresses of the index block. To find read the ith block, we use
pointer in the ith index-block entry.
1. Single indirect block, which is an index block containing not data but the
addresses of blocks that do contain data.
2. Double index blocks, which contains the address of a block that contains the
addresses of blocks that contain pointers to the actual data blocks.
3. Triple indirect block : the last pointer contains the addresses of a triple indirect
block
1. FAT is File Allocation Table: A section of disk at the beginning of each volume is
set aside to contain a table. The Table has one entry for each disk block & is
indexed by block number. The FAT is used in much the same way as linked list.
The directory entry contains the block number of the first block of the file. The
table entry indexed by that block number contains the block number of the next
block in the file. This chain continues until the last block, which has a special
end-of-file value as the table rntry.
1. Directory operations are: Search for a file, Create a file, Delete file, List a
directory, Rename a file, and Traverse the file system.
File organization techniques are: Sequential File Organization, Direct Access File
Organization, and Index Sequential File Organization.
1. When the number of files increases or when the system has more than one user.
Since all files are in the same directory ,they must have unique names. If 2 users
call their data file test, then the unique-name is violated.
1. UFD-user file directory: the UFDs have similar structures, but each lists only the
files of single user. When a job starts ora user logs in, the system’s master file
directory (MFD)
1. This structure effectively isolates one user from another. Isolation is an advantage
when the users are completely independent but is disadvantage when the users
want to cooperate on some task and to access one another’s files. Some systems
simply do not allow local user files to be accessed by other users.
If access is to be permitted, one user must have the ability to name a file in another user’s
directory.
1. An absolute path name begins at the root and follows a path down to the specified
file, giving the directory names on the path.
E.g. root/spell/mail/prt/first
1. A user’s ability to access files created by other users, and ability to permit other
users to access his files.
1.
1. A process requests resources; and if the resources are not available at that time,
the process enters a waiting state. Sometimes, it has requested are held by other
waiting processes. This situation is called a deadlock.
1. Need [i][j]=Max[i][j]-Allocation[i][j]
1. Actions are:
1. Deadlock prevention provides a set of methods for ensuring that at least one of the
necessary conditions cannot hold. These methods prevent deadlocks by
constraining how requests for resources can be made.
1. To ensure that the hold- and-wait condition never occurs in the system, we must
guarantee that, whenever a process requests a resource, it does not hold any other
resources.
This can be avoided by applying a validity constraint to each resource request. The
validity constraint is a Boolean function of the resource state of a requesting process. It
evaluates to false if the request may lead to a circular wait in the system. Such a request
is rejected straightaway. Or else the resource is allocated if it is available; otherwise, the
process is blocked for the resource.
a) Selecting a victim
b) Rollback
c) Starvation
1. Non-sharable resources
1. Loading of a new page into a page frame that previously contained another page
is called a page replacement. It becomes necessary when a page fault occurs and
no free page frame exist in memory.
1. While performing address translation for a logical address (pi, bi) the Memory
Management Unit (MMU) checks the valid bit of the page table entry of pi. If it
indicates that pi is not present in memory, the MMU raises an interrupt called a
page fault or a missing page interrupt. The interrupt action transfers control to the
interrupt handler, which invokes the virtual memory handler when it finds that the
interrupt is a page fault.
1. In demand paging, a page is loaded in memory when needed, i.e., when a logical
address generated by a process points to a page that is not present in memory. It
involves interaction between hardware and software components of the virtual
memory i.e., between MMU and the virtual memory handler.
1. For some page-replacement algorithms, the page-fault rate may increase as the
number of allocated frames increases. We would expect that giving more memory
to a process would improve its performance. In some early research, investigators
noticed that this assumption was not always true. Belady’s anomaly was
discovered as a result.
54. List different page replacement algorithms.
1. The breaking of physical memory into fixed-sized blocks is called as frames. The
breaking of logical memory into blocks of same size called as pages.
1. Replace the page that will not be used for the longest period of time.
1. LFU requires that the page with the smallest count be replaced. MFU is based on
the argument that the page with the smallest count was probably just brought in
and has yet to be used.
1. The page table contains the base address of each page in physical address.
1. External fragmentation: arises when free memory areas existing in a system are
too small to be allocated to processes. The kernel is aware of external
fragmentation, and may be able to take some actions to relieve it. Internal
fragmentation exists when the memory allocated to a process is not fully utilized.
Internal fragmentation arises if the kernel allocates a memory area of a standard
size to a process irrespective of its request.
62. How page table can be implemented?(checks)
1. The base address is combined with the page offset to define the physical memory
address that is sent to the memory unit.