From: Cui Lei <neverforget_2002@163.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: Grub2 can not detect usb disk
Date: Thu, 30 Jun 2011 10:38:29 +0800 [thread overview]
Message-ID: <4E0BE1A5.6060009@163.com> (raw)
In-Reply-To: <4E09B613.1020904@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 6572 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 11047 bytes --]
next prev parent reply other threads:[~2011-06-30 2:39 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-23 10:01 Grub2 can not detect usb disk Cui Lei
2011-06-23 13:32 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-06-24 2:57 ` Cui Lei
2011-06-27 9:16 ` Cui Lei
2011-06-27 9:27 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-06-27 10:04 ` Rock Cui
2011-06-27 10:19 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-06-28 1:19 ` Rock Cui
2011-06-28 4:56 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-06-28 8:45 ` Rock Cui
2011-06-28 9:02 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-06-28 10:02 ` Cui Lei
2011-06-28 11:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-06-28 11:27 ` Graeme Russ
2011-06-30 2:38 ` Cui Lei [this message]
2011-06-30 13:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-07-01 3:00 ` Rock Cui
2011-07-01 6:57 ` Rock Cui
2011-07-02 21:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-07-05 6:33 ` Cui Lei
2011-07-05 6:35 ` Cui Lei
2011-07-06 14:03 ` 崔磊
2011-07-12 11:11 ` Cui Lei
2011-07-21 11:11 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-07-27 8:11 ` Rock Cui
2011-07-27 8:49 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-07-27 9:28 ` Rock Cui
2011-07-20 21:34 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-07-21 1:19 ` Rock Cui
2011-07-21 11:07 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-06-30 13:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
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=4E0BE1A5.6060009@163.com \
--to=neverforget_2002@163.com \
--cc=grub-devel@gnu.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 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.