2021-02-15

Device Files in Windows and Unix

 


Funny! This is kind of like the /dev in Unix. I gather this is why there was no Windows 9–the worry was that some bit of code might see the 9 and think it was code from Windows 95 or 98 and run it wrong or fail to start or something disastrous.

Corvec
Could you tell me what /dev has to do with this? I'm not aware. I feel that as a Linux user that I should be aware of it.
Jay Dearien
@Corvec all the devices for a Unix machine live in /dev, e.g., /dev/null, /dev/com1, /dev/print1, /dev/rhd1, /dev/chd1, /dev/net, etc. i.e., they are special files which are not special files at all but call I/O interfaces in the O/S when they are referenced as a file. However, Unix, I think, abstracts things more thoroughly in that these "special files" only live in /dev (maybe you could create a device interface inode elsewhere, I don't know, have not tried it). And you can delete them or replace them with "real" files or other device driver links, and then things would get missed up really fast. Plus, the programs that use them have to have access to the files, e.g., Oracle likes access to the raw device interface to a hard disk partition it is using (as opposed to the character mode or block mode interface...to the same disk device...but two different device driver interface file in /dev). Of course, having said all that, many or most (except for the actual disks and maybe the console, i.e., /dev/con or such) are going to be out there on the ethernet or Internet cloud somewhere, so accessed by something like /dev/net. Back in the day dozens of terminals and printers would all be hooked directly to a Unix box by serial cables, and so there would be things like /dev/com1-32 or /dev/printer1-5 or such, which you don't tend to see these days. If you're installing devices which are directly wired to the box (like a non-network printer which you are hosting), or installing middleware that has an intimate contact with the built-in devices of the box (like a database), or installing a device which has a lot of special properties, then you may have to dive deeper into the /dev directory.

No comments:

Post a Comment