public static VirtualFileSystem Root = new VirtualFileSystem(); // this is the root filesystem...... public static void DetectDrives() { for (int i = 0; i < Cosmos.Hardware.BlockDevice.Partition.Devices.Count; i++) { if (Cosmos.Hardware.BlockDevice.Partition.Devices[i] is Cosmos.Hardware.BlockDevice.Partition) { if (GruntyOS.HAL.GLNFS.isGFS(((Cosmos.Hardware.BlockDevice.Partition)Cosmos.Hardware.BlockDevice.BlockDevice.Devices[i]))) { GruntyOS.HAL.GLNFS fs = new GruntyOS.HAL.GLNFS(((Cosmos.Hardware.BlockDevice.Partition)Cosmos.Hardware.BlockDevice.BlockDevice.Devices[i])); Drive drv = new Drive(); GruntyOS.HAL.Devices.device dev = new GruntyOS.HAL.Devices.device(); Console.WriteLine("GLNFS PARTITION FOUND"); dev.name = @"?\\Harddrive\Partition" + i.ToString(); dev.dev = ((Cosmos.Hardware.BlockDevice.Partition)Cosmos.Hardware.BlockDevice.BlockDevice.Devices[i]); drv.DeviceFile = dev.name; GruntyOS.HAL.Devices.dev.Add(dev); Root.AddDrive(drv); } } } }
public GLNFS(Cosmos.Hardware.BlockDevice.Partition p) { fs = new GruntyOS.HAL.GLNFS(p); }
protected override void BeforeRun() { #region GLNFS GruntyOS.HAL.ATA.Detect(); // This will detect all ATA devices and add them to the device filesystem GruntyOS.CurrentUser.Privilages = 0; // This has to be set, 1 = limited 0 = root GruntyOS.CurrentUser.Username = "******"; // When using anything in the class File this will be the default username GruntyOS.HAL.FileSystem.Root = new GruntyOS.HAL.RootFilesystem(); // initialize virtual filesystem GruntyOS.HAL.FileSystem.Root.Seperator = '/'; bool ispart = false; for (int i = 0; i < GruntyOS.HAL.Devices.dev.Count; i++) { if (GruntyOS.HAL.Devices.dev[i].dev is Cosmos.Hardware.BlockDevice.Partition) { GruntyOS.HAL.GLNFS FS = new GruntyOS.HAL.GLNFS((Cosmos.Hardware.BlockDevice.Partition)GruntyOS.HAL.Devices.dev[i].dev); if (GruntyOS.HAL.GLNFS.isGFS((Cosmos.Hardware.BlockDevice.Partition)GruntyOS.HAL.Devices.dev[i].dev)) { Console.WriteLine("Drive Detected"); ispart = true; cd = "/"; fs = FS; GruntyOS.HAL.FileSystem.Root.Mount("/", FS); } else { Console.Write("Filesystem Label: "); new GruntyOS.HAL.GLNFS((Cosmos.Hardware.BlockDevice.Partition)GruntyOS.HAL.Devices.dev[i].dev).Format(Console.ReadLine()); Cosmos.Core.Global.CPU.Reboot(); } } } if (!ispart) new fdisk().Execute(new string[1]); #endregion fs.makeDir("/root", "Admin"); Console.WriteLine("Welcome to Quicksilver OS Alpha 1.0.0.44 as of 24.02.13\r\nCopyright (c) 2013"); if (fs.ListFiles("/root").Contains("users.sys")) { string pswd = GruntyOS.IO.File.Open("/root/password.sys"); string s = GruntyOS.IO.File.Open("/root/users.sys"); string[] parts = s.Split(':'); bool password_correct = false; while (!password_correct) { Console.Write("Please enter your password, " + parts[0] + ": "); if (Console.ReadLine() == (pswd)) { Console.Write("You have sucessfully logged in."); UserService.user = parts[0]; cd = parts[2]; password_correct = true; } else { Console.Write("Incorrect password."); } } } else { Console.Write("Please pick a username and Password\r\nUsername: "******"Password: "******"/root/users.sys", UserService.user + ":/:/home" + ":ROOT"); GruntyOS.IO.File.Save("/root/password.sys", password); Console.WriteLine("Account " + UserService.user + " has been created. Press a key to continue."); cd = "/home"; Console.Read(); } Parser.Init(); Console.Clear(); current = new Prompt(); }
protected override void BeforeRun() { #region SMBIOS SMBIOS.SMBIOS smbios = new SMBIOS.SMBIOS(); //gets smbios if (smbios.CheckSMBIOS()) { smbios.GetSMBIOS_Data(); List <SMBIOS.BaseInfo> bi = smbios.GetHardwareDescriptorByType(SMBIOS.TableTypes.ProcessorInformation); if (bi.Count >= 1) { Console.ReadLine(); cpuid.pi = (SMBIOS.Table.ProcessorInformation)bi[0]; } } #endregion #region GLNFS GruntyOS.HAL.ATA.Detect(); // This will detect all ATA devices and add them to the device filesystem Console.WriteLine("Welcome to Quicksilver OS Alpha 1.0.0.22 as of 130202-1133\r\nCopyright (c) 2013"); Console.Write("Please pick a username: "******"system"); if (GruntyOS.HAL.GLNFS.isGFS((Cosmos.Hardware.BlockDevice.Partition)GruntyOS.HAL.Devices.dev[i].dev)) { Console.WriteLine("Drive detected!"); ispart = true; } else { Console.Write("Filesystem Label: "); new GruntyOS.HAL.GLNFS((Cosmos.Hardware.BlockDevice.Partition)GruntyOS.HAL.Devices.dev[i].dev).Format(Console.ReadLine()); } GruntyOS.HAL.FileSystem.Root.Mount("/" + FS.DriveLabel, FS); // mount it as root (you can only have on partition mounted as root!!!! if (!ispart) { new fdisk().Execute(new string[1]); } cd = "/" + FS.DriveLabel; var d = new GDOS.Drive(); d.Filesystem = FS; d.DeviceFile = GruntyOS.HAL.Devices.dev[i].name; vfs.AddDrive(d); } } #endregion //quicksilver praxis //pt = new Praxis.Emulator.PartitionTable(vd); //part = Praxis.Emulator.Partitioner.Create(pt, 4096); //Praxis.PraxisFormatter.format(part, "system"); //prax = new Praxis.PraxisPartition(part); //Praxis.PraxisPartitionTable.Add(prax); Parser.Init(); mouse.Initialize(); Console.Clear(); //Praxis.IO.File.Create("/system/hello.com", Quicksilver2013.Files.Exes.hello); vfs.saveFile(Quicksilver2013.Files.Exes.hello, cd + "/system/hello.exe", UserService.user); }
protected override void BeforeRun() { #region GLNFS GruntyOS.HAL.ATA.Detect(); // This will detect all ATA devices and add them to the device filesystem GruntyOS.CurrentUser.Privilages = 0; // This has to be set, 1 = limited 0 = root GruntyOS.CurrentUser.Username = "******"; // When using anything in the class File this will be the default username GruntyOS.HAL.FileSystem.Root = new GruntyOS.HAL.RootFilesystem(); // initialize virtual filesystem GruntyOS.HAL.FileSystem.Root.Seperator = '/'; bool ispart = false; for (int i = 0; i < GruntyOS.HAL.Devices.dev.Count; i++) { if (GruntyOS.HAL.Devices.dev[i].dev is Cosmos.Hardware.BlockDevice.Partition) { GruntyOS.HAL.GLNFS FS = new GruntyOS.HAL.GLNFS((Cosmos.Hardware.BlockDevice.Partition)GruntyOS.HAL.Devices.dev[i].dev); if (GruntyOS.HAL.GLNFS.isGFS((Cosmos.Hardware.BlockDevice.Partition)GruntyOS.HAL.Devices.dev[i].dev)) { Console.WriteLine("Drive Detected"); ispart = true; cd = "/"; fs = FS; GruntyOS.HAL.FileSystem.Root.Mount("/", FS); } else { Console.Write("Filesystem Label: "); new GruntyOS.HAL.GLNFS((Cosmos.Hardware.BlockDevice.Partition)GruntyOS.HAL.Devices.dev[i].dev).Format(Console.ReadLine()); Cosmos.Core.Global.CPU.Reboot(); } } } if (!ispart) { new fdisk().Execute(new string[1]); } #endregion fs.makeDir("/root", "Admin"); Console.WriteLine("Welcome to Quicksilver OS Alpha 1.0.0.44 as of 24.02.13\r\nCopyright (c) 2013"); if (fs.ListFiles("/root").Contains("users.sys")) { string pswd = GruntyOS.IO.File.Open("/root/password.sys"); string s = GruntyOS.IO.File.Open("/root/users.sys"); string[] parts = s.Split(':'); bool password_correct = false; while (!password_correct) { Console.Write("Please enter your password, " + parts[0] + ": "); if (Console.ReadLine() == (pswd)) { Console.Write("You have sucessfully logged in."); UserService.user = parts[0]; cd = parts[2]; password_correct = true; } else { Console.Write("Incorrect password."); } } } else { Console.Write("Please pick a username and Password\r\nUsername: "******"Password: "******"/root/users.sys", UserService.user + ":/:/home" + ":ROOT"); GruntyOS.IO.File.Save("/root/password.sys", password); Console.WriteLine("Account " + UserService.user + " has been created. Press a key to continue."); cd = "/home"; Console.Read(); } Parser.Init(); Console.Clear(); current = new Prompt(); }