From: Stephen Samuel <samuel@bcgreen.com>
To: Martin Dalecki <dalecki@evision-ventures.com>,
linux-kernel@vger.kernel.org
Subject: Re: More than 10 IDE interfaces
Date: Tue, 16 Apr 2002 04:48:49 -0700 [thread overview]
Message-ID: <3CBC0FA1.8070907@bcgreen.com> (raw)
In-Reply-To: <20020411040845.GE14801@dark.x.dtu.dk> <3CB53D70.5070100@evision-ventures.com>
It might be trowing bad money after good to do it, but why
not just put together a simple translation table.
rather than
drivenum=(driveletter - 'a')
and
driveletter=(drivenum+'a')
have translation tables, so that
drivenum= chartodrivenum[driveletter]
and
driveletter= drivenumtoletter[drivenum]
If you're willing to map (almost) all of the printable
characters, you could get 46 controllers and 92 drives
(I'd refuse to map ', ", \ or space)
You'd still be limited to one character, but it would, at least
make it easy to have 26 controllers and 52 drives (and that's
just using upper and lower case characters!)
Martin Dalecki wrote:
> Baldur Norddahl wrote:
>> With there changes the kernel detects the extra interfaces and the
>> disks on
>> them. They get some strange names like IDE< and the last disk is named
>> hd{,
>> but I guess I can live with that :-)
>
>
> The cause of those funny names is well known in the 2.5.xx series.
> The solution to it will first involve a complete rewrite of the kernel
> parameter parsing in ide.
Geh... Here's even a perl script to generate the mapping..
Change the characters if you wish.
#!/bin/perl -w
# Copyright (c) 2002 Stephen Samuel
# Can be re-licensed under either GPL or LGPL
#
my (%drivenum, %idenum);
my (@drivenames, @idenames);
@drivenames= qw' a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F
G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 ';
@idenames= qw' 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U ' ;
$drivenames=scalar(@drivenames);
$idenames=scalar(@idenames);
print <<EOF1
/*
defines the ide drive and controller mappings
*/
#define MAX_IDE_DEFINABLE $idenames
#define MAX_IDE_DRIVES_DEFINABLE $drivenames
EOF1
;
print "\n signed char drivenumtochar[$drivenames] ={";
$drivecount=0;
foreach $drive ( @drivenames ){
printf "%s%s\t'%s'",
$drivecount?",":"",
($drivecount & 7) ?"":"\n/*$drivecount*/" ,
$drive;
$drivenum{$drive} = $drivecount++;
};
print "};\n\n";
print "signed char idenumtochar[$idenames] ={";
$idecount=0;
foreach $ide ( @idenames ){
printf "%s%s\t'%s'",
$idecount?",":"",
($idecount & 7) ?"":"\n/*$idecount*/" ,
$ide;
$idenum{$ide} = $idecount++;
};
print "};\n\n";
$idecount=0;
foreach $ide ( @idenames ){
$idenum{$ide} = $idecount++;
};
print "\n/* can't be 128 because of EBCDIC */\nsigned char chartodrivenum[256] ={";
for ($char=0; $char<256; $char++){
printf "%s%s\t%s",
$char?",":"",
($char & 7) ?"":"\n/*$char*/" ,
defined($drivenum{chr($char)})?$drivenum{chr($char)}:-1;
};
print "}; \n\n";
print " signed char chartoidenum[256] ={";
for ($char=0; $char<256; $char++){
printf "%s%s\t%s",
$char?",":"",
($char & 7) ?"":"\n/*$char*/" ,
defined($idenum{chr($char)})?$idenum{chr($char)}:-1;
}
print "}; \n\n"
--
Stephen Samuel +1(604)876-0426 samuel@bcgreen.com
http://www.bcgreen.com/~samuel/
Powerful committed communication, reaching through fear, uncertainty and
doubt to touch the jewel within each person and bring it to life.
next prev parent reply other threads:[~2002-04-16 11:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-11 4:08 More than 10 IDE interfaces Baldur Norddahl
2002-04-11 7:38 ` Martin Dalecki
2002-04-11 13:09 ` Bill Davidsen
2002-04-11 12:22 ` Martin Dalecki
2002-04-12 13:39 ` Martin Dalecki
2002-04-16 11:48 ` Stephen Samuel [this message]
2002-04-17 10:21 ` Martin Dalecki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3CBC0FA1.8070907@bcgreen.com \
--to=samuel@bcgreen.com \
--cc=dalecki@evision-ventures.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox