void
wscninit(struct consdev *cp)
{
	if ((*wsfbcninit)()) {
		/*
		 * For some reason, the console initialization failed.
		 * Fallback to serial console, by re-electing a console.
		 */
		wscn_ignore = 1;
		cninit();
		return;
	}

	switch (vax_bustype) {
	case VAX_VSBUS:
#if NDZKBD > 0
		dzkbd_cnattach(0); /* Connect keyboard and screen together */
#endif
		break;
	case VAX_VXTBUS:
#if NQSCKBD > 0
		qsckbd_cnattach(QSC_LINE_KEYBOARD);
#endif
		break;
	}
}
示例#2
0
void
boot(dev_t dev)
{
    u_long marks[MARK_MAX];
    char path[128];

    pdc_init();
    cninit();
    devboot(dev, path);
    strncpy(path + strlen(path), ":/bsd.rd", 9);
    printf(">> OpenBSD/" MACHINE " CDBOOT 0.1\n"
           "booting %s: ", path);

    marks[MARK_START] = (u_long)DEFAULT_KERNEL_ADDRESS;
    if (!loadfile(path, marks, LOAD_KERNEL)) {
        marks[MARK_END] = ALIGN(marks[MARK_END] -
                                (u_long)DEFAULT_KERNEL_ADDRESS);
        fcacheall();

        __asm("mtctl %r0, %cr17");
        __asm("mtctl %r0, %cr17");
        (*(startfuncp)(marks[MARK_ENTRY]))((int)(long)pdc, 0, bootdev,
                                           marks[MARK_END], BOOTARG_APIVER, BOOTARG_LEN,
                                           (caddr_t)BOOTARG_OFF);
        /* not reached */
    }
}
示例#3
0
文件: model_dep.c 项目: Prajna/mach
/*
 *	Cpu initialization.  Running virtual, but without MACH VM
 *	set up.  First C routine called.
 */
void machine_startup()
{
	/*
	 * Do basic VM initialization
	 */
	i386_init();

	/*
	 * Initialize the console so we can print.
	 */
	cninit();
#if	MACH_KDB

	/*
	 * Initialize the kernel debugger.
	 */
	ddb_init();

	/*
	 * Cause a breakpoint trap to the debugger before proceeding
	 * any further if RB_KDB (the '-d' switch to the boot program)
	 * was specified in the boot flags.
	 */
	if (boothowto & RB_KDB) {
		Debugger();
	}

#if 1 /* stan set to 0 [10-14-91] */
	/*
	 * XXX Until bootcube or something else allows us to dynamically
	 * XXX provide boot options, always ask root and bootstrap names.
	 */
	boothowto |= RB_ASKNAME;
	boothowto |= (RB_ASKNAME << RB_SHIFT);
#endif
#endif	MACH_KDB

printf("EXPERIMENTAL ");
	printf(version);
#if 0
{
        int     i;

        db_printf("boot magic:\n");
        for (i = 0; bootenv[i]; i++) {
                db_printf("%d %x %s\n", i, bootenv[i], bootenv[i]);
        }
}
#endif

	machine_slot[0].is_cpu = TRUE;
	machine_slot[0].running = TRUE;
	machine_slot[0].cpu_type = CPU_TYPE_I386;
	machine_slot[0].cpu_subtype = CPU_SUBTYPE_iPSC386;

	/*
	 * Start the system.
	 */
	setup_main();
}
示例#4
0
文件: zs.c 项目: MarginC/kame
int
zs_attach(device_t dev)
{
	struct device *child[ZS_NCHAN];
	struct zs_softc *sc;
	int i;

	sc = device_get_softc(dev);
	sc->sc_dev = dev;

	for (i = 0; i < ZS_NCHAN; i++)
		child[i] = device_add_child(dev, "zstty", -1);
	bus_generic_attach(dev);
	for (i = 0; i < ZS_NCHAN; i++)
		sc->sc_child[i] = device_get_softc(child[i]);

	swi_add(&tty_ithd, "tty:zs", zs_softintr, sc, SWI_TTY,
	    INTR_TYPE_TTY, &sc->sc_softih);

	ZS_WRITE_REG(sc->sc_child[0], 2, sc->sc_child[0]->sc_creg[2]);
	ZS_WRITE_REG(sc->sc_child[0], 9, sc->sc_child[0]->sc_creg[9]);

	if (zstty_cons != NULL) {
		DELAY(50000);
		cninit();
	}

	EVENTHANDLER_REGISTER(shutdown_final, zs_shutdown, sc,
	    SHUTDOWN_PRI_DEFAULT);

	return (0);
}
示例#5
0
int
main()
{
	const char *envvar;

	cninit();

	/*
	 * Figure out whether we are running on a Gdium system, which
	 * has an horribly castrated PMON. If we do, the best we can do
	 * is boot an initrd image.
	 */
	envvar = pmon_getenv("Version");
	if (envvar != NULL && strncmp(envvar, "Gdium", 5) == 0)
		is_gdium = 1;

	/*
	 * Check if we have a valid initrd loaded.
	 */

	envvar = pmon_getenv("rd");
	if (envvar != NULL && *envvar != '\0')
		boot_rd = rd_isvalid();

	if (boot_rd != 0)
		bootprompt = 0;

	boot(boot_rd);
	return 0;
}
示例#6
0
/*
 * Console initialization: called early on from main,
 * before vm init or cpu_startup.  This system is able
 * to use the console for output immediately (via PROM)
 * but can not use it for input until after this point.
 */
void 
consinit(void)
{

	/*
	 * Switch from the PROM console (output only)
	 * to our own console driver.
	 */
	cninit();

#if NKSYMS || defined(DDB) || defined(LKM)
	{
		extern int nsym;
		extern char *ssym, *esym;

		ksyms_init(nsym, ssym, esym);
	}
#endif	/* DDB */

	/*
	 * Now that the console can do input as well as
	 * output, consider stopping for a debugger.
	 */
	if (boothowto & RB_KDB) {
#ifdef KGDB
		/* XXX - Ask on console for kgdb_dev? */
		/* Note: this will just return if kgdb_dev==NODEV */
		kgdb_connect(1);
#else	/* KGDB */
		/* Either DDB or no debugger (just PROM). */
		Debugger();
#endif	/* KGDB */
	}
}
示例#7
0
/*
 * Console initialization: called early on from main, before vm init or startup.
 * Do enough configuration to choose and initialize a console.
 */
void
consinit()
{
	if (console_ok) {
		return;
	}
	cninit();
	console_ok = 1;
}
示例#8
0
void
ofwoea_consinit(void)
{
	static int initted = 0;

	if (initted)
		return;

	initted = 1;
	cninit();
}
示例#9
0
/*
 * consinit:
 * initialize the system console.
 *
 * XXX - shouldn't deal with this initted thing, but then,
 * it shouldn't be called from init386 either.
 */
void
consinit(void)
{
	static int initted;

	if (initted)
		return;
	initted = 1;

	cninit();
}
示例#10
0
文件: consinit.c 项目: MarginC/kame
void
consinit(void)
{
	static int consinit_called = 0;

	if (consinit_called != 0)
		return;
	consinit_called = 1;

	/* No serial console for now ? hmm... should be in constab */
	cninit();
}
void
consinit(void)
{
	static int consinit_called = 0;

	if (consinit_called != 0)
		return;

	consinit_called = 1;
	if (bootinfo->bi_cnuse == BI_CNUSE_SERIAL) {
		cninit();
	}
}
示例#12
0
/*
 * Early console initialization: called early on from main, before vm init.
 * We want to stick to the BUG routines for now, and we'll switch to the
 * real console in cpu_startup().
 */
void
consinit()
{
	cn_tab = NULL;
	cninit();

#if defined(DDB)
	db_machine_init();
	ddb_init();
	if (boothowto & RB_KDB)
		Debugger();
#endif
}
示例#13
0
void
platform_start(__register_t a0, __register_t a1,  __register_t a2, 
    __register_t a3)
{
	vm_offset_t kernend;
	uint64_t platform_counter_freq;
	int argc = a0;
	char **argv = (char **)a1;
	char **envp = (char **)a2;
	int i;

	/* clear the BSS and SBSS segments */
	kernend = (vm_offset_t)&end;
	memset(&edata, 0, kernend - (vm_offset_t)(&edata));

	mips_postboot_fixup();

	mips_pcpu0_init();

	/*
	 * XXXRW: Support for the gxemul real-time clock required in order to
	 * usefully determine our emulated timer frequency.  Go with something
	 * classic as the default in the mean time.
	 */
	platform_counter_freq = MIPS_DEFAULT_HZ;
	mips_timer_early_init(platform_counter_freq);

	cninit();
	printf("entry: platform_start()\n");

	bootverbose = 1;
	if (bootverbose) {
		printf("cmd line: ");
		for (i = 0; i < argc; i++)
			printf("%s ", argv[i]);
		printf("\n");

		if (envp != NULL) {
			printf("envp:\n");
			for (i = 0; envp[i]; i += 2)
				printf("\t%s = %s\n", envp[i], envp[i+1]);
		} else {
			printf("no envp.\n");
		}
	}

	realmem = btoc(GXEMUL_MP_DEV_READ(GXEMUL_MP_DEV_MEMORY));
	mips_init();

	mips_timer_init_params(platform_counter_freq, 0);
}
示例#14
0
void
platform_start(__register_t a0, __register_t a1,  __register_t a2, 
    __register_t a3)
{
	vm_offset_t kernend;
	uint64_t platform_counter_freq;
	int argc = a0;
	int32_t *argv = (int32_t*)a1;
	int32_t *envp = (int32_t*)a2;
	unsigned int memsize = a3;
	int i;

	/* clear the BSS and SBSS segments */
	kernend = (vm_offset_t)&end;
	memset(&edata, 0, kernend - (vm_offset_t)(&edata));

	mips_postboot_fixup();

	mips_pcpu0_init();
	platform_counter_freq = malta_cpu_freq();
	mips_timer_early_init(platform_counter_freq);
	init_static_kenv(boot1_env, sizeof(boot1_env));

	cninit();
	printf("entry: platform_start()\n");

	bootverbose = 1;
	/* 
	 * YAMON uses 32bit pointers to strings so
	 * convert them to proper type manually
	 */
	if (bootverbose) {
		printf("cmd line: ");
		for (i = 0; i < argc; i++)
			printf("%s ", (char*)(intptr_t)argv[i]);
		printf("\n");

		printf("envp:\n");
		for (i = 0; envp[i]; i += 2)
			printf("\t%s = %s\n", (char*)(intptr_t)envp[i],
			    (char*)(intptr_t)envp[i+1]);

		printf("memsize = %08x\n", memsize);
	}

	realmem = btoc(memsize);
	mips_init();

	mips_timer_init_params(platform_counter_freq, 0);
}
示例#15
0
void
machdep(void)
{
    pdc_init();
#ifdef notyet
    debug_init();
#endif
    cninit();

#ifdef PDCDEBUG
    if (debug) {
        int i;

        printf("SSTOR:\n");
        printf("pri_boot=");
        DEVPATH_PRINT(&sstor.ss_pri_boot);
        printf("alt_boot=");
        DEVPATH_PRINT(&sstor.ss_alt_boot);
        printf("console =");
        DEVPATH_PRINT(&sstor.ss_console);
        printf("keyboard=");
        DEVPATH_PRINT(&sstor.ss_keyboard);
        printf("mem=%d, fn=%s, osver=%d\nos={",
               sstor.ss_fast_size, sstor.ss_filenames,
               sstor.ss_os_version);
        for (i = 0; i < sizeof(sstor.ss_os); i++)
            printf ("%x%c", sstor.ss_os[i], (i%8)? ',' : '\n');

        printf("}\nPAGE0:\n");
        printf("ivec=%x, pf=%p[%u], toc=%p[%u], rndz=%p, clk/10ms=%u\n",
               PAGE0->ivec_special, PAGE0->ivec_mempf,
               PAGE0->ivec_mempflen, PAGE0->ivec_toc,
               PAGE0->ivec_toclen, PAGE0->ivec_rendz,
               PAGE0->mem_10msec);
        printf ("mem: cont=%u, phys=%u, pdc_spa=%u, resv=%u, free=%x\n"
                "cpu_hpa=%x, pdc=%p, imm_hpa=%p[%u,%u], soft=%u\n",
                PAGE0->memc_cont, PAGE0->memc_phsize, PAGE0->memc_adsize,
                PAGE0->memc_resv, PAGE0->mem_free, PAGE0->mem_hpa,
                PAGE0->mem_pdc, PAGE0->imm_hpa, PAGE0->imm_spa_size,
                PAGE0->imm_max_mem, PAGE0->imm_soft_boot);

        printf("console:  ");
        PZDEV_PRINT(&PAGE0->mem_cons);
        printf("boot:     ");
        PZDEV_PRINT(&PAGE0->mem_boot);
        printf("keyboard: ");
        PZDEV_PRINT(&PAGE0->mem_kbd);
    }
#endif
}
示例#16
0
文件: machdep.c 项目: MarginC/kame
void
machdep()
{
	pdc_init();
#ifdef notyet
	debug_init();
#endif
	cninit();

#ifdef PDCDEBUG
	if (debug) {
		printf("SSTOR:\n");
		printf("pri_boot=");	DEVPATH_PRINT(&sstor.ss_pri_boot);
		printf("alt_boot=");	DEVPATH_PRINT(&sstor.ss_alt_boot);
		printf("console =");	DEVPATH_PRINT(&sstor.ss_console);
		printf("keyboard=");	DEVPATH_PRINT(&sstor.ss_keyboard);
		printf("mem=%d, fn=%s, osver=%d\n"
		       "os={%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,\n"
		           "%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x}\n",
		       sstor.ss_fast_size, sstor.ss_filenames,
		       sstor.ss_os_version,
		       sstor.ss_os[0], sstor.ss_os[1], sstor.ss_os[2],
		       sstor.ss_os[3], sstor.ss_os[4], sstor.ss_os[5],
		       sstor.ss_os[6], sstor.ss_os[7], sstor.ss_os[8],
		       sstor.ss_os[9], sstor.ss_os[10], sstor.ss_os[11],
		       sstor.ss_os[12], sstor.ss_os[13], sstor.ss_os[14],
		       sstor.ss_os[15], sstor.ss_os[16], sstor.ss_os[17],
		       sstor.ss_os[18], sstor.ss_os[19], sstor.ss_os[20],
		       sstor.ss_os[21]);

		printf("PAGE0:\n");
		printf("ivec=%x, pf=%p[%u], toc=%p[%u], rendz=%p\n"
		       "mem: cont=%u, phys=%u, pdc_spa=%u, resv=%u, free=%x\n"
		       "cpu_hpa=%p, pdc=%p, imm_hpa=%p[%u,%u]\n"
		       "soft=%u, tic/10ms=%u\n",
		       PAGE0->ivec_special, PAGE0->ivec_mempf,
		       PAGE0->ivec_mempflen, PAGE0->ivec_toc,
		       PAGE0->ivec_toclen, PAGE0->ivec_rendz,
		       PAGE0->memc_cont, PAGE0->memc_phsize, PAGE0->memc_adsize,
		       PAGE0->memc_resv, PAGE0->mem_free, PAGE0->mem_hpa,
		       PAGE0->mem_pdc, PAGE0->imm_hpa, PAGE0->imm_spa_size,
		       PAGE0->imm_max_mem, PAGE0->imm_soft_boot,
		       PAGE0->mem_10msec);
		printf("console:  ");	PZDEV_PRINT(&PAGE0->mem_cons);
		printf("boot:     ");	PZDEV_PRINT(&PAGE0->mem_boot);
		printf("keyboard: ");	PZDEV_PRINT(&PAGE0->mem_kbd);
	}
#endif
}
示例#17
0
/*
 * Find devices.  The system is alive.
 */
void machine_init(void)
{
	/*
	 * Initialize the console.
	 */
	cninit();

	/*
	 * Set up to use floating point.
	 */
	init_fpu();

#ifdef MACH_HYP
	hyp_init();
#else	/* MACH_HYP */
#ifdef LINUX_DEV
	/*
	 * Initialize Linux drivers.
	 */
	linux_init();
#endif

	/*
	 * Find the devices
	 */
	probeio();
#endif	/* MACH_HYP */

	/*
	 * Get the time
	 */
	inittodr();

#ifndef MACH_HYP
	/*
	 * Tell the BIOS not to clear and test memory.
	 */
	*(unsigned short *)phystokv(0x472) = 0x1234;
#endif	/* MACH_HYP */

#if VM_MIN_KERNEL_ADDRESS == 0
	/*
	 * Unmap page 0 to trap NULL references.
	 *
	 * Note that this breaks accessing some BIOS areas stored there.
	 */
	pmap_unmap_page_zero();
#endif
}
示例#18
0
/*
 * Console initialization: called early on from main,
 * before vm init or startup, but already running virtual.
 * Do enough configuration to choose and initialize a console.
 */
void
consinit()
{
	/*
	 * Initialize the console before we print anything out.
	 */
	cninit();

#ifdef DDB
	db_machine_init();
	ddb_init();

	if (boothowto & RB_KDB)
		Debugger();
#endif
}
示例#19
0
void
platform_start(__register_t a0, __register_t a1, __register_t a2,
	       __register_t a3)
{
	vm_offset_t 		 kernend;
	uint64_t		 platform_counter_freq;
	int			 error;

	/* clear the BSS and SBSS segments */
	kernend = (vm_offset_t)&end;
	memset(&edata, 0, kernend - (vm_offset_t)(&edata));

	mips_postboot_fixup();

	/* Initialize pcpu stuff */
	mips_pcpu0_init();

#ifdef CFE
	/*
	 * Initialize CFE firmware trampolines. This must be done
	 * before any CFE APIs are called, including writing
	 * to the CFE console.
	 *
	 * CFE passes the following values in registers:
	 * a0: firmware handle
	 * a2: firmware entry point
	 * a3: entry point seal
	 */
	if (a3 == CFE_EPTSEAL)
		cfe_init(a0, a2);
#endif

	/* Init BCM platform data */
	if ((error = bcm_init_platform_data(&bcm_platform_data)))
		panic("bcm_init_platform_data() failed: %d", error);

	platform_counter_freq = bcm_get_cpufreq(bcm_get_platform());

	/* CP0 ticks every two cycles */
	mips_timer_early_init(platform_counter_freq / 2);

	cninit();

	mips_init();

	mips_timer_init_params(platform_counter_freq, 1);
}
示例#20
0
文件: boot2.c 项目: ryo/netbsd-src
void
boot2(uint32_t boot_biossector)
{
	int currname;
	int c;

	/* Initialize hardware */
	tick_init();

	/* Initialize console */
	cninit(boot_params.bp_consdev);

	print_banner();

	/* try to set default device to what BIOS tells us */
	bios2dev(0x40, &default_devname, &default_unit,
		boot_biossector, &default_partition);

	/* if the user types "boot" without filename */
	default_filename = DEFFILENAME;

	printf("Press return to boot now, any other key for boot menu\n");
	currname = 0;
	for (;;) {
		printf("booting %s - starting in ", 
		    sprint_bootsel(names[currname][0]));

		c = awaitkey(boot_params.bp_timeout, 1);
		if ((c != '\r') && (c != '\n') && (c != '\0')) {
			printf("type \"?\" or \"help\" for help.\n");
			bootmenu(); /* does not return */
		}

		/*
		 * try pairs of names[] entries, foo and foo.gz
		 */
		/* don't print "booting..." again */
		bootit(names[currname][0], 0, 0);
		/* since it failed, try compressed bootfile. */
		bootit(names[currname][1], 0, 1);
		/* since it failed, try switching bootfile. */
		currname = (currname + 1) % NUMNAMES;
	}
}
示例#21
0
void
platform_start(__register_t a0, __register_t a1,  __register_t a2, 
    __register_t a3)
{
	vm_offset_t kernend;
	uint64_t platform_counter_freq;
	int argc = a0;
	char **argv = (char **)a1;
	char **envp = (char **)a2;
	unsigned int memsize = a3;
	int i;

	/* clear the BSS and SBSS segments */
	kernend = (vm_offset_t)&end;
	memset(&edata, 0, kernend - (vm_offset_t)(&edata));

	mips_postboot_fixup();

	mips_pcpu0_init();
	platform_counter_freq = malta_cpu_freq();
	mips_timer_early_init(platform_counter_freq);

	cninit();
	printf("entry: platform_start()\n");

	bootverbose = 1;
	if (bootverbose) {
		printf("cmd line: ");
		for (i = 0; i < argc; i++)
			printf("%s ", argv[i]);
		printf("\n");

		printf("envp:\n");
		for (i = 0; envp[i]; i += 2)
			printf("\t%s = %s\n", envp[i], envp[i+1]);

		printf("memsize = %08x\n", memsize);
	}

	realmem = btoc(memsize);
	mips_init();

	mips_timer_init_params(platform_counter_freq, 0);
}
示例#22
0
/*
 * Console initialization: called early on from main,
 * before vm init or startup.  Do enough configuration
 * to choose and initialize a console.
 */
consinit()
{

	/*
	 * Set cpuspeed immediately since cninit() called routines
	 * might use delay.  Note that we only set it if a custom value
	 * has not already been specified.
	 */
	if (cpuspeed == 0) {
		switch (machineid) {
		case HP_320:
		case HP_330:
		case HP_340:
			cpuspeed = MHZ_16;
			break;
		case HP_350:
		case HP_360:
		case HP_380:
			cpuspeed = MHZ_25;
			break;
		case HP_370:
		case HP_433:
			cpuspeed = MHZ_33;
			break;
		case HP_375:
			cpuspeed = MHZ_50;
			break;
		default:	/* assume the fastest */
			cpuspeed = MHZ_50;
			break;
		}
		if (mmutype == MMU_68040)
			cpuspeed *= 2;	/* XXX */
	}
	/*
         * Find what hardware is attached to this machine.
         */
	find_devs();

	/*
	 * Initialize the console before we print anything out.
	 */
	cninit();
}
示例#23
0
文件: model_dep.c 项目: Prajna/mach
/*
 *	Cpu initialization.  Running virtual, but without MACH VM
 *	set up.  First C routine called.
 */
void machine_startup()
{
	/*
	 * Do basic VM initialization
	 */
	i386_init();

	/*
	 * Initialize the console so we can print.
	 */
	cninit();
	proberc();
#if	MACH_KDB

	/*
	 * Initialize the kernel debugger.
	 */
	ddb_init();

	/*
	 * Cause a breakpoint trap to the debugger before proceeding
	 * any further if the proper option bit was specified in
	 * the boot flags.
	 *
	 * XXX use -a switch to invoke kdb, since there's no
	 *     boot-program switch to turn on RB_HALT!
	 */
	if (boothowto & RB_ASKNAME)
	    Debugger();
#endif	MACH_KDB

	printf(version);

	machine_slot[0].is_cpu = TRUE;
	machine_slot[0].running = TRUE;
	machine_slot[0].cpu_type = CPU_TYPE_I386;
	machine_slot[0].cpu_subtype = CPU_SUBTYPE_AT386;

	/*
	 * Start the system.
	 */
	setup_main();
}
示例#24
0
void
platform_start(__register_t a0, __register_t a1, __register_t a2,
               __register_t a3)
{
    vm_offset_t 		 kernend;
    uint64_t		 platform_counter_freq;
    struct bcm_socinfo	*socinfo;

    /* clear the BSS and SBSS segments */
    kernend = (vm_offset_t)&end;
    memset(&edata, 0, kernend - (vm_offset_t)(&edata));

    mips_postboot_fixup();

    /* Initialize pcpu stuff */
    mips_pcpu0_init();

    socinfo = bcm_get_socinfo();
    platform_counter_freq = socinfo->cpurate * 1000 * 1000; /* BCM4718 is 480MHz */

    mips_timer_early_init(platform_counter_freq);

#ifdef CFE
    /*
     * Initialize CFE firmware trampolines before
     * we initialize the low-level console.
     *
     * CFE passes the following values in registers:
     * a0: firmware handle
     * a2: firmware entry point
     * a3: entry point seal
     */
    if (a3 == CFE_EPTSEAL)
        cfe_init(a0, a2);
#endif
    cninit();

    mips_init();

    /* BCM471x timer is 1/2 of Clk */
    mips_timer_init_params(platform_counter_freq, 1);
}
示例#25
0
void
platform_start(__register_t a0 __unused, __register_t a1 __unused, 
    __register_t a2 __unused, __register_t a3 __unused)
{
	vm_offset_t kernend;
	uint64_t platform_counter_freq = 175 * 1000 * 1000;

	/* clear the BSS and SBSS segments */
	kernend = (vm_offset_t)&end;
	memset(&edata, 0, kernend - (vm_offset_t)(&edata));

	mips_postboot_fixup();

	/* Initialize pcpu stuff */
	mips_pcpu0_init();

	cninit();
	mips_init();
	mips_timer_init_params(platform_counter_freq, 0);
}
示例#26
0
文件: machdep.c 项目: MarginC/kame
/*
 * Console initialization: called early on from main,
 * before vm init or startup.  Do enough configuration
 * to choose and initialize a console.
 */
void
consinit()
{

	/*
	 * Initialize the console before we print anything out.
	 */
	cninit();

#ifdef DDB
	{
		extern int end;
		extern int *esym;

		ddb_init(*(int *)&end, ((int *)&end) + 1, esym);
	}
	if (boothowto & RB_KDB)
		Debugger();
#endif
}
示例#27
0
/*
 * Find devices.  The system is alive.
 */
void machine_init()
{
	/*
	 * Initialize the console.
	 */
	cninit();

	/*
	 * Set up to use floating point.
	 */
	init_fpu();

#ifdef LINUX_DEV
	/*
	 * Initialize Linux drivers.
	 */
	linux_init();
#endif

	/*
	 * Find the devices
	 */
	probeio();

	/*
	 * Get the time
	 */
	inittodr();

	/*
	 * Tell the BIOS not to clear and test memory.
	 */
	*(unsigned short *)phystokv(0x472) = 0x1234;

	/*
	 * Unmap page 0 to trap NULL references.
	 */
	pmap_unmap_page_zero();
}
示例#28
0
void
platform_start(__register_t a0, __register_t a1, __register_t a2,
               __register_t a3)
{
    /*
     * Make sure that kseg0 is mapped cacheable-coherent
     */
    kseg0_map_coherent();

    /* clear the BSS and SBSS segments */
    memset(&edata, 0, (vm_offset_t)&end - (vm_offset_t)&edata);
    mips_postboot_fixup();

    sb_intr_init(0);
    sb_timecounter_init();

    /* Initialize pcpu stuff */
    mips_pcpu0_init();

#ifdef CFE
    /*
     * Initialize CFE firmware trampolines before
     * we initialize the low-level console.
     *
     * CFE passes the following values in registers:
     * a0: firmware handle
     * a2: firmware entry point
     * a3: entry point seal
     */
    if (a3 == CFE_EPTSEAL)
        cfe_init(a0, a2);
#endif
    cninit();

    mips_init();

    mips_timer_init_params(sb_cpu_speed(), 0);
}
示例#29
0
文件: consinit.c 项目: MarginC/kame
void
consinit(void)
{
#if ((NVIDCVIDEO>0) && (NRPCKBD>0))
	static struct rpckbd_softc *ksc = &console_kbd;
#endif

	static int consinit_called = 0;

	if (consinit_called != 0)
		return;
	consinit_called = 1;

#ifdef COMCONSOLE
	comcninit(NULL);
	return;
#endif


#if ((NVIDCVIDEO>0) && (NRPCKBD>0))
	/* set up bus variables for attachment */
	ksc->sc_iot	 = &iomd_bs_tag;
	ksc->t_isconsole = 1;
	ksc->data_port	 = IOMD_KBDDAT;
	ksc->cmd_port	 = IOMD_KBDCR;
	ksc->sc_enabled	 = 1;
	bus_space_map(ksc->sc_iot, IOMD_KBDDAT, 8, 0, &(ksc->sc_ioh));

	rpckbd_cnattach((struct device *) ksc);
	vidcvideo_cnattach(videomemory.vidm_vbase);
	return;
#else
	/* XXX For old VIDC console. */
	cninit();
	return;
#endif
	panic("No console");	/* Will we ever see this?  */
}
示例#30
0
/*
 * Console initialization: called early on from main,
 * before vm init or startup.  Do enough configuration
 * to choose and initialize a console.
 */
void
consinit(void)
{

	/*
	 * Initialize the console before we print anything out.
	 */
	cninit();

#if NKSYMS || defined(DDB) || defined(LKM)
	{
		extern char end[];
		extern int *esym;

		ksyms_init((int)esym - (int)&end - sizeof(Elf32_Ehdr),
		    (void *)&end, esym);
	}
#endif
#ifdef DDB
	if (boothowto & RB_KDB)
		Debugger();
#endif
}