From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1HtpnJ-00075g-Ny for mharc-grub-devel@gnu.org; Thu, 31 May 2007 14:54:45 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HtpnI-00075P-45 for grub-devel@gnu.org; Thu, 31 May 2007 14:54:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HtpnG-00075B-Ch for grub-devel@gnu.org; Thu, 31 May 2007 14:54:42 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HtpnG-000758-75 for grub-devel@gnu.org; Thu, 31 May 2007 14:54:42 -0400 Received: from smtp.freemail.gr ([81.171.104.107]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HtpnF-0004Ce-KW for grub-devel@gnu.org; Thu, 31 May 2007 14:54:41 -0400 Received: from [192.168.1.35] (unknown [85.72.70.220]) by smtp.freemail.gr (Postfix) with ESMTP id 1380AA08253 for ; Thu, 31 May 2007 21:54:37 +0300 (EEST) Message-ID: <465F193E.4090002@freemail.gr> Date: Thu, 31 May 2007 21:51:42 +0300 From: Constantine Kousoulos User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: The development of GRUB 2 References: <465C756E.8000506@freemail.gr> <465D9D89.1010904@freemail.gr> In-Reply-To: <465D9D89.1010904@freemail.gr> Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 7bit X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) Subject: Re: multiboot header error X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2007 18:54:44 -0000 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