Beispiel #1
0
/*
 * Loader main routine
 *
 * We assume that the following machine state has
 * been already set before this routine.
 *	- CPU is initialized.
 *	- DRAM is configured.
 *	- Loader BSS section is filled with 0.
 *	- Loader stack is configured.
 *	- All interrupts are disabled.
 */
int
main(void)
{
	entry_t entry;

	memset(bootinfo, 0, BOOTINFOSZ);

	/*
	 * Initialize debug port.
	 */
	debug_init();

	DPRINTF(("Prex Boot Loader\n"));

	/*
	 * Do platform dependent initialization.
	 */
	startup();

	/*
	 * Show splash screen.
	 */
	splash();

	/*
	 * Load OS modules to appropriate locations.
	 */
	load_os();

	/*
	 * Dump boot infomation for debug.
	 */
	dump_bootinfo();

	/*
	 * Launch kernel.
	 */
	entry = (entry_t)kvtop(bootinfo->kernel.entry);
	DPRINTF(("Entering kernel (at 0x%lx) ...\n\n", (long)entry));
	(*entry)();

	panic("Oops!");
	/* NOTREACHED */
	return 0;
}
Beispiel #2
0
/*
 * C entry point
 */
void
loader_main(void)
{
	paddr_t kernel_entry;

	/*
	 * Initialize data.
	 */
	memset(bootinfo, 0, BOOTINFO_SIZE);

	load_base = 0;
	load_start = 0;
	nr_img = 0;

	/*
	 * Setup minimum hardware for boot (may include machine_putc()).
	 */
	machine_setup();

	DPRINTF(("Prex Boot Loader V1.00\n"));

	/*
	 * Load program image.
	 */
	setup_image();
#if defined(DEBUG) && defined(DEBUG_BOOTINFO)
	dump_bootinfo();
#endif
	/*
	 * Jump to the kernel entry point
	 * via machine-dependent code.
	 */
	kernel_entry = (paddr_t)phys_to_virt(bootinfo->kernel.entry);

	DPRINTF(("kernel_entry=%x\n", kernel_entry));
	DPRINTF(("Entering kernel...\n\n"));

	start_kernel(kernel_entry);

	/* NOTREACHED */
}