0

From Tanenbaum's Modern OS,

every operating system has an I/O subsystem for managing its I/O devices. Some of the I/O software is device independent, that is, applies to many or all I/O devices equally well. Other parts of it, such as device drivers, are specific to particular I/O devices.

There is also a diagram of the layers of the I/O software systems:

enter image description here

In the following two diagrams of Linux's IO subsystem, can you draw a boundary between device-independent and device-dependent components? In other wards, which components are device-dependent, and which components are device-independent? My thought is "drivers" are device-dependent, and "VFS" is device-independent. But I am not sure about the other components.

From the same book:

enter image description here

Bovet's Understanding the Linux Kernel 2005 also has one:

enter image description here

1

In the first Linux diagram, above the "device driver" part; same for Bovet's diagram.

When writing an operating system, you want to keep the device-dependent parts as isolated as possible, so you can add further devices cleanly. In Linux' case, "device driver for a disk" (or "network card", or "WiFi card", or whatever) is a class in the sense of object oriented programming, further refined into classes for individual device types(e .g. "Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller"), which in turn can be instatiated as several copies of the same (or similar enough) devices, as needed. e.g. whose objects are In some cases, device specific functionality is abstracted into higher-level subsystems, like the whole complex handling of WiFi administrative domains and restrictions (this was originally part of each driver). Sometimes there are devices layered on top of one another, like a USB thumbdrive, which uses USB and is handled in turn as a SCSI disk over USB, or SCSI over IP (which in turn runs over fiber optic network interfaces).

tl;dr: This clean separation (as much most what you see in "operating system" texts) is just a very crude first approximation, reality is a much more interesting mess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.