Esempio n. 1
0
void
run_loadfile(u_long *marks, int howto)
{
    u_long entry;
#ifndef _TEST
    dev_t bootdev = bootdev_dip->bootdev;
    size_t ac = BOOTARG_LEN;
    caddr_t av = (caddr_t)BOOTARG_OFF;
    bios_consdev_t cd;
    extern int com_speed; /* from bioscons.c */
    extern int com_addr;
    bios_ddb_t ddb;
    extern int db_console;
    bios_bootduid_t bootduid;

    if (sa_cleanup != NULL)
        (*sa_cleanup)();

    cd.consdev = cn_tab->cn_dev;
    cd.conspeed = com_speed;
    cd.consaddr = com_addr;
    cd.consfreq = 0;
    addbootarg(BOOTARG_CONSDEV, sizeof(cd), &cd);

    if (bootmac != NULL)
        addbootarg(BOOTARG_BOOTMAC, sizeof(bios_bootmac_t), bootmac);

    if (db_console != -1) {
        ddb.db_console = db_console;
        addbootarg(BOOTARG_DDB, sizeof(ddb), &ddb);
    }

    bcopy(bootdev_dip->disklabel.d_uid, &bootduid.duid, sizeof(bootduid));
    addbootarg(BOOTARG_BOOTDUID, sizeof(bootduid), &bootduid);

    /* Pass memory map to the kernel */
    mem_pass();

    makebootargs(av, &ac);

    entry = marks[MARK_ENTRY] & 0x0fffffff;

    printf("entry point at 0x%x\n", (int) entry);
    /* stack and the gung is ok at this point, so, no need for asm setup */
    (*(startfuncp)entry)(howto, bootdev, BOOTARG_APIVER,
                         marks[MARK_END], extmem, cnvmem, ac, (int)av);
    /* not reached */
#endif
}
Esempio n. 2
0
void
machdep_exec(struct x_param *xp, int howto, void *loadaddr)
{
#ifdef EXEC_DEBUG
    extern int debug;
    int i;
#endif
    size_t ac = BOOTARG_LEN;
    void *av = (void *)BOOTARG_OFF;
#ifdef notyet
    makebootargs(av, &ac);
#endif

#ifdef EXEC_DEBUG
    if (debug) {
        printf("ep=0x%x [", xp->xp_entry);
        for (i = 0; i < 10240; i++) {
            if (!(i % 8)) {
                printf("\b\n%p:", &((u_int *)xp->xp_entry)[i]);
                if (getchar() != ' ')
                    break;
            }
            printf("%x,", ((int *)xp->xp_entry)[i]);
        }
        printf("\b\b ]\n");
    }
#endif

    fcacheall();

    __asm("mtctl %r0, %cr17");
    __asm("mtctl %r0, %cr17");
    /* stack and the gung is ok at this point, so, no need for asm setup */
    (*(startfuncp)(xp->xp_entry)) ((int)pdc, howto, bootdev, xp->xp_end,
                                   BOOTARG_APIVER, ac, av);
    /* not reached */
}