Пример #1
0
extern "C" void boot2(){

	dln
printd("memset\r\n");
delay_cpu(10);
  for (int i = (int) _bss_start; i < (int)_bss_end; i++)
  {
    *((char*) i)=0;
  }


	dln
printd("boot2\r\n");
delay_cpu(10);

debug_serial_printhex_int((int)&__preinit_array_start);dln
debug_serial_printhex_int((int)&__preinit_array_end);dln
debug_serial_printhex_int((int)&__init_array_start);dln
debug_serial_printhex_int((int)&__init_array_end);dln
debug_serial_printhex_int((int)&_ctor_start);dln
debug_serial_printhex_int((int)&_ctor_end);dln


// BEGIN C++ support (2/2)
  //Call C++ global constructors
  call_constructors(&__preinit_array_start, &__preinit_array_end);
  call_constructors(&__init_array_start, &__init_array_end);
 call_constructors(&_ctor_start, &_ctor_end);
  // END C++ support (2/2)

dln
printd("callconstrend\r\n");
delay_cpu(10);

	second_init();
	drivers_init();
	hmain();
	
	systemError("MAIN FUNCTION END. Kernel bewilderment :)");	
}
Пример #2
0
extern "C" void boot2(){
printd("GenOS boot2 function successful load\r\n");
printd("Section info:\r\n");
printd("_text_begin :"); dpr_inthex((int)&_text_begin);dln;
printd("_text_end   :"); dpr_inthex((int)&_text_end);dln;
printd("_data_begin :"); dpr_inthex((int)&_data_begin);dln;
printd("_data_end   :"); dpr_inthex((int)&_data_end);dln;
printd("_bss_begin  :"); dpr_inthex((int)&_bss_begin);dln;
printd("_bss_end    :"); dpr_inthex((int)&_bss_end);dln;


printd("bss clean...   ");
//delay_cpu(10);

  for (unsigned int i = (unsigned int)&_bss_begin; i < (unsigned int)&_bss_end; i++)
  {
    *((char*) i)=0;
  }
printd("OK\r\n");
//delay_cpu(10);

printd("Constructor info:\r\n");
printd("__preinit_array_start:");dpr_inthex((int)&__preinit_array_start);dln
printd("__preinit_array_end  :");dpr_inthex((int)&__preinit_array_end);dln
printd("__init_array_start   :");dpr_inthex((int)&__init_array_start);dln
printd("__init_array_end     :");dpr_inthex((int)&__init_array_end);dln
printd("_ctor_start          :");dpr_inthex((int)&_ctor_start);dln
printd("_ctor_end            :");dpr_inthex((int)&_ctor_end);dln

printd("constr call:\r\n");
// BEGIN C++ support (2/2)
  //Call C++ global constructors
  call_constructors(&__preinit_array_start, &__preinit_array_end);
  call_constructors(&__init_array_start, &__init_array_end);
 call_constructors(&_ctor_start, &_ctor_end);
  // END C++ support (2/2)
printd("constr call OK\r\n");

delay_cpu(10);
//	second_init();


//	drivers_init();
printd("Call boot3 function...");

	boot3();
	
systemError("BOOT2 FUNCTION END. Kernel bewilderment :)");	
}
Пример #3
0
DWORD WINAPI Worker (void *arg)
{
    THARG * threadArgs;
    int iThread;

    threadArgs = (THARG *)arg;    
    iThread = threadArgs->threadNumber;

    while (threadArgs->tasksComplete < threadArgs->tasksToComplete) {
        delay_cpu (workerDelay);
        (threadArgs->tasksComplete)++;
    }
        
    return 0;        
}