A small trail through the Linux kernel (2001)
win.tue.nlThat's great!
If you're interested in more detail about how a VFS (Virtual File System; the bit where it finds the file and then finds the data in the file) works, Chapter 17 (Another Level of Indirection) in Beautiful Code (http://shop.oreilly.com/product/9780596510046.do ) is well worth a read.
It explains how the VFS in FreeBSD works. How disks, partitions, volumes, filesystems, offsets, etc all get orchestrated together so that the Unix "single directory hierarchy" abstraction works as intended even tho' the actual data may be spread around a number of locations (both local and remote).
The concepts and ideas are largely applicable to other Unixes and Unix-like operating systems.
It's also a great example of how elegantly one can express polymorphic code, even in plain C.
I stumbled across this, and it's nice. It's a very straightforward walkthrough of what happens when a small program calls open() and then read().
If you look up today's Linux source code, the code has of course evolved and is a bit more complex, but not a lot more. The nice thing about the 2001 code is that it's still dead-simple.