Changeset cfdeedc in mainline for boot/arch/ppc32/src/main.c


Ignore:
Timestamp:
2018-10-21T23:12:23Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bf05c74
Parents:
d59718e
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-21 22:53:48)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-21 23:12:23)
Message:

Keep kernel in ELF format

By keeping kernel in an ELF file (instead of converting it to
a flat binary), we can use the information it contains, like
symbol table and debug info.

We can also later implement more advanced functionality, like
loading kernel at multiple discontiguous blocks, or loading
a position-independent kernel at a randomized address.

Currently the functionality is quite restricted, to keep changes
to a minimum. Code in boot/generic/src/kernel.c validates that
the kernel image was built with the same addresses as the boot
loader uses, giving an extra level of sanity checking compared
to a flat binary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/ppc32/src/main.c

    rd59718e rcfdeedc  
    4242#include <errno.h>
    4343#include <payload.h>
     44#include <kernel.h>
    4445
    4546#define BALLOC_MAX_SIZE  131072
     
    6869        printf(" %p|%p: real mode trampoline\n", &real_mode, real_mode_pa);
    6970        printf(" %p|%p: boot info structure\n", &bootinfo, bootinfo_pa);
    70         printf(" %p|%p: kernel entry point\n",
    71             (void *) PA2KA(BOOT_OFFSET), (void *) BOOT_OFFSET);
    7271        printf(" %p|%p: loader entry point\n",
    7372            (void *) LOADER_ADDRESS, loader_address_pa);
     
    144143        }
    145144
     145        uintptr_t entry = check_kernel_translated(inflate_base, 0);
     146
    146147        printf("Booting the kernel...\n");
    147         jump_to_kernel(bootinfo_pa, transtable_pa, pages, real_mode_pa,
    148             PA2KA(BOOT_OFFSET));
     148        jump_to_kernel(bootinfo_pa, transtable_pa, pages, real_mode_pa, entry);
    149149}
Note: See TracChangeset for help on using the changeset viewer.