[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems booting AROS64's bootstrap with grub2..
From: |
Bean |
Subject: |
Re: Problems booting AROS64's bootstrap with grub2.. |
Date: |
Fri, 21 Mar 2008 19:08:48 +0800 |
On Fri, Mar 21, 2008 at 8:53 AM, Kalamatee <address@hidden> 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