Ejemplo n.º 1
0
        public readonly IOPortWrite Control; // BAR1 + 2 - write only

        /// <summary>
        /// Constructor for ATA-spec device (including ATAPI?)
        /// aSecondary boolean to check if Primary or Secondary channel, used in modern ATA controllers
        /// </summary>
        /// <param name="aSecondary"></param>
        public ATA(bool aSecondary)
        {
            if (aSecondary)
            {
                Global.mDebugger.Send("Creating Secondary ATA IOGroup");
            }
            else
            {
                Global.mDebugger.Send("Creating Primary ATA IOGroup");
            }

            var xBAR0 = GetBAR0(aSecondary);
            var xBAR1 = GetBAR1(aSecondary);

            Error            = new IOPort(xBAR0, 1);
            Features         = new IOPortWrite(xBAR0, 1);
            Data             = new IOPort(xBAR0);
            SectorCount      = new IOPort(xBAR0, 2);
            LBA0             = new IOPort(xBAR0, 3);
            LBA1             = new IOPort(xBAR0, 4);
            LBA2             = new IOPort(xBAR0, 5);
            DeviceSelect     = new IOPort(xBAR0, 6);
            Status           = new IOPortRead(xBAR0, 7);
            Command          = new IOPortWrite(xBAR0, 7);
            SectorCountLBA48 = new IOPort(xBAR0, 8);
            LBA3             = new IOPort(xBAR0, 9);
            LBA4             = new IOPort(xBAR0, 10);
            LBA5             = new IOPort(xBAR0, 11);
            AlternateStatus  = new IOPortRead(xBAR1, 2);
            Control          = new IOPortWrite(xBAR1, 2);
        }
Ejemplo n.º 2
0
        public override void Initialize()
        {
            Device.Name = "GenericVGA_0x" + Device.Resources.GetIOPortRegion(0).BaseIOPort.ToString("X");

            byte portBar = (byte)(Device.Resources.IOPointRegionCount - 1);

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

            memory = Device.Resources.GetMemory((byte)(Device.Resources.MemoryRegionCount - 1));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <param name="hardwareResources"></param>
        /// <returns></returns>
        public override bool Setup(HardwareResources hardwareResources)
        {
            this.HardwareResources = hardwareResources;
            base.Name = "IDE_0x" + base.HardwareResources.GetIOPortRegion(0).BaseIOPort.ToString("X");

            DataPort        = base.HardwareResources.GetIOPortReadWrite(0, 0);
            ErrorPort       = base.HardwareResources.GetIOPortReadWrite(0, 1);
            FeaturePort     = base.HardwareResources.GetIOPortReadWrite(0, 1);
            SectorCountPort = base.HardwareResources.GetIOPortReadWrite(0, 2);
            LBALowPort      = base.HardwareResources.GetIOPortReadWrite(0, 3);
            LBAMidPort      = base.HardwareResources.GetIOPortReadWrite(0, 4);
            LBAHighPort     = base.HardwareResources.GetIOPortReadWrite(0, 5);
            DeviceHeadPort  = base.HardwareResources.GetIOPortReadWrite(0, 6);
            CommandPort     = base.HardwareResources.GetIOPortWrite(0, 7);
            StatusPort      = base.HardwareResources.GetIOPortReadWrite(0, 7);
            ControlPort     = base.HardwareResources.GetIOPortWrite(1, 0);
            AltStatusPort   = base.HardwareResources.GetIOPortReadWrite(1, 6);

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

            base.DeviceStatus = DeviceStatus.Online;

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

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

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

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

            return(true);
        }
Ejemplo n.º 5
0
        public override void Initialize()
        {
            Device.Name        = "IDE_0x" + Device.Resources.GetIOPortRegion(0).BaseIOPort.ToString("X");
            Device.ComponentID = Device.Resources.GetIOPortRegion(0).BaseIOPort;

            DataPort        = Device.Resources.GetIOPortReadWrite(0, 0);
            ErrorPort       = Device.Resources.GetIOPortReadWrite(0, 1);
            FeaturePort     = Device.Resources.GetIOPortReadWrite(0, 1);
            SectorCountPort = Device.Resources.GetIOPortReadWrite(0, 2);
            LBALowPort      = Device.Resources.GetIOPortReadWrite(0, 3);
            LBAMidPort      = Device.Resources.GetIOPortReadWrite(0, 4);
            LBAHighPort     = Device.Resources.GetIOPortReadWrite(0, 5);
            DeviceHeadPort  = Device.Resources.GetIOPortReadWrite(0, 6);
            CommandPort     = Device.Resources.GetIOPortWrite(0, 7);
            StatusPort      = Device.Resources.GetIOPortReadWrite(0, 7);
            ControlPort     = Device.Resources.GetIOPortWrite(1, 0);
            AltStatusPort   = Device.Resources.GetIOPortReadWrite(1, 6);

            MaximumDriveCount = 2;

            for (var drive = 0; drive < DrivesPerConroller; drive++)
            {
                driveInfo[drive].Present = false;
                driveInfo[drive].MaxLBA  = 0;
            }
        }
Ejemplo n.º 6
0
        public override void Initialize()
        {
            Device.Name = "StandardKeyboard";

            dataPort    = Device.Resources.GetIOPortReadWrite(0, 0);                // 0x60
            statusPort  = Device.Resources.GetIOPortRead(1, 0);                     // 0x64
            commandPort = Device.Resources.GetIOPortWrite(1, 0);                    // 0x64

            fifoBuffer = new byte[fifoSize];
            fifoStart  = 0;
            fifoEnd    = 0;
        }
Ejemplo n.º 7
0
Archivo: ATA.cs Proyecto: iSalva/Cosmos
    //* DEVADDRESS: BAR1 + 2; // I don't know what is the benefit from this register

    internal ATA(bool aSecondary)
    {
      Console.WriteLine("Creating ATA IOGroup");

      var xBAR0 = GetBAR0(aSecondary);
      var xBAR1 = GetBAR1(aSecondary);
      Data = new IOPort(xBAR0);
      SectorCount = new IOPortWrite(xBAR0, 2);
      LBA0 = new IOPort(xBAR0, 3);
      LBA1 = new IOPort(xBAR0, 4);
      LBA2 = new IOPort(xBAR0, 5);
      Command = new IOPortWrite(xBAR0, 7);
      Status = new IOPortRead(xBAR0, 7);
      DeviceSelect = new IOPortWrite(xBAR0, 6);
      Control = new IOPortWrite(xBAR1, 2);
    }
Ejemplo n.º 8
0
        //* DEVADDRESS: BAR1 + 2; // I don't know what is the benefit from this register

        internal ATA(bool aSecondary)
        {
            Console.WriteLine("Creating ATA IOGroup");

            var xBAR0 = GetBAR0(aSecondary);
            var xBAR1 = GetBAR1(aSecondary);

            Data         = new IOPort(xBAR0);
            SectorCount  = new IOPortWrite(xBAR0, 2);
            LBA0         = new IOPort(xBAR0, 3);
            LBA1         = new IOPort(xBAR0, 4);
            LBA2         = new IOPort(xBAR0, 5);
            Command      = new IOPortWrite(xBAR0, 7);
            Status       = new IOPortRead(xBAR0, 7);
            DeviceSelect = new IOPortWrite(xBAR0, 6);
            Control      = new IOPortWrite(xBAR1, 2);
        }
Ejemplo n.º 9
0
 private void Init()
 {
     _Data         = new IOPort(_BusPort);
     _Error        = new IOPortRead(_BusPort, 1);
     _Feature      = new IOPortWrite(_BusPort, 1);
     _SectorCount  = new IOPortWrite(_BusPort, 2);
     _SectorNumber = new IOPortWrite(_BusPort, 3);
     _LBA1         = new IOPort(_BusPort, 3);
     _LBA2         = new IOPort(_BusPort, 4);
     _LBA3         = new IOPort(_BusPort, 5);
     _LBA4         = new IOPort(_BusPort, 3);
     _LBA5         = new IOPort(_BusPort, 4);
     _LBA6         = new IOPort(_BusPort, 5);
     _Command      = new IOPortWrite(_BusPort, 7);
     _Status       = new IOPortRead(_BusPort, 7);
     _DeviceSelect = new IOPortWrite(_BusPort, 6);
     _Control      = new IOPortWrite(_ControllerPort, 2);
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Initializes this device.
        /// </summary>
        protected override void Initialize()
        {
            Device.Name = "COM_0x" + Device.Resources.GetIOPortRegion(0).BaseIOPort.ToString("X");

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

            fifoBuffer = new byte[fifoSize];
            fifoStart  = 0;
            fifoEnd    = 0;
        }
Ejemplo n.º 11
0
        protected override void Initialize()
        {
            Device.Name = "VGAText";

            miscellaneousOutput     = Device.Resources.GetIOPortReadWrite(0, 0x1C);
            crtControllerIndex      = Device.Resources.GetIOPortReadWrite(0, 0x04);
            crtControllerData       = Device.Resources.GetIOPortReadWrite(0, 0x05);
            crtControllerIndexColor = Device.Resources.GetIOPortReadWrite(0, 0x24);
            crtControllerDataColor  = Device.Resources.GetIOPortReadWrite(0, 0x25);

            miscellaneousOutputWrite  = Device.Resources.GetIOPortWrite(0, 0x12);
            sequencerAddress          = Device.Resources.GetIOPortReadWrite(0, 0x14);
            sequencerData             = Device.Resources.GetIOPortReadWrite(0, 0x15);
            graphicsControllerAddress = Device.Resources.GetIOPortReadWrite(0, 0x1E);
            graphicsControllerData    = Device.Resources.GetIOPortReadWrite(0, 0x1F);
            inputStatus1ReadB         = Device.Resources.GetIOPortReadWrite(0, 0x2A);
            attributeAddress          = Device.Resources.GetIOPortReadWrite(0, 0x10);
            attributeData             = Device.Resources.GetIOPortReadWrite(0, 0x11);

            memory = Device.Resources.GetMemory(0);
        }
Ejemplo n.º 12
0
Archivo: ATA.cs Proyecto: Orvid/Cosmos
    //* DEVADDRESS: BAR1 + 2; // I don't know what is the benefit from this register

    internal ATA(bool aSecondary)
    {
      if (aSecondary)
      {
        Debugger.DoSend("Creating Secondary ATA IOGroup");
      }
      else
      {
        Debugger.DoSend("Creating Primary ATA IOGroup");
      }

      var xBAR0 = GetBAR0(aSecondary);
      var xBAR1 = GetBAR1(aSecondary);
      Data = new IOPort(xBAR0);
      SectorCount = new IOPortWrite(xBAR0, 2);
      LBA0 = new IOPort(xBAR0, 3);
      LBA1 = new IOPort(xBAR0, 4);
      LBA2 = new IOPort(xBAR0, 5);
      Command = new IOPortWrite(xBAR0, 7);
      Status = new IOPortRead(xBAR0, 7);
      DeviceSelect = new IOPortWrite(xBAR0, 6);
      Control = new IOPortWrite(xBAR1, 2);
    }
Ejemplo n.º 13
0
        //* DEVADDRESS: BAR1 + 2; // I don't know what is the benefit from this register

        /// <summary>
        /// Create new instance of the <see cref="ATA"/> class.
        /// </summary>
        /// <param name="aSecondary">True if secondary ATA.</param>
        internal ATA(bool aSecondary)
        {
            if (aSecondary)
            {
                Global.mDebugger.Send("Creating Secondary ATA IOGroup");
            }
            else
            {
                Global.mDebugger.Send("Creating Primary ATA IOGroup");
            }

            var xBAR0 = GetBAR0(aSecondary);
            var xBAR1 = GetBAR1(aSecondary);

            Data         = new IOPort(xBAR0);
            SectorCount  = new IOPortWrite(xBAR0, 2);
            LBA0         = new IOPort(xBAR0, 3);
            LBA1         = new IOPort(xBAR0, 4);
            LBA2         = new IOPort(xBAR0, 5);
            Command      = new IOPortWrite(xBAR0, 7);
            Status       = new IOPortRead(xBAR0, 7);
            DeviceSelect = new IOPortWrite(xBAR0, 6);
            Control      = new IOPortWrite(xBAR1, 2);
        }