Filesystem API

Filesystem API

A file system API is an application programming interface through which an operating system interfaces with file system code. The operating system usually provides abstractions for accessing different file systems transparently to userland programs, and in this sense it is analogous to device driver APIs that provide abstracted access to hardware.

Some file system APIs may also include interfaces for maintenance operations, such as creating or initializing a file system, verifying the file system for integrity, and defragmentation – although these are more often implemented independently from the file system code.

Microsoft Windows NT, 2000, and XP have a default file system API known as a file system driver for the NTFS, FAT and FAT32 file systems.

History

Originally, operating systems were capable of handling only a disk filesystem, but as systems expanded two problems arose:
* Network shares were required to appear to the user as local disks.
* Users wanted to exchange files with other users that might be running another operating system.

In the old scheme, all filesystems and network protocols are specific to the operating system's kernel and when the user tried to access a file, it was the kernel that knew how the filesystem or network protocol worked.Fact|date=February 2007

This scheme means that adding support for a filesystem requires a major kernel rewrite. This isn't very efficient, so operating systems designers thought about separating the specific filesystem code from the file and network handling code of the kernel, and filesystem APIs resulted.

Kernel-level API

The API is "kernel-level" when the kernel not only provides the interfaces for the filesystems developers but is also the space in which the filesystem code reside.

It differs with the old schema in that the kernel itself uses its own facilities to talk with the filesystem driver and vice-versa, as contrary to the kernel being the one that handles the filesystem layout and the filesystem the one that directly access the hardware.

It isn't the cleanest scheme but resolves the difficulties of major rewrite that has the old scheme.

With modular kernels it allows adding filesystems as any kernel module, even third party ones. With non-modular kernels however it requires the kernel to be recompiled with the new filesystem code (and in closed-source kernels, this makes third party filesystem impossible).

Unixes and Unix-like systems such as Linux have used this scheme.

There is a variation of this scheme used in MS-DOS (DOS 4.0 onward) and compatibles to support CD-ROM and network filesystems. Instead of adding code to the kernel, as in the old scheme, or using kernel facilities as in the kernel-based scheme, it traps all calls to a file and identifies if it should be redirected to the kernel's equivalent function or if it has to be handled by the specific filesystem driver, and the filesystem driver "directly" access the disk contents using low-level BIOS functions.

Driver-based API

The API is "driver-based" when the kernel provides facilities but the filesystem code resides totally external to the kernel (not even as a module of a modular kernel).

It is a cleaner scheme as the filesystem code is totally independent, it allows filesystems to be created for closed-source kernels and online filesystem additions or removals from the system.

Examples of this scheme are the Windows NT and OS/2 respective IFSs.

Mixed kernel-driver-based API

In this API all filesystems are in the kernel, like in kernel-based APIs, but they are automatically trapped by another API, that is driver-based, by the OS.

This scheme was used in Windows 3.1 for providing a FAT filesystem driver in 32-bit protected mode, and cached, (VFAT) that bypassed the DOS FAT driver in the kernel (MSDOS.SYS) completely, and later in the Windows 9x series (95, 98 and Me) for VFAT, the ISO9660 filesystem driver (along with Joliet), network shares, and third party filesystem drivers, as well as adding to the original DOS APIs the LFN API (that IFS drivers can not only intercept the already existent DOS file APIs but also add new ones from within the 32-bit protected mode executable).

However that API was not completely documented, and third parties found themselves in a "make-it-by-yourself" scenario even worse than with kernel-based APIs.

User space API

The API is in the user space when the filesystem doesn't directly use kernel facilities but accesses disks using high-level operating system functions and provides functions in a library that a series of utilities use to access the filesystem.

This is useful for handling disk images.

The advantage is that a filesystem can be made portable between operating systems as the high-level operating system functions it uses can be as common as ANSI C, but the disadvantage is that the API is unique to each application that implements one.

Examples of this scheme are the [http://www.mars.org/home/rob/proj/hfs/ hfsutils] and the [http://lclevy.club.fr/adflib/adflib adflib] .

Interoperatibility between filesystem APIs

As all filesystems (at least the disk ones) need equivalent functions provided by the kernel, it is possible to easily port a filesystem code from one API to another, even if they are of different types.

For example, the ext2 driver for OS/2 is simply a wrapper from the Linux's VFS to the OS/2's IFS and the Linux's ext2 kernel-based, and the HFS driver for OS/2 is a port of the hfsutils to the OS/2's IFS. There also exists a project that uses a Windows NT IFS driver for making NTFS work under Linux.

Bibliography

* O'Reilly - Windows NT File System Internals, A Developer's Guide - By Rajeev Nagar - ISBN 1-56592-249-2
* Microsoft Press - Inside Windows NT File System - By Helen Custer - ISBN 1-55615-660-X
* Wiley - UNIX Filesystems: Evolution, Design, and Implementation - By Steve D. Pate - ISBN 0-471-16483-6
* Microsoft Press - Inside Windows NT - By Helen Custer - ISBN 1-55615-481-X

ee also

* File system
* Installable File System
* Filing OSID
* List of file systems
* Comparison of file systems
* Filename extension
* Virtual file system

External links

* [http://www.forensics.nl/filesystems Filesystem Specifications and Technical Whitepapers]
* [http://www.tldp.org/LDP/khg/HyperNews/get/fs/vfstour.html A Tour of the Linux VFS]
* [http://www.microsoft.com/whdc/devtools/ifskit/default.mspx Microsoft's IFSKit]
* [http://www.developer.ibm.com/isv/tech/faq/individual?oid=2:17718 IBM's information about IFS]
* [http://www.mars.org/home/rob/proj/hfs/ hfsutils]
* [http://lclevy.club.fr/adflib/ adflib]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Fork (filesystem) — In computer file systems, a fork is additional data associated with a file system object. A file system might support only one fork per file or might support multiple named forks. Unlike extended attributes , which are typically limited in size,… …   Wikipedia

  • Virtual Filesystem Switch — Ein virtuelles Dateisystem (engl. virtual file system, VFS) ist eine Abstraktionsschicht oberhalb konkreter Dateisysteme. Ein VFS Layer stellt Programmen eine einheitliche API zur Verfügung, um auf unterschiedliche Dateisysteme zuzugreifen. Dies… …   Deutsch Wikipedia

  • Installable File System — The Installable File System (IFS) is a filesystem API in IBM OS/2 and Microsoft Windows NT that enables the operating system to recognize and load drivers for file systems. It is part of the Windows Driver Kit.HistoryWhen IBM and Microsoft were… …   Wikipedia

  • Comparison of layout engines (HTML5) — HTML HTML and HTML5 Dynamic HTML XHTML XHTML Mobile Profile and C HTML Canvas element Character encodings Document Object Model Font family HTML editor HTML element HTML Frames HTML5 video HTML scrip …   Wikipedia

  • HTML5 — (HyperText Markup Language) Расширение …   Википедия

  • Java (Technik) — Java Logo Die Java Technik (englisch Java Technology) ist eine ursprünglich von Sun entwickelte Sammlung von Spezifikationen, die einerseits die Programmiersprache Java und andererseits verschiedene Laufzeitumgebungen für Computerprogramme… …   Deutsch Wikipedia

  • IFS — could stand for *Initiative on Financial Security a business driven, policy program working to create a comprehensive savings policy for America. *Ifs, Calvados, a commune of the département of Calvados, in the Basse Normandie région , in France… …   Wikipedia

  • Device driver — Operating systems Common features …   Wikipedia

  • AmigaOS — Infobox OS name = AmigaOS logo = caption = A screenshot of AmigaOS 4.0 family = Amiga OS developer = Commodore International (1.0 3.1) Haage Partner (3.5 3.9) Hyperion Entertainment (4.0) source model = Closed source working state = Current… …   Wikipedia

  • Ext2 — infobox filesystem name = ext2 full name = Second extended file system developer = Rémy Card introduction os = Linux introduction date = January 1993 partition id = Apple UNIX SVR2 (Apple Partition Map) 0x83 (Master Boot Record) EBD0A0A2 B9E5… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”