0% found this document useful (0 votes)
59 views8 pages

OS Sheet (5) Solution

The document is a math exam sheet that contains multiple choice and short answer questions about operating systems and file systems. It tests students' knowledge of topics like system calls, file types, file structures, directory structures, file management functions, and file allocation methods. The questions cover definitions of terms like files, directories, sequential access vs direct access, and file system components like the file allocation table.

Uploaded by

hussienboss99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views8 pages

OS Sheet (5) Solution

The document is a math exam sheet that contains multiple choice and short answer questions about operating systems and file systems. It tests students' knowledge of topics like system calls, file types, file structures, directory structures, file management functions, and file allocation methods. The questions cover definitions of terms like files, directories, sequential access vs direct access, and file system components like the file allocation table.

Uploaded by

hussienboss99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Helwan University First Term, Academic Year 2019/2020

Faculty of since M 317 - Operating System


Math. Department Sheet 4 - solution
St. Name:

University ID:

First: Choose the correct answer (1 mark)


1- The process related to process control, file management and communication that is
requested by any higher-level language can be performed by __________.
a) Editors
b) Compilers
c) System Call
d)Caching

2- Which one of the following is not the function of Operating System?


a) Resource Management
b) File Management
c) Networking
d) Processor Management

3- The operating system allows users to organize the computer’s contents in a hierarchical structure
of directories that include all of the following EXCEPT:

A. files. B. folders.

B. drives. D. systems.

4- provides organizational structure to the computer’s contents

a) root directory b) folder

c) file d) file management

5- the top of the filing structure of the computer system


a) root directory b) folder

c) file d) file management

6- a collection of files

a)root directory b) folder

c) file d) file management


7- . a collection of related pieces of information stored together as a single unit

a) root directory b) folder

c) file d) file management

8- FAT and NTFS are:

a. file management utility programs.

b. part of the boot process.

c. programs for managing and scheduling tasks on the system.

d. file systems.
Second : Answer the following (2 mark)

1.What is a file?
Answer: A named collection of related data defined by the creator, recorded on secondary
storage.
2. List some file types.

Answer:
_ source-language for programs (.BAS, COB, .FOR, .MAR, .PAS, .PLI, ...)
_ binary language (.OBJ, .EXE)
_ ASCII code (.TXT)
_ mail format (.MAI)

3. What is a sequential file?


Answer: A file that is read one record or block or parameter at a time in order, based on
a tape model of a file.

4. What is direct access?


Answer: A file in which any record or block can be read next. Usually the blocks are
fixed length.

5. What is a file path name?


Answer: A list of the directories, subdirectories, and files we must traverse to reach a
file from the root directory.

6. What is meant by Text File?

Answer:
A Text File is a sequence of characters organized into lines.
7. What is meant by Source File?

Answer:
A Source File is a sequence of subroutines and functions, each of which is further
organized as declarations followed by executable statements.

8. What is meant by Object File?


Answer:
An Object file is a sequence of bytes organized into blocks understandable by the
system's linker.

9. What is meant by Executable file?


Answer:
An Executable file is a series of code sections that the loader can bring into memory and
execute.
10. What are the Access methods available?
Answer:
 Sequential Access
 OPERATING SYSTEMS 14 V.GOPALA KRISHNAN AP/CSE
 Direct Access
 Other Access methods
11. What are the various operations performed in a File?
Answer:
1) Creating 6) Writing
2) Deleting 7) Appending
3) Opening 8) Seeking
4) Closing 9) Renaming
5) Reading 10) Getting & Setting Attributes.
12. What are the operations performed in a Directory?
Answer:
1) Create 5) Readdir
2) Delete 6) Rename
3) Opendir 7) Link
4) Closedir 8) Unlink

13. Why would we want a subdirectory?


Answer:
To group files into collections of similar nature, and to protect certain groups
of files from other users.

14. What are the different directory structures available?


Answer:
 Single - Level Directory
 Two - Level Directory
 Three - Structured Directory
 A cyclic - Graph Directory
 General Graph Directory

15. What is the responsibility of the file manager?

Answer:
The file manager is responsible for the maintenance of secondary storage (e.g., hard disks). This
includes providing directories to organize files and providing commands to read and write the
contents of a file, to set the file read/write position, to set and use the protection mechanism, to
change the ownership, to list files in a directory, and to remove files.
16. What is meant by Identifier in Files?
Answer:
This has a unique tag, which is always a number that identifies the file within the filesystem
and it is non-human readable name for the file.
17. What is meant by File Pointer?
Answer:
This pointer is unique to each process operating on the file and it is the pointer used by
the pointer used by the system to track the last read-write location as a current - file position
pointer.

18. What is directory?


Answer:
A directory is a symbol table, which can be searched for information about the
files. Also, it is the fundamental way of organizing files. Usually, a directory is
itself a file. A typical directory entry contains information about a file. Directory entries are
added as files are created & are removed when files are deleted.
Common directory structures are:
1- Single-level: shared by all users
2- Two-level: one level for each user
3- Tree: arbitrary tree for each user
The files & directories at any level are contained in the directory above them.
To access a file, the names of all the directories above it need to be specified.
The topmost directory in any file is called the root directory. A directory that is
below another directory is called a subdirectory. A directory above a subdirectory is called the
parent directory

19. What are the different ways to implement a directory?


Answer:
Directory implementation:
1) Linear list:
- a linear list is the simplest & easiest directory structure to set up.
- finding a file requires linear search.
- deletions can be done by moving all entries, flagging an entry as deleted or
by moving the last entry into the newly vacan position.
- sorting the list makes searches faster, at the expense of more complex insertions & deletions
- a linked list makes insertions & deletions into sorted list easier.

2) Hash table:
- a hash table can also be used to speed up searches
- hash table are generally implemented in addition to a linear or other structure

20. Write short notes on the following:


(a) Basic file system
Answer:
A. The basic file system level works directly with the device drevers in terms of retrieving
& Storing raw blocks of data, without any consideration for what is in each block.
Depending on the system, blocks may be referred to with a single block number, or
with head sector cylinder combinations.
The basic file system needs only to issue generic commands to the appropriate device
driver to read & write physical blocks on the disk. Each physical block is
identified by its numeric disk address.

(b) Logical file system


Answer:
The logical file system deals with all of the metadata associated with a file
i.e. everything about the file except the data itself. This level manages the directory
structure to provide the file name. It maintains file structure via file control blocks
, FCBs, which contain all of the metadata which includes information about file,
including ownership, permissions & location of the file contents as well as
block number information for finding the data on the disk.

(c) File access mechanism.


Answer:
1. Contiguous allocation: This method requires each file to occupy a set of contiguous
address on the disk. Disk address defines a linear ordering on the disk. The difficulty
with contiguous allocation is finding space for a new file. It also suffers from external
fragmentation.
2. Linked allocation: In linked allocation, each file is a linked list of disk blocks.
The directory contains a pointer to the first block of the file. There is no external
fragmentation with linked allocation. Any free block is used to satisfy a request. The
problem with it is that it is inefficient to support direct-access; it is effective
only for sequential-access files.

22. Name three ways in which storage blocks can be organized in secondary storage
devices.
Answer:
Contiguous Allocation, Linked Allocation, and Indexed Allocation.
Indexed allocation: This allocation method is the solution to the problem of both
the above allocation. This is done by bringing all the pointers together into one location
called the index block. Each file has its own index block, which is an array of disk
sector of addresses. The directory contains the address of the index block of a file.

23. How are files typically organized?

Answer:
Most file managers allow files to be grouped into a bundle called a directory or folder. This
approach allows a user to organize his or her files according to their purpose by placing related
files in the same directory. Moreover, by allowing directories to contain other directories, called
subdirectories, a hierarchical organization can be constructed.

You might also like