示例#1
0
            public bool Initialize(UIntPtr controllerHandle, UIntPtr context)
            {
                Clients[Thread.CurrentProcess.ProcessId] = this;

                ControllerHandle = controllerHandle;
                Context          = context;

                if (!KernelController.RegisterExternalController(controllerHandle, context))
                {
                    Clients.Remove(Thread.CurrentProcess.ProcessId);
                    return(false);
                }

                return(true);
            }
示例#2
0
        internal override void Initialize()
        {
            if (KernelControllerObject != null)
            {
                //  Already initialized

                return;
            }

            base.Initialize();
            ProcessContext.Initialize();

            GeneralPurposeStorage = EventingStorage.CreateLocalStorage(QualityOfService.RecyclableEvents,
                                                                       BUFFER_EXPANSION_SIZE);

            KernelControllerObject = this;
        }
示例#3
0
        //  Public methods

        static public void InitializeSystem()
        {
            // Create the system controller if needed. The SIPs will
            // get a proxy controller object that will handle operations
            // as syscalls.
            // TODO: Further optimizations may allow writing a more
            // efficient proxy that may use shared memory.

#if SINGULARITY_KERNEL
            KernelController controller = new KernelController();

            if (controller != null)
            {
                LocalControllerObject  = controller;
                SystemControllerObject = LocalControllerObject;
                controller.Initialize();
            }
#else
            LocalController controller = new LocalController();

            if (controller != null)
            {
                LocalControllerObject = controller;

                //  For SIPs we need a proxy object that will handle the calls
                //  to the system controller

                SystemControllerObject = new SystemControllerProxy();

                controller.Initialize();
            }
#endif
            if (SystemControllerObject != null)
            {
                SystemControllerObject.Initialize();
                SystemControllerObject.RegisterController();
                QuerySession.InitializeQuerySystem();
            }
        }