Skip to contentSkip to conversation

More than 10 IDE interfaces

DISCUSSION Baldur Norddahl 4 participants 7 messages Apr 11, 2002 – Apr 17, 2002

lore
Share & tools
lore
#0 lore raw

Hi,

I have a machine with the following configuration:

2 on board IDE interfaces (AMD chipset)
2 Promise Technology UltraDMA100 controllers with each 2 IDE interfaces. 4 Promise Technology UltraDMA133 controllers with each 2 IDE interfaces.

This adds up to 14 IDE interfaces. And I just discovered that the kernel only supports 10 IDE interfaces :-(

So I tried to hack the kernel, and I was partially successfull. I changed MAX_HWIF from 10 to 14. I made up some major numbers for the extra interfaces (115, 116, 117 and 118).

drivers/ide/ide.c and fs/partitions/check.c were modified to know about IDE10_MAJOR to IDE13_MAJOR.

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 :-)

But when it tries to detect the partitions on the extra interfaces, it locks up. The last lines it writes is:

Partition check:
hda: hda1
hde: hde1
hdg: hdg1
hdi: hdi1
hdk: hdk1
hdm: hdm1
hdo: hdo1
hdq: hdq1
hds: hds1
hdu:

I am looking for any clues about how to do this.

Some information about the system:

Linux kernel 2.4.18 with ide.2.4.18-rc1.02152002.patch IDE patches applied. Dual Athlon MP 1800+ 1.53 GHz. Tyan Tiger MPX motherboard, AMD 760 MPX chipset. 8 x 80 GB western digital disks in a raid5, 4 x 160 GB maxtor in a raid5, the two raids are merged with LVM into one filesystem with reiserfs.

Thanks,
Baldur

#1 lore raw
Quoted 8 lines · Baldur Norddahl

Hi,

I have a machine with the following configuration:

2 on board IDE interfaces (AMD chipset)
2 Promise Technology UltraDMA100 controllers with each 2 IDE interfaces. 4 Promise Technology UltraDMA133 controllers with each 2 IDE interfaces.

Quoted 5 lines

This adds up to 14 IDE interfaces. And I just discovered that the kernel only supports 10 IDE interfaces :-(

So I tried to hack the kernel, and I was partially successfull. I changed MAX_HWIF from 10 to 14. I made up some major numbers for the extra

In your case if should be changed to 15 there is an off by one error here in the interpretation of this constant.

Quoted 8 lines

interfaces (115, 116, 117 and 118).

drivers/ide/ide.c and fs/partitions/check.c were modified to know about IDE10_MAJOR to IDE13_MAJOR.

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.c

Quoted 4 lines

But when it tries to detect the partitions on the extra interfaces, it locks up. The last lines it writes is:

Quoted 11 lines

Partition check:
hda: hda1
hde: hde1
hdg: hdg1
hdi: hdi1
hdk: hdk1
hdm: hdm1
hdo: hdo1
hdq: hdq1
hds: hds1
hdu:

See above + make MAX_HWIFS 15 and you should have more luck. (Not tested actually).

#2 lore raw
Quoted 9 lines · Martin Dalecki
Quoted 8 lines · Baldur Norddahl

Hi,

I have a machine with the following configuration:

2 on board IDE interfaces (AMD chipset)
2 Promise Technology UltraDMA100 controllers with each 2 IDE interfaces. 4 Promise Technology UltraDMA133 controllers with each 2 IDE interfaces.

Quoted 8 lines
Quoted 5 lines

This adds up to 14 IDE interfaces. And I just discovered that the kernel only supports 10 IDE interfaces :-(

So I tried to hack the kernel, and I was partially successfull. I changed MAX_HWIF from 10 to 14. I made up some major numbers for the extra

In your case if should be changed to 15 there is an off by one error here in the interpretation of this constant.

??? If the current value is 10, and supports 10 interfaces, and I
believe that is the case, why should he need a value of 15 to get 14? Doesn't the off by one error happen on smaller values, or what?

I am NOT disagreeing with you, I just don't see how to code an off by
one and have it work some of the time and not others.

Quoted 5 lines
Quoted 5 lines

interfaces (115, 116, 117 and 118).

drivers/ide/ide.c and fs/partitions/check.c were modified to know about IDE10_MAJOR to IDE13_MAJOR.

Quoted 7 lines
Quoted 3 lines

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.c

I thought devfs was supposed to eliminate all this stuff and replace
names with long hierarchical names. In hindsight it probably would have been better to call drives something like hdNNX, where NN is the interface and X is m or s. Hum, I wonder how hard that would be as a retrofit?

Quoted 15 lines
Quoted 14 lines

But when it tries to detect the partitions on the extra interfaces, it locks up. The last lines it writes is:

Partition check:
hda: hda1
hde: hde1
hdg: hdg1
hdi: hdi1
hdk: hdk1
hdm: hdm1
hdo: hdo1
hdq: hdq1
hds: hds1
hdu:

Quoted 2 lines

See above + make MAX_HWIFS 15 and you should have more luck. (Not tested actually).

Right. I would be interested in this one myself, but I don't have a good
way of getting that many drives attached. I have a pile of old Promise ATA33 cards, and I could come up with a hundred 400-500MB drives, but the case and cabling is a serious issue.

Anyway, if you have a moment to hint why an off by one error is not
biting us on ten drives I'd be interested.

Signature · 3 lines
bill davidsen <[email protected]>
  CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.
#3 lore raw
Quoted 16 lines · Bill Davidsen
Quoted 13 lines · Martin Dalecki
Quoted 11 lines · Baldur Norddahl

Hi,

I have a machine with the following configuration:

2 on board IDE interfaces (AMD chipset)
2 Promise Technology UltraDMA100 controllers with each 2 IDE interfaces. 4 Promise Technology UltraDMA133 controllers with each 2 IDE interfaces.

This adds up to 14 IDE interfaces. And I just discovered that the kernel only supports 10 IDE interfaces :-(

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

So I tried to hack the kernel, and I was partially successfull. I changed MAX_HWIF from 10 to 14. I made up some major numbers for the extra

In your case if should be changed to 15 there is an off by one error here in the interpretation of this constant.

Anyway, if you have a moment to hint why an off by one error is not
biting us on ten drives I'd be interested.

I think simply (not tested) that MAX_HWIF provides only 9 possible interfaces right now.

#4 lore raw
In reply to Bill Davidsen
Quoted 23 lines · Bill Davidsen
Quoted 10 lines · Martin Dalecki
Quoted 8 lines · Baldur Norddahl

Hi,

I have a machine with the following configuration:

2 on board IDE interfaces (AMD chipset)
2 Promise Technology UltraDMA100 controllers with each 2 IDE interfaces. 4 Promise Technology UltraDMA133 controllers with each 2 IDE interfaces.

Quoted 8 lines
Quoted 5 lines

This adds up to 14 IDE interfaces. And I just discovered that the kernel only supports 10 IDE interfaces :-(

So I tried to hack the kernel, and I was partially successfull. I changed MAX_HWIF from 10 to 14. I made up some major numbers for the extra

In your case if should be changed to 15 there is an off by one error here in the interpretation of this constant.

Quoted 6 lines

??? If the current value is 10, and supports 10 interfaces, and I
believe that is the case, why should he need a value of 15 to get 14? Doesn't the off by one error happen on smaller values, or what?

I am NOT disagreeing with you, I just don't see how to code an off by
one and have it work some of the time and not others.

You can have luck due to alignment issues.

#5 lore raw
In reply to Baldur Norddahl

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!)

Quoted 9 lines · Martin Dalecki
Quoted 3 lines · Baldur Norddahl

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"

Signature · 4 lines
Stephen Samuel +1(604)876-0426                [email protected]
		   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.
#6 lore raw
In reply to Baldur Norddahl
Quoted 17 lines · Stephen Samuel

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)

Quoted 3 lines

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!)

Hmm this propasal is not without reaons but the main obstacle is currently just the option parsing code in ide. At some point in time I just intend to rewrite it and to support namings along the way of /dev/hdXX, where XX are simply digits. The old names will be preserved as "backwards compatibility".

OK?
If you wish you could of course look in to this yourself, since it's not *that* difficult. I would be really glad if someone did this.