public async Task <IActionResult> Edit(int id, [Bind("BioId,Title,Tags,Logline,Type")] Bios bios)
        {
            if (id != bios.BioId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bios);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BiosExists(bios.BioId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(bios));
        }
Example #2
0
 private void BackgroundWorker_InitWMI(object sender, DoWorkEventArgs e)
 {
     cpu  = new CPU();
     bios = new Bios();
     ram  = new RAM();
     disk = new Disk();
     gpu  = new GPU();
     os   = new OS();
 }
Example #3
0
 public ActionResult BioSkillsPost(Bios bios)
 {
     if (ModelState.IsValid)
     {
         bios.CreatedDate = DateTime.Now;
         db.Bios.Add(bios);
         db.SaveChanges();
     }
     return(RedirectToAction("EditResumeAdmin"));
 }
Example #4
0
 public void Down()
 {
     //56mb
     this.cpu.Dispose();
     this.bios   = null;
     this.redBus = null;
     this.bus    = null;
     this.cpu    = null;
     GC.Collect();
     //55mb (-2.3kb)
 }
        public async Task <IActionResult> Create([Bind("BioId,Title,Tags,Logline,Type")] Bios bios)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bios);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(bios));
        }
Example #6
0
 private string ReadKey()
 {
     try
     {
         return(this._hashService.Sha256(Bios.GetId() + Hdd.GetId() + Processor.GetId()));
     }
     catch
     {
         return("ZGVmYXVsdF9pZA==");
     }
 }
Example #7
0
        public static Bios GetBiosInfo()
        {
            Bios bios = new Bios();

            ManagementObjectSearcher managmentSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_BIOS");

            foreach (ManagementObject managmentObject in managmentSearcher.Get())
            {
                foreach (PropertyData properties in managmentObject.Properties)
                {
                    switch (properties.Name)
                    {
                    case "BIOSVersion":
                        bios.Version = string.Join(" / ", (string[])properties.Value);
                        break;

                    case "BuildNumber":
                        bios.BuildNumber = (string)properties.Value;
                        break;

                    case "Caption":
                        bios.Caption = (string)properties.Value;
                        break;

                    case "CodeSet":
                        bios.CodeSet = (string)properties.Value;
                        break;

                    case "CurrentLanguage":
                        bios.CurrentLanguage = (string)properties.Value;
                        break;

                    case "Description":
                        bios.Description = (string)properties.Value;
                        break;

                    case "InstallDate":
                        bios.InstallDate = (string)properties.Value;
                        break;

                    case "Manufacturer":
                        bios.Manufacturer = (string)properties.Value;
                        break;
                    }
                }

                managmentObject.Dispose();
            }

            return(bios);
        }
Example #8
0
        private Bios GetBios()
        {
            var result = new Bios();
            ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_BIOS");

            foreach (ManagementObject mo in searcher.Get())
            {
                result.Name         = mo.GetPropertyValue("Name").ToString();
                result.Version      = mo.GetPropertyValue("Version").ToString();
                result.Manufacturer = mo.GetPropertyValue("Manufacturer").ToString();
                result.SerialNumber = mo.GetPropertyValue("SerialNumber").ToString();
            }
            return(result);
        }
Example #9
0
        /// <summary>
        /// Initializes a new instance of the TextConsole class.
        /// </summary>
        /// <param name="video">Current VideoHandler instance.</param>
        /// <param name="bios">Current Bios instance.</param>
        public TextConsole(VideoHandler video, Bios bios)
        {
            unsafe
            {
                displayData = (ushort *)video.VideoRam.ToPointer();
            }

            this.video = video;
            this.bios  = bios;

            this.AnsiEnabled = true;
            Width            = 80;
            Height           = 25;
            ForegroundColor  = 7;
        }
Example #10
0
        public Bios GetBiosInfo()
        {
            ManagementObjectSearcher   manegament = new ManagementObjectSearcher("Select Version,Caption,Manufacturer,SerialNumber,ReleaseDate From Win32_BIOS");
            ManagementObjectCollection collection = manegament.Get();
            Bios bios = new Bios();

            foreach (var prop in collection)
            {
                bios.Version      = prop["Version"].ToString();
                bios.Caption      = prop["Caption"].ToString();
                bios.Manufacturer = prop["Manufacturer"].ToString();
                bios.ReleaseDate  = ManagementDateTimeConverter.ToDateTime(prop["ReleaseDate"].ToString());
                bios.SerialNumber = prop["SerialNumber"].ToString();
            }
            return(bios);
        }
        private void GetDevices()
        {
            using var deviceManager = platform.GetDeviceManager();
            var count = deviceManager.GetTotalDeviceCount();

            for (var i = 0uL; i < count; i++)
            {
                var device = deviceManager.GetDevice(i);

                if (device.GetDeviceType() == DeviceType.DT_CPU)
                {
                    cpu = device.AsCpu();
                }
                else if (device.GetDeviceType() == DeviceType.DT_BIOS)
                {
                    bios = device.AsBios();
                }
            }
        }
Example #12
0
        /// <summary>
        /// Constructs the machine with the given RAM size and load a bootloader into memory.
        /// The bootloader is loaded at address 0x400 to 0x500.
        /// </summary>
        /// <param name="bootloader">
        /// The path to the bootloader file
        /// </param>
        /// <param name="coreRamSize">
        /// The size of RAM in bytes
        /// </param>
        public Machine(string bootloader, string os, int coreRamSize)
        {
            try
            {
                bios    = new Bios(this, 0x0100, "PGX");
                cpu     = new CPU(IsLight);
                redBus  = new RedBus(cpu);
                bus     = new Bus(redBus);
                cpu.Bus = (bus);
                var deb = new Debugger(cpu);

                cpu.linkDebugger(deb);

                var ram = new Memory(0x0000, coreRamSize - 1, cpu);
                if (bootloader != null)
                {
                    ram.loadFromFile(bootloader, 0x0300, 0x4268, "bootloader");
                }
                if (os != null)
                {
                    ram.loadFromFile(os, 0x0300, 0x4268, "os");
                }
                bus.AddDevice(ram);
                //bus.AddDevice(new Acia6850(0x8800, cpu)); // invalid instruction page
                bus.AddDevice(new Acia6551(0x8800, cpu));
                bus.AddDevice(new CRTC(0x9000, cpu, ram));
                //bus.AddDevice(new WIFICard(0x10000, cpu)); // wtf, hault on divide by zero
                bus.AddDevice(new WirelessTerminal(0x9500, cpu)); // in address 0x10k, wsod on register overflow
            }
            catch (Exception e)
            {
                cpu.Hault(e);
                Down();
            }
            reset();
            coldUpCPU();
        }
        private void AbrirBios(string path)
        {
            LimparTela();
            Bios = new Bios(path);

            if (Bios.PE000)
            {
                LinhaBios linhaBios = Bios.linhasDaBios[0];
                hcHeader.RomHeader         = linhaBios.RomHeader;
                hcHeader.FileName          = new FileInfo(path).Name;
                hcHeader.ImageChecksum     = linhaBios.ImageChecksum;
                hcHeader.GeneratedChecksum = linhaBios.GenerateChecksum();

                if (linhaBios.BoostTable != null)
                {
                    CE00D.E001(linhaBios.BoostTable.BoostClocks.Select(param0_2 => param0_2.Frequency).ToList());
                }

                tabControl.TabPages.Add(tpCommon);
                bbcBaseBoost.PE000 = linhaBios.FE006;

                if (Bios.PE003)
                {
                    vtcVoltageTable.BoostTable   = linhaBios.BoostTable;
                    vtcVoltageTable.PerfTable    = linhaBios.PerfTable;
                    vtcVoltageTable.VoltageTable = linhaBios.VoltageTable;
                    tabControl.TabPages.Add(tpVoltageTable);
                }

                if (Bios.PossuiFanSettings)
                {
                    frcFanRange.FanSettings  = linhaBios.FanSettings;
                    frcFanRange.FanSettings2 = linhaBios.FanSettings2;
                }

                if (Bios.PossuiPowerTable)
                {
                    ptcPowerTable.PowerTable = linhaBios.PowerTable;
                    tabControl.TabPages.Add(tpPowerTable);
                }

                tabControl.TabPages.Add(tpBoostTable);

                if (Bios.PossuiBoostProfile)
                {
                    boostConfigControl.BoostProfile = linhaBios.BoostProfile;
                    blhBoostLimiterHelperControl.BoostConfigControl = boostConfigControl;
                    tabControl.TabPages.Add(tpBoostStates);
                }

                ptcPerfTable.PerfTable          = linhaBios.PerfTable;
                mchMemoryClock.PerfTableControl = ptcPerfTable;
                ttcTempTargets.TempTargets      = linhaBios.TempTargets;
                tabControl.TabPages.Add(tpClockStates);
                btcBoostClocks.BoostTable = linhaBios.BoostTable;
                tabControl.Enabled        = true;
            }
            else
            {
                hcHeader.ResetDisplay(true);
            }
        }
Example #14
0
 public string GetUniqPC()
 {
     return(BaseBoard.GetSerialNumber() + Bios.GetSerialNumber());
 }
        public ComputerModel GetAllData()
        {
            computer.Open();
            computer.CpuEnabled       = true;
            computer.MainboardEnabled = true;
            computer.RAMEnabled       = true;
            computer.GPUEnabled       = true;
            hardware = computer.Hardware;
            CpuModel[] cpus = new CpuModel[] { };
            var        hwd  = hardware.OfType <GenericCPU>().ToArray();

            var hwCpus = hwd.OfType <GenericCPU>();

            var hwBios = hardware.OfType <Mainboard>()?.FirstOrDefault()?.BIOS;

            cpus = hwCpus.Select(cp =>
            {
                var l1CacheData         = cp.Caches.ContainsKey(CacheLevels.Level1) ? cp.Caches[CacheLevels.Level1].FirstOrDefault(ch => ch.CacheType == CacheType.Data) : null;
                var l1CacheInstructions = cp.Caches.ContainsKey(CacheLevels.Level1) ? cp.Caches[CacheLevels.Level1].FirstOrDefault(ch => ch.CacheType == CacheType.Instructions) : null;
                var l2Cache             = cp.Caches.ContainsKey(CacheLevels.Level2) ? cp.Caches[CacheLevels.Level2].FirstOrDefault() : null;
                var l3Cache             = cp.Caches.ContainsKey(CacheLevels.Level3) ? cp.Caches[CacheLevels.Level3].FirstOrDefault() : null;

                IntelCPU intelCpu = cp as IntelCPU;
                var specificCpu   = (intelCpu != null) ? intelCpu : ((cp is AMDCPU amdCPu) ? amdCPu : cp);

                var cpuModel = new CpuModel()
                {
                    Architecture              = ArchitectureHelper.GetArchitecture((uint)(specificCpu.Is64bit ? 9 : 0), 0),
                    Name                      = specificCpu.Name,
                    CodeName                  = specificCpu.CodeName,
                    Specification             = cp.BrandString,
                    NumberOfCores             = (uint)cp.Cores,
                    NumberOfLogicalProcessors = (uint)cp.Threads,
                    Technology                = cp.Technology,
                    CpuClocks                 = new CpuClocks()
                    {
                    },
                    CpuFamilyModelStepping = new CpuFamilyModelStepping()
                    {
                        FullFamily = (byte)cp.Family,
                        Family     = (byte)cp.FamilyId,
                        FullModel  = (byte)cp.Model,
                        Stepping   = (byte)cp.Stepping,
                    },
                    Instructions = GetInstructions(specificCpu, cp.InstructionsExtensions),
                    Caches       = new CpuCaches()
                    {
                        Level1Data = l1CacheData != null ? new CpuCacheItem()
                        {
                            Level         = 1,
                            Associativity = (byte)l1CacheData.Associativity,
                            Size          = l1CacheData.SizeKbytes * 1024,
                            LineSize      = l1CacheData.LineSize,
                            NumberOfCores = (uint)cp.Cores
                        } : new CpuCacheItem()
                        {
                        },
                        Level1Instructions = l1CacheInstructions != null ? new CpuCacheItem()
                        {
                            Level         = 1,
                            Associativity = (byte)l1CacheInstructions.Associativity,
                            Size          = l1CacheInstructions.SizeKbytes * 1024,
                            LineSize      = l1CacheInstructions.LineSize,
                            NumberOfCores = (uint)cp.Cores
                        } : new CpuCacheItem()
                        {
                        },
                        Level2 = l2Cache != null ? new CpuCacheItem()
                        {
                            Level         = 2,
                            Associativity = (byte)l2Cache.Associativity,
                            Size          = l2Cache.SizeKbytes * 1024,
                            LineSize      = l2Cache.LineSize,
                            NumberOfCores = (uint)cp.Cores
                        } : new CpuCacheItem()
                        {
                        },
                        Level3 = l3Cache != null ? new CpuCacheItem()
                        {
                            Level         = 3,
                            Associativity = (byte)l3Cache.Associativity,
                            LineSize      = l3Cache.LineSize,
                            Size          = l3Cache.SizeKbytes * 1024
                        } : new CpuCacheItem()
                        {
                        },
                    }
                };

                SetCpuClocks(cp, hwBios, cpuModel.CpuClocks);

                return(cpuModel);
            }).ToArray();


            Motherboard motherboard = null;

            if (hwBios != null && hwBios.Board != null)
            {
                motherboard = new Motherboard()
                {
                    Manufacturer = hwBios.Board.ManufacturerName,
                    Model        = hwBios.Board.ProductName,
                    Version      = hwBios.Board.Version
                };
            }
            else
            {
                motherboard = new Motherboard()
                {
                    Manufacturer = string.Empty,
                    Model        = string.Empty,
                    Version      = string.Empty
                };
            }

            Bios bios = null;

            if (hwBios != null && hwBios.BIOS != null)
            {
                bios = new Bios()
                {
                    Brand   = hwBios.BIOS.Vendor,
                    Date    = hwBios.BIOS.Date,
                    Version = hwBios.BIOS.Version
                };
            }
            else
            {
                bios = new Bios()
                {
                    Brand   = string.Empty,
                    Date    = string.Empty,
                    Version = string.Empty
                };
            }

            return(new ComputerModel()
            {
                Cpus = new AllCpus()
                {
                    Cpus = cpus,
                    RootCpu = cpus?[0],
                    TotalOfCores = cpus.Length > 1 ? (uint)cpus.Sum(c => c.NumberOfCores) : (cpus?[0]?.NumberOfCores ?? 0),
                    TotalOfLogicalProcessors = cpus.Length > 1 ? (uint)cpus.Sum(c => c.NumberOfLogicalProcessors) : (cpus?[0]?.NumberOfLogicalProcessors ?? 0),
                },
                Motherboard = motherboard,
                Bios = bios
            });
        }
Example #16
0
 public DetallesPC(string hora, string fecha, TarjetaMadre tarjeM, List <DiscoDuro> discoD, Procesador process, Bios bi, SistemaOperativo so, Temperatura temp)
 {
     this.hora    = hora;
     this.fecha   = fecha;
     this.tarjeM  = tarjeM;
     this.discoD  = discoD;
     this.process = process;
     this.bi      = bi;
     this.so      = so;
     this.temp    = temp;
 }