예제 #1
0
        internal static IRQCallBack[] callBacks;                //TODO: create list per IRQ (for shared IRQs)

        #region Constructor
        internal IRQHandler16bit(byte irq)
        {
            spinLock.Enter();

            if (irqs == null)
            {
                irqs      = new bool[16];
                callBacks = new IRQCallBack[16];
            }

            this.irq = irq;

            IDT.Interrupt interrupt = (IDT.Interrupt)(irq + 0x20);

            IDT.RegisterIRQ(interrupt, Stubs.GetFunctionPointer(INTERRUPT16BIT_HANDLER));

            spinLock.Exit();
        }
예제 #2
0
 public static void Setup()
 {
     IDT.RegisterIRQ(IDT.Interrupt.DivideError, Stubs.GetFunctionPointer(DIVIDE_ERROR));
 }
예제 #3
0
        /*
         * // sigh.. one can only dream
         * public delegate void somefunction(uint value);
         * unsafe static somefunction[] timerEvents = (somefunction[])Stubs.StaticAlloc<somefunction>(Kernel.MaxEventHandlers);
         * public event somefunction function
         * {
         *      add
         *      {
         *              for (int x = 0; x < Kernel.MaxEventHandlers; ++x)
         *                      if (timerEvents[x] == value)
         *                              return;
         *
         *              for (int x = 0; x < Kernel.MaxEventHandlers; ++x)
         *                      if (timerEvents[x] == null)
         *                              timerEvents[x] = value;
         *      }
         *      remove
         *      {
         *              for (int x = 0; x < Kernel.MaxEventHandlers; ++x)
         *                      if (timerEvents[x] == value)
         *                              timerEvents[x] = null;
         *      }
         * }
         */

        #region Setup
        public static void Setup()
        {
            SetTimerFrequency(HZ);

            IDT.RegisterIRQ(IDT.Interrupt.SystemTimer, Stubs.GetFunctionPointer(TIMER_HANDLER));
        }
예제 #4
0
 public static void Setup()
 {
     IDT.RegisterIRQ(IDT.Interrupt.Keyboard, Stubs.GetFunctionPointer(KEYBOARD_HANDLER));
 }