Hi,

Your patch works fine for my laptop too.

Thank you.

Masanobu SAITOH <msai...@execsw.org> writes:

> On 2019/12/27 1:55, Emmanuel Dreyfus wrote:
>> On Wed, Dec 25, 2019 at 05:05:11PM +0900, Masanobu SAITOH wrote:
>>>>> After this change, amd64 kernel does not boot on my HP Spectre x360
>>>>> 13-inch ae019TU laptop with pure UEFI boot mode.
>>>  I have a UEFI boot machine and it also doesn't boot well.
>> 
>> Please try the attached patch.
>> 
>> It adds the -n flag to ld, which disable auto-alignment of sections
>> in the file. I undestand alignement is highly desirable for userland
>> programs that may be mapped from file, but useless for the kernel,
>> which is just readen once by the bootloader.
>> 
>> Without auto-alignement, the .text segment starts right after the
>> ELF headers. This means the multiboot header can go in .text and
>> stay below 32k (as required by the multiboot specification). There
>> is no need for a multiboot section for that, and therefore no 
>> need to modify the linker script.
>> 
>> A side effect is that the kernel file shrinks of 2 MB, because there
>> is not an alignement hole between ELF headers and the .text section
>> anymore.
>> 
>> My patch also enable the MULTIBOOT option so that we can check
>> nothing gets broken with it. You can also try with the option
>> disabled, of course.
>> 
>
> Both with and without MULTIBOOT works fine. No any hangup/panic.
>
>  Thanks.
>
> -- 
> -----------------------------------------------
>                 SAITOH Masanobu (msai...@execsw.org
>                                  msai...@netbsd.org)

-- 
Ryo ONODERA // r...@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3

Reply via email to