Page 149 - DCAP403_Operating System
P. 149
Operating System
Notes 8.1.2 File Systems and Operating Systems
Most operating systems provide a file system, as a file system is an integral part of any
modern operating system. Early microcomputer operating systems’ only real task was fi le
management - a fact reflected in their names. Some early operating systems had a separate
component for handling file systems which was called a disk operating system. On some
microcomputers, the disk operating system was loaded separately from the rest of the operating
system. On early operating systems, there was usually support for only one, native, unnamed fi le
system; for example, CP/M supports only its own file system, which might be called “CP/M fi le
system” if needed, but which didn’t bear any official name at all.
Because of this, there needs to be an interface provided by the operating system software between
the user and the file system. This interface can be textual (such as provided by a command
line interface, such as the Unix shell, or OpenVMS DCL) or graphical (such as provided by a
graphical user interface, such as file browsers). If graphical, the metaphor of the folder, containing
documents, other files, and nested folders is often used.
Flat fi le systems: In a fl at file system, there are no subdirectories-everything is stored at the same
(root) level on the media, be it a hard disk, floppy disk, etc. While simple, this system rapidly
becomes inefficient as the number of files grows, and makes it difficult for users to organise data
into related groups.
Like many small systems before it, the original Apple Macintosh featured a fl at file system, called
Macintosh File System. Its version of Mac OS was unusual in that the file management software
(Macintosh Finder) created the illusion of a partially hierarchical filing system on top of MFS.
This structure meant that every file on a disk had to have a unique name, even if it appeared to be
in a separate folder. MFS was quickly replaced with Hierarchical File System, which supported
real directories.
8.2 File Concept
A file is a collection of letters, numbers and special characters: it may be a program, a database, a
dissertation, a reading list, a simple letter etc. Sometimes you may import a file from elsewhere,
for example from another computer. If you want to enter your own text or data, you will start by
creating a file. Whether you copied a file from elsewhere or created your own, you will need to
return to it later in order to edit its contents.
The most familiar file systems make use of an underlying data storage device that offers access
to an array of fixed-size blocks, sometimes called sector, generally 512 bytes each. The fi le system
software is responsible for organizing these sectors into files and directories, and keeping track
of which sectors belong to which file and which are not being used. Most file systems address
data in fixed-sized units called “clusters” or “blocks” which contain a certain number of disk
sectors (usually 1-64). This is the smallest logical amount of disk space that can be allocated to
hold a fi le.
However, file systems need not make use of a storage device at all. A file system can be used to
organize and represent access to any data, whether it be stored or dynamically generated (e.g,
from a network connection).
Whether the file system has an underlying storage device or not, file systems typically have
directories which associate file names with files, usually by connecting the file name to an index
into a file allocation table of some sort, such as the FAT in an MS-DOS file system, or an inode in
a Unix-like file system. Directory structures may be flat, or allow hierarchies where directories
may contain subdirectories. In some fi le systems, file names are structured, with special syntax
for filename extensions and version numbers. In others, file names are simple strings, and per-fi le
metadata is stored elsewhere.
142 LOVELY PROFESSIONAL UNIVERSITY