Ejemplo n.º 1
0
Archivo: pre_init.c Proyecto: grd/minix
kinfo_t *pre_init(u32_t magic, u32_t ebx)
{
	/* Clear BSS */
	memset(&_edata, 0, (u32_t)&_end - (u32_t)&_edata);

	omap3_ser_init();	
	/* Get our own copy boot params pointed to by ebx.
	 * Here we find out whether we should do serial output.
	 */
	get_parameters(ebx, &kinfo);

	/* Make and load a pagetable that will map the kernel
	 * to where it should be; but first a 1:1 mapping so
	 * this code stays where it should be.
	 */
	dcache_clean(); /* clean the caches */
	pg_clear();
	pg_identity(&kinfo);
	kinfo.freepde_start = pg_mapkernel();
	pg_load();
	vm_enable_paging();

	/* Done, return boot info so it can be passed to kmain(). */
	return &kinfo;
}
Ejemplo n.º 2
0
kinfo_t *pre_init(u32_t magic, u32_t ebx)
{
	/* Get our own copy boot params pointed to by ebx.
	 * Here we find out whether we should do serial output.
	 */
	get_parameters(ebx, &kinfo);

	assert(magic == MULTIBOOT_BOOTLOADER_MAGIC);

	/* Make and load a pagetable that will map the kernel
	 * to where it should be; but first a 1:1 mapping so
	 * this code stays where it should be.
	 */
	pg_clear();
	pg_identity(&kinfo);
	kinfo.freepde_start = pg_mapkernel();
	pg_load();
	vm_enable_paging();

	/* Done, return boot info so it can be passed to kmain(). */
	return &kinfo;
}
Ejemplo n.º 3
0
int vm_init(void)
{
	slock_init(&global_mem_lock);
#ifdef __ALLOW_VM_SHARE__
	vm_share_init(); /* Setup shared memory */
#endif

	/** 
	 * The boot loader has handled all of the messy work for us.
	 * All we need to do is pick up the free map head and kernel
	 * page directory.
	 */
	
	/* The boot strap directly mapped in the null guard page */
	vm_unmappage(0x0, k_pgdir);

	vmflags_t dir_flags = VM_DIR_READ | VM_DIR_WRIT;
	vmflags_t tbl_flags = VM_TBL_READ | VM_TBL_WRIT;

	/* Map pages in for our kernel stack */
	vm_mappages(KVM_KSTACK_S, KVM_KSTACK_E - KVM_KSTACK_S, k_pgdir, 
		dir_flags, tbl_flags);

	/* Add bootstrap code to the memory pool */
	int boot2_s = PGROUNDDOWN(KVM_BOOT2_S) + PGSIZE;
	int boot2_e = PGROUNDUP(KVM_BOOT2_E);

	int x;
	for(x = boot2_s;x < boot2_e;x += PGSIZE)
		pfree(x);	

	/* Clear the TLB */
	vm_enable_paging(k_pgdir);

	return 0;
}
Ejemplo n.º 4
0
void segmentation2paging(struct proc * current)
{
	/* switch to the current process page tables before turning paging on */
	switch_address_space(current);
	vm_enable_paging();
}