From: Constantine Kousoulos <wuwei@freemail.gr>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: multiboot header error
Date: Thu, 31 May 2007 21:51:42 +0300 [thread overview]
Message-ID: <465F193E.4090002@freemail.gr> (raw)
In-Reply-To: <465D9D89.1010904@freemail.gr>
Since i didn't get any feedback, i was forced to use the force and
go to the source. I found out a few amazing things.
First of all, there is a serious inconsistency between the next
version of the Multiboot Specification and the current code. The
spec mentions: "[..] The header must start with a 32-bit magic
number 0xe85250d6 in native endian [..]'. However, there is no
such magic number defined in the source code!! No wonder i got
"error: No multiboot header found". Grub2 always checks for the
standard magic number 0x1badb002.
So, after i changed the multiboot header to the old magic number i
got over the annoying error message and stumbled onto another. The
cause of this error is this piece of code from
grub2/loader/i386/pc/multiboot.c (line 210, inside
grub_multiboot_load_elf64() ):
if (grub_file_read (file, (void *) ((grub_uint32_t) phdr->p_paddr),
phdr->p_filesz)
!= (grub_ssize_t) phdr->p_filesz)
return grub_error (GRUB_ERR_BAD_OS,
"couldn't read segment from file");
That's right, i get "error: couldn't read segment from file".
For once more i call upon the experience of the Grub2
developers. Is this a bug of grub_read_file()? The loaded elf64
file is so small that it should have no problem fitting into
physical memory. In addition to that, 'objdump -D mykernel' shows
that the kernel is loaded at address 0x400120 which is within the
usable physical RAM map.
Sorry for troubling you with all these emails, but i need to load
an elf64 kernel for an os project i'm working on.
Thanks,
Constantine
prev parent reply other threads:[~2007-05-31 18:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-29 18:48 multiboot header error Constantine Kousoulos
2007-05-30 15:51 ` Constantine Kousoulos
2007-05-31 18:51 ` Constantine Kousoulos [this message]
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=465F193E.4090002@freemail.gr \
--to=wuwei@freemail.gr \
--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.