コード例 #1
0
        public RuntimeEngine(string path, IKernel kernel, IMyLib myLib)
        {
            _path   = path;
            _kernel = kernel;
            _myLib  = myLib;

            _package = SharpZipLibFileSystem.Open(_myLib.Storage.ReadFileAsStream(Path.Combine(_myLib.CurrentDirectory, path)));
            kernel.MountDisk(_package, "/mnt/" + path);

            _storage = new StorageService();

            Name = "Test";
        }
コード例 #2
0
ファイル: RuntimeEngine.cs プロジェクト: dwnz/myos
        public RuntimeEngine(string path, IKernel kernel, IMyLib myLib)
        {
            _path   = path;
            _kernel = kernel;

            _package = SharpZipLibFileSystem.Open(myLib.Storage.ReadFileAsStream(Path.Combine(myLib.CurrentDirectory, path)));
            kernel.MountDisk(_package, "/mnt/" + path);

            _storage = new StorageService(kernel.Drive("/mnt/" + path));

            string data = _storage.ReadFileAsString("/app.json");

            _manifest = JsonConvert.DeserializeObject <ApplicationManifest>(data);
            Name      = "app." + _manifest.Name;
        }
コード例 #3
0
ファイル: OperatingSystem.cs プロジェクト: dwnz/myos
        public void Boot(IKernel kernel, IProcessManager processManager)
        {
            _kernel         = kernel;
            _processManager = processManager;
            _currentDrive   = kernel.Drives.First().Value;
            _myLib          = new MyLib(_kernel, _currentDrive)
            {
                CurrentDirectory = "/"
            };

            Console.WriteLine("Checking for boot.ini");

            if (_currentDrive.Exists(FileSystemPath.Parse("/system/boot.ini")))
            {
                using (Stream bootStream = _currentDrive.OpenFile(FileSystemPath.Parse("/system/boot.ini"), FileAccess.Read))
                    using (StreamReader streamReader = new StreamReader(bootStream))
                    {
                        ExecuteCommand("cd system");

                        while (!streamReader.EndOfStream)
                        {
                            ExecuteCommand(streamReader.ReadLine());
                        }

                        ExecuteCommand("cd ..");
                    }
            }
            else
            {
                Console.WriteLine("No boot.ini file found, moving on");
            }

            while (true)
            {
                Console.Write("#" + _myLib.CurrentDirectory + "> ");
                ExecuteCommand(Console.ReadLine());
            }
        }
コード例 #4
0
 public void Initialize(IKernel kernel, IProcessManager processManager, IMyLib myLib)
 {
     Kernel         = kernel;
     ProcessManager = processManager;
     MyLib          = myLib;
 }
コード例 #5
0
 public void Initialize(IProcessManager processManager, IMyLib myLib)
 {
     _processManager = processManager;
     MyLib           = myLib;
 }