예제 #1
0
        private static void mountBootPartition()
        {
            string bootDevice = BootParams.GetParam("--bootdev");
            string bootFS     = BootParams.GetParam("--boottype");

            if (bootDevice == null)
            {
                Panic.DoPanic("No bootdevice specified.");
            }

            if (bootFS == null)
            {
                Panic.DoPanic("No boot filesystem specified.");
            }

            Console.Write("[Init] Mounting bootdevice ");
            Console.Write(bootDevice);
            Console.Write(":");
            Console.Write(bootFS);
            Console.WriteLine("");

            Node hddNode = VFS.GetByAbsolutePath(bootDevice, 0);

            if (hddNode == null)
            {
                Panic.DoPanic("Bootdevice not found.");
            }

            DiskMountResult res = Disk.Mount(hddNode, "C", bootFS);

            if (res != DiskMountResult.SUCCESS)
            {
                Panic.DoPanic("Failed to mount bootdevice.");
            }


            Tasking.CurrentTask.CurrentDirectory = "C://";
        }
예제 #2
0
        /// <summary>
        /// Kernel entrypoint
        /// </summary>
        /// <param name="header">The multiboot header</param>
        /// <param name="magic">The magic</param>
        /// <param name="end">The end address of the kernel</param>
        public static unsafe void KernelMain(Multiboot.Header *header, uint magic, void *end)
        {
            heapStart = end;
            Console.Clear();
            X86Arch.EarlyInit();

            processMultiboot(header, magic);
            Heap.InitTempHeap(heapStart);


            X86Arch.Init();


            Random.Init();

            VFS.Init();
            initPCIDevices();
            Keyboard.Init();

            Tasking.Init();

            BootParams.Init(Util.CharPtrToString((char *)header->CMDLine));

            initUSB();
            initStorage();

            mountBootPartition();

            //initNetworking();
            initSound();
            runUserspace();

            // Idle loop
            while (true)
            {
                CPU.HLT();
            }
        }
예제 #3
0
        private bool ResetScene(string sceneName)
        {
            string        atlasPath         = LuaRuntime.GetGlobalString("ResPath_Atlases");
            string        defaultAtlas      = LuaRuntime.GetGlobalString("ResName_DefaultAtlas");
            List <string> additionalAtlases = LuaRuntime.GetGlobalStringArray("ResName_AdditionalAtlases");

            if (string.IsNullOrEmpty(atlasPath) || string.IsNullOrEmpty(defaultAtlas) || additionalAtlases.Count == 0)
            {
                return(false);
            }

            SceneEd.Instance.Selection.ClearSelection();
            ActionQueue.Instance.ClearActions();

            BootParams bp = new BootParams {
                ReourcePath          = atlasPath,
                DefaultReourceImage  = defaultAtlas,
                ReourceImages        = additionalAtlases,
                ScenePath            = sceneName,
                DesignTimeResolution = GetDefaultResolution()
            };

            if (!Bootstrap.Instance.Init(bp))
            {
                return(false);
            }

            m_glRenderBuffer.SetScene(Scene.Instance);
            m_glRenderBuffer.SetSceneEd(SceneEd.Instance);

            // 不管是 Load 还是 Reset 成功,均需要刷新窗体的标题栏
            UpdateFormTitle();

            SceneEd.Instance.Select(Scene.Instance.Root);
            SceneEdEventNotifier.Instance.Emit_RefreshScene(RefreshSceneOpt.Refresh_All);
            return(true);
        }