Пример #1
0
        public void RawWrite(ConsoleSession console, uint row, uint column, char chr, byte color)
        {
            if (console != active)
                return;

            Mosa.Kernel.x86.Screen.RawWrite(row, column, chr, color);
        }
Пример #2
0
        /// <summary>
        /// Main
        /// </summary>
        public static void Main()
        {
            Kernel.x86.Kernel.Setup();

            Console = ConsoleManager.Controller.Boot;
            Console.Clear();

            IDT.SetInterruptHandler(ProcessInterrupt);

            Serial.SetupPort(Serial.COM1);

            _hal = new Hardware();
            if (VBE.InitVBE(_hal))
            {
                Log("VBE setup OK!");

                DoGraphics();
            }
            else
            {
                Log("VBE setup ERROR!");
            }

            ForeverLoop();
        }
Пример #3
0
        private Task <MethodResponse> UnsetConsoleSession(MethodRequest methodRequest, object userContext)
        {
            FireDirectMethodInvoked(methodRequest.Name, methodRequest);
            string json       = Encoding.UTF8.GetString(methodRequest.Data);
            var    consoleDsn = JsonConvert.DeserializeObject <string>(json);

            // if the existing MobileSession matches the value provided, then unset it:
            Task <MethodResponse> task = null;

            if (ConsoleSession != null && ConsoleSession.Equals(consoleDsn))
            {
                ConsoleSession = null;
                ConsoleState   = null;

                // Acknowlege the direct method call with a 200 success message
                string jsonResponse = JsonConvert.SerializeObject(new DirectMethodResponse()
                {
                    Result = $"Executed direct method: {methodRequest.Name}"
                });
                task = Task.FromResult(new MethodResponse(Encoding.UTF8.GetBytes(jsonResponse), (int)HttpStatusCode.OK));
            }
            else
            {
                // return 409 Conflict:
                string jsonResponse = JsonConvert.SerializeObject(new DirectMethodResponse()
                {
                    Result = $"Console session did not match (consoleDsn: {consoleDsn} current value: {ConsoleSession})."
                });
                task = Task.FromResult(new MethodResponse(Encoding.UTF8.GetBytes(jsonResponse), (int)HttpStatusCode.Conflict));
            }

            FireDirectMethodResponseSent(methodRequest.Name, task.Result);
            return(task);
        }
        static int Main(string[] args)
        {
            var session    = new ConsoleSession();
            var jobFactory = SelectFactory(ref args);

            if (jobFactory == null)
            {
                Console.Error.WriteLine($@"Usage: {Path.GetFileName(session.Application)} <mode> <args...>
where <mode> is one of: inspect, import, create-datasource");
                return(1);
            }
            session.Options.AddCollector(jobFactory);
            session.ArgumentList.AddCollector(jobFactory as IReceiveArgumentList);
            var logging = session.Options.AddCollector(new SimpleConsoleLoggingPolicy());

            session.ExcessPositionalArgumentsPolicy = ExcessPositionalArgumentsPolicy.Warn;

            return(session.Run(args, async() => {
                using (LoggingPolicy.Register(session, logging))
                {
                    var job = jobFactory.CreateJob();
                    await job.Run(Console.Out);
                    return 0;
                }
            }));
        }
Пример #5
0
        public void RawWrite(ConsoleSession console, uint row, uint column, char chr, byte color)
        {
            if (console != active)
            {
                return;
            }

            Screen.RawWrite(row, column, chr, color);
        }
Пример #6
0
        public AppManager(ConsoleSession debug, IKeyboard keyboard, ServiceManager serviceManager)
        {
            this.ServiceManager = serviceManager;
            this.keyboard       = keyboard;
            this.debug          = debug;

            shell = new Shell();

            currentApp = shell;
        }
Пример #7
0
        public AppManager(ConsoleSession debug, IKeyboard keyboard)
        {
            this.keyboard = keyboard;

            this.debug = debug;

            shell = new Shell();

            currentApp = shell;
        }
Пример #8
0
 public void SetUp()
 {
     saveOut   = Console.Out;
     saveIn    = Console.In;
     saveError = Console.Error;
     testOut   = new StringWriter();
     Console.SetOut(testOut);
     testError = new StringWriter();
     Console.SetError(testError);
     session = new ConsoleSession(new TypeDictionary());
 }
Пример #9
0
 public void SetUp()
 {
     saveOut = Console.Out;
     saveIn = Console.In;
     saveError = Console.Error;
     testOut = new StringWriter();
     Console.SetOut(testOut);
     testError = new StringWriter();
     Console.SetError(testError);
     session = new ConsoleSession(new TypeDictionary());
 }
Пример #10
0
        /// <summary>
        /// Main
        /// </summary>
        unsafe public static void Main()
        {
            Mosa.Kernel.x86.Kernel.Setup();

            Console = ConsoleManager.Controller.Boot;
            Console.Clear();

            IDT.SetInterruptHandler(ProcessInterrupt);

            Console.Color           = Colors.White;
            Console.BackgroundColor = Colors.Green;

            Console.Write(@"                   MOSA OS Version 1.4 - Compiler Version 1.4");
            FillLine();
            Console.Color           = Colors.White;
            Console.BackgroundColor = Colors.Black;

            if (SmbiosManager.IsAvailable)
            {
                BiosInformationStructure biosInfo = new BiosInformationStructure();
                CpuStructure             cpuInfo  = new CpuStructure();

                Console.WriteLine("> Checking BIOS...");
                BulletPoint(); Console.Write("Vendor  "); InBrackets(biosInfo.BiosVendor, Colors.White, Colors.LightBlue); Console.WriteLine();
                BulletPoint(); Console.Write("Version "); InBrackets(biosInfo.BiosVersion, Colors.White, Colors.LightBlue); Console.WriteLine();

                Console.WriteLine("> Checking CPU...");
                BulletPoint(); Console.Write("Vendor  "); InBrackets(cpuInfo.Vendor, Colors.White, Colors.LightBlue); Console.WriteLine();
                BulletPoint(); Console.Write("Version "); InBrackets(cpuInfo.Version, Colors.White, Colors.LightBlue); Console.WriteLine();
            }
            else
            {
                Console.WriteLine("> No SMBIOS available!");
            }

            Console.WriteLine("> Initializing hardware abstraction layer...");
            Setup.Initialize();

            Console.WriteLine("> Adding hardware devices...");
            Setup.Start();

            Console.WriteLine("> System ready");
            Console.WriteLine();
            Console.Goto(24, 0);
            Console.Color           = Colors.White;
            Console.BackgroundColor = Colors.Green;
            Console.Write("          Copyright (C) 2008-2015 [Managed Operating System Alliance]");
            FillLine();

            Process();
        }
Пример #11
0
        public PanelConsole(ConsoleSession session)
        {
            InitializeComponent();

            AutoSize = true;
            Text     = session.SessionName;
            //Resize += new System.EventHandler(TermPanel_Resize);

            Controls.Add(conemu = new ConEmuControl()
            {
                AutoStartInfo = null, Dock = DockStyle.Fill
            });
            con_session = conemu.Start(new ConEmuStartInfo()
            {
                ConsoleProcessCommandLine = session.CommandLine
            });
        }
Пример #12
0
        /// <summary>
        ///
        /// </summary>
        public static void RunTests()
        {
            Console = Boot.Console;

            Console.Goto(2, 0);
            Console.Color = Color.Yellow;
            Console.Write("[");
            Console.Color = Color.White;
            Console.Write("Tests");
            Console.Color = Color.Yellow;
            Console.Write("]");
            Console.WriteLine();
            Console.WriteLine();
            Console.Color = Color.Yellow;

            var delegateTest   = new DelegateTest();
            var stringTest     = new StringTest();
            var interfaceTest  = new InterfaceTest();
            var genericsTest   = new GenericTest();
            var generics2Test  = new Generic2Test();
            var isInstanceTest = new IsInstanceTest();
            var exceptionTest  = new ExceptionTest();
            var plugTestTest   = new PlugTestTest();
            var compareTest    = new ComparisonTest();
            var simpleTest     = new OptimizationTest();
            var reflectionTest = new ReflectionTest();
            var arrayTest      = new ArrayTest();
            var int64Test      = new Int64Test();
            var otherTest      = new OtherTest();

            int64Test.Test();
            delegateTest.Test();
            stringTest.Test();
            interfaceTest.Test();
            genericsTest.Test();
            generics2Test.Test();
            isInstanceTest.Test();
            exceptionTest.Test();
            plugTestTest.Test();
            compareTest.Test();
            simpleTest.Test();

            reflectionTest.Test();
            arrayTest.Test();
            otherTest.Test();
        }
Пример #13
0
        /// <summary>
        /// Main
        /// </summary>
        unsafe public static void Main()
        {
            Kernel.x86.Kernel.Setup();

            Console = ConsoleManager.Controller.Boot;
            Debug   = ConsoleManager.Controller.Boot;

            Console.Clear();

            Console.ScrollRow = 23;

            IDT.SetInterruptHandler(ProcessInterrupt);

            Console.Color           = Colors.White;
            Console.BackgroundColor = Colors.Green;

            Console.Write(@"                   MOSA OS Version 1.4 - Compiler Version 1.4");
            FillLine();
            Console.Color           = Colors.White;
            Console.BackgroundColor = Colors.Black;

            Console.WriteLine("> Initializing hardware abstraction layer...");
            Setup.Initialize();

            Console.WriteLine("> Adding hardware devices...");
            Setup.Start();

            Console.Color = Colors.White;
            Console.WriteLine();

            Debug = ConsoleManager.Controller.Debug;

            // setup keymap
            var keymap = new US();

            // setup keyboard (state machine)
            var keyboard = new Mosa.DeviceSystem.Keyboard(Setup.StandardKeyboard, keymap);

            // setup app manager
            var manager = new AppManager(Console, keyboard);

            IDT.SetInterruptHandler(manager.ProcessInterrupt);

            manager.Start();
        }
Пример #14
0
        public void Change(ConsoleSession console)
        {
            if (console == active)
                return;

            for (byte row = 0; row < 40; row++)
            {
                for (byte column = 0; column < 80; column++)
                {
                    char chr = console.GetText(column, row);
                    byte color = console.GetColor(column, row);

                    Mosa.Kernel.x86.Screen.RawWrite(row, column, chr, color);
                }
            }

            Mosa.Kernel.x86.Screen.Goto(console.Row, console.Column);

            active = console;
        }
Пример #15
0
        public void Switch(ConsoleSession console)
        {
            if (console == active)
                return;

            for (byte row = 0; row < 40; row++)
            {
                for (byte column = 0; column < 80; column++)
                {
                    char chr = console.GetText(column, row);
                    byte color = console.GetColor(column, row);

                    Screen.RawWrite(row, column, chr, color);
                }
            }

            Screen.Goto(console.Row, console.Column);
            UpdateCursor(console);

            active = console;
        }
Пример #16
0
        static void Main(string[] args)
        {
            #region init book and shelf

            var bookShelfServ = new BookShelfService(new BookShelf
            {
                Name = "Tolkien's books"
            });

            bookShelfServ.AddBook(new Book
            {
                Name       = "Lord of Rings",
                NumOfPages = 789,
                Authors    = new List <string>(new string[] { "Tolkien" }),
                Year       = 1978
            });

            #endregion init book and shelf

            var session1 = new ConsoleSession(bookShelfServ);
            session1.NewSession();
        }
Пример #17
0
        private Task <MethodResponse> SetConsoleTelemetry(MethodRequest methodRequest, object userContext)
        {
            FireDirectMethodInvoked(methodRequest.Name, methodRequest);
            string json             = Encoding.UTF8.GetString(methodRequest.Data);
            var    consoleTelemetry = JsonConvert.DeserializeObject <ConsoleTelemetry>(json);

            Task <MethodResponse> task = null;

            if (ConsoleSession != null && ConsoleSession.Equals(consoleTelemetry.Id))
            {
                ConsoleTelemetry = consoleTelemetry;

                // Acknowlege the direct method call with a 200 success message
                string jsonResponse = JsonConvert.SerializeObject(new DirectMethodResponse()
                {
                    Result = $"Executed direct method: {methodRequest.Name}"
                });
                task = Task.FromResult(new MethodResponse(Encoding.UTF8.GetBytes(jsonResponse), (int)HttpStatusCode.OK));
            }

            FireDirectMethodResponseSent(methodRequest.Name, task.Result);
            return(task);
        }
Пример #18
0
        public void Switch(ConsoleSession console)
        {
            if (console == active)
            {
                return;
            }

            for (byte row = 0; row < 40; row++)
            {
                for (byte column = 0; column < 80; column++)
                {
                    char chr   = console.GetText(column, row);
                    byte color = console.GetColor(column, row);

                    Screen.RawWrite(row, column, chr, color);
                }
            }

            Screen.Goto(console.Row, console.Column);
            UpdateCursor(console);

            active = console;
        }
Пример #19
0
        /// <summary>
        /// Main
        /// </summary>
        public static void Main()
        {
            Mosa.Kernel.x86.Kernel.Setup();

            Console = ConsoleManager.Controller.Boot;

            Console.Clear();

            IDT.SetInterruptHandler(ProcessInterrupt);

            Console.Color = Colors.White;

            Console.Goto(0, 0);

            Console.Color           = Colors.Yellow;
            Console.BackgroundColor = Colors.Black;

            Console.Write("MOSA OS Version 1.4 '");
            Console.Color = Colors.Red;
            Console.Write("Neptune");
            Console.Color = Colors.Yellow;
            Console.Write("'                                Copyright 2008-2015");

            Console.Color = 0x0F;
            Console.Write(new String((char)205, 60));
            Console.Write((char)203);
            Console.Write(new String((char)205, 19));
            Console.WriteLine();

            Console.Goto(2, 0);
            Console.Color = Colors.Green;
            Console.Write("Multibootaddress: ");
            Console.Color = Colors.Gray;
            unsafe
            {
                Console.Write((uint)Multiboot.MultiBootInfo, 16, 8);
            }

            Console.WriteLine();
            Console.Color = Colors.Green;
            Console.Write("Multiboot-Flags:  ");
            Console.Color = Colors.Gray;
            Console.Write(Multiboot.Flags, 2, 32);
            Console.WriteLine();
            Console.WriteLine();

            Console.Color = Colors.Green;
            Console.Write("Size of Memory:   ");
            Console.Color = Colors.Gray;
            Console.Write((Multiboot.MemoryLower + Multiboot.MemoryUpper) / 1024, 10, -1);
            Console.Write(" MB (");
            Console.Write(Multiboot.MemoryLower + Multiboot.MemoryUpper, 10, -1);
            Console.Write(" KB)");
            Console.WriteLine();

            Console.Color = Colors.White;
            for (uint index = 0; index < 60; index++)
            {
                Console.Write((char)205);
            }

            Console.WriteLine();

            Console.Color = Colors.Green;
            Console.Write("Memory-Map:");
            Console.WriteLine();

            for (uint index = 0; index < Multiboot.MemoryMapCount; index++)
            {
                Console.Color = Colors.White;
                Console.Write(Multiboot.GetMemoryMapBase(index), 16, 10);
                Console.Write(" - ");
                Console.Write(Multiboot.GetMemoryMapBase(index) + Multiboot.GetMemoryMapLength(index) - 1, 16, 10);
                Console.Write(" (");
                Console.Color = Colors.Gray;
                Console.Write(Multiboot.GetMemoryMapLength(index), 16, 10);
                Console.Color = Colors.White;
                Console.Write(") ");
                Console.Color = Colors.Gray;
                Console.Write("Type: ");
                Console.Write(Multiboot.GetMemoryMapType(index), 16, 1);
                Console.WriteLine();
            }
            Console.WriteLine();
            Console.WriteLine();
            Console.Color = Colors.Green;
            Console.Write("Smbios Info: ");
            if (SmbiosManager.IsAvailable)
            {
                Console.Color = Colors.White;
                Console.Write("[");
                Console.Color = Colors.Gray;
                Console.Write("Version ");
                Console.Write(SmbiosManager.MajorVersion, 10, -1);
                Console.Write(".");
                Console.Write(SmbiosManager.MinorVersion, 10, -1);
                Console.Color = Colors.White;
                Console.Write("]");
                Console.WriteLine();

                Console.Color = Colors.Yellow;
                Console.Write("[Bios]");
                Console.Color = Colors.White;
                Console.WriteLine();

                BiosInformationStructure biosInformation = new BiosInformationStructure();
                Console.Color = Colors.White;
                Console.Write("Vendor: ");
                Console.Color = Colors.Gray;
                Console.Write(biosInformation.BiosVendor);
                Console.WriteLine();
                Console.Color = Colors.White;
                Console.Write("Version: ");
                Console.Color = Colors.Gray;
                Console.Write(biosInformation.BiosVersion);
                Console.WriteLine();
                Console.Color = Colors.White;
                Console.Write("Date: ");
                Console.Color = Colors.Gray;
                Console.Write(biosInformation.BiosDate);

                Console.Color  = Colors.Yellow;
                Console.Row    = 8;
                Console.Column = 35;
                Console.Write("[Cpu]");
                Console.Color = Colors.White;
                Console.WriteLine();
                Console.Column = 35;

                CpuStructure cpuStructure = new CpuStructure();
                Console.Color = Colors.White;
                Console.Write("Vendor: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.Vendor);
                Console.WriteLine();
                Console.Column = 35;
                Console.Color  = Colors.White;
                Console.Write("Version: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.Version);
                Console.WriteLine();
                Console.Column = 35;
                Console.Color  = Colors.White;
                Console.Write("Socket: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.Socket);
                Console.Write(" MHz");
                Console.WriteLine();
                Console.Column = 35;
                Console.Color  = Colors.White;
                Console.Write("Cur. Speed: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.MaxSpeed, 10, -1);
                Console.Write(" MHz");
                Console.WriteLine();
                Console.Column = 35;
            }
            else
            {
                Console.Color = Colors.Red;
                Console.Write("No SMBIOS available on this system!");
            }

            Console.Goto(14, 0);

            Console.Color = 0x0F;
            for (uint index = 0; index < 60; index++)
            {
                Console.Write((char)205);
            }

            Console.WriteLine();

            //CpuInfo cpuInfo = new CpuInfo();

            //#region Vendor

            //Console.Color = Colors.Green;
            //Console.Write("Vendor:   ");
            //Console.Color = Colors.White;

            //cpuInfo.PrintVendorString(Console);

            //Console.WriteLine();

            //#endregion Vendor

            //#region Brand

            //Console.Color = Colors.Green;
            //Console.Write("Brand:    ");
            //Console.Color = Colors.White;
            //cpuInfo.PrintBrandString(Console);
            //Console.WriteLine();

            //#endregion Brand

            //#region Stepping

            //Console.Color = Colors.Green;
            //Console.Write("Stepping: ");
            //Console.Color = Colors.White;
            //Console.Write(cpuInfo.Stepping, 16, 2);

            //#endregion Stepping

            //#region Model

            //Console.Color = Colors.Green;
            //Console.Write(" Model: ");
            //Console.Color = Colors.White;
            //Console.Write(cpuInfo.Model, 16, 2);

            //#endregion Model

            //#region Family

            //Console.Color = Colors.Green;
            //Console.Write(" Family: ");
            //Console.Color = Colors.White;
            //Console.Write(cpuInfo.Family, 16, 2);

            //#endregion Family

            //#region Type

            //Console.Color = Colors.Green;
            //Console.Write(" Type: ");
            //Console.Color = Colors.White;

            //Console.Write(cpuInfo.Type, 16, 2);
            //Console.WriteLine();
            //Console.Color = Colors.Green;
            //Console.Write("Cores:    ");
            //Console.Color = Colors.White;
            //Console.Write(cpuInfo.NumberOfCores, 16, 2);

            //#endregion Type

            Console.Row = 19;
            for (uint index = 0; index < 80; index++)
            {
                Console.Column = index;
                Console.Write((char)205);
            }

            Console.Row = 23;
            for (uint index = 0; index < 80; index++)
            {
                Console.Column = index;
                Console.Write((char)205);
            }

            for (uint index = 2; index < 20; index++)
            {
                Console.Column = 60;
                Console.Row    = index;

                Console.Color = Colors.White;
                if (index == 6)
                {
                    Console.Write((char)185);
                }
                else if (index == 14)
                {
                    Console.Write((char)185);
                }
                else if (index == 19)
                {
                    Console.Write((char)202);
                }
                else
                {
                    Console.Write((char)186);
                }
            }

            Console.Goto(24, 29);
            Console.Color = Colors.Yellow;

            Console.Write("www.mosa-project.org");

            Console.Goto(12, 0);

            byte last = 0;

            while (true)
            {
                DisplayCMOS();
                DisplayTime();

                byte second = CMOS.Second;

                if (second % 10 != 5 & last != second)
                {
                    last = CMOS.Second;
                    DebugClient.SendAlive();
                }

                Native.Hlt();
            }
        }
Пример #20
0
 public ConsoleManager()
 {
     Boot   = CreateSeason();
     Debug  = CreateSeason();
     active = Boot;
 }
Пример #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AppOutputStream"/> class.
 /// </summary>
 /// <param name="session">The session.</param>
 public AppOutputStream(ConsoleSession session)
 {
     Session = session;
 }
Пример #22
0
 public ConsoleManager()
 {
     Boot = CreateSeason();
     Debug = CreateSeason();
     active = Boot;
 }
Пример #23
0
 public void UpdateCursor(ConsoleSession console)
 {
     Screen.SetCursor(console.Row, console.Column);
 }
Пример #24
0
 public void UpdateCursor(ConsoleSession console)
 {
     Mosa.Kernel.x86.Screen.SetCursor(console.Row, console.Column);
 }
Пример #25
0
 public ConsoleManager()
 {
     Boot   = new ConsoleSession(this);
     Debug  = new ConsoleSession(this);
     active = Boot;
 }
Пример #26
0
 public ConsoleManager()
 {
     Boot = new ConsoleSession(this);
     Debug = new ConsoleSession(this);
     active = Boot;
 }
Пример #27
0
        /// <summary>
        /// Main
        /// </summary>
        public static void Main()
        {
            Kernel.x86.Kernel.Setup();

            Console = ConsoleManager.Controller.Boot;
            Console.Clear();

            Serial.SetupPort(Serial.COM1);
            IDT.SetInterruptHandler(ProcessInterrupt);

            hal = new Hardware();

            // Create Service manager and basic services
            var serviceManager = new ServiceManager();

            DeviceService = new DeviceService();

            var diskDeviceService    = new DiskDeviceService();
            var partitionService     = new PartitionService();
            var pciControllerService = new PCIControllerService();
            var pciDeviceService     = new PCIDeviceService();

            serviceManager.AddService(DeviceService);
            serviceManager.AddService(diskDeviceService);
            serviceManager.AddService(partitionService);
            serviceManager.AddService(pciControllerService);
            serviceManager.AddService(pciDeviceService);

            DeviceSystem.Setup.Initialize(hal, DeviceService.ProcessInterrupt);

            DeviceService.RegisterDeviceDriver(DeviceDriver.Setup.GetDeviceDriverRegistryEntries());
            DeviceService.Initialize(new X86System(), null);

            partitionService.CreatePartitionDevices();
            var partitions = DeviceService.GetDevices <IPartitionDevice>();

            foreach (var partition in partitions)
            {
                var fat = new FatFileSystem(partition.DeviceDriver as IPartitionDevice);
                hasFS = fat.IsValid;

                if (hasFS)
                {
                    var location = fat.FindEntry("WALLP.BMP");

                    if (location.IsValid)
                    {
                        var fatFileStream = new FatFileStream(fat, location);
                        var _wall         = new byte[(uint)fatFileStream.Length];

                        for (int k = 0; k < _wall.Length; k++)
                        {
                            _wall[k] = (byte)(char)fatFileStream.ReadByte();
                        }

                        wallpaper = new Bitmap(_wall);
                    }
                }
            }

            var standardMice = DeviceService.GetDevices("StandardMouse");

            if (standardMice.Count == 0)
            {
                hal.Pause();
                hal.Abort("Catastrophic failure, mouse and/or PIT not found.");
            }

            mouse = standardMice[0].DeviceDriver as StandardMouse;
            mouse.SetScreenResolution(VBE.ScreenWidth, VBE.ScreenHeight);

            if (VBEDisplay.InitVBE(hal))
            {
                Log("VBE setup OK!");
                DoGraphics();
            }
            else
            {
                Log("VBE setup ERROR!");
            }
        }
Пример #28
0
        /// <summary>
        /// Main
        /// </summary>
        public static void Main()
        {
            Kernel.x86.Kernel.Setup();

            Console = ConsoleManager.Controller.Boot;

            Console.Clear();
            Console.Goto(0, 0);

            //IDT.SetInterruptHandler(ProcessInterrupt);

            Console.ScrollRow       = 23;
            Console.Color           = ScreenColor.White;
            Console.BackgroundColor = ScreenColor.Green;

            Debug = ConsoleManager.Controller.Boot;

            Console.Write("                   MOSA OS Version 1.5 - Compiler Version 1.5");
            FillLine();
            Console.Color           = ScreenColor.White;
            Console.BackgroundColor = ScreenColor.Black;

            Console.WriteLine("> Initializing hardware abstraction layer...");
            var hardware = new HAL.Hardware();

            var DeviceManager = Setup.Initialize(PlatformArchitecture.X86, hardware);

            Console.WriteLine("> Registering device drivers...");
            DeviceDriver.Setup.Register(DeviceManager);

            Console.WriteLine("> Starting devices...");
            DeviceDriver.Setup.Start(DeviceManager);

            Console.Write("> Probing for ISA devices...");
            var isaDevices = DeviceManager.GetAllDevices();

            Console.WriteLine("[Completed: " + isaDevices.Count.ToString() + " found]");

            foreach (var device in isaDevices)
            {
                Console.Write("  ");
                Bullet(ScreenColor.Yellow);
                Console.Write(" ");
                InBrackets(device.Name, ScreenColor.White, ScreenColor.Green);
                Console.WriteLine();
            }

            Console.Write("> Probing for PCI devices...");

            //Setup.StartPCIDevices();
            var pciDevices = DeviceManager.GetDevices <DeviceSystem.PCI.IPCIDevice>(DeviceStatus.Available);

            Console.WriteLine("[Completed: " + pciDevices.Count.ToString() + " found]");

            foreach (var device in pciDevices)
            {
                var pciDevice = device.DeviceDriver as DeviceSystem.PCI.IPCIDevice;

                Console.Write("  ");
                Bullet(ScreenColor.Yellow);
                Console.Write(" ");
                InBrackets(device.Name + ": " + pciDevice.VendorID.ToString("x") + ":" + pciDevice.DeviceID.ToString("x") + " " + pciDevice.SubSystemID.ToString("x") + ":" + pciDevice.SubVendorID.ToString("x") + " (" + pciDevice.Function.ToString("x") + ":" + pciDevice.ClassCode.ToString("x") + ":" + pciDevice.SubClassCode.ToString("x") + ":" + pciDevice.ProgIF.ToString("x") + ":" + pciDevice.RevisionID.ToString("x") + ")", ScreenColor.White, ScreenColor.Green);
                Console.WriteLine();
            }

            Console.Write("> Probing for disk controllers...");
            var diskcontrollers = DeviceManager.GetDevices <IDiskControllerDevice>();

            Console.WriteLine("[Completed: " + diskcontrollers.Count.ToString() + " found]");

            foreach (var device in diskcontrollers)
            {
                Console.Write("  ");
                Bullet(ScreenColor.Yellow);
                Console.Write(" ");
                InBrackets(device.Name, ScreenColor.White, ScreenColor.Green);
                Console.WriteLine();
            }

            Console.Write("> Probing for disks...");
            var disks = DeviceManager.GetDevices <IDiskDevice>();

            Console.WriteLine("[Completed: " + disks.Count.ToString() + " found]");

            foreach (var disk in disks)
            {
                Console.Write("  ");
                Bullet(ScreenColor.Yellow);
                Console.Write(" ");
                InBrackets(disk.Name, ScreenColor.White, ScreenColor.Green);
                Console.Write(" " + (disk.DeviceDriver as IDiskDevice).TotalBlocks.ToString() + " blocks");
                Console.WriteLine();
            }

            var partitionManager = new PartitionManager(DeviceManager);

            partitionManager.CreatePartitionDevices();

            Console.Write("> Finding partitions...");
            var partitions = DeviceManager.GetDevices <IPartitionDevice>();

            Console.WriteLine("[Completed: " + partitions.Count.ToString() + " found]");

            foreach (var partition in partitions)
            {
                Console.Write("  ");
                Bullet(ScreenColor.Yellow);
                Console.Write(" ");
                InBrackets(partition.Name, ScreenColor.White, ScreenColor.Green);
                Console.Write(" " + (partition.DeviceDriver as IPartitionDevice).BlockCount.ToString() + " blocks");
                Console.WriteLine();
            }

            Console.Write("> Finding file systems...");

            foreach (var partition in partitions)
            {
                var fat = new FatFileSystem(partition.DeviceDriver as IPartitionDevice);

                if (fat.IsValid)
                {
                    Console.WriteLine("Found a FAT file system!");

                    const string filename = "TEST.TXT";

                    var location = fat.FindEntry(filename);

                    if (location.IsValid)
                    {
                        Console.Write("Found: " + filename);

                        var fatFileStream = new FatFileStream(fat, location);

                        uint len = (uint)fatFileStream.Length;

                        Console.WriteLine(" - Length: " + len.ToString());

                        Console.Write("Reading File: ");

                        for (; ;)
                        {
                            int i = fatFileStream.ReadByte();

                            if (i < 0)
                            {
                                break;
                            }

                            Console.Write((char)i);
                        }

                        Console.WriteLine();
                    }
                }
            }

            // Get StandardKeyboard
            var standardKeyboards = DeviceManager.GetDevices("StandardKeyboard");

            if (standardKeyboards.Count == 0)
            {
                Console.WriteLine("No Keyboard!");
                ForeverLoop();
            }

            var standardKeyboard = standardKeyboards[0].DeviceDriver as IKeyboardDevice;

            Debug = ConsoleManager.Controller.Debug;

            // setup keymap
            var keymap = new US();

            // setup keyboard (state machine)
            var keyboard = new DeviceSystem.Keyboard(standardKeyboard, keymap);

            // setup app manager
            var manager = new AppManager(Console, keyboard);

            IDT.SetInterruptHandler(manager.ProcessInterrupt);

            Logger.Log("<SELFTEST:PASSED>");

            manager.Start();
        }
Пример #29
0
 public void UpdateCursor(ConsoleSession console)
 {
     Screen.SetCursor(console.Row, console.Column);
 }
Пример #30
0
        /// <summary>
        /// Main
        /// </summary>
        public static void Main()
        {
            Kernel.x86.Kernel.Setup();

            Console = ConsoleManager.Controller.Boot;

            Console.Clear();
            Console.Goto(0, 0);

            IDT.SetInterruptHandler(ProcessInterrupt);

            Console.ScrollRow       = 25;
            Console.Color           = ScreenColor.Yellow;
            Console.BackgroundColor = ScreenColor.Black;

            Console.Write("MOSA OS Version 1.4 '");
            Console.Color = ScreenColor.Red;
            Console.Write("Neptune");
            Console.Color = ScreenColor.Yellow;
            Console.Write("'                                Copyright 2008-2018");

            Console.Color = ScreenColor.White;
            Console.Write(new String((char)205, 60));
            Console.Write((char)203);
            Console.Write(new String((char)205, 19));
            Console.WriteLine();

            Console.Goto(2, 0);
            Console.Color = ScreenColor.Green;
            Console.Write("Multibootaddress: ");
            Console.Color = ScreenColor.Gray;
            Console.Write(Multiboot.MultibootAddress, 16, 8);

            Console.WriteLine();
            Console.Color = ScreenColor.Green;
            Console.Write("Multiboot-Flags:  ");
            Console.Color = ScreenColor.Gray;
            Console.Write(Multiboot.Flags, 2, 32);
            Console.WriteLine();

            Console.Color = ScreenColor.Green;
            Console.Write("Size of Memory:   ");
            Console.Color = ScreenColor.Gray;
            Console.Write((Multiboot.MemoryLower + Multiboot.MemoryUpper) / 1024, 10, -1);
            Console.Write(" MB (");
            Console.Write(Multiboot.MemoryLower + Multiboot.MemoryUpper, 10, -1);
            Console.Write(" KB)");
            Console.WriteLine();
            Console.WriteLine();

            Console.WriteLine();
            Console.Color = ScreenColor.Green;
            Console.Write("Smbios Info: ");

            if (SmbiosManager.IsAvailable)
            {
                Console.Color = ScreenColor.White;
                Console.Write("[");
                Console.Color = ScreenColor.Gray;
                Console.Write("Version ");
                Console.Write(SmbiosManager.MajorVersion, 10, -1);
                Console.Write(".");
                Console.Write(SmbiosManager.MinorVersion, 10, -1);
                Console.Color = ScreenColor.White;
                Console.Write("]");
                Console.WriteLine();

                Console.Color = ScreenColor.Yellow;
                Console.Write("[Bios]");
                Console.Color = ScreenColor.White;
                Console.WriteLine();

                var biosInformation = new BiosInformationStructure();
                Console.Color = ScreenColor.White;
                Console.Write("Vendor: ");
                Console.Color = ScreenColor.Gray;
                Console.Write(biosInformation.BiosVendor);
                Console.WriteLine();
                Console.Color = ScreenColor.White;
                Console.Write("Version: ");
                Console.Color = ScreenColor.Gray;
                Console.Write(biosInformation.BiosVersion);
                Console.WriteLine();
                Console.Color = ScreenColor.White;
                Console.Write("Date: ");
                Console.Color = ScreenColor.Gray;
                Console.Write(biosInformation.BiosDate);

                Console.Color  = ScreenColor.Yellow;
                Console.Row    = 8;
                Console.Column = 35;
                Console.Write("[Cpu]");
                Console.Color = ScreenColor.White;
                Console.WriteLine();
                Console.Column = 35;

                var cpuStructure = new CpuStructure();
                Console.Color = ScreenColor.White;
                Console.Write("Vendor: ");
                Console.Color = ScreenColor.Gray;
                Console.Write(cpuStructure.Vendor);
                Console.WriteLine();
                Console.Column = 35;
                Console.Color  = ScreenColor.White;
                Console.Write("Version: ");
                Console.Color = ScreenColor.Gray;
                Console.Write(cpuStructure.Version);
                Console.WriteLine();
                Console.Column = 35;
                Console.Color  = ScreenColor.White;
                Console.Write("Socket: ");
                Console.Color = ScreenColor.Gray;
                Console.Write(cpuStructure.Socket);
                Console.Write(" MHz");
                Console.WriteLine();
                Console.Column = 35;
                Console.Color  = ScreenColor.White;
                Console.Write("Cur. Speed: ");
                Console.Color = ScreenColor.Gray;
                Console.Write(cpuStructure.MaxSpeed, 10, -1);
                Console.Write(" MHz");
                Console.WriteLine();
                Console.Column = 35;
            }
            else
            {
                Console.Color = ScreenColor.Red;
                Console.Write("No SMBIOS available on this system!");
            }

            Console.WriteLine();
            Console.WriteLine();

            Console.Color = ScreenColor.Green;
            Console.Write("Memory-Map:");
            Console.WriteLine();

            for (uint index = 0; index < Multiboot.MemoryMapCount; index++)
            {
                Console.Color = ScreenColor.White;
                Console.Write(Multiboot.GetMemoryMapBase(index), 16, 8);
                Console.Write(" - ");
                Console.Write(Multiboot.GetMemoryMapBase(index) + Multiboot.GetMemoryMapLength(index) - 1, 16, 8);
                Console.Write(" (");
                Console.Color = ScreenColor.Gray;
                Console.Write(Multiboot.GetMemoryMapLength(index), 16, 8);
                Console.Color = ScreenColor.White;
                Console.Write(") ");
                Console.Color = ScreenColor.Gray;
                Console.Write("Type: ");
                Console.Write(Multiboot.GetMemoryMapType(index), 16, 1);
                Console.WriteLine();
            }

            Console.Color = ScreenColor.Yellow;
            Console.Goto(24, 29);
            Console.Write("www.mosa-project.org");

            // Borders

            Console.Color = ScreenColor.White;

            for (uint index = 0; index < 60; index++)
            {
                Console.Goto(14, index);
                Console.Write((char)205);
            }

            for (uint index = 0; index < 60; index++)
            {
                Console.Goto(6, index);
                Console.Write((char)205);
            }

            for (uint index = 60; index < 80; index++)
            {
                Console.Goto(19, index);
                Console.Write((char)205);
            }

            for (uint index = 0; index < 80; index++)
            {
                Console.Goto(23, index);
                Console.Write((char)205);
            }

            for (uint index = 2; index < 20; index++)
            {
                Console.Goto(index, 60);
                if (index == 6)
                {
                    Console.Write((char)185);
                }
                else if (index == 14)
                {
                    Console.Write((char)185);
                }
                else if (index == 19)
                {
                    Console.Write((char)200);
                }
                else
                {
                    Console.Write((char)186);
                }
            }

            Console.Goto(12, 0);

            while (true)
            {
                DisplayCMOS();
                DisplayTime();

                Native.Hlt();
            }
        }
Пример #31
0
        public static void Start()
        {
            Screen.Color = 0x0;
            Screen.Clear();
            Screen.GotoTop();
            Screen.Color = 0x0E;
            Screen.Write('M');
            Screen.Write('O');
            Screen.Write('S');
            Screen.Write('A');
            Screen.Write(' ');
            Screen.Write('O');
            Screen.Write('S');
            Screen.Write("!");
            Screen.Write(" ");

            DebugClient.Setup(Serial.COM1);
            Screen.Write('0');
            IDT.SetInterruptHandler(null);
            Screen.Write('1');
            Multiboot.Setup();
            Screen.Write('2');
            PIC.Setup();
            Screen.Write('3');
            GDT.Setup();
            Screen.Write('4');
            IDT.Setup();
            Screen.Write('5');
            PageFrameAllocator.Setup();
            Screen.Write('6');
            PageTable.Setup();
            Screen.Write('7');
            VirtualPageAllocator.Setup();
            Screen.Write('8');
            ProcessManager.Setup();
            Screen.Write('9');
            GC.Setup();
            Screen.Write('0');

            //Runtime.Setup();
            Screen.Write('A');
            TaskManager.Setup();
            Screen.Write('B');
            IDT.SetInterruptHandler(ProcessInterrupt);
            Screen.Write('C');
            ConsoleManager.Setup();
            Screen.Write('D');
            Console = ConsoleManager.Controller.Boot;
            Screen.Write('E');
            Screen.Write('F');

            Console.Color           = 0x0E;
            Console.BackgroundColor = 1;
            Console.WriteLine();
            Console.WriteLine();
            Console.Write("!MOSA is alive!");

            Console.WriteLine();

            KernelTest.RunTests();

            Console.WriteLine();

            DumpStackTrace();

            //System.Threading.SpinLock splk = new System.Threading.SpinLock();

            //bool lockTaken = false;
            //splk.Enter(ref lockTaken);
            //if (splk.IsHeld)
            //	Console.Write("Entered...");

            //lockTaken = false;
            //splk.Enter(ref lockTaken);

            //Console.Write("Should have looped!!!");

            Console.Goto(22, 0);

            Process();
        }
Пример #32
0
        public static void Main()
        {
            Screen.Clear();
            Screen.Color = ScreenColor.Yellow;
            Screen.Write('M');
            Screen.Write('O');
            Screen.Write('S');
            Screen.Write('A');
            Screen.Write(' ');
            Screen.Write('O');
            Screen.Write('S');
            Screen.Write("!");
            Screen.Write(" ");

            Multiboot.Setup();
            Screen.Write('0');
            GDT.Setup();
            Screen.Write('1');

            IDT.SetInterruptHandler(null);
            Screen.Write('2');
            Debugger.Setup(Serial.COM1);

            Screen.Write('3');
            PIC.Setup();
            Screen.Write('4');
            IDT.Setup();
            Screen.Write('5');
            PageFrameAllocator.Setup();
            Screen.Write('6');
            PageTable.Setup();
            Screen.Write('7');
            VirtualPageAllocator.Setup();
            Screen.Write('8');
            GC.Setup();
            Screen.Write('9');

            Scheduler.Setup();
            Screen.Write('B');
            IDT.SetInterruptHandler(ProcessInterrupt);
            Screen.Write('C');
            ConsoleManager.Setup();
            Screen.Write('D');
            Console = ConsoleManager.Controller.Boot;
            Screen.Write('E');

            Console.Color           = ScreenColor.Yellow;
            Console.BackgroundColor = ScreenColor.Blue;
            Console.WriteLine();
            Console.WriteLine();

            //ArrayLayoutTests.U8d();

            KernelTest.RunTests();

            DumpStackTrace();

            Console.Goto(2, 0);

            Scheduler.CreateThread(Thread1, PageFrameAllocator.PageSize);
            Scheduler.CreateThread(Thread2, PageFrameAllocator.PageSize);
            Scheduler.CreateThread(Thread3, PageFrameAllocator.PageSize);
            Scheduler.CreateThread(Thread4, PageFrameAllocator.PageSize);

            Scheduler.Start();

            // should never get here
            Screen.Write("!BAD!");

            while (true)
            {
                Native.Hlt();
            }
        }
Пример #33
0
 public void UpdateCursor(ConsoleSession console)
 {
     Mosa.Kernel.x86.Screen.SetCursor(console.Row, console.Column);
 }
Пример #34
0
        /// <summary>
        /// Main
        /// </summary>
        public static void Main()
        {
            Kernel.x86.Kernel.Setup();

            Console = ConsoleManager.Controller.Boot;

            Console.Clear();
            Console.Goto(0, 0);
            Console.ScrollRow       = 23;
            Console.Color           = ScreenColor.White;
            Console.BackgroundColor = ScreenColor.Green;

            Debug = ConsoleManager.Controller.Debug;

            Console.Write("                   MOSA OS Version 2.2 - Compiler Version 2.2");
            FillLine();
            Console.Color           = ScreenColor.White;
            Console.BackgroundColor = ScreenColor.Black;

            Console.WriteLine("> Initializing services...");

            // Create Service manager and basic services
            var serviceManager = new ServiceManager();

            DeviceService = new DeviceService();

            var diskDeviceService    = new DiskDeviceService();
            var partitionService     = new PartitionService();
            var pciControllerService = new PCIControllerService();
            var pciDeviceService     = new PCIDeviceService();
            var pcService            = new PCService();

            serviceManager.AddService(DeviceService);
            serviceManager.AddService(diskDeviceService);
            serviceManager.AddService(partitionService);
            serviceManager.AddService(pciControllerService);
            serviceManager.AddService(pciDeviceService);
            serviceManager.AddService(pcService);

            Console.WriteLine("> Initializing hardware abstraction layer...");

            // Set device driver system with the hardware HAL
            var hardware = new HAL.Hardware();

            DeviceSystem.Setup.Initialize(hardware, DeviceService.ProcessInterrupt);

            Console.WriteLine("> Registering device drivers...");
            DeviceService.RegisterDeviceDriver(DeviceDriver.Setup.GetDeviceDriverRegistryEntries());

            Console.WriteLine("> Starting devices...");

            DeviceService.Initialize(new X86System(), null);

            var acpi = DeviceService.GetFirstDevice <IACPI>().DeviceDriver as IACPI;

            // Setup APIC
            var localApic = Mosa.DeviceSystem.HAL.GetPhysicalMemory((Pointer)acpi.LocalApicAddress, 0xFFFF).Address;
            var ioApic    = Mosa.DeviceSystem.HAL.GetPhysicalMemory((Pointer)acpi.IOApicAddress, 0xFFFF).Address;

            APIC.Setup(localApic, ioApic);

            Console.Write("> Probing for ISA devices...");
            var isaDevices = DeviceService.GetChildrenOf(DeviceService.GetFirstDevice <ISABus>());

            Console.WriteLine("[Completed: " + isaDevices.Count.ToString() + " found]");

            foreach (var device in isaDevices)
            {
                Console.Write("  ");
                Bullet(ScreenColor.Yellow);
                Console.Write(" ");
                InBrackets(device.Name, ScreenColor.White, ScreenColor.Green);
                Console.WriteLine();
            }

            Console.Write("> Probing for PCI devices...");
            var devices = DeviceService.GetDevices <PCIDevice>();

            Console.WriteLine("[Completed: " + devices.Count.ToString() + " found]");

            foreach (var device in devices)
            {
                Console.Write("  ");
                Bullet(ScreenColor.Yellow);
                Console.Write(" ");

                var pciDevice = device.DeviceDriver as PCIDevice;
                InBrackets(device.Name + ": " + pciDevice.VendorID.ToString("x") + ":" + pciDevice.DeviceID.ToString("x") + " " + pciDevice.SubSystemID.ToString("x") + ":" + pciDevice.SubSystemVendorID.ToString("x") + " (" + pciDevice.ClassCode.ToString("x") + ":" + pciDevice.SubClassCode.ToString("x") + ":" + pciDevice.ProgIF.ToString("x") + ":" + pciDevice.RevisionID.ToString("x") + ")", ScreenColor.White, ScreenColor.Green);

                var children = DeviceService.GetChildrenOf(device);

                if (children.Count != 0)
                {
                    var child = children[0];

                    Console.WriteLine();
                    Console.Write("    ");

                    var pciDevice2 = child.DeviceDriver as PCIDevice;
                    InBrackets(child.Name, ScreenColor.White, ScreenColor.Green);
                }

                Console.WriteLine();
            }

            Console.Write("> Probing for disk controllers...");
            var diskcontrollers = DeviceService.GetDevices <IDiskControllerDevice>();

            Console.WriteLine("[Completed: " + diskcontrollers.Count.ToString() + " found]");

            foreach (var device in diskcontrollers)
            {
                Console.Write("  ");
                Bullet(ScreenColor.Yellow);
                Console.Write(" ");
                InBrackets(device.Name, ScreenColor.White, ScreenColor.Green);
                Console.WriteLine();
            }

            Console.Write("> Probing for disks...");
            var disks = DeviceService.GetDevices <IDiskDevice>();

            Console.WriteLine("[Completed: " + disks.Count.ToString() + " found]");

            foreach (var disk in disks)
            {
                Console.Write("  ");
                Bullet(ScreenColor.Yellow);
                Console.Write(" ");
                InBrackets(disk.Name, ScreenColor.White, ScreenColor.Green);
                Console.Write(" " + (disk.DeviceDriver as IDiskDevice).TotalBlocks.ToString() + " blocks");
                Console.WriteLine();
            }

            partitionService.CreatePartitionDevices();

            Console.Write("> Finding partitions...");
            var partitions = DeviceService.GetDevices <IPartitionDevice>();

            Console.WriteLine("[Completed: " + partitions.Count.ToString() + " found]");

            //foreach (var partition in partitions)
            //{
            //	Console.Write("  ");
            //	Bullet(ScreenColor.Yellow);
            //	Console.Write(" ");
            //	InBrackets(partition.Name, ScreenColor.White, ScreenColor.Green);
            //	Console.Write(" " + (partition.DeviceDriver as IPartitionDevice).BlockCount.ToString() + " blocks");
            //	Console.WriteLine();
            //}

            Console.Write("> Finding file systems...");

            foreach (var partition in partitions)
            {
                var fat = new FatFileSystem(partition.DeviceDriver as IPartitionDevice);

                if (fat.IsValid)
                {
                    Console.WriteLine("Found a FAT file system!");

                    const string filename = "TEST.TXT";

                    var location = fat.FindEntry(filename);

                    if (location.IsValid)
                    {
                        Console.Write("Found: " + filename);

                        var fatFileStream = new FatFileStream(fat, location);

                        uint len = (uint)fatFileStream.Length;

                        Console.WriteLine(" - Length: " + len.ToString() + " bytes");

                        Console.Write("Reading File: ");

                        for (; ;)
                        {
                            int i = fatFileStream.ReadByte();

                            if (i < 0)
                            {
                                break;
                            }

                            Console.Write((char)i);
                        }

                        Console.WriteLine();
                    }

                    const string bmpname = "WALLP.BMP";

                    var bmploc = fat.FindEntry(bmpname);

                    if (bmploc.IsValid)
                    {
                        Console.Write("Found: " + bmpname);

                        var fatFileStream = new FatFileStream(fat, bmploc);

                        uint len = (uint)fatFileStream.Length;

                        Console.WriteLine(" - Length: " + len.ToString() + " bytes");
                        Console.WriteLine();
                    }
                }
            }

            // Get StandardKeyboard
            var keyboards = DeviceService.GetDevices("StandardKeyboard");

            if (keyboards.Count == 0)
            {
                Console.WriteLine("No Keyboard!");
                ForeverLoop();
            }

            var stdKeyboard = keyboards[0].DeviceDriver as IKeyboardDevice;

            // setup keymap
            var keymap = new US();

            // setup keyboard (state machine)
            var keyboard = new DeviceSystem.Keyboard(stdKeyboard, keymap);

            // setup app manager
            var manager = new AppManager(Console, keyboard, serviceManager);

            IDT.SetInterruptHandler(manager.ProcessInterrupt);

            Logger.Log("<SELFTEST:PASSED>");

            manager.Start();
        }
Пример #35
0
 public ConsoleInterface(IServiceCollection serviceCollection)
 {
     _instance = new ConsoleSession(serviceCollection);
 }