Exemplo n.º 1
0
void switch_to_ctx(struct ctx_s * suivant)
{
	if (current_ctx) 
	{
		getEBP(current_ctx->ebp_b);
		getESP(current_ctx->esp_b);
	}
	current_ctx = suivant;
	liste = current_ctx;
	static short launched =0;
	static func_t * pf;
	static void* params;
	pf = current_ctx->func;
	params = current_ctx->parameters;

	if(!current_ctx->launched)
	{
		current_ctx->launched=1;
		launched =1;
	}
  	setESP(current_ctx->esp_b);
  	setEBP(current_ctx->ebp_b);
        
  	if(launched)
    	{
      		launched = 0;
    		pf(params);
	}
  	return 0;
}
Exemplo n.º 2
0
void cGenProt(isrVal_t regs)
{
  printf("GP\n");
  printf("\nGeneral Protection Fault\neip\tcs\tds\teflags\tprocesp\tss\n");
  printf("%X\t%X\t%X\t%X\t%X\n", regs.eip, regs.cs, regs.ds, regs.eflags,
                                                        regs.procesp, regs.ss);
  printf("\nCurrent:\n");
  printf("CS\tDS\tSS\tESP\n");
  printf("%X\t%X\t%X\t%X\n", getCS(), getDS(), getSS(), getESP());
  checkFrame(&regs);
//   panic("General Protection fault");
}
Exemplo n.º 3
0
void cBreakp(isrVal_t regs)
{
  printf("BP\n");
  checkFrame(&regs);
  printf("Debug:\n");

  printf("eax\tebx\tecx\tedx\n%X\t%X\t%X\t%X\n", regs.eax, regs.ebx, regs.ecx, regs.edx);
  printf("\nds\n%X\n", regs.ds);
  printf("\nedi\tesi\tebp\tesp\n%X\t%X\t%X\t%X\n", regs.edi, regs.esi, regs.ebp, regs.esp);
  printf("\neip\tcs\teflags\tuseresp\tss\n%X\t%X\t%X\t%X\t%X\n", regs.eip, regs.cs, regs.eflags, regs.procesp, regs.ss);
  printf("\nerr_code\tfunc_ptr\n%X\t%X\n", regs.errCode, regs.funcPtr);
  printf("\n\nCurrent:\n");
  printf("CS\tDS\tSS\tESP\n%X\t%X\t%X\t%X\n", getCS(), getDS(), getSS(), getESP());
}
Exemplo n.º 4
0
void cDivByZero(isrVal_t regs)
{
  printf("D0\n");
  checkFrame(&regs);
  if (regs.cs != 0x8)
  {
    panic("No process killing code yet");
  }
  printf("\nDiv by 0\neip\tcs\teflags\tprocesp\tss\n");
  printf("%X\t%X\t%X\t%X\t%X\n", regs.eip, regs.cs, regs.eflags, regs.procesp, regs.ss);
  printf("\nCurrent:\n");
  printf("CS\tDS\tSS\tESP\n");
  printf("%X\t%X\t%X\t%X\n", getCS(), getDS(), getSS(), getESP());
  panic ("Devide by zero");
}