Beispiel #1
0
        /// <summary>
        /// Initial kernel method, overrides the built-in Cosmos BeforeRun method
        /// </summary>
        protected override void BeforeRun()
        {
            fs = new Cosmos.System.FileSystem.CosmosVFS();
            VFSManager.RegisterVFS(fs);
            fs.Initialize();
            Console.Clear();
            OSVars.Ver();
            //This is just to identify the users machine, much later in Medli will this have any usage however
            //i.e. not until networking is set up, FS Permissions are working etc...
            //If it wasn't able to find a machinename file, then it will try and create one.
            //This is why initializing the filesystem is vital before executing this code.

            /*
             * if (File.Exists(OSVars.reginfo))
             * {
             *  string[] lines = File.ReadAllLines(OSVars.reginfo);
             *  foreach (string line in lines)
             *  {
             *      OSVars.regname = line;
             *  }
             */

            PreInit();


            Console.Clear();
            OSVars.Ver();
        }
Beispiel #2
0
        protected override void BeforeRun()
        {
            KernelUtils.Init(this);
            Curse.kern = this;
            env_vars  += ";VERSION:" + kernel_version + ";KERNEL:" + kernel_flavour;
            FS         = new Sys.FileSystem.CosmosVFS();
            Sys.FileSystem.VFS.VFSManager.RegisterVFS(FS);
            FS.Initialize();
            Console.WriteLine("Scanning filesystems...");
            if (!Directory.Exists(@"0:\"))
            {
                Curse.ShowMessagebox("FAT Driver", "Cosmos could not find a valid FAT filesystem on 0:\\. Some Memphis applications may not function.");
            }
            UserManager.LoginScreen();
            Console.Clear();
            Console.WriteLine(memphis_logo);
            Console.WriteLine("Welcome to Memphis.");
            Console.WriteLine($"Version: {GetVar("VERSION")}\t\tKernel flavour: {GetVar("KERNEL")}");
            Console.WriteLine($@"System information:
 - FAT partition count: {Sys.FileSystem.VFS.VFSManager.GetVolumes().Count}
 - Current user: {UserManager.CurrentUser.Name}
 - Permission level: {UserManager.CurrentUser.PermissionLevel}
 - User Directory: {UserManager.CurrentUser.UserDirectory}
 - Current date and time is: {SystemInfo.Time.ToString()}");
        }
Beispiel #3
0
        protected override void BeforeRun()
        {
            //filesystem
A:
            var fs = new Sys.FileSystem.CosmosVFS();

            Sys.FileSystem.VFS.VFSManager.RegisterVFS(fs);
            fs.Initialize();
            fs.CreateDirectory("0:\\PROGRAM");
            fs.CreateDirectory("0:\\OS");
            fs.CreateDirectory("0:\\document");
            var    CD = fs.CreateFile("0:\\document\\test.txt");
            var    GD = fs.GetFile("0:\\document\\test.txt");
            string RD = GD.ToString();

            Console.WriteLine(RD);
            //text color
            var textscr = Cosmos.HAL.Global.TextScreen;

            Cosmos.System.Global.Console = new Cosmos.System.Console(textscr);
            Cosmos.HAL.Global.TextScreen = textscr;
            Console.ForegroundColor      = ConsoleColor.Green;
            Console.BackgroundColor      = ConsoleColor.Black;
            //debug
            Kernel.PrintDebug("test");

            //login
E:
            Console.WriteLine("RF OS V 1.0 TERMLINK");
            Console.Write("login user password:"******"admin";
            string inputp   = Console.ReadLine();

            if (inputp == password)
            {
                Console.Clear();
                Run();
            }
            else
            {
                Console.WriteLine("ENTRY DENIED TRY AGAIN");
                Console.WriteLine("press any key to repeat");
                Console.ReadKey();
                Console.Clear();
                goto E;
            }
            if (inputp == "rundebugmode")
            {
                Console.Clear();
                goto A;
            }
            if (inputp == "shutdown")
            {
                Sys.Power.Shutdown();
            }
        }
Beispiel #4
0
        public static void Init()
        {
            Console.WriteLine("Initializing FileSystems...");
            var FileSys = new Sys.FileSystem.CosmosVFS();

            Sys.FileSystem.VFS.VFSManager.RegisterVFS(FileSys);
            FileSys.Initialize();
            GetCoreInfo.CoreInfo();
            Console.WriteLine("Filesystems Initialized.");
            Console.WriteLine("System dir separator: " + Sys.FileSystem.VFS.VFSManager.GetDirectorySeparatorChar());
            Console.Clear();
            if (!Directory.Exists(@"0:\"))
            {
                osvars.livesession = true;
                ErrorHandler.Warning(2, "fsnf");
                Console.WriteLine("Chocolate could not find a valid FAT Filesystem on your main hard drive.");
                Console.WriteLine("Some Applications may not work, so for full functionality");
                Console.WriteLine("use a hard drive partition tool to create one.");
                Console.WriteLine("Chocolate will run in Live mode.");
            }
            else
            {
                Console.WriteLine("Chocolate has detected a FAT FileSystem.");
                Console.WriteLine("You now have the choice to run Chocolate as a Live user or a fully featured user.");
                Console.WriteLine("Live users are only good for debugging purposes.");
                Console.WriteLine("Do you wish to run as a full user?");
                string uclive = Console.ReadLine();
                if (uclive == "yes")
                {
                    if (!Directory.Exists(usrs_dir))
                    {
                        Directory.CreateDirectory(usrs_dir);
                    }
                    osvars.livesession = false;
                }
                else if (uclive == "no")
                {
                    osvars.livesession = true;
                    current_user       = "******";
                }
            }
        }
Beispiel #5
0
 public static void Init()
 {
     Console.WriteLine("Initializing FileSystems...");
     var FileSys = new Sys.FileSystem.CosmosVFS();
     Sys.FileSystem.VFS.VFSManager.RegisterVFS(FileSys);
     FileSys.Initialize();
     GetCoreInfo.CoreInfo();
     Console.WriteLine("Filesystems Initialized.");
     Console.WriteLine("System dir separator: " + Sys.FileSystem.VFS.VFSManager.GetDirectorySeparatorChar());
     Console.Clear();
     if (!Directory.Exists(@"0:\"))
     {
         osvars.livesession = true;
         ErrorHandler.Warning(2, "fsnf");
         Console.WriteLine("Chocolate could not find a valid FAT Filesystem on your main hard drive.");
         Console.WriteLine("Some Applications may not work, so for full functionality");
         Console.WriteLine("use a hard drive partition tool to create one.");
         Console.WriteLine("Chocolate will run in Live mode.");
     }
     else
     {
         Console.WriteLine("Chocolate has detected a FAT FileSystem.");
         Console.WriteLine("You now have the choice to run Chocolate as a Live user or a fully featured user.");
         Console.WriteLine("Live users are only good for debugging purposes.");
         Console.WriteLine("Do you wish to run as a full user?");
         string uclive = Console.ReadLine();
         if (uclive == "yes")
         {
             if (!Directory.Exists(usrs_dir))
             {
                 Directory.CreateDirectory(usrs_dir);
             }
             osvars.livesession = false;
         }
         else if (uclive == "no")
         {
             osvars.livesession = true;
             current_user = "******";
         }
     }
 }
Beispiel #6
0
 /// <summary>
 /// Starts the INIT method, creating filesystem, registering the filesystem
 /// </summary>
 public static void Start()
 {
     VFSManager.RegisterVFS(fs);
     Console.WriteLine("Initializing filesystem...");
     fs.Initialize();
     Console.Clear();
     AConsole.WriteLineEx("    Welcome to Apollo OS    ", ConsoleColor.White, ConsoleColor.Black, true, false);
     AConsole.WriteLineEx("Press any key to continue...", ConsoleColor.White, ConsoleColor.Black, true, false);
     AConsole.ReadKey(true);
     if (IntegrityCheck() == false)
     {
         Console.Clear();
         Console.WriteLine("Filesystem integrity checks completed!");
         Console.WriteLine("Not all directories were present however, so they have been recreated.");
         Console.WriteLine("Data loss is to be expected.");
         Environment_variables.PressAnyKey();
         Console.Clear();
     }
     else
     {
         Console.Clear();
         Console.WriteLine("Filesystem integrity checks completed!");
         Console.WriteLine("All filesystem checks passed successfully, but be sure to check files in case.");
         Environment_variables.PressAnyKey();
         Console.Clear();
     }
     UserInit();
     if (!File.Exists(usr_vars.varsfile))
     {
         File.Create(KernelVariables.bindir + "vars.sys").Dispose();
     }
     else
     {
         usr_vars.ReadVars();
     }
     Console.WriteLine("SysGuard Checks proceeded.");
     Environment_variables.PressAnyKey("Press any key to continue boot...");
     Console.Clear();
 }
Beispiel #7
0
        protected override void BeforeRun()
        {
            FS = new Sys.FileSystem.CosmosVFS();
            Sys.FileSystem.VFS.VFSManager.RegisterVFS(FS);
            FS.Initialize();
            if (!Directory.Exists("0:\\sysfolder"))
            {
                Directory.CreateDirectory("0:\\sysfolder");
            }
            Directory.SetCurrentDirectory("0:\\");
            System.Settings.kernel = this;

            /*System.Settings.currentCanvas = Sys.Graphics.FullScreenCanvas.GetFullScreenCanvas();
             * System.Graphics.BitterScreen bitScreen = new System.Graphics.BitterScreen();
             * bitScreen.initScreen();
             * bitScreen.DrawFilledRectangle(150, 150, 15, 15, Color.Blue);
             * bitScreen.DrawBuffer();*/

            //vcan.Display();

            /*System.Graphics.Window wnd = new System.Graphics.Window(new IntPtr(1), "Long Program Name Lol Cool Right Haha LMAOOOOOOOO OKKKKKK grgrgrgrgrgrgrg", new Sys.Graphics.Point(150, 150), new Sys.Graphics.Point(200, 100));
             * wnd.DrawWindow();*/
        }
Beispiel #8
0
 protected override void BeforeRun()
 {
     FS = new Sys.FileSystem.CosmosVFS(); Sys.FileSystem.VFS.VFSManager.RegisterVFS(FS); FS.Initialize();
 }