* ata.c and sata disks
@ 2008-05-03 17:35 Marco Vega Trucillo
2008-05-03 22:59 ` Pavel Roskin
0 siblings, 1 reply; 8+ messages in thread
From: Marco Vega Trucillo @ 2008-05-03 17:35 UTC (permalink / raw)
To: grub-devel
Hi to all,
I tried to modify ata.c simply add more ioaddress (I attach the diff file
from 1.96 version), and it work and recognize
my four sata disk on different pc. If I try to change sata port, the name
of device on grub change because it depend by index of ioaddress
in grub_ata_io_address array.
There is some reason because ata.c currently report thar support "only two
ide drives" ? the driver seems work well... I can read file for my
partition, and then boot linux and even windows with chainloader. (i.e.:
chailoader (ata4,1)+1 and boot)
and forgive me if I write something of stupid...
bye
Marco
--- ata.c 2008-05-03 19:30:37.000000000 +0200
+++ ata.c~ 2008-05-03 18:06:15.000000000 +0200
@@ -32,11 +32,9 @@
GRUB_ATA_LBA48
} grub_ata_addressing_t;
-
-/* try address of commons sata controller */
-static const int grub_ata_ioaddress[] = {0x1f0, 0x170
,0x9800,0x9000,0x8800,0x18f8,0x18f0};
-static const int grub_ata_ioaddress2[] = {0x3f6,
0x376,0x9402,0x8802,0x8402,0x18ce,0x18ca};
-
+/* At the moment, only two IDE ports are supported. */
+static const int grub_ata_ioaddress[] = { 0x1f0, 0x170 };
+static const int grub_ata_ioaddress2[] = { 0x3f6, 0x376 };
#define GRUB_CDROM_SECTOR_SIZE 2048
@@ -338,7 +336,7 @@
int port;
int device;
- for (port = 0; port <= 6; port++)
+ for (port = 0; port <= 1; port++)
{
for (device = 0; device <= 1; device++)
{
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ata.c and sata disks
2008-05-03 17:35 ata.c and sata disks Marco Vega Trucillo
@ 2008-05-03 22:59 ` Pavel Roskin
2008-05-06 15:05 ` Robert Millan
0 siblings, 1 reply; 8+ messages in thread
From: Pavel Roskin @ 2008-05-03 22:59 UTC (permalink / raw)
To: The development of GRUB 2
On Sat, 2008-05-03 at 19:35 +0200, Marco Vega Trucillo wrote:
> Hi to all,
>
> I tried to modify ata.c simply add more ioaddress (I attach the diff file
> from 1.96 version), and it work and recognize
> my four sata disk on different pc.
I think it's generally considered unsafe to probe addresses above 0x3ff
without making sure they belong to a compatible device. The device
should be found on the PCI bus, and enabled if necessary.
> -/* try address of commons sata controller */
> -static const int grub_ata_ioaddress[] = {0x1f0, 0x170
> ,0x9800,0x9000,0x8800,0x18f8,0x18f0};
Your patch is reversed. Also, it would be better to make a patch
against the current CVS version.
> - for (port = 0; port <= 6; port++)
> + for (port = 0; port <= 1; port++)
Using sizeof would be great here. Unless we switch to using a dynamic
list of interface.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ata.c and sata disks
2008-05-03 22:59 ` Pavel Roskin
@ 2008-05-06 15:05 ` Robert Millan
2008-05-06 19:57 ` Marco Vega Trucillo
0 siblings, 1 reply; 8+ messages in thread
From: Robert Millan @ 2008-05-06 15:05 UTC (permalink / raw)
To: The development of GRUB 2
On Sat, May 03, 2008 at 06:59:54PM -0400, Pavel Roskin wrote:
> On Sat, 2008-05-03 at 19:35 +0200, Marco Vega Trucillo wrote:
> > Hi to all,
> >
> > I tried to modify ata.c simply add more ioaddress (I attach the diff file
> > from 1.96 version), and it work and recognize
> > my four sata disk on different pc.
>
> I think it's generally considered unsafe to probe addresses above 0x3ff
> without making sure they belong to a compatible device. The device
> should be found on the PCI bus, and enabled if necessary.
Marco Gerards sent a patch to add PCI support to ata.c, but it had some
bugs that nobody has looked into yet.
Marco (Vega), if you want to help us, you could look at his patch (it's in
the list archives) and see what needs to be done with it?
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ata.c and sata disks
2008-05-06 15:05 ` Robert Millan
@ 2008-05-06 19:57 ` Marco Vega Trucillo
2008-05-06 20:38 ` PCI+ATA Marco Vega Trucillo
2008-05-06 21:00 ` ata.c and sata disks Marco Vega Trucillo
0 siblings, 2 replies; 8+ messages in thread
From: Marco Vega Trucillo @ 2008-05-06 19:57 UTC (permalink / raw)
To: The development of GRUB 2
On Tue, 6 May 2008 17:05:53 +0200, Robert Millan <rmh@aybabtu.com> wrote:
> Marco Gerards sent a patch to add PCI support to ata.c, but it had some
bugs that nobody has looked into yet.
Just few hors ago I've made a patch that probes pci bus for ide/ada devices
(I've calles the iterate function in pci.h/pci.c) and it seems work well...
I will take a look to Marco Gerards's patch. :) Marco
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PCI+ATA
2008-05-06 19:57 ` Marco Vega Trucillo
@ 2008-05-06 20:38 ` Marco Vega Trucillo
2008-05-06 21:00 ` ata.c and sata disks Marco Vega Trucillo
1 sibling, 0 replies; 8+ messages in thread
From: Marco Vega Trucillo @ 2008-05-06 20:38 UTC (permalink / raw)
To: The development of GRUB 2
I've realised a similar patch there are some difference:
Marco Gerards check if this class and subclass ID matches that of a PCI
IDE Controller.
I instead check only class so I recognize even my sata disk that have the
same class of PCI IDE Controller but different subclass (for example 0x04
and 0x00).
Marco Gerards try to indentify devices only on address of 0x10 and 0x14
registers (BAR0 and BAR1)... I scan even 0x18 and 0x1c registers (BAR2 and
BAR3).
The remaining code is very similar.
I read that someone had problems of hangs: neither I nor Gerars changed
the access code to the device but only recognition. For now about my two
hardware I did not have hangs (on both I have 3 drive, two in fake-raid and
one single, and I recognize and access all of three).
forgive me again for my bad english.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ata.c and sata disks
2008-05-06 19:57 ` Marco Vega Trucillo
2008-05-06 20:38 ` PCI+ATA Marco Vega Trucillo
@ 2008-05-06 21:00 ` Marco Vega Trucillo
2008-05-07 9:00 ` Marco Gerards
2008-08-05 10:09 ` Marco Gerards
1 sibling, 2 replies; 8+ messages in thread
From: Marco Vega Trucillo @ 2008-05-06 21:00 UTC (permalink / raw)
To: The development of GRUB 2
On Tue, 06 May 2008 21:57:37 +0200, Marco "Vega" Trucillo
<vega+grub@gbnetc.it> wrote:
> On Tue, 6 May 2008 17:05:53 +0200, Robert Millan <rmh@aybabtu.com> wrote:
>
>> Marco Gerards sent a patch to add PCI support to ata.c, but it had some
> bugs that nobody has looked into yet.
>
I looked on Gerard's code and seems that if there is bug is it on original
code of ata.c not in patch. However I've not tried yet Gerard's pach
beacuse I can't now, I only looked his code and
compared with my. My code is still very disorganised
(http://62.123.21.220/ata.c). I think that
tomorrow I'll try to modify Gerard's code that is written well.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ata.c and sata disks
2008-05-06 21:00 ` ata.c and sata disks Marco Vega Trucillo
@ 2008-05-07 9:00 ` Marco Gerards
2008-08-05 10:09 ` Marco Gerards
1 sibling, 0 replies; 8+ messages in thread
From: Marco Gerards @ 2008-05-07 9:00 UTC (permalink / raw)
To: The development of GRUB 2
Marco "Vega" Trucillo <vega+grub@gbnetc.it> writes:
> On Tue, 06 May 2008 21:57:37 +0200, Marco "Vega" Trucillo
> <vega+grub@gbnetc.it> wrote:
>> On Tue, 6 May 2008 17:05:53 +0200, Robert Millan <rmh@aybabtu.com> wrote:
>>
>>> Marco Gerards sent a patch to add PCI support to ata.c, but it had some
>> bugs that nobody has looked into yet.
>>
>
> I looked on Gerard's code and seems that if there is bug is it on original
> code of ata.c not in patch. However I've not tried yet Gerard's pach
> beacuse I can't now, I only looked his code and
> compared with my. My code is still very disorganised
> (http://62.123.21.220/ata.c). I think that
> tomorrow I'll try to modify Gerard's code that is written well.
How about this:
First I commit my patch. This might break some things, but OTOH,
people can work on this. In the current state, it would be better to
break ATA to make it right than leaving it as it currently is.
Any objections to this?
--
Marco
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ata.c and sata disks
2008-05-06 21:00 ` ata.c and sata disks Marco Vega Trucillo
2008-05-07 9:00 ` Marco Gerards
@ 2008-08-05 10:09 ` Marco Gerards
1 sibling, 0 replies; 8+ messages in thread
From: Marco Gerards @ 2008-08-05 10:09 UTC (permalink / raw)
To: The development of GRUB 2; +Cc: vega+grub
Hi Marco,
Marco "Vega" Trucillo <vega+grub@gbnetc.it> writes:
> On Tue, 06 May 2008 21:57:37 +0200, Marco "Vega" Trucillo
> <vega+grub@gbnetc.it> wrote:
>> On Tue, 6 May 2008 17:05:53 +0200, Robert Millan <rmh@aybabtu.com> wrote:
>>
>>> Marco Gerards sent a patch to add PCI support to ata.c, but it had some
>> bugs that nobody has looked into yet.
>
> I looked on Gerard's code and seems that if there is bug is it on original
> code of ata.c not in patch. However I've not tried yet Gerard's pach
> beacuse I can't now, I only looked his code and
> compared with my. My code is still very disorganised
> (http://62.123.21.220/ata.c). I think that
> tomorrow I'll try to modify Gerard's code that is written well.
Did you find the time to have a look? :-)
I just committed my PCI+ATA code, so people can actually to continue
to work on this.
Thanks,
Marco
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-08-05 10:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-03 17:35 ata.c and sata disks Marco Vega Trucillo
2008-05-03 22:59 ` Pavel Roskin
2008-05-06 15:05 ` Robert Millan
2008-05-06 19:57 ` Marco Vega Trucillo
2008-05-06 20:38 ` PCI+ATA Marco Vega Trucillo
2008-05-06 21:00 ` ata.c and sata disks Marco Vega Trucillo
2008-05-07 9:00 ` Marco Gerards
2008-08-05 10:09 ` Marco Gerards
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.