Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Jcf7G-0006T5-HT for mharc-grub-devel@gnu.org; Fri, 21 Mar 2008 07:08:54 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jcf7F-0006SN-Cz for grub-devel@gnu.org; Fri, 21 Mar 2008 07:08:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jcf7D-0006Rn-OZ for grub-devel@gnu.org; Fri, 21 Mar 2008 07:08:52 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jcf7D-0006Rk-Id for grub-devel@gnu.org; Fri, 21 Mar 2008 07:08:51 -0400 Received: from ti-out-0910.google.com ([209.85.142.187]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jcf7D-0002ns-1f for grub-devel@gnu.org; Fri, 21 Mar 2008 07:08:51 -0400 Received: by ti-out-0910.google.com with SMTP id a20so480574tia.10 for ; Fri, 21 Mar 2008 04:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=gpfmkkKW1houj4moyFDyldFmv7FAcEH3pm/62edEMF0=; b=jQb6Q8cJLjmWVqE3lndDSaHaHqFGPa1b3Y+eJuQI80U7SHIZHrX45ytg4Zn0evTtxldZr4HpBbMocH+fGSNwKIttVgboD13TI5vvKOuJ1BuSS49KMkES+a9YLlr9W3aDoZnWXkxNWL70iZcBU09I7rV5+JX75clGzak7bmZXDio= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=YHwSkYcGUer/xDwCSi+zWsyyJnpG7zwLuOpYhhPq4W6gPyl48kSgY66JoDC+axwViQDm5rLYUR3tky1cEVGIcQkpPTWN8bIlAAtqoXrOyME82HU/93Es4BFL5P7avnNYGdvM7sCt1ev+R95o2O0tDsU67cfD/H3CWkZsMJ3MOyk= Received: by 10.110.49.6 with SMTP id w6mr887451tiw.2.1206097728983; Fri, 21 Mar 2008 04:08:48 -0700 (PDT) Received: by 10.110.62.19 with HTTP; Fri, 21 Mar 2008 04:08:48 -0700 (PDT) Message-ID: Date: Fri, 21 Mar 2008 19:08:48 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <5cc84b460803201753j2c1dbc85mc4e28e3ddfecf07b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5cc84b460803201753j2c1dbc85mc4e28e3ddfecf07b@mail.gmail.com> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: Problems booting AROS64's bootstrap with grub2.. 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: Fri, 21 Mar 2008 11:08:53 -0000 On Fri, Mar 21, 2008 at 8:53 AM, Kalamatee wrote: > OK, > > Currently theres 2 problems im aware of that I could use some verification > of .. > > Firstly... Grub2 currently fails in loader/i386/pc/multiboot.c line 145 when > trying to load the elf-32 boostrap code. > > heres a readelf dump of the file in question .. > > http://rafb.net/p/AH4Qkx97.html > > As you can see, the first program segment has a FileSiz of 0x00000, but a > MemSiz of 0x0f400. > > Im not familiar with the elf specification and cant find any solid > information that says whether this is legal or not, so ive tried playing > with grub2s multboot elf loader code and found the following. > > If I skip this segment completely AROS64 fails to jump into its 64bit > environment using ljmp (presumably since the bss section contains random > data causing it to jump somewhere outside of the valid memory range). If I > change the elf loader so it only attempts the grub_read_file when > phdr->p_filesz > 0, AROS64 continues to boot as it is expected to. From this > I suspect only attempting to load the file data when filesz > 0 is the > correct behaviour (and if it is 0 but memsz > 0, it should still clear the > segments memory range) - but could do with some verification from someone > who understands the elf spec's. I take a look at the grub_file_read, when len = 0, it actually means reading until the end of file. So i guess you should skip the grub_file_read call if the size is 0. > > Secondly, After addressing the first issue, AROS64 bails out further on. > Studying its code it appears to "require" the mmap data that grub legacy > provided - however I cant seem to find mention of it in grub2. Am i correct > in assuming grub2 only currently passes a flat memory region to multiboot > os'es via mem_upper/mem_lower? If yes, I can atleast look at fixing AROS to > use this single region if the mmap data is unavailable. Yes, the multiboot loader of grub2 doesn't pass the mmap information, but mem_upper/mem_lower is available. -- Bean