delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/09/24/08:38:36

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Date: Mon, 24 Sep 2001 14:38:26 +0200
From: Corinna Vinschen <vinschen AT redhat DOT com>
To: cygdev <cygwin-developers AT cygwin DOT com>
Subject: Re: Fixed device names
Message-ID: <20010924143826.R17037@cygbert.vinschen.de>
Reply-To: cygdev <cygwin-developers AT cygwin DOT com>
Mail-Followup-To: cygdev <cygwin-developers AT cygwin DOT com>
References: <20010916112221 DOT B15312 AT cygbert DOT vinschen DOT de>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <20010916112221.B15312@cygbert.vinschen.de>; from vinschen@redhat.com on Sun, Sep 16, 2001 at 11:22:21AM +0200

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 AT cygwin DOT com
Red Hat, Inc.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019