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"; }
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; }
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()); } }
public void Initialize(IKernel kernel, IProcessManager processManager, IMyLib myLib) { Kernel = kernel; ProcessManager = processManager; MyLib = myLib; }
public void Initialize(IProcessManager processManager, IMyLib myLib) { _processManager = processManager; MyLib = myLib; }