Hi,

Is there a way to determine if my disk will be recognized as hda or sda using only the kernel ?

I know that there are generic rules such as : IDE disk -> hda
but there are exceptions it seems, for 2 different distributions can map the same disk either in hda or in sda.

For my problem, I used to start a RAM disk containing the linux kernel and a small app that tried to open the disk like this :
Code:
int  devices[]={ 0x300, 0x340, 0x1600, 0x1640 };
...
mknod("/mydev",S_IFBLK,devices[i])<0);
fd=open("/mydev",O_RDWR);
But from version 2.6, the disk drivers are in a module and not contained in the kernel anymore.
I think that the only remaining way to proceed is to use the same logic used by the kernel to identify my disk, but I don't know where to look for this information.

Can anyone help ?

Thank you very much