示例#1
0
文件: boot.c 项目: b-man/xBoot
int boot_main(int argc, char *argv[])
{
	printf("Booting darwin.\n");
	start_darwin();

	return 0;
}
示例#2
0
/**
 * corestart_main
 *
 * Prepare the system for Darwin kernel execution.
 */
void
corestart_main(uint32_t __unused, uint32_t machine_type, struct atag *atags)
{
    /* We're in. */
    init_debug();

    /*
     * Verify machine type.
     */
    if (machine_type != MACH_TYPE_REALVIEW_PBA8) {
        printf("********************************\n"
               "*                              *\n"
               "*  This unit is not supported  *\n"
               "*                              *\n"
               "********************************\n");
        printf("Machine type is %d, expected %d\n", machine_type,
               MACH_TYPE_REALVIEW_PBA8);
        _locore_halt_system();
    }

    /*
     * Announce ourselves.
     */
    printf("=======================================\n"
           "::\n"
           ":: GenericBooter for ARM RealView, Copyright 2013, winocm.\n"
           "::\n"
           "::\tBUILD_TAG: %s\n"
           "::\n"
           "::\tBUILD_STYLE: %s\n"
           "::\n"
           "::\tCOMPILE_DATE: " __DATE__ " " __TIME__ "\n"
           "::\n"
           "=======================================\n", gBuildTag, gBuildStyle);

    bzero((void *)&gBootArgs, sizeof(boot_args));

    /*
     * Set up boot_args based on atag data, the rest will be filled out during
     * initialization.
     */
    struct atag_header *atag_base = (struct atag_header *)atags;
    uint32_t tag = atag_base->tag;

    while (tag != ATAG_NONE) {
        tag = atag_base->tag;

        switch (tag) {
        case ATAG_MEM:
            populate_memory_info((struct atag *)atag_base);
            break;
        case ATAG_CMDLINE:
            populate_commandline_info((struct atag *)atag_base);
            break;
        case ATAG_INITRD2:
            populate_ramdisk_info((struct atag *)atag_base);
            break;
        default:
            break;
        }

        atag_base =
            (struct atag_header *)((uint32_t *) atag_base + (atag_base->size));
    };

    if (!is_malloc_inited)
        panic("malloc not inited");

    start_darwin();

    panic("Nothing to do...\n");
    return;
}