This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Fixed device names


On Sun, Sep 16, 2001 at 11:22:21AM +0200, Corinna Vinschen wrote:
> Hi,
> 
> for a long time I'm thinking about giving fixed device names
> to the devices which are handled by the fhandler_dev_raw and 
> subsequent classes.  I don't like the solution that these    
> devices have to have mount table entries and I would like to get
> rid of them.
> 
> The new device name mapping using fixed names could work as follows
> (note that it works on NT systems anyway):

I have implemented that stuff but I'm using a different approach.
I'm translating the POSIX device names straightforward into
NT device names as given in the internal namespace and then I
open them using the NTDLL.DLL system call NtOpenFile.  That way,
I can go without remapping into the Win32 namespace using that
crappy QueryDosDevice() function.

Currently I have used the following mappings.  I didn't want to
change too much stuff, so I used the already existing major device
numbers.  This restricts the number of accessible devices a bit
but I don't think that is too big a constraint.

POSIX name	Major	Minor	NT device name
----------      -----	-----	---------------------------------
/dev/fd0	FLOPPY     0	\device\floppy0
/dev/fd1	FLOPPY	   1	\device\floppy1
...

/dev/scd0	FLOPPY	  16	\device\cdrom0
/dev/scd1	FLOPPY	  17	\device\cdrom1
...
/dev/scd15	FLOPPY	  31	\device\cdrom15

/dev/sda	FLOPPY	  32	\device\harddisk0\partition0
				("partition0" means "whole disk")
/dev/sda1	FLOPPY	  33	\device\harddisk0\partition1
...
/dev/sda15	FLOPPY	  47	\device\harddisk0\partition15

/dev/sdb	FLOPPY	  48	\device\harddisk1\partition0
...

/dev/sdn	FLOPPY	 240	\device\harddisk13\partition0
...
/dev/sdn15	FLOPPY	 255	\device\harddisk13\partition15

So that scheme supports up to 16 floppies, 16 cdroms, 14 disks,
15 partitions per disk.

/dev/st0	TAPE	   0	\device\tape0
/dev/nst0	TAPE	 128	\device\tape0
/dev/st1	TAPE	   1	\device\tape1
/dev/nst1	TAPE	 129	\device\tape1
...

I have used that naming scheme since that reflects, erm, pretends
the naming when you're using only SCSI devices on a Linux box.

Of course we could change /dev/sd.. to /dev/hd.. as on an IDE
box but I don't like that naming scheme.  Using /dev/scdX for
the cdroms wouldn't be logical then since an Linux IDE system
uses the standard /dev/hd.. naming for cdroms, too.  But that
wouldn't result in a non-ambiguous name mapping POSIX<->NT
anymore.

However, if somebody wants to propose other POSIX device names,
go ahead.

I didn't check that in for now since that will not become
part of 1.3.4.  I will check it in right after the 1.3.4
release.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]