Skip to main content

Answer Chapter 5

Question

File system

1.    Explain a File System.
Answer
a.    File system is a method for storing and organizing computer files and the data they contain to make it easy to find and access them.
b.    File systems may use a data storage device such as a hard disk or CD-ROM.
c.    Involve maintaining the physical location of the files.
d.    Provide access to data on a file server by acting as clients for a network protocol.



Objectives of the File Management

2.    List six objectives of the file management in operating system
Answer
a.    To minimize or eliminate the potential for lost or destroyed data.
b.    To meet the data management needs and requirements of the user which include storage of data and the ability to perform the aforementioned operations.
c.    To guarantee, to the extent possible, that the data in the file are valid.
d.    To provide I/O support for a variety of storage device types.
e.    To provide a standardized set of I/O interface routines to use processes.
f.     To optimize performance, both from the system point of view in terms of overall throughput.

Fields, Record, File, and Database

3.    What is the Fields, Record, File, and Database?
Answer
Fields
·         Is a collection of similar records
·         Treated as a single entity
·         May implement access control mechanisms
Record
·         Collection of related fields
·         Treated as a unit
File
·         Have file names
·         Is a collection of similar records
·         Treated as a single entity
·         May implement access control mechanisms
Database
·         Collection of related data
·         Relationships exist among elements
·         Consists of one or more files
4.    List the basic function of File Management to control a file.
Answer
a.    Create
b.    Delete
c.    Open
d.    Close
e.    Read
f.     Write



File structures

5.    Describe THREE (3) types of file structures below:
a.    Structure (record sequence)
b.    Unstructured (byte sequence)
c.    Tree
Answer
a.    Structure (record sequence)
·   Collection of bytes treated as a unit.
·   Example: employee record.
·   Operations at the level of record (read_rec, write_rec).
·   File is a collection of similar records.
·   OS can optimize operations on records.
b.    Unstructured (Byte sequence)
·   Read or write a number of byte.
·   Unstructured or linear.
·   Simplifies file management for the OS.
·   Applications can impose their own structure.
·   Used by LINUX, Windows, most modem OSes.
c.    Tree
·   Record of variable length.
·   Each has an associated key.
·   Record retrieval based on key.
·   Used on some data processing systems (mainframes).
·   Mostly incorporated into modem databases.
6.    Draw the Example of Tree Structured Directory.

Answer


Method of Storing File

1.    Files are allocated disk spaces by operating system. Operating systems deploy following three main ways to allocate disk space to files. List and explain three types of storing methods.
Answer
a.    Contiguous Allocation
b.    Linked Allocation
c.    Indexed Allocation
Contiguous Allocation
·         Each file occupies a contiguous address space on disk.
·         Assigned disk address is in linear order.
·         Easy to implement.
·         External fragmentation is a major issue with this type of allocation technique.
Linked Allocation
·         Each file carries a list of links to disk blocks.
·         Directory contains link / pointer to first block of a file.
·         No external fragmentation
·         Effectively used in sequential access file.
·         Inefficient in case of direct access file.
Indexed Allocation
·         Provides solutions to problems of contiguous and linked allocation.
·         A index block is created having all pointers to files.
·         Each file has its own index block which stores the addresses of disk space occupied by the file.
·         Directory contains the addresses of index blocks of files.
2.    What is the Index-Node?
Answer
    1. An i-node (index node) is a control structure that contains the key information needed by the operating system for a particular file
    2. Several file names may be associated with a single i-node

Diagram of Contiguous Allocated Method

3.    Draw a diagram of storing file using contiguous allocated method based on the file allocation in table 2.
Table 1
File name
Start block
Length
A
2
3
B
9
5
C
18
8
D
30
2
E
26
3

 Answer


Linked List Allocated Using Index Method.

1.    Draw a diagram of storing file using linked list allocated using index method.
Answer

Diagram of Linked List Allocation Method

1.    Draw a diagram of storing file using linked list allocation method based on the file allocation in following statement.
“A file (File B) of five blocks might start at block 1 and continue at block 8, then block 3, then block 14 and finally block 28.”

Answer

Diagrams of Storing File Methods

1.    With aid diagrams explain the methods of storing file below.
a.    Contiguous Allocation
b.    Linked Allocation
c.    Indexed Allocation
Answer
Contiguous Allocation

·         Each file occupies a set of contiguous on the disk
·         Simple – only starting location (block #) and length (number of blocks) are required.
·         Suits sequential or direct access.
·         Fast (very little head movement) and easy to recover in the event of system crash.
Linked Allocation
·         Each file is a linked list of disk blocks
·         Blocks may be scattered anywhere on the disk
·         Each node in list can be a fixed size physical block or a contiguous collection of blocks.
·         Allocate as needed and then link together via pointer.
Indexed Allocation
·         Bring all pointers together into the index block
·         Need index table
·         Support sequential, direct and indexed access
·         Dynamic access without external fragmentation, but have overhead of index block.

Caching Enhances File System Performance

1.    How caching enhances file system performance?
Answer

a.    Small amount of fast memory
b.    Sits between normal main memory and CPU
c.    May be located on CPU chip or module




Comments

Popular posts from this blog

2.1.4 Distinguish between logical I/O and physical I/O

2.1.4 Distinguish between logical I/O and physical I/O logical input relate to hard disk Logical I/O an Physical I/O Physical" I/O is an actual fetch of data from a storage device such as a disk. Logical" I/O is a programmatic request for data satisfied by a memory (block, buffer) access. A logical I/O may cause a physical I/O in the first place, or a logical I/O may retrieve a part of a block (buffer) of data from memory. 2.1.5 Distinguish between directory management and disk space management. Directory management A directory is a hierarchical collection of directories and files.  The only constraint on the number of files that can be contained in a single directory is the physical size of the disk on which the directory is located. Disk management A hard disk is a rigid disk inside a computer that stores and provides relatively quick access to large amounts of data. It is the type of storage most often used with Windows. The system also supp

3.1.1 Identify Between Resident And Transient Routines

Memory Management Memory management is concerned with managing: The computer’s available pool of memory Allocating space to application routines and making sure that they do not interfere with each other. 3.1.1 Identify between resident and transient routines The operating system is a collection of software routines. Resident routines Transient routines Routines that directly support application programs as they run Stored on disk and read into memory only when needed Example: routine that control physical I/O Example: routine that formats disks The operating system occupies low memory beginning with address 0. Key control information comes first followed by the various resident operating system routines. The remaining memory, called the transient area, is where application programs and transient operating system routines are loaded. Resident & transient routines structure

Operating Systems Definition and the Classification of OS

             OPERATING SYSTEMS ( OS ) What is an operating system? An operating system (sometimes abbreviated as "OS") is the program that, after being initially loaded into the computer by a boot program, manages all the other programs in a computer. The other programs are called applications or application programs. The application programs make use of the operating system by making requests for services through a defined application program interface (API). In addition, users can interact directly with the operating system through a user interface such as a command language or a graphical user interface (GUI). An operating system performs these services for applications:     In a multitasking operating system where multiple programs can be running at the same time, the operating system determines which applications should run in what order and how much time should be allowed for each application before giving another application a turn.     It manages the sharing of