kexec-loader

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
solemnwarning
Posts: 8
Joined: Thu May 29, 2008 2:42 am
Location: Gosport, UK

kexec-loader

Post by solemnwarning »

kexec-loader is a Linux-based bootloader which has a target selection menu and other features such as GRUB menu.lst+device.map support, it loads the selected kernel using kexec and the TODO for v1.4 is code cleanup and a command-line.

It aims to support multiboot kernels since kexec claims to, although booting Exclaim apparently doesn't work, so testing of various multiboot kernels would be appreciated. :)

http://www.solemnwarning.net/kexec-loader/
http://www.solemnwarning.net/kexec-loader/release-images/kexec-loader-1.3.1.img.gz

Any comments/suggestions?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

If I get a bit of time this evening I'll try poking pedigree in there and see what happens.

Does it support x64 too or just 32-bit?
User avatar
JackScott
Member
Member
Posts: 1031
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Contact:

Post by JackScott »

Just curious, what is the benefit of this over GRUB?

It surely can't be size... a 1.15MiB floppy image for the boot loader?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Yayyak wrote:Just curious, what is the benefit of this over GRUB?

It surely can't be size... a 1.15MiB floppy image for the boot loader?
It uses kexec, so can load from any filesystem that linux supports. (I've been lurking in #exclaim where solemnwarning loiters)
solemnwarning
Posts: 8
Joined: Thu May 29, 2008 2:42 am
Location: Gosport, UK

Post by solemnwarning »

JamesM wrote:
Yayyak wrote:Just curious, what is the benefit of this over GRUB?

It surely can't be size... a 1.15MiB floppy image for the boot loader?
It uses kexec, so can load from any filesystem that linux supports. (I've been lurking in #exclaim where solemnwarning loiters)
And any device, the standard image supports PATA, SATA and USB mass storage
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

Post by xyzzy »

It doesn't work well with higher half Multiboot kernels seemingly due to a kexec/kexec-tools bug - the sections in the ELF image are loaded to the correct physical location however it attempts to jump into the kernel at the virtual address, resulting in QEMU dying with "tried to execute code outside RAM or ROM".

Anyway, the benefit of kexec-loader is that it can boot off any device you configure the kernel to support. It's useful, for example, for booting off a CD or USB mass storage device if the BIOS doesn't support it.
solemnwarning
Posts: 8
Joined: Thu May 29, 2008 2:42 am
Location: Gosport, UK

Post by solemnwarning »

r293 commited to SVN with working command-line code!

kexec-loader-r293.img.gz

No docs yet, there's a "help" command though
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Post by Korona »

Does it support gzipped kernel images yet? Which binary formats are supported for the kernel image?
solemnwarning
Posts: 8
Joined: Thu May 29, 2008 2:42 am
Location: Gosport, UK

Post by solemnwarning »

It supports any kernel images which can be loaded by kexec-tools
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

Post by xyzzy »

Right, so we discovered on IRC that using a physical address as an entry point in a multiboot kernel isn't actually part of the Multiboot specification, however GRUB does have a workaround for it which is why it works. The kexec program from kexec-tools, however, does not support it, therefore tries to use the virtual address. To fix this I defined a symbol __phys_start which points to the physical entry address in the linker script, and set the entry point to it:

Code: Select all

ENTRY (__phys_start)
OUTPUT_FORMAT("elf32-i386")
OUTPUT_ARCH("i386")

VirtBase = 0xC0000000;
PhysBase = 0x100000;
PageSize = 0x1000;

SECTIONS
{
        . = VirtBase + PhysBase;
        __phys_start = _start - VirtBase;
This allows kexec-loader to load the kernel, and it still works in GRUB.

Also, I discovered that Linux uses hardware VGA scrolling, so output wasn't being displayed on the screen properly when control was passed to my kernel. In kexec-loader revision 297 there's a new configuration directive reset-vga which passes the --reset-vga option to kexec, which makes VGA output display properly.

EDIT: Image of r297: http://www.solemnwarning.net/kexec-loader-r297.img.gz
Post Reply