]> git.ipfire.org Git - thirdparty/grub.git/commit
loader/i386/linux: Calculate the setup_header length
authorAndrew Jeddeloh <andrew.jeddeloh@coreos.com>
Fri, 29 Mar 2019 15:09:54 +0000 (16:09 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Apr 2019 11:09:54 +0000 (13:09 +0200)
commite683cfb0cf59fd2dcaa3bb61b3c8ec5e1a09cd37
treed1cecc56f2644521c1d5a027e7c3699d40ae5790
parentffe392153895cb1341d38fa291f977e2707f62e6
loader/i386/linux: Calculate the setup_header length

Previously the setup_header length was just assumed to be the size of the
linux_kernel_params struct. The linux x86 32-bit boot protocol says that the
end of the linux_i386_kernel_header is at 0x202 + the byte value at 0x201 in
the linux_i386_kernel_header. So, calculate the size of the header using the
end of the linux_i386_kernel_header, rather than assume it is the size of the
linux_kernel_params struct.

Additionally, add some required members to the linux_kernel_params
struct and align the content of linux_i386_kernel_header struct with
it. New members naming was taken directly from Linux kernel source.

linux_kernel_params and linux_i386_kernel_header structs require more
cleanup. However, this is not urgent, so, let's do this after release.
Just in case...

Signed-off-by: Andrew Jeddeloh <andrew.jeddeloh@coreos.com>
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Vladimir Serbinenko <phcoder@google.com>
Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
grub-core/loader/i386/linux.c
include/grub/i386/linux.h