How are filesystem organized with multiple drives?
The solution that was included with DOS and later became part of Windows was to give each drive a letter. The first floppy drive was A and the second floppy drive was B. The first hard drive was C and other drives would follow.
Whenever you insert a floppy disk, or a CD or DVD, or even a USB drive, the operating system will detect this event and make that drive letter available for use. So it’s not really the drive itself that makes a drive letter. But instead it’s the presence of a filesystem that makes a drive letter. If you have a floppy drive that’s empty, we might think of that as drive A. But you won’t have a drive A available for use until you insert a floppy disk that contains a filesystem and the operating system recognizes the filesystem.
Let me be a bit more specific though. I’ve been referring to the “operating system” up till now. It’s probably time that I describe something called the shell. The shell is part of the operating system in the sense that you get a shell with the operating system. But it’s not part of the deep internals of the operating system. It’s like a shell that sits around the operating system. For most of us, the shell is what we see and what we think of as the operating system. It would be like how a company spokesperson can become famous and come to represent the company as a whole. But the spokesperson is not the company just like the shell is not the operating system.
Make sure to listen to the full episode for more details about the shell and how this interacts with the filesystem. You’ll also learn about how you can control when information actually gets written to a filesystem through your application code by flushing buffers.