Re: [CFT] kexec syscall for 2.5.43 (linux booting linux)

Eric W. Biederman
2002-10-19T17:33:32Z

Werner Almesberger <wa@almesberger.net> writes:

> Eric W. Biederman wrote:
> > Cool. What fails with X11. Fixing it might be as simple as calling
> > int 0x10 early in the new image.
>
> The graphic engine (i810) simply doesn't switch back to text mode.
> Yes, 0x10 helps. I've attached a little patch that does this in a
> relatively safe way. (Alternative, one could also use set_80x25,
> but I think always forcing mode 3 is slightly more reliable.
> Except for MGA users, of course :-)
>
> If you get a new boot loader type code from Peter Anvin, this
> should even be good enough for inclusion into the mainstream
> kernel. Alternatively, we could also pick a new loader flag to
> indicate that the firmware didn't initialize the system.

For the most part my preferences is to put the system into a sane state
when we reboot/shutdown. The device_shutdown call in the kernel can handle
this, on reboot. The problem with video is mostly that the drivers
are not well integrated.

> > [vmlinux] specifies incorrect physical
> > addresses, and it expects to be passed a whole host of strange values,
> > in weird places.
>
> I see. Perhaps you could say then that mkelfImage fixes flaws in
> the vmlinux ELF image meta-data, or such:

The primary thing it does is give the kernel a working 32bit entry
point.

> | A kernel reformater is makes images that seem to boot more reliably is at:
> | ftp://ftp.lnxi.com/pub/mkelfImage/mkelfImage-1.17.tar.gz
>
> This sounds more like "if I kick it here, it usually works,
> but I have no idea why" :-)

The code was built so I could put a kernel, a ramdisk, and a command line
all in a single ELF executable. With the addition of entering the kernel
at it's unsupported 32bit entry point. So I perform a different set of BIOS
calls that setup.S does. Though they are very similar.

But why mkelfImage works occasionally when a bzImage doesn't and you
have a pcbios is a mystery to me. I know why only mkelfImage works
under LinuxBIOS...

> And yes, if it's not too intrusive, fixing the ELF meta-data
> along with the addition of kexec might be a good idea.

The meta-data is easy, about one line in vmlinux.lds. Fixing the
actual entry point is more interesting. I've done it and the result
is maintainable but the patch met some definitions of intrusive.

Eric