====== CallProg 분석 ====== Testapp7 에 있는 CallProg 라는 함수에 대한 분석이다. 이 함수는 흔히 다른 함수와는 달리 어셈블리어로 만들어져 있다. 그 만큼 중요하고, 또 마지막에 jump 코드가 포함되어 있다. 아마도 이 코드를 분석한다면, 내가 원하는 듀얼부팅에 뭔가 실마리를 얻을 수 있을 것 같다. void callprog(void* addr) // 테스트 프로그램에서 callprog((void *)0x7ffffffe) 로 호출했다 { int i; int priority = 0; int regs[4]; /*lint -e550*/ #ifdef APK long int res; char buf[100]; #endif /* check the hardware priority */ __asm { ldpri; // 우선순위를 load 한다 st priority; // st 에 우선 순위값을 저장한다 } if (1 == priority) { /* change to high priority */ __asm { ldlabeldiff here - there; // here 와 there 사이의 차이를 load 한다 ldpi; // 포인터를 load 한다 here:; stl -1; // -1 을 local 에 저장한다 ldlp 0; // 0 의 local pointer 를 load 한다. runp; // 프로세스를 실행한다 there:; } } /* disable inturrupts */ interrupt_disable_global (); // 인터럽트를 중지시킨다 /* restore the interrupt controller */ // 인터럽트 복구 for (i=0; i