Ejemplo n.º 1
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "Intel440FX";

            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "COM_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");

            rbrBase = base.hardwareResources.GetIOPort(0, 0);             // Receive Buffer Register (read only)
            thrBase = base.hardwareResources.GetIOPort(0, 0);             // Transmitter Holding Register (write only)
            ierBase = base.hardwareResources.GetIOPort(0, 1);             // Interrupt Enable Register
            dllBase = base.hardwareResources.GetIOPort(0, 0);             // Divisor Latch (LSB and MSB)
            dlmBase = base.hardwareResources.GetIOPort(0, 1);
            iirBase = base.hardwareResources.GetIOPort(0, 2);             // Interrupt Identification Register (read only)
            fcrBase = base.hardwareResources.GetIOPort(0, 2);             // FIFO Control Register (write only, 16550+ only)
            lcrBase = base.hardwareResources.GetIOPort(0, 3);             // Line Control Register
            mcrBase = base.hardwareResources.GetIOPort(0, 4);             // Modem Control Register
            lsrBase = base.hardwareResources.GetIOPort(0, 5);             // Line Status Register
            msrBase = base.hardwareResources.GetIOPort(0, 6);             // Modem Status Register
            scrBase = base.hardwareResources.GetIOPort(0, 7);             // Scratch Register (16450+ and some 8250s, special use with some boards)

            fifoBuffer = new byte[fifoSize];
            fifoStart  = 0;
            fifoEnd    = 0;

            base.deviceStatus = DeviceStatus.Online;
            return(true);
        }
Ejemplo n.º 3
0
        /// <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.AddLast(hardwareResources.GetMemoryRegion(r));
            }

            spinLock.Exit();

            return(true);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "IntelPCI_ISA_IDE_Xcelerator_PIIX4";

            return true;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "AMDPCNet_0x" + hardwareResources.GetIOPortRegion(0).BaseIOPort.ToString("X");

            ioProm1 = hardwareResources.GetIOPort(0, 0x0);
            ioProm4 = hardwareResources.GetIOPort(0, 0x4);
            rdp     = hardwareResources.GetIOPort(0, 0x10);
            rap     = hardwareResources.GetIOPort(0, 0x14);
            bdp     = hardwareResources.GetIOPort(0, 0x1C);

            initBlock    = hardwareResources.GetMemory(0);
            txDescriptor = hardwareResources.GetMemory(1);
            rxDescriptor = hardwareResources.GetMemory(2);
            buffers      = hardwareResources.GetMemory(3);

            bufferSize = 2048;
            uint len = (ushort)(~bufferSize);

            len = (len + 1) & 0x0FFF | 0x8000F000;

            physicalBufferAddress = HAL.GetPhysicalAddress(buffers);

            for (uint index = 0; index < 16; index++)
            {
                uint offset = index * 4;
                rxDescriptor.Write32((offset + 1) * 4, len);
                rxDescriptor.Write32((offset + 2) * 4, physicalBufferAddress + (bufferSize * index));
                txDescriptor.Write32((offset + 2) * 4, physicalBufferAddress + (bufferSize * (index + 16)));
            }

            nextTXDesc = 0;

            return(true);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "IntelPCI_ISA_IDE_Xcelerator_PIIX4";

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

            return true;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "IntelHSUART";

            return true;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "GenericVGA";

            byte portBar = (byte)(base.hardwareResources.IOPointRegionCount - 1);

            miscellaneousOutputRead = base.hardwareResources.GetIOPort(portBar, 0x1C);
            crtControllerIndex      = base.hardwareResources.GetIOPort(portBar, 0x04);
            crtControllerData       = base.hardwareResources.GetIOPort(portBar, 0x05);
            crtControllerIndexColor = base.hardwareResources.GetIOPort(portBar, 0x24);
            crtControllerDataColor  = base.hardwareResources.GetIOPort(portBar, 0x25);
            dacPaletteMask          = base.hardwareResources.GetIOPort(portBar, 0x16);
            dacIndexRead            = base.hardwareResources.GetIOPort(portBar, 0x17);
            dacIndexWrite           = base.hardwareResources.GetIOPort(portBar, 0x18);
            dacData                   = base.hardwareResources.GetIOPort(portBar, 0x19);
            inputStatus1              = base.hardwareResources.GetIOPort(portBar, 0x12);
            miscellaneousOutputWrite  = base.hardwareResources.GetIOPort(portBar, 0x12);
            sequencerAddress          = base.hardwareResources.GetIOPort(portBar, 0x14);
            sequencerData             = base.hardwareResources.GetIOPort(portBar, 0x15);
            graphicsControllerAddress = base.hardwareResources.GetIOPort(portBar, 0x1E);
            graphicsControllerData    = base.hardwareResources.GetIOPort(portBar, 0x1F);
            inputStatus1ReadB         = base.hardwareResources.GetIOPort(portBar, 0x2A);
            attributeAddress          = base.hardwareResources.GetIOPort(portBar, 0x10);
            attributeData             = base.hardwareResources.GetIOPort(portBar, 0x11);

            memory = base.hardwareResources.GetMemory((byte)(base.hardwareResources.MemoryRegionCount - 1));

            return(true);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <param name="hardwareResources"></param>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "IDE_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");

            DataPort        = base.hardwareResources.GetIOPort(0, 0);
            ErrorPort       = base.hardwareResources.GetIOPort(0, 1);
            FeaturePort     = base.hardwareResources.GetIOPort(0, 1);
            SectorCountPort = base.hardwareResources.GetIOPort(0, 2);
            LBALowPort      = base.hardwareResources.GetIOPort(0, 3);
            LBAMidPort      = base.hardwareResources.GetIOPort(0, 4);
            LBAHighPort     = base.hardwareResources.GetIOPort(0, 5);
            DeviceHeadPort  = base.hardwareResources.GetIOPort(0, 6);
            CommandPort     = base.hardwareResources.GetIOPort(0, 7);
            StatusPort      = base.hardwareResources.GetIOPort(0, 7);

            for (int drive = 0; drive < DrivesPerConroller; drive++)
            {
                driveInfo[drive].Present = false;
                driveInfo[drive].MaxLBA  = 0;
            }

            base.deviceStatus = DeviceStatus.Online;
            return(true);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "IntelGPIOController";

            return(true);
        }
Ejemplo n.º 12
0
        /// <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);
        }
Ejemplo n.º 13
0
Archivo: CMOS.cs Proyecto: hj1980/Mosa
        /// <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;
        }
Ejemplo n.º 14
0
        /// <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);
        }
Ejemplo n.º 15
0
        /// <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);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "PCI_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");

            configAddress = base.hardwareResources.GetIOPort(0, 0);
            configData    = base.hardwareResources.GetIOPort(0, 4);

            return(true);
        }
Ejemplo n.º 17
0
        /// <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.MemoryRegionCount; r++)
            {
                memoryRegions.Remove(hardwareResources.GetMemoryRegion(r));
            }

            spinLock.Exit();
        }
Ejemplo n.º 18
0
        /// <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;
        }
Ejemplo n.º 19
0
        /// <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);
        }
Ejemplo n.º 20
0
        /// <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;
        }
Ejemplo n.º 21
0
        /// <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);
        }
Ejemplo n.º 22
0
        /// <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);
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Setups the standard keyboard driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "StandardKeyboard";

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

            this.fifoBuffer = new byte[fifoSize];
            this.fifoStart  = 0;
            this.fifoEnd    = 0;

            return(true);
        }
Ejemplo n.º 24
0
        /// <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();
        }
Ejemplo n.º 25
0
        /// <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);
        }
Ejemplo n.º 26
0
        /// <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);
        }
Ejemplo n.º 27
0
        /// <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;
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            // Store reference to hardware resources
            this.hardwareResources = hardwareResources;
            // Set the driver's name
            base.name = "S3Trio64V2";

            // Store portmanager
            byte portBar = (byte)(base.hardwareResources.IOPointRegionCount - 1);

            vgaEnableController = base.hardwareResources.GetIOPort(portBar, Register.VgaEnable);
            miscOutputReader    = base.hardwareResources.GetIOPort(portBar, Register.MiscOutRead);
            miscOutputWriter    = base.hardwareResources.GetIOPort(portBar, Register.MiscOutWrite);
            crtcControllerIndex = base.hardwareResources.GetIOPort(portBar, Register.CrtcIndex);
            crtcControllerData  = base.hardwareResources.GetIOPort(portBar, Register.CrtcData);
            seqControllerIndex  = base.hardwareResources.GetIOPort(portBar, Register.SequenceIndex);
            seqControllerData   = base.hardwareResources.GetIOPort(portBar, Register.SequenceData);

            // Everything went fine
            return(true);
        }
Ejemplo n.º 29
0
        /// <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;
        }
Ejemplo n.º 30
0
        /// <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);
        }
Ejemplo n.º 31
0
        /// <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);
        }
Ejemplo n.º 32
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "PCI_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");

            configAddress = base.hardwareResources.GetIOPort(0, 0);
            configData = base.hardwareResources.GetIOPort(0, 4);

            return true;
        }
Ejemplo n.º 33
0
 /// <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);
 }
Ejemplo n.º 34
0
 /// <summary>
 /// Setups this hardware device driver
 /// </summary>
 /// <returns></returns>
 public abstract bool Setup(IHardwareResources hardwareResources);
Ejemplo n.º 35
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            // Store reference to hardware resources
            this.hardwareResources = hardwareResources;
            // Set the driver's name
            base.name = "S3Trio64V2";

            // Store portmanager
            byte portBar = (byte)(base.hardwareResources.IOPointRegionCount - 1);

            vgaEnableController = base.hardwareResources.GetIOPort(portBar, Register.VgaEnable);
            miscOutputReader = base.hardwareResources.GetIOPort(portBar, Register.MiscOutRead);
            miscOutputWriter = base.hardwareResources.GetIOPort(portBar, Register.MiscOutWrite);
            crtcControllerIndex = base.hardwareResources.GetIOPort(portBar, Register.CrtcIndex);
            crtcControllerData  = base.hardwareResources.GetIOPort(portBar, Register.CrtcData);
            seqControllerIndex = base.hardwareResources.GetIOPort(portBar, Register.SequenceIndex);
            seqControllerData = base.hardwareResources.GetIOPort(portBar, Register.SequenceData);

            // Everything went fine
            return true;
        }
Ejemplo n.º 36
0
        /// <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;
        }
Ejemplo n.º 37
0
 /// <summary>
 /// Setups this hardware device driver
 /// </summary>
 /// <returns></returns>
 public abstract bool Setup(IHardwareResources hardwareResources);
Ejemplo n.º 38
0
        /// <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;
        }
Ejemplo n.º 39
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <param name="hardwareResources"></param>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "IDE_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");

            DataPort = base.hardwareResources.GetIOPort(0, 0);
            ErrorPort = base.hardwareResources.GetIOPort(0, 1);
            FeaturePort = base.hardwareResources.GetIOPort(0, 1);
            SectorCountPort = base.hardwareResources.GetIOPort(0, 2);
            LBALowPort = base.hardwareResources.GetIOPort(0, 3);
            LBAMidPort = base.hardwareResources.GetIOPort(0, 4);
            LBAHighPort = base.hardwareResources.GetIOPort(0, 5);
            DeviceHeadPort = base.hardwareResources.GetIOPort(0, 6);
            CommandPort = base.hardwareResources.GetIOPort(0, 7);
            StatusPort = base.hardwareResources.GetIOPort(0, 7);

            for (int drive = 0; drive < DrivesPerConroller; drive++)
            {
                driveInfo[drive].Present = false;
                driveInfo[drive].MaxLBA = 0;
            }

            base.deviceStatus = DeviceStatus.Online;
            return true;
        }
Ejemplo n.º 40
0
        /// <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;
        }
Ejemplo n.º 41
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "GenericVGA";

            byte portBar = (byte)(base.hardwareResources.IOPointRegionCount - 1);

            miscellaneousOutputRead = base.hardwareResources.GetIOPort(portBar, 0x1C);
            crtControllerIndex = base.hardwareResources.GetIOPort(portBar, 0x04);
            crtControllerData = base.hardwareResources.GetIOPort(portBar, 0x05);
            crtControllerIndexColor = base.hardwareResources.GetIOPort(portBar, 0x24);
            crtControllerDataColor = base.hardwareResources.GetIOPort(portBar, 0x25);
            dacPaletteMask = base.hardwareResources.GetIOPort(portBar, 0x16);
            dacIndexRead = base.hardwareResources.GetIOPort(portBar, 0x17);
            dacIndexWrite = base.hardwareResources.GetIOPort(portBar, 0x18);
            dacData = base.hardwareResources.GetIOPort(portBar, 0x19);
            inputStatus1 = base.hardwareResources.GetIOPort(portBar, 0x12);
            miscellaneousOutputWrite = base.hardwareResources.GetIOPort(portBar, 0x12);
            sequencerAddress = base.hardwareResources.GetIOPort(portBar, 0x14);
            sequencerData = base.hardwareResources.GetIOPort(portBar, 0x15);
            graphicsControllerAddress = base.hardwareResources.GetIOPort(portBar, 0x1E);
            graphicsControllerData = base.hardwareResources.GetIOPort(portBar, 0x1F);
            inputStatus1ReadB = base.hardwareResources.GetIOPort(portBar, 0x2A);
            attributeAddress = base.hardwareResources.GetIOPort(portBar, 0x10);
            attributeData = base.hardwareResources.GetIOPort(portBar, 0x11);

            memory = base.hardwareResources.GetMemory((byte)(base.hardwareResources.MemoryRegionCount - 1));

            return true;
        }
Ejemplo n.º 42
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "COM_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");

            rbrBase = base.hardwareResources.GetIOPort(0, 0); // Receive Buffer Register (read only)
            thrBase = base.hardwareResources.GetIOPort(0, 0); // Transmitter Holding Register (write only)
            ierBase = base.hardwareResources.GetIOPort(0, 1); // Interrupt Enable Register
            dllBase = base.hardwareResources.GetIOPort(0, 0); // Divisor Latch (LSB and MSB)
            dlmBase = base.hardwareResources.GetIOPort(0, 1);
            iirBase = base.hardwareResources.GetIOPort(0, 2); // Interrupt Identification Register (read only)
            fcrBase = base.hardwareResources.GetIOPort(0, 2); // FIFO Control Register (write only, 16550+ only)
            lcrBase = base.hardwareResources.GetIOPort(0, 3); // Line Control Register
            mcrBase = base.hardwareResources.GetIOPort(0, 4); // Modem Control Register
            lsrBase = base.hardwareResources.GetIOPort(0, 5); // Line Status Register
            msrBase = base.hardwareResources.GetIOPort(0, 6); // Modem Status Register
            scrBase = base.hardwareResources.GetIOPort(0, 7); // Scratch Register (16450+ and some 8250s, special use with some boards)

            fifoBuffer = new byte[fifoSize];
            fifoStart = 0;
            fifoEnd = 0;

            base.deviceStatus = DeviceStatus.Online;
            return true;
        }
Ejemplo n.º 43
0
        /// <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();
        }
Ejemplo n.º 44
0
        /// <summary>
        /// Setups the standard keyboard driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "StandardKeyboard";

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

            this.fifoBuffer = new byte[fifoSize];
            this.fifoStart = 0;
            this.fifoEnd = 0;

            return true;
        }
Ejemplo n.º 45
0
        /// <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;
        }
Ejemplo n.º 46
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "AMDPCNet_0x" + hardwareResources.GetIOPortRegion(0).BaseIOPort.ToString("X");

            ioProm1 = hardwareResources.GetIOPort(0, 0x0);
            ioProm4 = hardwareResources.GetIOPort(0, 0x4);
            rdp = hardwareResources.GetIOPort(0, 0x10);
            rap = hardwareResources.GetIOPort(0, 0x14);
            bdp = hardwareResources.GetIOPort(0, 0x1C);

            initBlock = hardwareResources.GetMemory(0);
            txDescriptor = hardwareResources.GetMemory(1);
            rxDescriptor = hardwareResources.GetMemory(2);
            buffers = hardwareResources.GetMemory(3);

            bufferSize = 2048;
            uint len = (ushort)(~bufferSize);
            len = (len + 1) & 0x0FFF | 0x8000F000;

            physicalBufferAddress = HAL.GetPhysicalAddress(buffers);

            for (uint index = 0; index < 16; index++)
            {
                uint offset = index * 4;
                rxDescriptor.Write32((offset + 1) * 4, len);
                rxDescriptor.Write32((offset + 2) * 4, physicalBufferAddress + (bufferSize * index));
                txDescriptor.Write32((offset + 2) * 4, physicalBufferAddress + (bufferSize * (index + 16)));
            }

            nextTXDesc = 0;

            return true;
        }
Ejemplo n.º 47
0
 /// <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);
 }
Ejemplo n.º 48
0
        /// <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;
        }
Ejemplo n.º 49
0
        /// <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.MemoryRegionCount; r++)
                memoryRegions.Remove(hardwareResources.GetMemoryRegion(r));

            spinLock.Exit();
        }
Ejemplo n.º 50
0
        /// <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;
        }