Академический Документы
Профессиональный Документы
Культура Документы
Software Concepts
Introduction to concepts of Operating System (Process & File Management)
Operating System
Process Management
Process Management
Functions:
– To keep track of the status of each process
Processor
– Hardware component that is capable of executing instructions
Process
– An instance of a program in execution
Program Counter (PC): The PC gives the address of the next instruction to be
executed by the process.
New : Created
Admitted
New
Interrupt
Ready
I/O or Event
Completion Running Exit
IO or Event
Waiting wait(Blocked) Terminated
The task of switching the CPU to another process by saving the state of the old
process and loading the saved state of the new process is known as context
switching
Context switching
– Keeps the CPU busy all the time
• An interrupt occurs
• An I/O is completed
• A process terminates
– Co-operating
Benefits
– Sharing of information
– Computation speed-up
– Modularity
– Convenience
Communication
– Message passing
– Shared memory
Uniprogramming
Multiprogramming
Multiprocessing
Multitasking
– Throughput
– Turnaround time
– Waiting time
– Response time
– Preemptive scheduling
CPU is allocated to a process till the job is over or incurs an I/O wait
Example
– FCFS ( First Come First Serve )
Disadvantage
Find the average waiting time for FCFS for the following processes whose CPU
time is given below:
P1 – 6 ms
P2 – 8 ms
P3 – 7 ms
P4 – 3 ms
Gantt Chart’s are used to analyze and evaluate the CPU scheduling.
P2 P3 P4
P1
0 6 21 24
14
time
If the process gets terminated before the time slice then CPU makes a context
switch
Example
– Round Robin
– Priority Scheduling
4 8 12 24
Average Waiting time=13.25
P1 P2 P3 P4 P1 P2 P3
15 17 21
P1 10 2 0
P2 4 1 2
P3 6 3 0
P1 P2 P3
0 10 14 20
P1 10 2 0
P2 4 1 2
P3 6 3 0
Preempt P1
P1 P2 P1 P3
0 2 6 14 20
Disadvantage
Due to priority some low priority jobs have to wait for longer time when the
frequency of high priority jobs are more
Solution
Aging :It is a concept in which the priority of a process is increased after some
time
In the case of multi threading two parts of the same program can execute
simultaneously
Threads shares the same address space, data section and resources
Features:
– Minimal I/O operations on files
File System is a method of storing and managing the files, which contain data.
Example.
File Allocation Table (FAT) is a file system that was developed for MS-DOS.
The purpose of the “File Allocation Table” is to keep track of which areas of the disk are
available and which areas are in use.
FAT12
FAT16
FAT32
most suitable for very small volumes, and is used on floppy disks and hard disk partitions
smaller than about 16 MB
used for hard disk volumes ranging in size from 16 MB to 2,048 MB.
Uses a 28-bit binary number to hold the cluster number, as 4 of the 32 bits are "reserved.
Used in by newer versions of Windows, like Windows 98, Windows ME and Windows
2000.
NTFS
MS-DOS has a tree structure i.e. files are organized on each logical drive
within a hierarchical directory structure.
Root directory is the top directory which holds numerous files and sub-
directories.
– Path
– Filename
Example:
C:\ER\CHSSC\CHAPTER.DOC
SECTOR
TRACK
CYLINDER
PLATTER
The entry in the FAT corresponding to each cluster contains a value that
indicates:
which cluster is unused
which cluster is reserved
which cluster considered as a bad cluster
the number of next cluster in the file
the last cluster of the file
1 FFFF
4 0007
7 FFFF
Cluster 8 is free
8 0000
Additional FAT : used for recovery during the failure of main FAT
File space : Rest of disk space which is available for files and sub-directories.
Additional
Boot Sector FAT Root Directory File Space
FATs
A file system
Super block : Has the state of the file-its size,where to find the free space on
the file system,how many files it can store etc.
Inode list : It follows the super block-Give the internal representation of the file
Data Block : Contains data.( Size of the blocks can vary from 512 bytes to 4K)
Boot Block Super Block Inode Block Data Block File System 1
Boot Block Super Block Inode Block Data Block File System 2
Boot Block Super Block Inode Block Data Block File System 3
Direct 0
.
.
. Data Block
Direct 9
Data Block
Single Index Block
Indirect
Double
Indirect
Data Block
Triple Index Block Index Block
Indirect
Array of 13
pointers
Data Block
r w x r w - - - -
c) Owner has read, write and execute permissions, while Group has read
and write and others don't have any permission
Copy of first 16
MFT records
Operating Systems DOS and all Windows NT, UNIX and Unix
versions of Windows based OS like
Windows 2000, Linux, etc.
Windows XP