[haiku-development] Re: Change of kernel args struct size...

  • From: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 02 Oct 2016 07:01:04 +0000

On Sun, 2 Oct 2016 7:36 pm Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:

On 10/02/2016 01:22 AM, Jessica Hamilton wrote:
On 21 September 2016 at 06:51, Ingo Weinhold <ingo_weinhold@xxxxxx>
wrote:
On 09/20/2016 03:08 AM, Jessica Hamilton wrote:
Currently in kernel main it does a validation of the size of the passed
in kernel args struct, which means a new release of the bootloader
won't
be able to boot previous kernels, unless we compile this information
into the kernel, or remove the size validation check.


But that's only part of the work, right? As I see it, you'll also need
code
that converts an older version of the args to the current one. Or the
structures need to be backward compatible -- i.e. adding stuff is only
allowed at the end and there's some way of initializing those addition,
if
an older version is passed by the boot loader.

Hmm, after thinking about the problem more, it seems that such changes
would only allow a newer kernel to boot from an older boot loader, but
not an older kernel from a newer boot loader, so perhaps this isn't
worth putting in the effort, and I just merge my changes as-is.

If new data were only put at the end -- which I don't think is actually
a practical strategy -- and if those data could be safely ignored by an
older kernel, then booting an older kernel from a newer boot loader
would work as well.

But TBH I don't think trying to implement backward and/or forward
compatibility is worth the effort anyway. Usually boot loader and kernel
live on the same partition/installation, so there's no reason why the
two would have mismatching versions.


Except you do a pkgman upgrade, and then you can't boot an older package
state.

Other related posts: