28 Apr, 2014

1 commit

  • The code is only slightly modified : entry points now use the
    FIXUP_ENDIAN trampoline to switch endian order. The 32bit wrapper
    is kept for big endian kernels and 64bit is enforced for little
    endian kernels with a PPC64_BOOT_WRAPPER config option.

    The linker script is generated using the kernel preprocessor flags
    to make use of the CONFIG_* definitions and the wrapper script is
    modified to take into account the new elf64ppc format.

    Finally, the zImage file is compiled as a position independent
    executable (-pie) which makes it loadable at any address by the
    firmware.

    Signed-off-by: Cédric Le Goater
    Signed-off-by: Benjamin Herrenschmidt

    Cédric Le Goater
     

20 Apr, 2011

1 commit

  • This patch adds code, linker script and makefile support to allow
    building the zImage wrapper around the kernel as a position independent
    executable. This results in an ET_DYN instead of an ET_EXEC ELF output
    file, which can be loaded at any location by the firmware and will
    process its own relocations to work correctly at the loaded address.

    This is of interest particularly since the standard ePAPR image format
    must be an ET_DYN (although this patch alone is not sufficient to
    produce a fully ePAPR compliant boot image).

    Note for now we don't enable building with -pie for anything.

    Signed-off-by: Paul Mackerras
    Signed-off-by: David Gibson
    Signed-off-by: Michael Ellerman
    Signed-off-by: Benjamin Herrenschmidt

    Michael Ellerman
     

01 Jul, 2008

1 commit

  • Currently we set the start of the .text section to be 4Mb for pSeries.
    In situations where the zImage is > 8Mb we'll fail to boot (due to
    overlapping with OF). Move .text in a zImage from 4MB to 64MB
    (well past OF).

    We still will not be able to load large zImage unless we also move OF,
    to that end, add a note to the zImage ELF to move OF to 32Mb. If this
    is the very first kernel booted then we'll need to move OF manually by
    setting real-base.

    Signed-off-by: Tony Breeds
    Signed-off-by: Paul Mackerras

    Tony Breeds
     

13 Mar, 2007

1 commit

  • This patch re-organises the way the zImage wrapper code is entered, to
    allow more flexibility on platforms with unusual entry conditions.
    After this patch, a platform .o file has two options:

    1) It can define a _zimage_start, in which case the platform code gets
    control from the very beginning of execution. In this case the
    platform code is responsible for relocating the zImage if necessary,
    clearing the BSS, performing any platform specific initialization, and
    finally calling start() to load and enter the kernel.

    2) It can define platform_init(). In this case the generic crt0.S
    handles initial entry, and calls platform_init() before calling
    start(). The signature of platform_init() is changed, however, to
    take up to 5 parameters (in r3..r7) as they come from the platform's
    initial loader, instead of a fixed set of parameters based on OF's
    usage.

    When using the generic crt0.S, the platform .o can optionally
    supply a custom stack to use, using the BSS_STACK() macro. If this
    is not supplied, the crt0.S will assume that the loader has
    supplied a usable stack.

    In either case, the platform code communicates information to the
    generic code (specifically, a PROM pointer for OF systems, and/or an
    initrd image address supplied by the bootloader) via a global
    structure "loader_info".

    In addition the wrapper script is rearranged to ensure that the
    platform .o is always linked first. This means that platforms where
    the zImage entry point is at a fixed address or offset, rather than
    being encoded in the binary header can be supported using option (1).

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     

09 Nov, 2006

1 commit


28 Sep, 2006

1 commit

  • This puts the knowledge of how to create various sorts of zImage
    wrappers into a script called "wrapper" that could be used outside of
    the kernel tree. This changes arch/powerpc/boot so it first builds
    the files that the wrapper script needs, then runs it to create
    whatever flavours of zImage are required.

    This version does uImages as well. The zImage names are changed
    slightly; zImage.pseries is the one with the PT_NOTE program header
    entry added, and zImage.pmac is the one without. If the
    zImage.pseries gets made, it will also get hardlinked to zImage;
    otherwise, if zImage.pmac is made, it gets hardlinked to zImage.

    Signed-off-by: Paul Mackerras

    Paul Mackerras