示例#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
}
示例#2
0
void
pciprobe(void)
{
	bios_pciinfo_t bpi;
	u_int32_t hw_chars, rev, rc, sig;
	u_int32_t entry32;

	/* PCI BIOS v2.0c+ - Installation Check */
	__asm __volatile(DOINT(0x1A) "; shll $8,%2; setc %b2"
		: "=a" (hw_chars), "=b" (rev), "=c" (rc),
		  "=d" (sig), "=D" (entry32)
		: "0" (0xB101), "4" (0x0)
		: "cc");

	if (rc & 0xff || hw_chars & 0xff00)
		return;
	if (sig != PCI_SIG)
		return;

	printf(" pci");
#ifdef DEBUG
	printf("[V%d.%d, %x 0x%x %d]", (rev>>8)&0xFF, (rev&0xFF),
		hw_chars, entry32, (rc>>8)&0xFF);
#endif

	bpi.pci_chars = hw_chars & 0xFFFF;
	bpi.pci_rev = rev & 0xFFFF;
	bpi.pci_entry32 = entry32;
	bpi.pci_lastbus = (rc>>8) & 0xFF;

	addbootarg(BOOTARG_PCIINFO, sizeof(bios_pciinfo_t), &bpi);
}
示例#3
0
void
diskprobe(void)
{
	struct diskinfo *dip;
	int i;

	/* These get passed to kernel */
	bios_diskinfo_t *bios_diskinfo;

	/* Init stuff */
	TAILQ_INIT(&disklist);

	/* Do probes */
	floppyprobe();
#ifdef BIOS_DEBUG
	if (debug)
		printf(";");
#endif
	hardprobe();

#ifdef SOFTRAID
	srprobe();
#endif

	/* Checksumming of hard disks */
	for (i = 0; disksum(i++) && i < MAX_CKSUMLEN; )
		;
	bios_cksumlen = i;

	/* Get space for passing bios_diskinfo stuff to kernel */
	for (i = 0, dip = TAILQ_FIRST(&disklist); dip;
	    dip = TAILQ_NEXT(dip, list))
		i++;
	bios_diskinfo = alloc(++i * sizeof(bios_diskinfo_t));

	/* Copy out the bios_diskinfo stuff */
	for (i = 0, dip = TAILQ_FIRST(&disklist); dip;
	    dip = TAILQ_NEXT(dip, list))
		bios_diskinfo[i++] = dip->bios_info;

	bios_diskinfo[i++].bios_number = -1;
	/* Register for kernel use */
	addbootarg(BOOTARG_CKSUMLEN, sizeof(u_int32_t), &bios_cksumlen);
	addbootarg(BOOTARG_DISKINFO, i * sizeof(bios_diskinfo_t),
	    bios_diskinfo);
}