Ejemplo n.º 1
0
        public static void Setup()
        {
            KernelMessage.WriteLine("Initialize SysCall Manager");

            IDTManager.SetInterruptHandler(FunctionIRQ, FunctionInterruptHandler);
            IDTManager.SetPrivilegeLevel(FunctionIRQ, 0x03);
            IDTManager.SetInterruptHandler(ActionIRQ, ActionInterruptHandler);
            IDTManager.SetPrivilegeLevel(ActionIRQ, 0x03);
            IDTManager.Flush();

            Commands = new SysCallHandlerInfo[256];
            SetCommands();
        }
Ejemplo n.º 2
0
        public static unsafe void Start()
        {
            SetThreadID(0);
            Enabled = true;

            KernelMessage.WriteLine("Enable Scheduler");
            IDTManager.SetPrivilegeLevel((uint)KnownInterrupt.TerminateCurrentThread, 0x03);
            GDT.Tss->ESP0 = Threads[0].KernelStackBottom;
            GDT.LoadTaskRegister();
            TriggerScheduler();

            // Normally, you should never get here
            Panic.Error("Main-Thread still alive");
        }