From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Qc79n-0005Wx-SW for mharc-grub-devel@gnu.org; Wed, 29 Jun 2011 22:39:08 -0400 Received: from eggs.gnu.org ([140.186.70.92]:56711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qc79f-0005Wl-OZ for grub-devel@gnu.org; Wed, 29 Jun 2011 22:39:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qc79b-0005Uy-Js for grub-devel@gnu.org; Wed, 29 Jun 2011 22:38:59 -0400 Received: from m50-132.163.com ([123.125.50.132]:55092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qc79Z-0005SV-C6 for grub-devel@gnu.org; Wed, 29 Jun 2011 22:38:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Received:Message-ID:Date:From:User-Agent: MIME-Version:To:Subject:References:In-Reply-To:Content-Type; bh=3ZSPgTRMvyxOmoempfPFlreWzA2j/HAtemYpGTmt/hw=; b=kBcKjOj8YF+/z VHysV072SjuZtAez8FYaY6Ae7kC/bRbKetpXPuh9j8crO2BrDNqOjdGksOmXKs6S O/syYcTC0e/UTWU1IaTdUhzXwybaV1oNEfI83Z0e5goI5jgQa66d88UJvvoatjfs OUkbsuCsDUNOUoOijy39zfwRp2yKcE= Received: from [10.2.8.35] (unknown [152.104.150.33]) by smtp2 (Coremail) with SMTP id DNGowKDrqZGm4QtOx+OZAA--.10006S2; Thu, 30 Jun 2011 10:38:31 +0800 (CST) Message-ID: <4E0BE1A5.6060009@163.com> Date: Thu, 30 Jun 2011 10:38:29 +0800 From: Cui Lei User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20110627 Thunderbird/5.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: Grub2 can not detect usb disk References: <4E030EF9.4060907@163.com> <4E034071.9040205@gmail.com> <4E03FD0C.2060400@163.com> <4E084A56.1030908@163.com> <4E084D04.4040001@gmail.com> <4E0855C6.8060704@viatech.com.cn> <4E085945.3010408@gmail.com> <4E092C1B.70906@viatech.com.cn> <4E095F02.9050504@gmail.com> <4E0994B7.4080408@viatech.com.cn> <4E099895.4060808@gmail.com> <4E09A6C7.5090205@163.com> <4E09B613.1020904@gmail.com> In-Reply-To: <4E09B613.1020904@gmail.com> Content-Type: multipart/alternative; boundary="------------030105000707040709090601" X-CM-TRANSID: DNGowKDrqZGm4QtOx+OZAA--.10006S2 X-Coremail-Antispam: 1Uf129KBjvJXoW3GFWUXw4UuF1rZF4fWw45ZFb_yoWxXr17pF 1DJFn2gw4kXr10yw1vyF1v9rWjyr4xtF1UJr1Fkr1ktFy5Zw47Jr1IgFyFg3Z8Jr4ft3W5 XF18Ga15WrWDJaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j20PfUUUUU= X-CM-SenderInfo: pqhyv25iruwvdwbsiiqs6rljoofrz/1tbiORxuNkjh7vi3fQAAsI X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 123.125.50.132 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2011 02:39:05 -0000 This is a multi-part message in MIME format. --------------030105000707040709090601 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I have found the the last version which can boot my machine, it is the r2348. The r2349 can not boot it. So I checked out the changelog from 2348 to 2349 : /*************************************************************************************************************/ === modified file 'ChangeLog' --- ChangeLog 2010-05-01 12:06:53 +0000 +++ ChangeLog 2010-05-01 12:32:48 +0000 @@ -1,5 +1,20 @@ 2010-05-01 Vladimir Serbinenko + Use LBIO on coreboot. + + * conf/i386-coreboot.rmk (kernel_img_SOURCES): Change + kern/i386/multiboot_mmap.c to kern/i386/coreboot/mmap.c. + * include/grub/i386/coreboot/memory.h (GRUB_LINUXBIOS_MEMBER_LINK): + New declaration. + * kern/i386/coreboot/init.c (grub_machine_init): Don't call + grub_machine_mmap_init on coreboot. + * kern/i386/coreboot/mmap.c (grub_linuxbios_table_iterate): Handle + GRUB_LINUXBIOS_MEMBER_LINK. + (grub_machine_mmap_iterate): Fix declaration. + * kern/i386/coreboot/startup.S: Don't save mbi location on coreboot. + +2010-05-01 Vladimir Serbinenko + Split coreboot and multiboot ports. * conf/i386-multiboot.rmk: New file. === modified file 'conf/i386-coreboot.rmk' --- conf/i386-coreboot.rmk 2010-04-10 23:14:31 +0000 +++ conf/i386-coreboot.rmk 2010-05-01 12:32:48 +0000 @@ -10,7 +10,7 @@ kernel_img_SOURCES = kern/i386/coreboot/startup.S \ kern/i386/misc.S \ kern/i386/coreboot/init.c \ - kern/i386/multiboot_mmap.c \ + kern/i386/coreboot/mmap.c \ kern/i386/halt.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ === modified file 'include/grub/i386/coreboot/memory.h' --- include/grub/i386/coreboot/memory.h 2008-11-20 20:30:24 +0000 +++ include/grub/i386/coreboot/memory.h 2010-05-01 12:32:48 +0000 @@ -44,8 +44,9 @@ struct grub_linuxbios_table_item { -#define GRUB_LINUXBIOS_MEMBER_UNUSED 0 -#define GRUB_LINUXBIOS_MEMBER_MEMORY 1 +#define GRUB_LINUXBIOS_MEMBER_UNUSED 0x00 +#define GRUB_LINUXBIOS_MEMBER_MEMORY 0x01 +#define GRUB_LINUXBIOS_MEMBER_LINK 0x11 grub_uint32_t tag; grub_uint32_t size; }; === modified file 'kern/i386/coreboot/init.c' --- kern/i386/coreboot/init.c 2010-02-06 23:52:31 +0000 +++ kern/i386/coreboot/init.c 2010-05-01 12:32:48 +0000 @@ -117,7 +117,9 @@ return 0; } +#ifdef GRUB_MACHINE_MULTIBOOT grub_machine_mmap_init (); +#endif grub_machine_mmap_iterate (heap_init); grub_tsc_init (); === modified file 'kern/i386/coreboot/mmap.c' --- kern/i386/coreboot/mmap.c 2008-08-17 16:32:18 +0000 +++ kern/i386/coreboot/mmap.c 2010-05-01 12:32:48 +0000 @@ -57,13 +57,23 @@ (long) table_header->size); for (; table_item->size; table_item = (grub_linuxbios_table_item_t) ((long) table_item + (long) table_item->size)) - if (hook (table_item)) - return 1; + { + if (table_item->tag == GRUB_LINUXBIOS_MEMBER_LINK + && check_signature ((grub_linuxbios_table_header_t) (grub_addr_t) + *(grub_uint64_t *) (table_item + 1))) + { + table_header = (grub_linuxbios_table_header_t) (grub_addr_t) + *(grub_uint64_t *) (table_item + 1); + goto signature_found; + } + if (hook (table_item)) + return 1; + } return 0; } -void +grub_err_t grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)) { mem_region_t mem_region; === modified file 'kern/i386/coreboot/startup.S' --- kern/i386/coreboot/startup.S 2009-12-24 14:09:06 +0000 +++ kern/i386/coreboot/startup.S 2010-05-01 12:32:48 +0000 @@ -66,10 +66,12 @@ .long -0x1BADB002 - MULTIBOOT_MEMORY_INFO codestart: +#ifdef GRUB_MACHINE_MULTIBOOT cmpl $MULTIBOOT_BOOTLOADER_MAGIC, %eax jne 0f movl %ebx, EXT_C(startup_multiboot_info) 0: +#endif /* initialize the stack */ movl $GRUB_MEMORY_MACHINE_PROT_STACK, %esp /***********************************************************************************************************************/ I guess it may be because the file "kern/i386/coreboot/mmap.c", but it has too much diffs with the multiboot_mmap.c and I am not familiar with the mmap at all, so I don't know how to found out the causes. Rock. > On 28.06.2011 12:02, Cui Lei wrote: >> Sorry , I don't know what the meaning of the "bisect" and how to do? >> Could you tell me some message in detail ? > You take a revision which doesn't work (1.99rc2 = r3229) and a working > one (1.98 = r2249). Then you try a revision in the middle, e.g. r2749. > If it works the error is in the range 2749..3229, otherwise in > 2249..2749, then you try a revision inside this range and in 10 steps > you'll have the exact revision which causes your problem. >> Thanks a lot. >> >> BRs, >> >> Rock. >> >>> On 28.06.2011 10:45, Rock Cui wrote: >>>> I had tried to use the grub1.99rc2 as a payload of coreboot at the >>>> beginning, but it can not boot my machine, >>> Could you try to bisect? Recent bzr worked fine in qemu+coreboot. Your >>> machine may present some special aspect and bisect is probably the >>> fastest way in your case. >>>> so I changed to 1.98 >>> As I said USB support in 1.98 wasn't good enough. Basically it worked >>> only in qemu. >>>> , then booting succeed. I want to insmod the uhci.mod and usbms.mod to >>>> support USB, >>>> but they are not exit in my build folder. If I run "configure" with >>>> "--with-platform=pc", they will be there, but >>>> with "--with-platform=coreboot", I can not found them. I don't know >>>> what should I do to get them for i386-coreboot, so I use the two >>>> modules which were built with "--with-platform=pc" in my payload.elf. >>> USB modules weren't enabled in 1.98 on coreboot. >>>> Surprising, they can be insmoded and run in the grub-shell , but >>>> unfortunately, I got those logs, they can not >>>> work. >>> it's already surprising they didn't crash GRUB altogether. >>> >>> >>> >>> _______________________________________________ >>> Grub-devel mailing list >>> Grub-devel@gnu.org >>> https://lists.gnu.org/mailman/listinfo/grub-devel >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel --------------030105000707040709090601 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I have found the the last version which can boot my machine,  it is the r2348. The r2349 can not boot it.
So I checked out the changelog from 2348 to 2349 :

/*************************************************************************************************************/
=== modified file 'ChangeLog'
--- ChangeLog    2010-05-01 12:06:53 +0000
+++ ChangeLog    2010-05-01 12:32:48 +0000
@@ -1,5 +1,20 @@
 2010-05-01  Vladimir Serbinenko  <phcoder@gmail.com>
 
+    Use LBIO on coreboot.
+
+    * conf/i386-coreboot.rmk (kernel_img_SOURCES): Change
+    kern/i386/multiboot_mmap.c to kern/i386/coreboot/mmap.c.
+    * include/grub/i386/coreboot/memory.h (GRUB_LINUXBIOS_MEMBER_LINK):
+    New declaration.
+    * kern/i386/coreboot/init.c (grub_machine_init): Don't call
+    grub_machine_mmap_init on coreboot.
+    * kern/i386/coreboot/mmap.c (grub_linuxbios_table_iterate): Handle
+    GRUB_LINUXBIOS_MEMBER_LINK.
+    (grub_machine_mmap_iterate): Fix declaration.
+    * kern/i386/coreboot/startup.S: Don't save mbi location on coreboot.
+
+2010-05-01  Vladimir Serbinenko  <phcoder@gmail.com>
+
     Split coreboot and multiboot ports.
 
     * conf/i386-multiboot.rmk: New file.

=== modified file 'conf/i386-coreboot.rmk'
--- conf/i386-coreboot.rmk    2010-04-10 23:14:31 +0000
+++ conf/i386-coreboot.rmk    2010-05-01 12:32:48 +0000
@@ -10,7 +10,7 @@
 kernel_img_SOURCES = kern/i386/coreboot/startup.S \
     kern/i386/misc.S \
     kern/i386/coreboot/init.c \
-    kern/i386/multiboot_mmap.c \
+       kern/i386/coreboot/mmap.c \
     kern/i386/halt.c \
     kern/main.c kern/device.c \
     kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \

=== modified file 'include/grub/i386/coreboot/memory.h'
--- include/grub/i386/coreboot/memory.h    2008-11-20 20:30:24 +0000
+++ include/grub/i386/coreboot/memory.h    2010-05-01 12:32:48 +0000
@@ -44,8 +44,9 @@
 
 struct grub_linuxbios_table_item
 {
-#define GRUB_LINUXBIOS_MEMBER_UNUSED        0
-#define GRUB_LINUXBIOS_MEMBER_MEMORY        1
+#define GRUB_LINUXBIOS_MEMBER_UNUSED        0x00
+#define GRUB_LINUXBIOS_MEMBER_MEMORY        0x01
+#define GRUB_LINUXBIOS_MEMBER_LINK              0x11
   grub_uint32_t tag;
   grub_uint32_t size;
 };

=== modified file 'kern/i386/coreboot/init.c'
--- kern/i386/coreboot/init.c    2010-02-06 23:52:31 +0000
+++ kern/i386/coreboot/init.c    2010-05-01 12:32:48 +0000
@@ -117,7 +117,9 @@
     return 0;
   }
 
+#ifdef GRUB_MACHINE_MULTIBOOT
   grub_machine_mmap_init ();
+#endif
   grub_machine_mmap_iterate (heap_init);
 
   grub_tsc_init ();

=== modified file 'kern/i386/coreboot/mmap.c'
--- kern/i386/coreboot/mmap.c    2008-08-17 16:32:18 +0000
+++ kern/i386/coreboot/mmap.c    2010-05-01 12:32:48 +0000
@@ -57,13 +57,23 @@
                    (long) table_header->size);
   for (; table_item->size;
        table_item = (grub_linuxbios_table_item_t) ((long) table_item + (long) table_item->size))
-    if (hook (table_item))
-      return 1;
+    {
+      if (table_item->tag == GRUB_LINUXBIOS_MEMBER_LINK
+         && check_signature ((grub_linuxbios_table_header_t) (grub_addr_t)
+                             *(grub_uint64_t *) (table_item + 1)))
+       {
+         table_header = (grub_linuxbios_table_header_t) (grub_addr_t)
+           *(grub_uint64_t *) (table_item + 1);
+         goto signature_found;  
+       }
+      if (hook (table_item))
+       return 1;
+    }
 
   return 0;
 }
 
-void
+grub_err_t
 grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t))
 {
   mem_region_t mem_region;

=== modified file 'kern/i386/coreboot/startup.S'
--- kern/i386/coreboot/startup.S    2009-12-24 14:09:06 +0000
+++ kern/i386/coreboot/startup.S    2010-05-01 12:32:48 +0000
@@ -66,10 +66,12 @@
     .long    -0x1BADB002 - MULTIBOOT_MEMORY_INFO
 
 codestart:
+#ifdef GRUB_MACHINE_MULTIBOOT
     cmpl    $MULTIBOOT_BOOTLOADER_MAGIC, %eax
     jne 0f
     movl    %ebx, EXT_C(startup_multiboot_info)
 0:
+#endif
 
     /* initialize the stack */
     movl $GRUB_MEMORY_MACHINE_PROT_STACK, %esp

/***********************************************************************************************************************/

I guess it may be because the file "kern/i386/coreboot/mmap.c", but it has too much diffs with the multiboot_mmap.c
and I am not familiar with the mmap at all, so I don't know how to found out the causes.

Rock.

 On 28.06.2011 12:02, Cui Lei wrote:
Sorry , I don't know what the meaning of the "bisect" and how to do?
Could you tell me some message in detail ?
You take a revision which doesn't work (1.99rc2 = r3229)  and a working
one (1.98 = r2249). Then you try a revision in the middle, e.g. r2749.
If it works the error is in the range 2749..3229, otherwise in
2249..2749, then you try a revision inside this range and in 10 steps
you'll have the exact revision which causes your problem.
Thanks a lot.

BRs,

Rock.

On 28.06.2011 10:45, Rock Cui wrote:
I had tried to use the grub1.99rc2 as a payload of coreboot at the
beginning, but it can not boot my machine,
Could you try to bisect? Recent bzr worked fine in qemu+coreboot. Your
machine may present some special aspect and bisect is probably the
fastest way in your case.
so I changed to 1.98
As I said USB support in 1.98 wasn't good enough. Basically it worked
only in qemu.
, then booting succeed. I want to insmod the uhci.mod and usbms.mod to
support USB,
but they are not exit in my build folder. If I run "configure" with
"--with-platform=pc", they will be there, but
with "--with-platform=coreboot", I can not found them. I don't know
what should I do to get them for i386-coreboot, so I use the two
modules which were built with "--with-platform=pc" in my payload.elf.
USB modules weren't enabled in 1.98 on coreboot.
Surprising, they can be insmoded and run in the grub-shell , but
unfortunately, I got those logs, they can not
work.
it's already surprising they didn't crash GRUB altogether.



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

--------------030105000707040709090601--