예제 #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();
        }
예제 #2
0
        public static void SetCommand(SysCallTarget command, DSysCallInfoHandler handler, Process proc = null)
        {
            var debug = false;

            if (command == SysCallTarget.Tmp_DisplayServer_CreateWindow)
            {
                debug = true;
            }

            if (proc != null)
            {
                KernelMessage.WriteLine("Register Command {0} for Process {1}", (uint)command, (uint)proc.ProcessID);
            }

            Commands[(uint)command] = new SysCallHandlerInfo
            {
                CommandID = command,
                Handler   = handler,
                Process   = proc,
                Debug     = debug,
            };
        }