Exemplo n.º 1
0
        public bool Start()
        {
            if (instance == null || !instance.IsRunning)
            {
                instance = appInstances.Run(ApplicationPath, string.Empty, new string[0]);
            }

            return(Started);
        }
Exemplo n.º 2
0
        public override int Start(string verb, string[] args)
        {
            Console.WriteLine(String.Join(",", args));

            Console.WriteLine(">> INIT, v.0.0.1 Booting SharpMedia ComponentOS (c) 2005-2008");
            Console.WriteLine("Init: Starting Services...");
            (componentDirectory.GetInstance <IServiceRegistry>() as IServiceControl).Start();

            Console.Out.WriteLine("Double Vectors Per Second on a WU Thread: " +
                                  (threadControl.WorkUnits.FreeMost(typeof(ICPUWorkUnit)) as ICPUWorkUnit).FPU.DoubleVectorCrosses4D);

            IApplicationInstance proc =
                applicationInstances.Run(
                    args.Length > 0 ? args[0] : "/System/Applications/Components/TextShell", string.Empty, args);

            while (proc.IsRunning)
            {
                Thread.Sleep(100);
            }

            Console.WriteLine("Init: Shutting Down...");
            (componentDirectory.GetInstance <IServiceRegistry>() as IServiceControl).Stop();
            return(1);
        }
Exemplo n.º 3
0
        public static void Execute(DatabaseManager dbMgr, string[] args)
        {
            //---- Hook up the assembly loading ----
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
            AppDomain.CurrentDomain.TypeResolve     += new ResolveEventHandler(CurrentDomain_TypeResolve);

            assemblyLoader = new KernelAssemblyLoader();
            assemblyLoader.DatabaseManager = dbMgr;

            kernelEnvironment.Register(
                new Instance(assemblyLoader, "AssemblyLoader"));

            kernelEnvironment.Register(
                new ConfiguredComponent(
                    typeof(DocumentManagement), "DocumentManagement"));

            kernelEnvironment.Register(
                new ConfiguredComponent(
                    typeof(KernelApplicationsDirectory), "ApplicationManagement"));

            kernelEnvironment.Register(
                new ConfiguredComponent(
                    typeof(Installation.AuthoringInstallationService), "InstallationService"));

            kernelEnvironment.Register(
                new Instance(dbMgr, "DatabaseManagerDriver"));

            kernelEnvironment.Register(
                new AlwaysNewConfiguredComponent(typeof(DatabaseManager), "DatabaseManager"));

            kernelEnvironment.Register(
                new ConfiguredComponent(typeof(StandardConsole), "Console"));

            kernelEnvironment.Register(
                new ConfiguredComponent(typeof(ServiceManager), "Services"));
            kernelEnvironment.GetInstance<IServiceRegistry>();

            kernelEnvironment.Register(
                new ConfiguredComponent(typeof(ThreadControl), "ThreadControl"));

            //---- INIT ----
            InstallationService installService = kernelEnvironment.GetInstance<InstallationService>();

            if (!installService.IsPackageInstalled(baseSystemId))
            {
                IPackage pkg = 
                    installService.OpenPackageForInstallation("/Volumes/Host/Installation/BaseSystem.ipkg");

                pkg.Selected = true;
                installService.Install(pkg);
     
                pkg =
                    installService.OpenPackageForInstallation("/Volumes/Host/Installation/Graphics.ipkg");
                
                pkg.Selected = true;
                installService.Install(pkg);

                
                pkg =
                    installService.OpenPackageForInstallation("/Volumes/Host/Installation/Direct3D10Driver.ipkg");

                pkg.Selected = true;
                installService.Install(pkg);
                 
                /*
                pkg = 
                    installService.OpenPackageForInstallation("/Volumes/Host/Installation/Tools.ipkg");
                pkg.Selected = true;
                installService.Install(pkg);*/
            }

            IApplicationInstances appInstances = kernelEnvironment.GetInstance<IApplicationInstances>();
            IApplicationInstance init = appInstances.Run("/System/Applications/Components/Init", string.Empty, args);

            while (init.IsRunning) Thread.Sleep(100);
        }