On Fri May 5 12:22:47 PDT 2006, David Wilder wrote
> Attached is a replacement man page for kexec. Please let me know what
> you think.
>
> Included is a html version for easy viewing.
>
> Thanks.
Hi. I was scanning fastboot list and found your post. Since it
doesn't look like you got any feedback I'll give you some.
First of all, thanks for starting the effort. I'll be responding
the the output of TERM=dumb man kexec | sed 's/.^H//' | fmt -65.
> SYNOPSIS
> /sbin/kexec [-v (--version)] [-f (--force)] [-x
> (--no-ifdown)] [-l (--load)] [-p (--load-panic)] [-u
> (--unload)] [-e (--exec)] [-t (--type)]
> [--mem-min=addr] [--mem-max=addr]
>
First of all, the long options in the synopsis and option lists are
formatted incorrectly. They are appearing as you have to specify
both -v and the version.
You should have one line for loading, and a second line for -e
and a third for unloading at the minimum. I guess another for --v.
> DESCRIPTION
> kexec is a system call
you are describing /sbin/kexec. Kexec is a utility
> that enables you to load and boot
> into another kernel from the currently running kernel.
using the kexec_load(2) and reboot(2) systemm calls.
> kexec performs the function of the boot loader
(yes it is the loader)
> from
> within the kernel.
No, it is userspace. The kernel does the final placement and exec.
Kexec is a utility to prepare, load, and start a new operating
enviornment replacing the currently running kernel. When the
new environment is the same kernel, it is effectively a reboot
of the existing system.
> The primary difference between a
> standard system boot and a kexec boot is that the
kernel directly invokes the new kernel instead of calling
the BIOS or firmare. Because the firmware is bypassed, any
> hardware initialization normally performed by the BIOS or
> firmware (depending on architecture) is not performed
> during a kexec boot. This has the effect of reducing the
> time required for a reboot.
>
> Make sure you have selected CONFIG_KEXEC=y when
> configuring the kernel. The CONFIG_KEXEC option enables
> the kexec system call.
To use kexec, your running kernel must have been compiled with
CONFIG_KEXEC=y, which enables the kexec_load(2) system call.
>
> USAGE
> Using kexec consists of
>
> (1) loading the kernel to be rebooted to into
> memory, and
operating environment consisting of a kernel, initrd, command line
paramters, and other architecture specific code and data.
> (2) actually rebooting to the
> pre-loaded kernel.
>
> To load a kernel, the syntax is as follows:
A kernel is laoded with the -l option.
>
> kexec -l kernel-image
> --append=command-line-options --ini-
> trd=initrd-image
This should be a line in SYNOPSIS
>
> where kernel-image is the kernel file that you intend to
> reboot to.
>
> Note: Compressed kernel images such as bzImage are not
> supported by kexec. Use the uncompressed vmlinux.
(This is architecture specific, as I just wrote a zImage varient
to be supported for ppc64. But I don't support zImiage.initrd
today, so not too far frpm correct.)
Something like:
The kexec program recoginses several file formats for the linux
kernel depending on the architecture. It extracts information
from the running kernel and supplied image to run, determines
a memory layout, and adds code necessary to setup the system
as expected by entry point of the image such as setting up a
stack or loading pointers to data in cpu registers. It supplies
the assembled content as a list of data to be placed in specified
memory locations and an the address the cpu should start executing
after the content has been copied to the specified location.
Hmm.. that sounds like a lot of it should be in description.
Here you might say "for most architectues the preferred format
for booting a linux kernel is an elf file", although that may
be pushing it.
> Insert the command-line parameters that must be passed to
> the new ker- nel into command-line-options. Passing
> the exact contents of /proc/cmdline into
> command-line-options is the safest way to ensure that
> correct values are passed to the rebooting kernel.
When rebooting into a new kernel, a good starting point for the
command line paramters is those passed to the existing kernel They
can be found in the file /proc/cmdline.
(The new enviornment may not be a linux kernel).
> The optional initrd-image is the initrd image to be used
> during boot.
>
Many distrobutions require a specific to be loaded with their
kernel to boot. If your existing kernel was supplied an initrd
via your bootloader you will probably need to specify that image
here.
> EXAMPLE
> For example, if the kernel image you want to
> reboot to is /boot/vmlinux, the contents of /proc/cmdline
> is root=/dev/hda1, and the path to the initrd is
> /boot/initrd, then you would use the following command to
> load the kernel:
>
> kexec -l /boot/vmlinux
> --append=root=/dev/hda1 --initrd=/boot/initrd
>
Use something with two command line optons, to show the need for quotes.
> OPTIONS
> -e (--exec)
> Run the currently loaded kernel.
>
>
I already commented this should be something like
-e
--exec Run the currently loaded kernel.
> -h (--help)
> Open a help file for kexec.
Display a synopsis of the avaliable options
> --mem-min=addr
> Specify the lowest memory address addr to load code
> into.
>
> --mem-max=addr
> Specify the highest memory address addr to load
> code into.
>
Are these really generic?
> ARCHITECTURE OPTIONS
i386 (and x86_64 ?) architecture options
Please add other architectures (eg powerpc 64-bit, ia64, s390)
as you can find their patches.
You should probably go into a bit more detail about the load-panic
option.
Don't take my wording as gospel. I'm sure it can stand further
editing, I'm a techie not a writer.
milton
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot