I have found the following image on the web:
What I understand from this image is that if for example Process 1 wants to read some file, it will do the following:
- Call
read()
and pass the file descriptor for the file as argument toread()
. - The Virtual File System will check to see on what filesystem type the file resides on, let's say that it resides on an ext2 filesystem.
- The ext2 driver (don't know if it's called "driver") will ask the appropriate device driver to retrieve the file from the HDD.
Now what I want to know is: what does the "Device driver" box in the image represent, does it represent device files such as /dev/sda1
, /dev/sda2
, /dev/sdb1
, etc.?
So basically does Linux actually uses these device files to access the HDD (i.e. when Linux wants to read some file, does it call open()
on the /dev/sda1
device file and then read from the returned file descriptor), or are these device files only available for the users and programs to use them, and Linux uses some other means to access the HDD partitions?