![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Differentiate Soft and Hard Link | balu_solaris | UNIX for Dummies Questions & Answers | 2 | 07-18-2007 11:41 PM |
| problem with device file | sameer017 | UNIX for Advanced & Expert Users | 1 | 01-26-2007 05:17 PM |
| how to differentiate a file from a folder in a FIND? | denysQC | UNIX for Dummies Questions & Answers | 3 | 06-06-2006 03:02 PM |
| How to Differentiate Between Files and Folders? | dgower2 | UNIX for Dummies Questions & Answers | 6 | 04-28-2006 09:10 AM |
| Is it possible to ufsdump to a file instead of a tape device? | PSC | UNIX for Dummies Questions & Answers | 8 | 07-21-2004 10:08 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
differentiate between a file and a device
sorry probably a beginner question but i was just wondering how unix does this as device are treated as files?
|
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
As far as I know, they may be files, but they aren't *regular* files.
But in any case, do you want to understand the inner workings of the operating system just to satisfy your curiosity, or do you actually have a practical problem to which the understanding of this may come in handy? |
|
#3
|
|||
|
|||
|
well i have a operating systems module at uni and i noticed this question in an old exam paper and cant find an answer to it anywhere. i thought it might have something to do with the arguments that open the file/device maybe.
|
|
#4
|
|||
|
|||
|
The very first thing to understand is that these files are NOT the drivers for the devices. Drivers are in the kernel itself (/unix or /xenix or /stand/unix), and the files in /dev do not actually contain anything at all: they are just pointers to where the driver code can be found in the kernel. There is nothing more to it than that. These aren't programs, they aren't drivers, they are just pointers.
That also means that if the device file points at code that isn't in the kernel, it obviously is not going to work. Existence of a device file does not necessarily mean that the device code is in the kernel, and creating a device file (with mknod) does NOT create kernel code. |
|
#5
|
|||
|
|||
|
well i found a multiple choice question for this.
Which one of the following allows the Unix version 6 system to differentiate between a file and a device? a) the arguements to the system call that opens the file or device b) the mode bits within the inode indetified by the system call c) the directory entry for the file or device d) the pathname for the file or device any thoughts? |
|
#6
|
||||
|
||||
|
Version 6?!? That is a very old exam you have there. I'm guessing '85 or so.
The answer is b, the mode bits. For a complete explanation see: Unix File Permissions But in that link, I use the term "block special" and "character special" for what you are collectively calling "device file". |
|
#7
|
|||
|
|||
|
Well its basic OS stuff so i guess they just chose whatever they thought would be easiest to teach with, who knows!
|
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|