next up previous
Next: About this document ... Up: oskit_tut Previous: Registering ISR

A sample C Code

The following sample code initializes the OSkit, the PIC and PIT.
init()
{
  oskit_clientos_init();
  base_irq_init();

  // Instal;l your interrupt handler
  base_irq_handlers[0]=&schedule;

  //Initialize the pit to generate interrupts at 100 Hz
  pit_init(100); 

  //Enable irq 0 in PIC
  pic_enable_irq(0);
}
This function can be called from main. Look at some of the OSKit examples.


Soumyadeb Mitra 2002-10-23