当前位置: 首页>>代码示例>>C#>>正文


C# IHardwareResources类代码示例

本文整理汇总了C#中IHardwareResources的典型用法代码示例。如果您正苦于以下问题:C# IHardwareResources类的具体用法?C# IHardwareResources怎么用?C# IHardwareResources使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IHardwareResources类属于命名空间,在下文中一共展示了IHardwareResources类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "IntelHSUART";

            return true;
        }
开发者ID:Profi-Concept,项目名称:MOSA-Project,代码行数:11,代码来源:IntelHSUART.cs

示例2: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "CMOS";

            commandPort = base.hardwareResources.GetIOPort(0, 0);
            dataPort = base.hardwareResources.GetIOPort(0, 4);

            return true;
        }
开发者ID:hj1980,项目名称:Mosa,代码行数:14,代码来源:CMOS.cs

示例3: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "TEST_" + hardwareResources.GetIOPortRegion(0).BaseIOPort.ToString("X");

            TestPort = hardwareResources.GetIOPort(0, 0);

            Command = new CommandRegister(TestPort, 8);

            Command.Enabled = true;

            return true;
        }
开发者ID:rtownsend,项目名称:MOSA-Project,代码行数:17,代码来源:TestDriver.cs

示例4: ClaimResources

        /// <summary>
        /// Claims the resources.
        /// </summary>
        /// <returns></returns>
        public bool ClaimResources(IHardwareResources hardwareResources)
        {
            if (!ioPortResources.ClaimResources(hardwareResources))
                return false;

            if (!memoryResources.ClaimResources(hardwareResources))
            {
                ioPortResources.ReleaseResources(hardwareResources);
                return false;
            }

            return true;
        }
开发者ID:tea,项目名称:MOSA-Project,代码行数:17,代码来源:ResourceManager.cs

示例5: ClaimResources

        /// <summary>
        /// Claims the resources.
        /// </summary>
        /// <param name="hardwareResources">The hardware resources.</param>
        /// <returns></returns>
        public bool ClaimResources(IHardwareResources hardwareResources)
        {
            spinLock.Enter();

            for (byte r = 0; r < hardwareResources.MemoryRegionCount; r++)
            {
                IMemoryRegion region = hardwareResources.GetMemoryRegion(r);

                foreach (IMemoryRegion memoryRegion in memoryRegions)
                    if ((memoryRegion.Contains(region.BaseAddress) || memoryRegion.Contains(region.BaseAddress + region.Size)))
                        return false;
            }

            for (byte r = 0; r < hardwareResources.MemoryRegionCount; r++)
                memoryRegions.Add(hardwareResources.GetMemoryRegion(r));

            spinLock.Exit();

            return true;
        }
开发者ID:rtownsend,项目名称:MOSA-Project,代码行数:25,代码来源:MemoryResources.cs

示例6: ClaimResources

        /// <summary>
        /// Claims the resources.
        /// </summary>
        /// <param name="hardwareResources">The hardware resources.</param>
        /// <returns></returns>
        public bool ClaimResources(IHardwareResources hardwareResources)
        {
            spinLock.Enter();

            for (byte r = 0; r < hardwareResources.IOPointRegionCount - 1; r++)
            {
                IIOPortRegion region = hardwareResources.GetIOPortRegion(r);
                for (int p = 0; p < region.Size; p++)
                    if (portUsed[region.BaseIOPort + p])
                        return false;
            }

            for (byte r = 0; r < hardwareResources.IOPointRegionCount; r++)
            {
                IIOPortRegion region = hardwareResources.GetIOPortRegion(r);
                for (int p = 0; p < region.Size; p++)
                    portUsed[region.BaseIOPort + p] = true;
            }

            spinLock.Exit();

            return true;
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:28,代码来源:IOPortResources.cs

示例7: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "DMA_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");

            statusRegister = base.hardwareResources.GetIOPort(0, 0x08);
            commandRegister = base.hardwareResources.GetIOPort(0, 0x08);
            requestRegister = base.hardwareResources.GetIOPort(0, 0x09);
            channelMaskRegister = base.hardwareResources.GetIOPort(0, 0x0A);
            modeRegister = base.hardwareResources.GetIOPort(0, 0x0B);
            byteWordRegister = base.hardwareResources.GetIOPort(0, 0x0C);
            intermediateRegister = base.hardwareResources.GetIOPort(0, 0x0D);
            maskRegister = base.hardwareResources.GetIOPort(0, 0x0F);

            channel0Address = base.hardwareResources.GetIOPort(0, 0x00);
            channel0Count = base.hardwareResources.GetIOPort(0, 0x01);
            channel0Page = base.hardwareResources.GetIOPort(0, 0x87);

            channel1Address = base.hardwareResources.GetIOPort(0, 0x02);
            channel1Count = base.hardwareResources.GetIOPort(0, 0x03);
            channel1Page = base.hardwareResources.GetIOPort(0, 0x83);

            channel2Address = base.hardwareResources.GetIOPort(0, 0x04);
            channel2Count = base.hardwareResources.GetIOPort(0, 0x05);
            channel2Page = base.hardwareResources.GetIOPort(0, 0x81);

            channel3Address = base.hardwareResources.GetIOPort(0, 0x06);
            channel3Count = base.hardwareResources.GetIOPort(0, 0x07);
            channel3Page = base.hardwareResources.GetIOPort(0, 0x82);

            memory0 = base.hardwareResources.GetMemory(0);
            memory1 = base.hardwareResources.GetMemory(1);
            memory2 = base.hardwareResources.GetMemory(2);
            memory3 = base.hardwareResources.GetMemory(3);

            return true;
        }
开发者ID:rtownsend,项目名称:MOSA-Project,代码行数:41,代码来源:DMA8Bit.cs

示例8: ReleaseResources

        /// <summary>
        /// Releases the resources.
        /// </summary>
        /// <param name="hardwareResources">The hardware resources.</param>
        public void ReleaseResources(IHardwareResources hardwareResources)
        {
            spinLock.Enter();

            for (byte r = 0; r < hardwareResources.IOPointRegionCount; r++)
            {
                IIOPortRegion region = hardwareResources.GetIOPortRegion(r);
                for (int p = 0; p < region.Size; p++)
                    portUsed[region.BaseIOPort + p] = false;
            }

            spinLock.Exit();
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:17,代码来源:IOPortResources.cs

示例9: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "VMWARE_SVGA_0x" + hardwareResources.GetIOPortRegion(0).BaseIOPort.ToString("X");

            indexPort = hardwareResources.GetIOPort(0, 0);
            valuePort = hardwareResources.GetIOPort(0, 1);

            memory = base.hardwareResources.GetMemory(0);
            fifo = base.hardwareResources.GetMemory(1);

            return true;
        }
开发者ID:hj1980,项目名称:Mosa,代码行数:17,代码来源:VMwareSVGAII.cs

示例10: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "PIT_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");

            modeControlPort = base.hardwareResources.GetIOPort(0, 3);
            counter0Divisor = base.hardwareResources.GetIOPort(0, 0);

            return true;
        }
开发者ID:Boddlnagg,项目名称:MOSA-Project,代码行数:14,代码来源:PIT.cs

示例11: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "VGAText";

            miscellaneousOutput = base.hardwareResources.GetIOPort(0, 0x1C);
            crtControllerIndex = base.hardwareResources.GetIOPort(0, 0x04);
            crtControllerData = base.hardwareResources.GetIOPort(0, 0x05);
            crtControllerIndexColor = base.hardwareResources.GetIOPort(0, 0x24);
            crtControllerDataColor = base.hardwareResources.GetIOPort(0, 0x25);

            miscellaneousOutputWrite = base.hardwareResources.GetIOPort(0, 0x12);
            sequencerAddress = base.hardwareResources.GetIOPort(0, 0x14);
            sequencerData = base.hardwareResources.GetIOPort(0, 0x15);
            graphicsControllerAddress = base.hardwareResources.GetIOPort(0, 0x1E);
            graphicsControllerData = base.hardwareResources.GetIOPort(0, 0x1F);
            inputStatus1ReadB = base.hardwareResources.GetIOPort(0, 0x2A);
            attributeAddress = base.hardwareResources.GetIOPort(0, 0x10);
            attributeData = base.hardwareResources.GetIOPort(0, 0x11);

            memory = base.hardwareResources.GetMemory(0);

            return true;
        }
开发者ID:rtownsend,项目名称:MOSA-Project,代码行数:28,代码来源:VGAText.cs

示例12: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "FDC_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");
            base.parent = null; // no parent

            commandPort = base.hardwareResources.GetIOPort(0, 2);
            statusPort = base.hardwareResources.GetIOPort(0, 4);
            dataPort = base.hardwareResources.GetIOPort(0, 5);
            configPort = base.hardwareResources.GetIOPort(0, 7);

            //			floppyDMA = base.CreateDMAChannel(2);
            //			floppyIRQ = base.CreateIRQHandler(6);

            return true;
        }
开发者ID:davidleon,项目名称:MOSA-Project,代码行数:20,代码来源:FloppyDiskController.cs

示例13: ReleaseResources

 /// <summary>
 /// Releases the resources.
 /// </summary>
 /// <param name="hardwareResources">The hardware resources.</param>
 /// <returns></returns>
 public void ReleaseResources(IHardwareResources hardwareResources)
 {
     ioPortResources.ReleaseResources(hardwareResources);
     memoryResources.ReleaseResources(hardwareResources);
 }
开发者ID:hj1980,项目名称:Mosa,代码行数:10,代码来源:ResourceManager.cs

示例14: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <param name="hardwareResources"></param>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "PIC_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");

            masterCommandPort = base.hardwareResources.GetIOPort(0, 0);
            masterDataPort = base.hardwareResources.GetIOPort(0, 1);

            slaveCommandPort = base.hardwareResources.GetIOPort(1, 0);
            slaveDataPort = base.hardwareResources.GetIOPort(1, 1);

            return true;
        }
开发者ID:davidleon,项目名称:MOSA-Project,代码行数:18,代码来源:PIC.cs

示例15: Setup

 /// <summary>
 /// Setups this hardware device driver
 /// </summary>
 /// <returns></returns>
 public abstract bool Setup(IHardwareResources hardwareResources);
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:5,代码来源:HardwareDevice.cs


注:本文中的IHardwareResources类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。