示例#1
0
文件: kheap.c 项目: 16Bitt/virtix
void init_kheap(){
	end = (unsigned int) &end;
	placement_address = end;

	kheap = (heap_header_t*) fmalloc(KHEAP_SIZE);
	init_heap(kheap, KHEAP_SIZE);
	
	//Make user heap, then map to its
	uheap = (heap_header_t*) kmalloc_a(UHEAP_SIZE);
	init_heap(uheap, UHEAP_SIZE);
	vpage_map_user(root_vpage_dir, (uint) &uheap, (uint) &uheap);
}
示例#2
0
virtix_proc_t* flat_load_bin(void* addr){
	cli();
	virtix_proc_t* proc = mk_empty_proc();
	proc->registers.useresp = 0;
	proc->registers.eip = 0xF0000000;
	
	proc->name = "FLAT_BIN";

	unsigned int mem = (unsigned int) kmalloc_a(PAGE_S);
	vpage_map_user(proc->cr3, mem, 0xF0000000);
	memcpy((void*) mem, (void*) addr, 1024);
	
	sti();
	return proc;
}