milispice.blogg.se

Single indirection vs double indirection
Single indirection vs double indirection











single indirection vs double indirection
  1. SINGLE INDIRECTION VS DOUBLE INDIRECTION SERIAL
  2. SINGLE INDIRECTION VS DOUBLE INDIRECTION CODE
  3. SINGLE INDIRECTION VS DOUBLE INDIRECTION PC
  4. SINGLE INDIRECTION VS DOUBLE INDIRECTION FREE

Here are some fields of the vop_vector structure: Each filesystem defines the operations that it supports as functions and then initializes a vop_vector structure with pointers to them.

SINGLE INDIRECTION VS DOUBLE INDIRECTION CODE

Consider how the FreeBSD operating system-a code base I admire for the maturity of its engineering-solves these problems. Moreover, adding a processing step to all the operations of a filesystem (for example, the mapping of remote user credentials) would also require the error-prone modification of each operation with the same boilerplate code.Īs you might have guessed, our task at hand calls for some additional levels of indirection. Worse, adding support for a new filesystem type would require modifying the code of each system call implementation and recompiling the kernel. This approach would bundle together code for the various filesystems, limiting modularity.

single indirection vs double indirection

Struct ucred *cred) /* User's credentials */Ĭase FS_ISO9660: /* ISO-9660-specific code */Ĭase FS_FAT32: /* FAT-32-specific code */ Struct uio *uio, /* Buffer specification */ Struct vnode *vp, /* File to read from */ Its kernel-side interface would look as follows: Consider as an example a hypothetical implementation of the read system call under the FreeBSD operating system. One approach would be to employ a switch statement for each operation. Let's consider how the operating system would structure the code for accessing the different filesystems.

SINGLE INDIRECTION VS DOUBLE INDIRECTION PC

Therefore, the ability to read on my PC a flash card written on my camera never ceases to amaze me.

SINGLE INDIRECTION VS DOUBLE INDIRECTION SERIAL

I grew up in an era where different computers more often than not had incompatible filesystems, forcing me to transfer data from one machine to another over serial links. Therefore, each filesystem requires different code for each operation on a file ( open, read, write, seek, close, delete, and so on).

SINGLE INDIRECTION VS DOUBLE INDIRECTION FREE

Each filesystem uses different data structures for managing free space, for storing file metadata, and for organizing files into directories. These storage devices may, in turn, employ different filesystem organizations: NTFS or ext3fs for a Windows or Linux native filesystem, ISO-9660 for the CD-ROM, and, often, the legacy FAT-32 filesystem for the USB stick. An operating system may use data residing on its native filesystem, a CD-ROM, or a USB stick. Let's start this particular journey by considering the problem of a typical operating system that supports disparate filesystem formats. The quote rings in my head on various occasions: when I am forced to talk to a secretary instead of the person I wish to communicate with, when I first travel east to Frankfurt in order to finally fly west to Shanghai or Bangalore, and-yes-when I examine a complex system's source code. Layers Forever?Īll problems in computer science can be solved by another level of indirection," is a famous quote attributed to Butler Lampson, the scientist who in 1972 envisioned the modern personal computer. From Code to a Domain-Specific Language 17.5. From Filesystems to Filesystem Layers 17.4. From Function Arguments to Argument Pointers 17.3. Works may not be reposted without the explicit permission of the All personsĬopying this information are expected to adhere to the terms andĬonstraints invoked by each author's copyright.

single indirection vs double indirection

Retained by authors or by other copyright holders. This material is presented to ensure timely dissemination of The document's metadata is available in BibTeX format. The publication should always be cited in preference to thisīeautiful Code: Leading Programmers Explain How They Think,Ĭhapter 17, pages 279–291. This is an HTML rendering of a working paper draft that

single indirection vs double indirection

Beautiful Code: Another Level of Indirection













Single indirection vs double indirection