Пример #1
0
        public bool CheckSMBIOS()
        {
            HasSMBIOS = false;
            //0x000F0000 Start

            //0x000F69E0 VMWare
            //0x000FFF30 VirtualBox

            //0x000FFFFF End
            SMBBIOSAddress = 0x000F0000;
            
            Cosmos.Kernel.MemoryAddressSpace Memory = new Cosmos.Kernel.MemoryAddressSpace( 0, 0 );

            while( SMBBIOSAddress <= 0x000FFFFF )
            {
                //if( Memory.Get32( SMBBIOSAddress ) == ( uint )0x5F534D5F || // "_SM_"  
                //    Memory.Get32( SMBBIOSAddress ) == ( uint )0x5F4D535F ) // "_MS_" indianess 
                if( Memory.Read8Unchecked( SMBBIOSAddress ) == ( byte )0x5F ) // 
                    if( Memory.Read8Unchecked( SMBBIOSAddress + 1 ) == ( byte )0x53 )
                        if( Memory.Read8Unchecked( SMBBIOSAddress + 2 ) == ( byte )0x4D )
                            if( Memory.Read8Unchecked( SMBBIOSAddress + 3 ) == ( byte )0x5F )
                            {

                                Signature = Memory.Read32Unchecked( SMBBIOSAddress );
                                HasSMBIOS = true;
                                break;
                            }

                SMBBIOSAddress++;
            }

            return HasSMBIOS;
        }
Пример #2
0
 public GenericSoundCard(PCIDevice device){
     if (device == null)
         throw new ArgumentException("PCI Device is null. Unable to get "+this.GetType()+" card");
     pciCard = device;
     mem = device.GetAddressSpace(1) as Cosmos.Kernel.MemoryAddressSpace;
     
     dacs = new List<DACManager>();
     adcs = new List<ADCManager>();
     uarts = new List<UARTManager>();
 }
Пример #3
0
        public GenericSoundCard(PCIDevice device)
        {
            if (device == null)
            {
                throw new ArgumentException("PCI Device is null. Unable to get " + this.GetType() + " card");
            }
            pciCard = device;
            mem     = device.GetAddressSpace(1) as Cosmos.Kernel.MemoryAddressSpace;

            dacs  = new List <DACManager>();
            adcs  = new List <ADCManager>();
            uarts = new List <UARTManager>();
        }
Пример #4
0
        public bool GetSMBIOS_Data()
        {
            if (HasSMBIOS == false && CheckSMBIOS() == false)
            {
                return(false);
            }

            Cosmos.Kernel.MemoryAddressSpace Memory = new Cosmos.Kernel.MemoryAddressSpace(SMBBIOSAddress, 32);

            SMBIOS_Data = new SMBIOS_Data();

            //4 Byte array
            SMBIOS_Data.AnchorString[0] = Memory.Read8Unchecked(0);
            SMBIOS_Data.AnchorString[1] = Memory.Read8Unchecked(1);
            SMBIOS_Data.AnchorString[2] = Memory.Read8Unchecked(2);
            SMBIOS_Data.AnchorString[3] = Memory.Read8Unchecked(3);

            SMBIOS_Data.EntryPointStructureChecksum = Memory.Read8Unchecked(4);
            SMBIOS_Data.EntryPointLength            = Memory.Read8Unchecked(5);
            SMBIOS_Data.SMBIOSMajorVersion          = Memory.Read8Unchecked(6);
            SMBIOS_Data.SMBIOSMinorVersion          = Memory.Read8Unchecked(7);
            SMBIOS_Data.MaximumStructureSize        = Memory.Read16Unchecked(8);

            SMBIOS_Data.EntryPointRevision = Memory.Read8Unchecked(10);

            //5 Byte array
            SMBIOS_Data.FormattedArea[0] = Memory.Read8Unchecked(11);
            SMBIOS_Data.FormattedArea[1] = Memory.Read8Unchecked(12);
            SMBIOS_Data.FormattedArea[2] = Memory.Read8Unchecked(13);
            SMBIOS_Data.FormattedArea[3] = Memory.Read8Unchecked(14);
            SMBIOS_Data.FormattedArea[4] = Memory.Read8Unchecked(15);

            //5 Byte array
            SMBIOS_Data.IntermediateAnchorString[0] = Memory.Read8Unchecked(16);
            SMBIOS_Data.IntermediateAnchorString[1] = Memory.Read8Unchecked(17);
            SMBIOS_Data.IntermediateAnchorString[2] = Memory.Read8Unchecked(18);
            SMBIOS_Data.IntermediateAnchorString[3] = Memory.Read8Unchecked(19);
            SMBIOS_Data.IntermediateAnchorString[4] = Memory.Read8Unchecked(20);

            SMBIOS_Data.IntermediateChecksum     = Memory.Read8Unchecked(21);
            SMBIOS_Data.StructureTableLength     = Memory.Read16Unchecked(22);
            SMBIOS_Data.StructureTableAddress    = Memory.Read32Unchecked(24);
            SMBIOS_Data.NumberOfSMBIOSStructures = Memory.Read16Unchecked(28);
            SMBIOS_Data.SMBIOSBCDRevision        = Memory.Read8Unchecked(30);

            return(true);
        }
Пример #5
0
        public static void DumpBytes( uint from, uint count, uint column )
        {
            Cosmos.Kernel.MemoryAddressSpace Memory = new Cosmos.Kernel.MemoryAddressSpace( 0, 0 );
            
            uint j = 0;

            for( uint i = 0; i < count; i++ )
            {
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( Memory.Read8Unchecked( from + i ), 2 ) );
                Console.Write( " " );
                j++;
                if( j == column )
                {
                    Console.WriteLine( "" );
                    j = 0;
                }
            }
        }
Пример #6
0
        public static void DumpBytes(uint from, uint count, uint column)
        {
            Cosmos.Kernel.MemoryAddressSpace Memory = new Cosmos.Kernel.MemoryAddressSpace(0, 0);

            uint j = 0;

            for (uint i = 0; i < count; i++)
            {
                //Console.Write( Cosmos.Kernel.HexExtension.ToHex( Memory.Read8Unchecked( from + i ), 2 ) );
                Console.Write(" ");
                j++;
                if (j == column)
                {
                    Console.WriteLine("");
                    j = 0;
                }
            }
        }
Пример #7
0
        public bool CheckSMBIOS()
        {
            HasSMBIOS = false;
            //0x000F0000 Start

            //0x000F69E0 VMWare
            //0x000FFF30 VirtualBox

            //0x000FFFFF End
            SMBBIOSAddress = 0x000F0000;

            Cosmos.Kernel.MemoryAddressSpace Memory = new Cosmos.Kernel.MemoryAddressSpace(0, 0);

            while (SMBBIOSAddress <= 0x000FFFFF)
            {
                //if( Memory.Get32( SMBBIOSAddress ) == ( uint )0x5F534D5F || // "_SM_"
                //    Memory.Get32( SMBBIOSAddress ) == ( uint )0x5F4D535F ) // "_MS_" indianess
                if (Memory.Read8Unchecked(SMBBIOSAddress) == ( byte )0x5F)    //
                {
                    if (Memory.Read8Unchecked(SMBBIOSAddress + 1) == ( byte )0x53)
                    {
                        if (Memory.Read8Unchecked(SMBBIOSAddress + 2) == ( byte )0x4D)
                        {
                            if (Memory.Read8Unchecked(SMBBIOSAddress + 3) == ( byte )0x5F)
                            {
                                Signature = Memory.Read32Unchecked(SMBBIOSAddress);
                                HasSMBIOS = true;
                                break;
                            }
                        }
                    }
                }

                SMBBIOSAddress++;
            }

            return(HasSMBIOS);
        }
Пример #8
0
        public bool GetSMBIOS_Data()
        {
            if( HasSMBIOS == false && CheckSMBIOS() == false )
                return false;

            Cosmos.Kernel.MemoryAddressSpace Memory = new Cosmos.Kernel.MemoryAddressSpace( SMBBIOSAddress, 32 );
            
            SMBIOS_Data = new SMBIOS_Data();
            
            //4 Byte array
            SMBIOS_Data.AnchorString[ 0 ] = Memory.Read8Unchecked( 0 );
            SMBIOS_Data.AnchorString[ 1 ] = Memory.Read8Unchecked( 1 );
            SMBIOS_Data.AnchorString[ 2 ] = Memory.Read8Unchecked( 2 );
            SMBIOS_Data.AnchorString[ 3 ] = Memory.Read8Unchecked( 3 );

            SMBIOS_Data.EntryPointStructureChecksum = Memory.Read8Unchecked( 4 );
            SMBIOS_Data.EntryPointLength = Memory.Read8Unchecked( 5 );
            SMBIOS_Data.SMBIOSMajorVersion = Memory.Read8Unchecked( 6 );
            SMBIOS_Data.SMBIOSMinorVersion = Memory.Read8Unchecked( 7 );
            SMBIOS_Data.MaximumStructureSize = Memory.Read16Unchecked( 8 );

            SMBIOS_Data.EntryPointRevision = Memory.Read8Unchecked( 10 );

            //5 Byte array
            SMBIOS_Data.FormattedArea[ 0 ] = Memory.Read8Unchecked( 11 );
            SMBIOS_Data.FormattedArea[ 1 ] = Memory.Read8Unchecked( 12 );
            SMBIOS_Data.FormattedArea[ 2 ] = Memory.Read8Unchecked( 13 );
            SMBIOS_Data.FormattedArea[ 3 ] = Memory.Read8Unchecked( 14 );
            SMBIOS_Data.FormattedArea[ 4 ] = Memory.Read8Unchecked( 15 );

            //5 Byte array
            SMBIOS_Data.IntermediateAnchorString[ 0 ] = Memory.Read8Unchecked( 16 );
            SMBIOS_Data.IntermediateAnchorString[ 1 ] = Memory.Read8Unchecked( 17 );
            SMBIOS_Data.IntermediateAnchorString[ 2 ] = Memory.Read8Unchecked( 18 );
            SMBIOS_Data.IntermediateAnchorString[ 3 ] = Memory.Read8Unchecked( 19 );
            SMBIOS_Data.IntermediateAnchorString[ 4 ] = Memory.Read8Unchecked( 20 );

            SMBIOS_Data.IntermediateChecksum = Memory.Read8Unchecked( 21 );
            SMBIOS_Data.StructureTableLength = Memory.Read16Unchecked( 22 );
            SMBIOS_Data.StructureTableAddress = Memory.Read32Unchecked( 24 );
            SMBIOS_Data.NumberOfSMBIOSStructures = Memory.Read16Unchecked( 28 );
            SMBIOS_Data.SMBIOSBCDRevision = Memory.Read8Unchecked( 30 );

            return true;
        }