/// <summary> /// Handler for timer /// </summary> /// <param name="context">The old context</param> /// <returns>The new context</returns> private static void *timerHandler(void *context) { // Update ticks Time.SubTicks++; // One second if (Time.SubTicks == Time.TicksPerSecond) { // Update ticks Time.SubTicks = 0; Time.FullTicks++; Time.Seconds++; if (Time.Seconds == 60) { Time.Seconds = 0; Time.Minutes++; // Re-read the CMOS time every hour if (Time.Minutes == 60) { CMOS.UpdateTime(); Time.FullTicks = Time.CalculateEpochTime(); } } } // Context switch context = Tasking.Scheduler(context); SendEOI(); return(context); }
/// <summary> /// Initializes the specific x86 stuff /// </summary> public static void Init() { GDT.Init(); PIC.Remap(); IDT.Init(); IRQ.Init(); PhysicalMemoryManager.Init(); Paging.Init(); Heap.InitRealHeap(); IOApicManager.Init(); Acpi.Init(); LocalApic.InitLocalAPIC(); IOApicManager.InitIOApics(); CMOS.UpdateTime(); Time.FullTicks = Time.CalculateEpochTime(); }