Professional Documents
Culture Documents
PART-A
1. Introduction to Operating system, Role of Operating System as resource manager, function of
kernel and shell, operating system structures, views of an operating system.
2. Process management: CPU scheduling, Scheduling Algorithms, PCB, Process synchronization,
Deadlocks, Prevention, Detection and Recovery .
3. Memory Management: Overlays, Memory management policies, Fragmentation and its types,
Partitioned memory managements:-Paging, Segmentation. Need of Virtual memories, Page
replacement Algorithms, Concept of Thrashing.
PART-B
4. Device Management: I/O system and secondary storage structure, Device management policies,
Role of I/O traffic controller, scheduler .
5. File Management: File System Architecture, Layered Architecture, Physical and Logical File
Systems, Protection and Security.
6. Brief study to multiprocessor and distributed operating systems.
7. Case Studies: LINUX / UNIX Operating System and Windows based operating systems
PART -B
FILE SYSTEMS(CHAPTER 5)
Ques: Discuss various file types ,file attributes and its operations.(10 marks)
File Attributes and operations
A file's attributes vary from one operating system to another but typically consist of these:
1. Name. The symbolic file name is the only information kept in human readable form.
2. Identifier. This unique tag, usually a number, identifies the file within the file system; it is the non-
human-readable name for the file.
3. Type. This information is needed for systems that support different types of files.
4. Location. This information is a pointer to a device and to the location of the file on that device.
5. Size. The current size of the file (in bytes, words, or blocks) and possibly the maximum allowed size
are included in this attribute.
6. Protection. Access-control information determines who can do reading, writing, executing, and so on.
7. Time, date, and user identification. This information may be kept for creation, last modification, and
last use. These data can be useful for protection, security, and usage monitoring.
Operations:
1. Creating a file. Two steps are necessary to create a file. First, space in the file system must be found
for the file. Second, an entry for the new file must be made in the directory.
2. Writing a file. To write a file, we make a system call specifying both the name of the file and the
information to be written to the file. Given the name of the file, the system searches the directory to
find the file's Location.The system must keep a write pointer to the location in the file where the next
write is to take place. The write pointer must be updated whenever a write occurs.
3. Reading a file. To read from a file, we use a system call that specifies the name of the file and where
(in memory) the next block of the file should be put. Again, the directory is searched for the
associated entry, and the system needs to keep a read pointer to the location in the file where the next
read is to take place. Once the read has taken place, the read pointer is updated. Because a process is
usually either reading from or writing to a file, the current operation location can be kept as a per-
process. Both the read and write operations use this same pointer, saving space and reducing system
complexity.
4. Repositioning within a file. The directory is searched for the appropriate entry, and the current-file-
position pointer is repositioned to a given value. Repositioning within a file need not involve any
actual I/0. This file
5. operation is also known as a file seek.
6. Deleting a file. To delete a file, we search the directory for the named file. Having found the
associated directory entry, we release all file space, so that it can be reused by other files, and erase the
directory entry.
7. Truncating a file. The user may want to erase the contents of a file but keep its attributes. Rather than
forcing the user to delete the file and then recreate it, this function allows all attributes to remain
unchanged –except for file length-but lets the file be reset to length zero and its file space released.
File Types
A common technique for implementing file types is to include the type as part of the file name. The name is
split into two parts-a name and an extension, usually separated by a period character . In this way, the user and
the operating system can tell from the name alone what the type of a file is. For example, most operating
systems allow users to specify a file name as a sequence of characters followed by a period and terminated by
an extension of additional characters. File name examples include resume.doc, Server.java, and
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
ReaderThread. c. The system uses the extension to indicate the type of the file and the type of operations that
can be done on that file. Only a file with a .com, .exe, or .bat extension can be executed, for instance. The
.com and .exe files are two forms of binary executable files
FILE TYPES
1.Sequential Access
1. Information in the file is processed in order, one record after the other. This mode of access is by
far the most common; for example, editors and compilers usually access files in this fashion.
2. Reads and writes make up the bulk of the operations on a file. A read operation-read next-reads
the next portion of the file and automatically advances a file pointer, which tracks the I/O location.
3. Similarly, the write operation-write next-appends to the end of the file and advances to the end of
the newly written material (the new end of file).
4. Such a file can be reset to the beginning; and on some systems, a program may be able to skip
forward or backward n records for some integer n-perhaps only for n = 1.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
Allocation Methods
Ques :-Discuss various file allocation methods(PTU 10 Marks)
There are three major methods of storing files on disks: contiguous, linked, and indexed.
1. Contiguous Allocation
It requires that each file occupy a set of contiguous blocks on disk. Disk addresses define a linear
ordering on the disk.
Contiguous allocation of a file is defined by the disk address and length (in block units) of the first
block. If the file is n blocks long and starts at location b, then it occupies blocks b, b + 1, b + 2, ... , b + n
- 1. The directory entry for each file indicates the address of the starting block and the length of the
area allocated for this file
Accessing a file that has been allocated contiguously is easy. For sequential access, the file system
remembers the disk address of the last block referenced and, when necessary, reads the next block. For
direct access to block i of a file that starts at block b, we can immediately access block b + i. Thus, both
sequential and direct access can be supported by contiguous allocation.
Contiguous allocation has some problems, however. One difficulty is finding space for a new file. First
fit and best fit are the most common strategies used to select a free hole from the set of available
holes. Simulations have shown that both first fit and best fit are more efficient than worst fit in terms of
both time and storage utilization. Neither first fit nor best fit is clearly best in terms of storage
utilization
Disadvantages:
All these algorithms suffer from the problem of external fragmentation. As files are allocated and
deleted, the free disk space is broken into pieces. External fragmentation exists whenever free space is
broken into chunks. It becomes a problem when the largest contiguous chunk is insufficient for a
request; storage is fragmented into a number of holes, none of which is large enough to store the data
One strategy for preventing loss of significant amounts of disk space to external fragmentation is to copy an entire file
system onto another disk or tape. The original disk is then freed completely, creating one large contiguous free space. This
is called compaction.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
2. Linked Allocation
Advantages
There is no external fragmentation with linked allocation, and any free block on the free-space list can be used to satisfy a
request. The size of a file need not be declared when that file is created. A file can continue to grow as long as free blocks
are available. Consequently, it is never necessary to compact disk space.
Disadvantages
1. Linked allocation does have disadvantages, however. The major problem is that it can be used effectively only
for sequential-access files. To filed the ith block of a file, we must start at the begining of that file and follow the
pointers until we get to the ith block. Each access to a pointer requires a disk read, and some require a disk seek.
Consequently, it is inefficient to support a direct-access capability for linked-allocation files.
2. Another disadvantage is the space required for the pointers. If a pointer requires 4 bytes out of a 512-byte
block, then 0.78 percent of the disk is being used for pointers, rather than for information. Each file requires
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
The File Allocation Table, FAT, used by DOS is a variation of linked allocation, where all the links are
stored in a separate table at the beginning of the disk. The benefit of this approach is that the FAT table
can be cached in memory, greatly improving random access speeds.
3. Indexed Allocation
Indexed Allocation combines all of the indexes for accessing each file into a
common block ( for that file ), as opposed to spreading them all over the disk or
storing them in a FAT table.
Each file has its own index block, which is an array of disk-block addresses. The i th
entry in the index block points to the ith block of the file. The directory contains the
address of the index block (Figure ).
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
To find and read the ith block, we use the pointer in the ith index-block entry. This
scheme is similar to the paging scheme.
When the file is created, all pointers in the index block are set to nil. When the ith
block is first written, a block is obtained from the free-space management and its
address is put in the ith index-block entry.
Advantage:-Indexed allocation supports direct access, without suffering from
external fragmentation, because any free block on the disk can satisfy a request for
more space. Disadvantage-The pointer overhead of the index block is generally
greater than the pointer overhead of linked allocation.
Directory Structure
11.3.1 Storage Structure
A disk can be used in its entirety for a file system.
Alternatively a physical disk can be broken up into multiple partitions, slices, or mini-disks, each of which
becomes a virtual disk and can have its own filesystem. ( or be used for raw storage, swap space, etc. )
Or, multiple physical disks can be combined into one volume, i.e. a larger virtual disk, with its own
filesystem spanning the physical disks.
Simple to implement, but each file must have a unique name. A single-level directory has significant limitations, however, 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 two users call their data file test, then the unique-name rule is violated.
Figure 11.9 - Single-level directory.
11.3.4 Two-Level Directory
In the two-level directory structure, each user has his own UFD(Unique File Directory) The UFDs have similar
structures, but each lists only the files of a single user. When a user job starts or a user logs in, the system's Master
File Directory(MFD)is searched The MFD is indexed by user name or account number, and each entry points to
the UFD for that user . When a user refers to a particular file, only his own UFD is searched.
Thus, different users may have files with the same name, as long as all the file names within each UFD are unique.
To create a file for a user, the operating system searches only that user's UFD to ascertain whether another file of
that name exists. To delete a file, the operating system confines its search to the local UFD; thus, it cannot
accidentally delete another user's file that has the same name.
A directory (or subdirectory) contains a set of files or subdirectories. A directory is simply another file, but it is
treated in a special way. All directories have the same internal format. One bit in each directory entry defines the
entry as a file (0) or as a subdirectory (1). Special system calls are used to create and delete directories.
An obvious extension to the two-tiered directory structure, and the one with which we are all most
familiar.
Each user / process has the concept of a current directory from which all ( relative ) searches take
place.
Files may be accessed using either absolute pathnames ( relative to the root of the tree ) or relative
pathnames ( relative to the current directory. )
Directories are stored the same as any other file in the system, except there is a bit that identifies
them as directories, and they have some special structure that the OS understands.
One question for consideration is whether or not to allow the removal of directories that are not
empty - Windows requires that directories be emptied first, and UNIX provides an option for
deleting entire sub-trees.
Disks provide the bulk of secondary storage on which a file system is maintained. They have two
characteristics that make them a convenient medium for storing multiple files:
1. A disk can be rewritten in place; it is possible to read a block from the disk, modify the block, and
write it back into the sance place.
2. A disk can access directly any block of information it contains. Thus, it is simple to access any file
either sequentially or randomly, and switching from one file to another requires only moving the read-
write heads and waiting for the disk to rotate.
1.Blocks-To improve I/0 efficiency, I/0 transfers between memory and disk are performed in units of blocks.
Each block has one or more sectors. Depending on the disk drive, sector size varies from 32 bytes to 4,096
bytes; the usual size is 512 bytes.
2.Defining Data structures: (Data structure used in paging is “page table” which translate logical address to
physical address).
File system provide efficient and convenient access to the disk by allowing data to be stored, located, and
retrieved easily. A file system poses two quite different design problems. The first problem is defining how the
file system should look to the user. This task involves defining a file and its attributes, the operations
allowed on a file, and the directory structure for organizing files. The second problem is creating
algorithms and data structures to map the logical file system onto the physical secondary-storage
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
devices. The file system itself is generally composed of many different levels. The structure shown in Figure is
an example of a layered design.
3.I/O control -The lowest level, the I/O control, consists of device drivers and interrupt handlers to transfer
information between the main memory and the disk system.
A device driver can be thought of as a translator. Its input consists of high-level commands such as "retrieve
block 123." Its output consists of low level, hardware specific instructions that are used by the hardware
controller, which interfaces the I/0 device to the rest of the system. The device driver usually writes specific bit
patterns to special locations in the I/0 controller's memory to tell the controller which device location to act on
and what actions to take.
3. Basic file systems --The Basic file systems needs only to issue generic commands to the appropriate
device driver to read and write physical blocks on the disk. Each physical block is identified by its
numeric disk address (for example, drive 1, cylinder 73, track 2, sector 10). This layer also manages
the memory buffers and caches that hold various file-system, directory, and data blocks.
4. File-organization module can translate logical block addresses to physical block addresses for the basic
file system to transfer. Each file's logical blocks are numbered from 0 (or 1) through N. Since the physical
blocks containing the data usually do not match the logical numbers(because logical address and physical
addresses are not same), a translation is needed to locate each block. (eg. Paging).
The file-organization module also includes the free-space manager, which tracks unallocated blocks and
provides these blocks to the file-organization module when requested.
5. Logical File systems manages metadata information. Metadata includes all of the file-system structure
except the actual data (or contents of the files). The logical file system manages the directory structure via
file-control blocks.(FCB).
.
File-System Implementation(FCB)
File systems store several important data structures on the disk:
o A boot-control block, ( per volume ) a.k.a. the boot block in UNIX or the partition boot sector in
Windows contains information about how to boot the system off of this disk. This will generally be
the first sector of the volume if there is a bootable system loaded on that volume, or the block will
be left vacant otherwise.
o A volume control block, ( per volume ) a.k.a. the master file table in UNIX or the superblock in
Windows, which contains information such as the partition table, number of blocks on each
filesystem, and pointers to free blocks and free FCB blocks.
o A directory structure ( per file system ), containing file names and pointers to corresponding FCBs.
UNIX uses inode numbers, and NTFS uses a master file table.
o The File Control Block, FCB, ( per file ) containing details about ownership, size, permissions,
dates, etc. UNIX stores this information in inodes, and NTFS in the master file table as a relational
database structure.
different types. ( UNIX inodes are unique only across a single filesystem, and certainly do not carry across
networked file systems. )
The VFS in Linux is based upon four key object types:
The inode object, representing an individual file
The file object, representing an open file.
The superblock object, representing a filesystem.
The dentry object, representing a directory entry.
Linux VFS provides a set of common functionalities for each filesystem, using function pointers accessed
through a table. The same functionality is accessed through the same table position for all filesystem types,
though the actual functions pointed to by the pointers may be filesystem-specific. See /usr/include/linux/fs.h
for full details. Common operations provided include open( ), read( ), write( ), and mmap( ).
DEVICE MANAGEMENT(CHAPTER 4)
Secondary Storage Structure
Ques: What is the difference between seek time and Rotational latency.(PTU 2 MARKS).
o The positioning time, a.k.a. the seek time or random access time is the time required to
move the heads from one cylinder to another, and for the heads to settle down after the move.
This is typically the slowest step in the process and the predominant bottleneck to overall
transfer rates.
o The rotational latency is the amount of time required for the desired sector to rotate around
and come under the read-write head.This can range anywhere from zero to one full
revolution, and on the average will equal one-half revolution. This is another physical step
and is usually the second slowest step behind seek time. ( For a disk rotating at 7200 rpm, the
average rotational latency would be 1/2 revolution / 120 revolutions per second, or just over
4 milliseconds, a long time by computer standards.
o The transfer rate, which is the time required to move the data electronically from the disk to
the computer. ( Some authors may also use the term transfer rate to refer to the overall
transfer rate, including seek time and rotational latency as well as the electronic data transfer
rate. )
As mentioned earlier, disk transfer speeds are limited primarily by seek times and rotational latency. When
multiple requests are to be processed there is also some inherent delay in waiting for other requests to be
processed.
Bandwidth is measured by the amount of data transferred divided by the total amount of time from the first
request being made to the last transfer being completed, ( for a series of disk requests. )
Both bandwidth and access time can be improved by processing requests in a good order.
Disk requests include the disk address, memory address, number of sectors to transfer, and whether the request
is for reading or writing.
10.4.1 FCFS Scheduling
First-Come First-Serve is simple and intrinsically fair, but not very efficient. Consider in the following
sequence the wild swing from cylinder 122 to 14 and then back to 124:
I/O DEVICES
I/O HARDWARE:
1. A device communicates with a computer system by sending signals over a cable or even through the
air. The device communicates with the machine via a connection point, or port .example, a serial
port.
2. If devices use a common set of wires, the connection is called a bus. A bus is a set of wires and a
rigidly defined protocol that specifies a set of messages that can be sent on the wires.
3. In terms of the electronics, the messages are conveyed by patterns of electrical voltages applied to the
wires with defined timings. When device A has a cable that plugs into device B, and device B has a
cable that plugs into device C, and device C plugs into a port on the computer, this arrangement is
called a daisy chain. A daisy chain usually operates as a bus.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
A typical PC bus structure appears in Figure 13.1. This figure shows a PCI bus (the common PC system bus)
that connects the processor-memory subsystem to the fast devices and an expansion bus that connects
relatively slow devices, such as the keyboard and serial and USB ports.
In the upper-right portion of the figure, four disks are connected together on a SCSI bus plugged into a SCSI
controller. Other common buses used to interconnect main parts of a computer include PCI-X with throughput
up to 4.3 GB and PCI-Express (PCie), with throughput to 16 GB and Hyper Transport with throughput up
to 20 GB.
One way of communicating with devices is through registers associated with each port. Registers
may be one to four bytes in size, and may typically include ( a subset of ) the following four:
1. The data-in register is read by the host to get input from the device.
2. The data-out register is written by the host to send output.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
3. The status register has bits read by the host to ascertain the status of the device, such as
idle, ready for input, busy, error, transaction complete, etc.
4. The control register has bits written by the host to issue commands or to change settings of
the device such as parity checking, word length, or full- versus half-duplex operation.
Figure shows some of the most common I/O port address ranges.
Interrupts
Interrupts allow devices to notify the CPU when they have data to transfer or when an operation is
complete, allowing the CPU to perform other duties when no I/O transfers need its immediate
attention.
The CPU has an interrupt-request line that is sensed after every instruction.
A device's controller raises an interrupt by asserting a signal on the interrupt request line.
The CPU then performs a state save, and transfers control to the interrupt handler routine at a fixed
address in memory. ( The CPU catches the interrupt and dispatches the interrupt handler. )
The interrupt handler determines the cause of the interrupt, performs the necessary processing,
performs a state restore, and executes a return from interrupt instruction to return control to the
CPU. ( The interrupt handler clears the interrupt by servicing the device. )
( Note that the state restored does not need to be the same state as the one that was saved when the interrupt
went off.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
Principles of Protection
The principle of least privilege dictates that programs, users, and systems be given just enough
privileges to perform their tasks.
This ensures that failures do the least amount of harm and allow the least of harm to be done.
For example, if a program needs special privileges to perform a task, it is better to make it a SGID
program with group ownership of "network" or "backup" or some other pseudo group, rather than
SUID with root ownership. This limits the amount of damage that can occur if something goes wrong.
Typically each user is given their own account, and has only enough privilege to modify their own
files.
The root account should not be used for normal day to day activities - The System Administrator
should also have an ordinary account, and reserve use of the root account for only those tasks which
need the root privileges
Goals of Protection
Obviously to prevent malicious misuse of the system by users or programs.
To ensure that each shared resource is used only in accordance with system policies, which may be
set either by system designers or by system administrators.
To ensure that errant programs cause the minimal amount of damage possible.
Note that protection systems only provide the mechanisms for enforcing policies and ensuring
reliable systems. It is up to administrators and users to implement those mechanisms effectively.
Mechanisms of protection:
1.Domain and Objects.
2.Access Matrix
3.Access Control List(ACL)
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
4.Capability List
1.Domain of Protection
A computer can be viewed as a collection of processes and objects ( both HW & SW ).
The need to know principle states that a process should only have access to those objects it needs to
accomplish its task, and furthermore only in the modes for which it needs access and only during the
time frame when it needs access.
The modes available for a particular object may depend upon its type.
Domain Structure
A protection domain specifies the resources that a process may access.
Each domain defines a set of objects and the types of operations that may be invoked on each
object.
An access right is the ability to execute an operation on an object.
A domain is defined as a set of < object, { access right set } > pairs, as shown below. Note that
some domains may be disjoint while others overlap.
3. In Access Control List (ACL) each object has a list of (action, user-list) tuple.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
Access Matrix
For example, in the above diagram File1 & File2 would have following ACL:
File1: ( (read, {user1}), (write, {user2}) )
File2: ( (read, {user1}), (write, {}) )
4. On the other hand, in the capability list system which is a counter-part of ACL system, a user is
associated with a list of (action, object-list) tuple.
For example, for user1, capability list would be :
User1: ( (read, {file1,file2}), (write, {}) )
User2: ( (read, { }), (write, {file1} ) )
1. Global Table
The simplest approach is one big global table with < domain, object, rights > entries.
Unfortunately this table is very large ( even if sparse ) and so cannot be kept in memory
( without invoking virtual memory techniques. )
There is also no good way to specify groupings - If everyone has access to some resource,
then it still needs a separate entry for every domain.
2. Access Lists for Objects
Each column of the table can be kept as a list of the access rights for that particular object,
discarding blank entries.
For efficiency a separate list of default access rights can also be kept, and checked first.
3. Capability Lists for Domains
In a similar fashion, each row of the table can be kept as a list of the capabilities of that
domain.
Capability lists are associated with each domain, but not directly accessible by the domain or
any user process.
Capability lists are themselves protected resources, distinguished from other data in one of
two ways:
o A tag, possibly hardware implemented, distinguishing this special type of data.
( other types may be floats, pointers, booleans, etc. )
o The address space for a program may be split into multiple segments, at least one of
which is inaccessible by the program itself, and used by the operating system for
maintaining the process's access right capability list.
14.6 Access Control
Authentication
One Time passwords
Program Threats
System Threats
Computer Security Classifications
Authentication
Authentication refers to identifying each user of the system and associating the executing programs with
those users. It is the responsibility of the Operating System to create a protection system which ensures that
a user who is running a particular program is authentic. Operating Systems generally
identifies/authenticates users using following three ways −
Username / Password − User need to enter a registered username and password with Operating
system to login into the system.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
User card/key − User need to punch card in card slot, or enter key generated by key generator in
option provided by operating system to login into the system.
User attribute - fingerprint/ eye retina pattern/ signature − User need to pass his/her attribute
via designated input device used by operating system to login into the system.
Program Threats
Operating system's processes and kernel do the designated task as instructed. If a user program made these
process do malicious tasks, then it is known as Program Threats. One of the common example of program
threat is a program installed in a computer which can store and send user credentials via network to some
hacker. Following is the list of some well-known program threats.
Trojan Horse − Such program traps user login credentials and stores them to send to malicious user
who can later on login to computer and can access system resources.
Trap Door − If a program which is designed to work as required, have a security hole in its code and
perform illegal action without knowledge of user then it is called to have a trap door.
Virus − Virus as name suggest can replicate themselves on computer system. They are highly
dangerous and can modify/delete user files, crash systems. A virus is generatlly a small code
embedded in a program. As user accesses the program, the virus starts getting embedded in other
files/ programs and can make system unusable for user
System Threats
System threats refers to misuse of system services and network connections to put user in trouble. System
threats can be used to launch program threats on a complete network called as program attack. System
threats creates such an environment that operating system resources/ user files are misused. Following is
the list of some well-known system threats.
Worm − Worm is a process which can choked down a system performance by using system
resources to extreme levels. A Worm process generates its multiple copies where each copy uses
system resources, prevents all other processes to get required resources. Worms processes can
even shut down an entire network.
Port Scanning − Port scanning is a mechanism or means by which a hacker can detects system
vulnerabilities (Vulnerability is a cyber-security term that refers to a flaw in a system that can
leave it open to attack)to make an attack on the system.
Denial of Service − Denial of service attacks normally prevents user to make legitimate use of the
system. For example, a user may not be able to use internet if denial of service attacks browser's
content settings.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
Linux’s file system has quite a few differences from the Windows file system. You won’t find any drive letters or
backslashes, but you will find an alien-looking layout where files can have the same name, differing only in capitalization.
This isn’t an exhaustive list. It is intended for new Linux users who aren’t aware of all the differences between Linux and
Windows. There are many more differences that apply.
1.Directory Structure
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
You won’t find any Windows, Program Files, or Users folders if you start browsing around the file system on your Linux
computer. (Although the /home/ directory is very similar to the Users folder.)
The Linux directory structure doesn’t just use different names for folders, it uses an entirely different layout. For example,
on Windows, an application might store all its files in C:\Program Files\Application. On Linux, its files would be split
between multiple locations – its binaries in /usr/bin, its libraries in /usr/lib, and its configuration files in /etc/.
2.Case Sensitivity
On Windows, you can’t have a file named file and another file named FILE in the same folder. The Windows file system
isn’t case sensitive, so it treats these names as the same file.
On Linux, the file system is case sensitive. This means that you could have files named file, File, and FILE in the same
folder. Each file would have different contents – Linux treats capitalized letters and lower-case letters as different
characters.
You will also notice that URLs in your web browser – even on Windows – use forward slashes. For example, it’s
https://www.howtogeek.com/article, not http:\\www.howtogeek.com\article.
Linux doesn’t have drive letters. Instead, it makes other file systems accessible at arbitrary directories. (Windows can do
this too, but this isn’t how it works out of the box.)
On Linux, everything is under / – the root directory. There are no files above the root directory, as there are files outside
of C: on Windows. When you connect a device to your computer, it will become available under /media/. The contents of
the directory display the contents of the mounted partition.
If you have multiple hard drives or hard drive partitions, you could mount them anywhere you like on your file system.
For example, you could place your home directories on a separate partition by mounting another partition at /home.
However, you could mount a partition anywhere you like – you could even mount it at /myBackupDrive.
5.Everything is a File
Just as every mounted file system is a directory under / (the root directory), everything on Linux is a file. For example,
your first hard drive is represented by /dev/sda, your CD drive is available at /dev/cdrom, while your mouse is
represented by /dev/mouse.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
On Linux, you could generally delete or modify the video file as it was playing.
7. In Unix,file structure is UFS(Unix File Systems).In Windows we have FAT(File Allocation Table),FAT32 and
NTFS(New Technology File Systems) file systems.
Windows 10 kernel uses Windows NT file systems..
Linux is one of popular version of UNIX operating System. It is open source as its source code is freely
available. It is free to use. Linux was designed considering UNIX compatibility. Its functionality list is quite
similar to that of UNIX.
Basic Features
Following are some of the important features of Linux Operating System.
Portable − Portability means software can works on different types of hardware in same way. Linux
kernel and application programs supports their installation on any kind of hardware platform.
Open Source − Linux source code is freely available and it is community based development project.
Multiple teams work in collaboration to enhance the capability of Linux operating system and it is
continuously evolving.
Multi-User − Linux is a multiuser system means multiple users can access system resources like
memory/ ram/ application programs at same time.
Multiprogramming − Linux is a multiprogramming system means multiple applications can run at
same time.
Hierarchical File System − Linux provides a standard file structure in which system files/ user files
are arranged.
Shell − Linux provides a special interpreter program which can be used to execute commands of the
operating system. It can be used to do various types of operations, call application programs. etc.
Security − Linux provides user security using authentication features like password protection/
controlled access to specific files/ encryption of data.
Architecture
The following illustration shows the architecture of a Linux system −
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
CHAPTER 6
Distributed Systems vs Network based Operating Systems
Ques: Discuss the difference between distributed and Network based operating systems.
Distributed Systems
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
There are four major reasons for building distributed systems: resource sharing, computation speedup,
reliability, and communication
16.1.3 Reliability
If one site fails in a distributed system, the remammg sites can continue operating, giving the system better
reliability. If the system is composed of multiple large autonomous installations (that is, general-purpose
computers), the failure of one of them should not affect the rest. If, however, the system is composed of small
machines, each of which is responsible for some crucialsystem function (such as character I/0 or the file
system), then a single failure may halt the operation of the whole system. In general, with enough redundancy
(in both hardware and data), the system can continue operation, even if some of its sites have failed.
16.1.4 Communication
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
When several sites are connected to one another by a communication network, users at the various
sites have the opportunity to exchange information. At a low level, are passed between systems, much
as messages are passed between processes in the single-computer message system .Given message
passing, all the higher-level functionality found in standalone systems can be expanded to encompass
the distributed system. Such functions include file transfer, login, mail, and remote procedure calls
(RPCs).
The advantage of a distributed system is that these functions can be carried out over great distances.
Two people at geographically distant sites can collaborate on a project, for example. By transferring
the files of the project, logging in to each other's remote systems to run programs, and exchanging
mail to coordinate the work, users minimize the limitations inherent in long distance work .
Remote Login
An important function of a network operating system is to allow users to log in remotely. The Internet provides
the telnet facility for this purpose.
Mainly there are two types of network operating systems named as peer-to-peer and client / server.
Peer-to-peer network operating systems allow users to share resources and files located on their
computers and to access shared resources found on other computers. In a peer-to-peer network, all
computers are considered equal; they all have the same privileges to use the resources available on the
network. Peer-to-peer networks are designed primarily for small to medium local area networks. Windows
for Workgroups is an example of the program that can function as peer-to-peer network operating systems.
Client/server network operating systems allow the network to centralize functions and applications in
one or more dedicated file servers. The file servers become the heart of the system, providing access to
resources and providing security. The workstations (clients) have access to the resources available on the
file servers. The network operating system allows multiple users to simultaneously share the same
resources irrespective of physical location.
4 Performance is badly affected if certain part It is more reliable or fault tolerant i.e
of the hardware starts malfunctioning. distributed operating system performs
even if certain part of the hardware
starts malfunctioning.
5 Remote resources are accessed by either Users access remote resources in the
logging into the desired remote machine or same manner as they access local
transferring data from the remote machine resources.
to user's own machines.
Multiprocessor Operating System
Multiprocessor Operating System refers to the use of two or more central processing units (CPU)
within a single computer system. These multiple CPUs are in a close communication sharing the
computer bus, memory and other peripheral devices. These systems are referred as tightly coupled
systems.
These types of systems are used when very high speed is required to process a large volume of data.
These systems are generally used in environment like satellite control, weather forecasting
etc.The basic organization of multiprocessing system is shown in fig.
OPEARATING SYSTEMS (SAHIL SOBTI) CHAPTER 4, 5,6,7
Multiprocessing operating system or the parallel system support the use of more than one processor in close
communication.
The advantages of the multiprocessing system are:
1. Increased Throughput − By increasing the number of processors, more work can be completed in a
unit time.
2. Cost Saving − Parallel system shares the memory, buses, peripherals etc. Multiprocessor system
thus saves money as compared to multiple single systems. Also, if a number of programs are to
operate on the same data, it is cheaper to store that data on one single disk and shared by all
processors instead of using many copies of the same data.
3. Increased Reliability − In this system, as the workload is distributed among several processors
which results in increased reliability. If one processor fails then its failure may slightly slow down
the speed of the system but system will work smoothly