All pastes #804750 Raw Edit

Miscellany

public c v1 · immutable
·published 2007-12-03 19:22 UTC
rendered paste body
int32_t execute(const uint8_t* command){		dentry_t fentry;	int return_val = -1;		if (-1 == read_dentry_by_name(command,&fentry)) {		return -1;	}	//	tss.cr3 = ppagedir;//	tss.esp0 = 0x800000;		asm  volatile (		"movl %0 , %%eax\n\t" 		"movl %%eax , %%CR3"	  		: 		: "r"(ppagedir)		: "%eax"	);		copy_file(fentry);		asm volatile (//		  "pushl %%ebp\n\t"	//	  "pushl %%eip\n\t" 		"pushl %2\n\t"		"pushl %4\n\t"		"pushl $0x0202 \n\t"		"pushl %3\n\t"		"pushl %0\n\t"		//"movl %1,%%ebp\n\t"		"mov %2,%%ax\n\t"		"mov %%ax,%%ds\n\t" 		"iret"		: 		: "g"(tss.eip),"g"(tss.ebp),"g"(USER_DS),"g"(USER_CS),"g"(tss.esp)		: "%eax"	);	return return_val;}