コード例 #1
0
ファイル: locore2.c プロジェクト: ryo/netbsd-src
/*
 * This is called from locore.s just after the kernel is remapped
 * to its proper address, but before the call to main().  The work
 * done here corresponds to various things done in locore.s on the
 * hp300 port (and other m68k) but which we prefer to do in C code.
 * Also do setup specific to the Sun PROM monitor and IDPROM here.
 */
void
_bootstrap(void)
{
	extern struct consdev consdev_prom;	/* XXX */

	/* First, Clear BSS. */
	memset(edata, 0, end - edata);

	/* Set v_handler, get boothowto. */
	sunmon_init();

	/*
	 * Initialize console to point to the PROM (output only) table
	 * for early printf calls.
	 */
	cn_tab = &consdev_prom;

	/* Handle kernel mapping, pmap_bootstrap(), etc. */
	_vm_init();

	/*
	 * Find and save OBIO mappings needed early,
	 * and call some init functions.
	 */
	obio_init();

	/*
	 * Point interrupts/exceptions to our vector table.
	 * (Until now, we use the one setup by the PROM.)
	 *
	 * This is done after obio_init() / intreg_init() finds
	 * the interrupt register and disables the NMI clock so
	 * it will not cause "spurrious level 7" complaints.
	 * Done after _vm_init so the PROM can debug that.
	 */
	setvbr((void **)vector_table);
	/* Interrupts are enabled later, after autoconfig. */

	/*
	 * Find the IDPROM and copy it to memory.
	 * Needs obio_init and setvbr earlier.
	 */
	idprom_init();

	/*
	 * Turn on the LEDs so we know power is on.
	 * Needs idprom_init and obio_init earlier.
	 */
	leds_init();
}
コード例 #2
0
ファイル: locore2.c プロジェクト: lacombar/netbsd-alc
/*
 * This is called from locore.s just after the kernel is remapped
 * to its proper address, but before the call to main().  The work
 * done here corresponds to various things done in locore.s on the
 * hp300 port (and other m68k) but which we prefer to do in C code.
 * Also do setup specific to the Sun PROM monitor and IDPROM here.
 */
void 
_bootstrap(void)
{
	vaddr_t va;

	/* First, Clear BSS. */
	memset(edata, 0, end - edata);

	/* Initialize the PROM. */
	prom_init();

	/* Copy the IDPROM from control space. */
	idprom_init();

	/* Validate the Sun2 model (from IDPROM). */
	_verify_hardware();

	/* Handle kernel mapping, pmap_bootstrap(), etc. */
	_vm_init();

	/*
	 * Point interrupts/exceptions to our vector table.
	 * (Until now, we use the one setup by the PROM.)
	 */
	setvbr((void **)vector_table);
	/* Interrupts are enabled later, after autoconfig. */

	/*
 	* Now unmap the PROM's physical/virtual pages zero through three.
 	*/
	for(va = 0; va < PAGE_SIZE * 4; va += PAGE_SIZE)
		set_pte(va, PG_INVAL);

	/*
	 * Turn on the LEDs so we know power is on.
	 * Needs idprom_init and obio_init earlier.
	 */
	leds_init();
}