Os Answer2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

4.1 What is a file?

[A1] CO4
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.
4.2 What are the information associated with an open file? [A1] CO4
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
4.3 What is a path name? Discuss about its types. [A2] CO4
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.
Path names can be of two types: absolute and relative
4.4 How can the index blocks be implemented in the indexed allocation scheme? [A1] CO4
a. Linked scheme
b. Multilevel scheme
c. Combined scheme
4.5 Name different free space management techniques. [A2] CO4
a. Bit Vector
b. Linked List
c. Grouping
d. Counting
Part B [2x10=20 Marks]
4.6 a Explain the different file access methods with examples [B1] CO4
Files store information. When it is used, this information must be accessed and
read into computer memory. The information in the file can be accessed in
several ways. Types of file access methods:
1. Sequential Access
2. Direct Access
3. Other Access Methods

Explanation each methods with example.


[OR]
b Explain the different levels Directory implementation in detail. [B2] CO4

1. Single-Level Directory
2. Two-Level Directory
3. Tree-Structured Directories
4. Acyclic-Graph Directories
5. General Graph Directory

Single-Level Directory: The simplest directory structure is the single-level


directory. All files are contained in the same directory, which is easy to
support and understand.
Two-Level Directory: A single-level directory often leads to confusion of file
names between different users. The standard solution is to create a separate
directory for each user.
• A two level directory can be a tree of height 2
• The root of a tree is Master File Directory (MFD).
• Its direct descendents are User File Directory (UFD).
• The descendents of UFD's are file themselves.
• The files are the leaves of the tree
Tree-Structured Directories: A tree is the most common directory structure.
The tree has a root directory, and every file in the system has a unique path
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.
Acyclic-Graph Directories:
➢ An acyclic graph allows directories to have shared subdirectories and files.
The same file or subdirectory may be in two different directories.
➢ An acyclic graph, that is, a graph with no cycles, is a natural generalization
of the tree structured directory scheme.
➢ A shared file (or directory) is not the same as two copies of the file. With a
shared file, only one actual file exists, so any changes made by one person are
immediately visible to the other.
General Graph Directory:
➢ If we start with a two-level directory and allow users to create
subdirectories, a tree-structured directory results.
➢ When we add links to an existing tree-structured directory, the tree structure
is destroyed, resulting in a simple graph structure.
4.7 a Explain in detail about the allocation methods of directory. [B1] CO4

Three major methods of allocating are,


1. Contiguous Allocation,
2. Linked Allocation,
3. Indexed Allocation.
Contiguous Allocation: The contiguous-allocation method requires each file
to occupy a set of contiguous blocks 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. (Explain this method in detail).
Linked Allocation
➢ Linked allocation solves all problems of contiguous allocation. With
linked allocation, each file is a linked list of disk blocks;
The disk blocks may be scattered anywhere on the disk.
The directory contains a pointer to the first and last blocks of the file.
For example, a file of five blocks might start at block 9, continue at block
16, then block 1, block 10, and finally block 25.
Indexed Allocation: Linked allocation solves the external-fragmentation and
size-declaration problems of contiguous allocation.
➢ However, in the absence of a FAT, linked allocation cannot support
efficient direct access, since the pointers to the blocks are scattered with the
blocks themselves all over the disk and must be retrieved in order.
➢ Indexed allocation solves this problem by bringing all the pointers together
into one location: the index block.
(Necessary Diagram and examples).
[OR] [OR]
b Let's say there are 200 tracks on a disk (0–199). The request sequence is 176, [B2] CO4
79, 34, 60, 92, 11, 41, 114. Initial head position on the disc is 50. Calculate
the seek time using various disk scheduling techniques (all 6 ways) and show
the disk arm movement.

Total Seek Time


FCFS- 510
SSTF- 204
SCAN- 226
C-SCAN- 190
LOOK – 291
C-LOOK - 156

Answer ALL Questions


Part A [5 x 2 = 10 Marks
5.1 Discuss the Kernel in Linux System. [B1] CO5
The kernel is responsible for maintaining the important abstractions of the
operating system
• Kernel code executes in kernel mode with full access to all the
physical resources of the computer
• All kernel code and data structures are kept in the same single
address space
5.2 What are attributes process identity in Linux system?
✓ Process ID (PID
✓ Credentials
✓ Personality
✓ Namespace
5.3 List any four services provided by the upper layer in android.
✓ hardware abstraction – via registration of device
✓ memory management – buddy, slabs, pmem, etc.
✓ security settings – SE for android, tomoyo, smack
✓ power management – by /sys/power/state (vfs) android aims to put
system to sleep, apps can prevent this with a WAKE_LOCK
✓ device drivers – camera, bluetooth, wi-fi, audio, video
✓ file system support – ext4, fuse, fat, ntfs, ...
✓ network stack - socket buffers, protocols, etc.
5.4 What are the responsibilities in Windows system components?
• thread scheduling
• interrupt and exception handling
• low-level processor synchronization
• recovery after a power failure
5.5 Brief about the system services in android.
System services implement most of the fundamental Android
features, including display and touch screen support, telephony, and network
connectivity.
With a few exceptions, each system service defines a remote
interface that can be called from other services and applications. Coupled
with the service discovery, mediation, and IPC provided by Binder, system
services effectively implement an object-oriented OS on top of Linux.
Part B [2x10=20 Marks]
5.6 a Explain in detail about the Linux system Kernel Modules in detail [B1] CO5
✓ Sections of kernel code that can be compiled, loaded, and unloaded
independent of the rest of the kernel.
✓ A kernel module may typically implement a device driver, a file
system, or a networking protocol
✓ The module interface allows third parties to write and distribute, on
their own terms, device drivers or file systems that could not be
distributed under the GPL.
✓ Kernel modules allow a Linux system to be set up with a standard,
minimal kernel, without any extra device drivers built in.
✓ Four components to Linux module support:
• module-management system
• module loader and unloader
• driver-registration system
• conflict-resolution mechanism
[OR]
b Explain the process management in Linux operating system. [B1] CO5
1. UNIX process management separates the creation of processes and
the running of a new program into two distinct operations.
a. The fork() system call creates a new process
b. A new program is run after a call to exec()
2. Under UNIX, a process encompasses all the information that the
operating system must maintain to track the context of a single
execution of a single program
3. Under Linux, process properties fall into three groups: the process’s
identity, environment, and context
Explain the following:
✓ Process Identity
✓ Process Environment
✓ Process Context

5.7 a Draw the neat sketch of Windows 10 Architecture and explain it. [B2] CO5

[OR]
b Explain the Binder in Android architecture. [B1/B2] CO5
Binder implements a distributed component architecture based on
abstract interfaces. It is similar to Windows Common Object Model (COM)
and Common Object
Broker Request Architectures (CORBA) on Unix, but unlike those
frameworks, it runs on a single device and does not support remote
procedure calls (RPC) across the network (although RPC support could be
implemented on top of Binder).

▪ Binder Implementation
▪ Binder Security
▪ Binder Identity
▪ Capability-Based Security

You might also like