Ejemplo n.º 1
0
        public UHCI(PCI.PCIDeviceNormal aPCIDevice)
            : base(aPCIDevice)
        {
#if UHCI_TRACE
            BasicConsole.WriteLine("UHCI: Constructor");
            BasicConsole.DelayOutput(5);
#endif

            usbBaseAddress = pciDevice.BaseAddresses[4].BaseAddress();
            Processes.ProcessManager.CurrentProcess.TheMemoryLayout.AddDataPage(
                (uint)usbBaseAddress & 0xFFFFF000,
                (uint)usbBaseAddress & 0xFFFFF000);
            VirtMemManager.Map((uint)usbBaseAddress & 0xFFFFF000, (uint)usbBaseAddress & 0xFFFFF000, 4096,
                               VirtMem.VirtMemImpl.PageFlags.KernelOnly);

            RootPortCount = UHCI_Consts.PORTMAX;
            EnabledPorts  = false;

            USBCMD    = new IO.IOPort(MapPort(UHCI_Consts.USBCMD));
            USBINTR   = new IO.IOPort(MapPort(UHCI_Consts.USBINTR));
            USBSTS    = new IO.IOPort(MapPort(UHCI_Consts.USBSTS));
            SOFMOD    = new IO.IOPort(MapPort(UHCI_Consts.SOFMOD));
            FRBASEADD = new IO.IOPort(MapPort(UHCI_Consts.FRBASEADD));
            FRNUM     = new IO.IOPort(MapPort(UHCI_Consts.FRNUM));
            PORTSC1   = new IO.IOPort(MapPort(UHCI_Consts.PORTSC1));
            PORTSC2   = new IO.IOPort(MapPort(UHCI_Consts.PORTSC2));

            FrameList = (uint *)VirtMemManager.MapFreePage(VirtMem.VirtMemImpl.PageFlags.KernelOnly);
            Processes.ProcessManager.CurrentProcess.TheMemoryLayout.AddDataPage(
                (uint)FrameList & 0xFFFFF000,
                (uint)FrameList & 0xFFFFF000);

            Start();
        }
Ejemplo n.º 2
0
        public Keyboard(IO.IOPort rowSelectPort, IO.IOPort columnSelectPort, IO.Nmi nmiLine)
        {
            _rowSelectPort    = rowSelectPort;
            _columnSelectPort = columnSelectPort;
            _nmiLine          = nmiLine;

            _rowSelectPort.OnPortOut += new IO.IOPort.PortOutDelegate(RowSelectPort_OnPortOut);
        }
Ejemplo n.º 3
0
        internal ATAIOPorts(bool isSecondary)
        {
            //BAR of main registers
            UInt16 xBAR0 = (UInt16)(isSecondary ? 0x0170 : 0x01F0);
            //BAR of alternative registers
            UInt16 xBAR1 = (UInt16)(isSecondary ? 0x0374 : 0x03F4);

            Data        = new IO.IOPort(xBAR0);
            Error       = new IO.IOPort(xBAR0, 1);
            Features    = new IO.IOPort(xBAR0, 1);
            SectorCount = new IO.IOPort(xBAR0, 2);
            //Logical block address
            LBA0         = new IO.IOPort(xBAR0, 3); //Lo-bits
            LBA1         = new IO.IOPort(xBAR0, 4); //Mid-bits
            LBA2         = new IO.IOPort(xBAR0, 5); //Hi-bits
            DeviceSelect = new IO.IOPort(xBAR0, 6);
            //Write - command
            Command = new IO.IOPort(xBAR0, 7);
            //Read - status
            Status = new IO.IOPort(xBAR0, 7);

            Control = new IO.IOPort(xBAR1, 2);
        }
Ejemplo n.º 4
0
        public Keyboard(IO.IOPort rowSelectPort, IO.IOPort columnSelectPort, IO.Nmi nmiLine)
        {
            _rowSelectPort = rowSelectPort;
            _columnSelectPort = columnSelectPort;
            _nmiLine = nmiLine;

            _rowSelectPort.OnPortOut += new IO.IOPort.PortOutDelegate(RowSelectPort_OnPortOut);
        }
Ejemplo n.º 5
0
        internal ATAIOPorts(bool isSecondary)
        {
            //BAR of main registers
            UInt16 xBAR0 = (UInt16)(isSecondary ? 0x0170 : 0x01F0);
            //BAR of alternative registers
            UInt16 xBAR1 = (UInt16)(isSecondary ? 0x0374 : 0x03F4);
            Data = new IO.IOPort(xBAR0);
            Error = new IO.IOPort(xBAR0, 1);
            Features = new IO.IOPort(xBAR0, 1);
            SectorCount = new IO.IOPort(xBAR0, 2);
            //Logical block address
            LBA0 = new IO.IOPort(xBAR0, 3); //Lo-bits
            LBA1 = new IO.IOPort(xBAR0, 4); //Mid-bits
            LBA2 = new IO.IOPort(xBAR0, 5); //Hi-bits
            DeviceSelect = new IO.IOPort(xBAR0, 6);
            //Write - command
            Command = new IO.IOPort(xBAR0, 7);
            //Read - status
            Status = new IO.IOPort(xBAR0, 7);

            Control = new IO.IOPort(xBAR1, 2);
        }
Ejemplo n.º 6
0
        public UHCI(PCI.PCIDeviceNormal aPCIDevice)
            : base(aPCIDevice)
        {
#if UHCI_TRACE
            BasicConsole.WriteLine("UHCI: Constructor");
            BasicConsole.DelayOutput(5);
#endif

            usbBaseAddress = pciDevice.BaseAddresses[4].BaseAddress();
            Processes.ProcessManager.CurrentProcess.TheMemoryLayout.AddDataPage(
                (uint)usbBaseAddress & 0xFFFFF000,
                (uint)usbBaseAddress & 0xFFFFF000);
            VirtMemManager.Map((uint)usbBaseAddress & 0xFFFFF000, (uint)usbBaseAddress & 0xFFFFF000, 4096,
                VirtMem.VirtMemImpl.PageFlags.KernelOnly);

            RootPortCount = UHCI_Consts.PORTMAX;
            EnabledPorts = false;

            USBCMD = new IO.IOPort(MapPort(UHCI_Consts.USBCMD));
            USBINTR = new IO.IOPort(MapPort(UHCI_Consts.USBINTR));
            USBSTS = new IO.IOPort(MapPort(UHCI_Consts.USBSTS));
            SOFMOD = new IO.IOPort(MapPort(UHCI_Consts.SOFMOD));
            FRBASEADD = new IO.IOPort(MapPort(UHCI_Consts.FRBASEADD));
            FRNUM = new IO.IOPort(MapPort(UHCI_Consts.FRNUM));
            PORTSC1 = new IO.IOPort(MapPort(UHCI_Consts.PORTSC1));
            PORTSC2 = new IO.IOPort(MapPort(UHCI_Consts.PORTSC2));

            FrameList = (uint*)VirtMemManager.MapFreePage(VirtMem.VirtMemImpl.PageFlags.KernelOnly);
            Processes.ProcessManager.CurrentProcess.TheMemoryLayout.AddDataPage(
                (uint)FrameList & 0xFFFFF000,
                (uint)FrameList & 0xFFFFF000);

            Start();
        }