Pavitran A/L Pupathe A170632 Operating Systems: Assignment 1
Pavitran A/L Pupathe A170632 Operating Systems: Assignment 1
(a) Discuss the concept of files, file systems and file system manager.
1. Files:
A file is a named collection of related information that is recorded
on secondary storage such as magnetic disks, magnetic tapes
and optical disks. In general, a file is a sequence of bits, bytes,
lines or records whose meaning is defined by the files creator
and user. Files can be structured or unstructured. Unstructured
files are just a sequence of bytes whereas structured files are a
sequence or tree of typed records.
2. File systems:
A file system is a process that manages how and where data on a
storage disk, typically a hard disk drive (HDD), is stored,
accessed and managed. It is a logical disk component that
manages a disk's internal operations as it relates to a computer
and is abstract to a human user. Usually file systems consist of
files which are separated into groups called directories.
Nowadays, the most frequently used Windows file system is
NTFS.
(b) UNIX file system consists of boot block, super block, i-nodes and data blocks. Explain
each of these items.
1. Boot block:
A boot block located in the first few sectors of a file system. The
boot block contains the initial bootstrap program used to load the
operating system. The boot block is usually a part of the disk
label, a particular set of blocks that contain information about the
layout of the disk.
Typically, the first sector contains a bootstrap program that reads
in a larger bootstrap program from the next few sectors, and so
forth.
2. Super block:
A super block describes the state of the file system: the total size
of the partition, the block size, pointers to a list of free blocks,
the inode number of the root directory, magic number, etc. In
general, each UNIX partition contains a special block called the
superblock. The superblock contains the basic information on the
entire system of files.
3. i-nodes:
A linear array of inodes (short for ``index nodes''). There is a one
to one mapping of files to inodes and vice versa. An inode is
identified by its ``inode number'', which contains the information
needed to find the inode itself on the disk. . File-system object
attributes may include metadata, as well as owner and
permission data. Thus, while users think of files in terms of file
names, Unix thinks of files in terms of inodes.
4. Data blocks:
Data blocks are simply blocks containing the actual contents of
files. The Unix file system allocates data blocks one at a time
from a pool of free blocks.
(c) A UNIX filesystem has 2-KB blocks and 4-byte disk addresses. Each i-node contains 10
direct entries, one singly-indirect entry and one doubly-indirect entry. What is the
maximum file size?
Block Size (A) = 2KB
Block Address (B) = 4 bytes
Solution (S) = A/B
N = 2KB/4 bytes
N = 514
Maximum file size = 10+512+512^2+512^3
= 256GB