// Main entry point of the kernel
        public static void Init()
        {
            var xBoot = new Cosmos.Sys.Boot();

            xBoot.Execute();
            //There's supposed to be a bit of text here. Change it to Console.WriteLine("Hello world!");
        }
Beispiel #2
0
        static void Main()
        {
            // Boot the Cosmos kernel:
            Cosmos.Sys.Boot xBoot = new Cosmos.Sys.Boot();
            xBoot.Execute();

            Console.WriteLine("Cosmos booted successfully. Type a line of text to get it echoed back:");
            string xResult = Console.ReadLine();

            Console.Write("Text typed: ");
            Console.WriteLine(xResult);
        }
Beispiel #3
0
        // Here is where your Cosmos code goes. This is the code that will be executed during Cosmos boot.
        // Write your code, and run. Cosmos build console will appear, select your target, and thats it!
        public static void Init() {
			try {
                var xBoot = new Cosmos.Sys.Boot();
                xBoot.Execute();
                //System.Console.WriteLine("Sorry - the Cosmos.Shell.Console is currently not working.");
                Prompter pmt = new Prompter();
                pmt.Initialize();
				//stages.Enqueue(new Prompter());

			} catch (Exception E) {
                System.Console.WriteLine("Error occurred:");
                System.Console.Write("    ");
                System.Console.WriteLine(E.Message);
			}

			System.Console.WriteLine("Halting system now!..");
			
			// Halt system.
			while (true)
				;
		}
Beispiel #4
0
        // Here is where your Cosmos code goes. This is the code that will be executed during Cosmos boot.
        // Write your code, and run. Cosmos build console will appear, select your target, and thats it!
        public static void Init()
        {
            try {
                var xBoot = new Cosmos.Sys.Boot();
                xBoot.Execute();
                //System.Console.WriteLine("Sorry - the Cosmos.Shell.Console is currently not working.");
                Prompter pmt = new Prompter();
                pmt.Initialize();
                //stages.Enqueue(new Prompter());
            } catch (Exception E) {
                System.Console.WriteLine("Error occurred:");
                System.Console.Write("    ");
                System.Console.WriteLine(E.Message);
            }

            System.Console.WriteLine("Halting system now!..");

            // Halt system.
            while (true)
            {
                ;
            }
        }
Beispiel #5
0
        public static void Init()
        {
            // prevent interrupts from being enabled for now. 
            bool xTest = true;
            if (xTest)
            {
                var xBoot = new Cosmos.Sys.Boot();
                xBoot.Execute();
            }

            SMBIOS a = new SMBIOS();

            if( a.CheckSMBIOS() )
            {
                a.GetSMBIOS_Data();
 
                Console.Write( " SMBios found at: 0x" );
                //Console.Write(Cosmos.Kernel.HexExtension.ToHex(a.SMBBIOSAddress, 8));
                Console.Write( " Version: " );
                Console.Write(a.SMBIOS_Data.SMBIOSMajorVersion);
                Console.Write( "." );
                Console.WriteLine(a.SMBIOS_Data.SMBIOSMinorVersion);

                Console.Write( " Signature: " );
                //Console.WriteLine( Cosmos.Kernel.HexExtension.ToHex( a.Signature ) );

                Console.WriteLine( " SMBIOS dump: " );

                DumpBytes( a.SMBBIOSAddress, 32, 16 );
                Console.WriteLine( "" );

                //Console.Write( " SMBIOS anchor:  " );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.AnchorString[ 0 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.AnchorString[ 1 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.AnchorString[ 2 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.AnchorString[ 3 ] ) );

                //Console.Write( " DMI anchor: " );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.IntermediateAnchorString[ 0 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.IntermediateAnchorString[ 1 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.IntermediateAnchorString[ 2 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.IntermediateAnchorString[ 3 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.IntermediateAnchorString[ 4 ] ) );

                Console.Write( " Number of tables:" );
                Console.Write( a.SMBIOS_Data.NumberOfSMBIOSStructures );

                Console.WriteLine( "" );
                Console.Write( a.SMBIOS_Data.StructureTableLength );
                Console.WriteLine( " bytes of data" );
                
                Console.Write( " Reading " );
                Console.Write(" tables... " );
                int read = a.ReadTables();
                Console.Write( read );
                Console.WriteLine( " tables read." );

                Console.WriteLine( " Found Hardware Types:" ); 
                for( int i = 0; i < a.TableList.Count; i++ )
                {
                    Console.Write( a.TableList[ i ].TableType );
                    Console.Write( " " );
                }
                Console.WriteLine( "" ); 

                Console.Write( " Interpreting data... " );
                a.InterpretData(); 
                Console.WriteLine( " done." );


                List<BaseInfo> lst = a.GetHardwareDescriptorByType( TableTypes.BIOSInformation );
                BIOSTable biosinfo;
                if( lst.Count > 0 )
                {
                    BaseInfo ht = lst[ 0 ];
                    biosinfo = ( BIOSTable )ht;
                    Console.WriteLine( " BIOS Information: " );
                    Console.Write( "   Vendor: " );
                    Console.WriteLine( biosinfo.Vendor );  
                }


                ProcessorInformation CPUInfo;
                lst = a.GetHardwareDescriptorByType( TableTypes.ProcessorInformation );

                if( lst.Count > 0 )
                {
                    CPUInfo = ( ProcessorInformation )lst[ 0 ];
                    if( CPUInfo == null )
                        Console.WriteLine( " No CPU Information." );
                    else
                    {
                        Console.WriteLine( " CPU Information: " );
                        Console.Write( "   CurrentSpeed: " );
                        Console.Write( CPUInfo.CurrentSpeed );
                        Console.Write( " MHz  Core Count: " );
                        Console.WriteLine( CPUInfo.CoreCount );
                        Console.WriteLine( CPUInfo.ProcessorManufacturer );
                    }
                }


                   
            }
            Console.WriteLine( "Press a key to shutdown..." );
            Console.Read();

              
            Console.WriteLine("Done");
            Cosmos.Sys.Deboot.ShutDown();
        }
Beispiel #6
0
        public static void Init()
        {
            // prevent interrupts from being enabled for now.
            bool xTest = true;

            if (xTest)
            {
                var xBoot = new Cosmos.Sys.Boot();
                xBoot.Execute();
            }

            SMBIOS a = new SMBIOS();

            if (a.CheckSMBIOS())
            {
                a.GetSMBIOS_Data();

                Console.Write(" SMBios found at: 0x");
                //Console.Write(Cosmos.Kernel.HexExtension.ToHex(a.SMBBIOSAddress, 8));
                Console.Write(" Version: ");
                Console.Write(a.SMBIOS_Data.SMBIOSMajorVersion);
                Console.Write(".");
                Console.WriteLine(a.SMBIOS_Data.SMBIOSMinorVersion);

                Console.Write(" Signature: ");
                //Console.WriteLine( Cosmos.Kernel.HexExtension.ToHex( a.Signature ) );

                Console.WriteLine(" SMBIOS dump: ");

                DumpBytes(a.SMBBIOSAddress, 32, 16);
                Console.WriteLine("");

                //Console.Write( " SMBIOS anchor:  " );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.AnchorString[ 0 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.AnchorString[ 1 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.AnchorString[ 2 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.AnchorString[ 3 ] ) );

                //Console.Write( " DMI anchor: " );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.IntermediateAnchorString[ 0 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.IntermediateAnchorString[ 1 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.IntermediateAnchorString[ 2 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.IntermediateAnchorString[ 3 ] ) );
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( a.SMBIOS_Data.IntermediateAnchorString[ 4 ] ) );

                Console.Write(" Number of tables:");
                Console.Write(a.SMBIOS_Data.NumberOfSMBIOSStructures);

                Console.WriteLine("");
                Console.Write(a.SMBIOS_Data.StructureTableLength);
                Console.WriteLine(" bytes of data");

                Console.Write(" Reading ");
                Console.Write(" tables... ");
                int read = a.ReadTables();
                Console.Write(read);
                Console.WriteLine(" tables read.");

                Console.WriteLine(" Found Hardware Types:");
                for (int i = 0; i < a.TableList.Count; i++)
                {
                    Console.Write(a.TableList[i].TableType);
                    Console.Write(" ");
                }
                Console.WriteLine("");

                Console.Write(" Interpreting data... ");
                a.InterpretData();
                Console.WriteLine(" done.");


                List <BaseInfo> lst = a.GetHardwareDescriptorByType(TableTypes.BIOSInformation);
                BIOSTable       biosinfo;
                if (lst.Count > 0)
                {
                    BaseInfo ht = lst[0];
                    biosinfo = ( BIOSTable )ht;
                    Console.WriteLine(" BIOS Information: ");
                    Console.Write("   Vendor: ");
                    Console.WriteLine(biosinfo.Vendor);
                }


                ProcessorInformation CPUInfo;
                lst = a.GetHardwareDescriptorByType(TableTypes.ProcessorInformation);

                if (lst.Count > 0)
                {
                    CPUInfo = ( ProcessorInformation )lst[0];
                    if (CPUInfo == null)
                    {
                        Console.WriteLine(" No CPU Information.");
                    }
                    else
                    {
                        Console.WriteLine(" CPU Information: ");
                        Console.Write("   CurrentSpeed: ");
                        Console.Write(CPUInfo.CurrentSpeed);
                        Console.Write(" MHz  Core Count: ");
                        Console.WriteLine(CPUInfo.CoreCount);
                        Console.WriteLine(CPUInfo.ProcessorManufacturer);
                    }
                }
            }
            Console.WriteLine("Press a key to shutdown...");
            Console.Read();


            Console.WriteLine("Done");
            Cosmos.Sys.Deboot.ShutDown();
        }