예제 #1
0
파일: Setup.cs 프로젝트: GeroL/MOSA-Project
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        public static void Initialize()
        {
            SetupPrimaryDisplayForm();

            // Emulate a ram chip (128Mb)
            //Mosa.EmulatedDevices.Emulated.RAMChip ramChip1 =
            new Mosa.EmulatedDevices.Emulated.RAMChip(0, 1024 * 640);
            //Mosa.EmulatedDevices.Emulated.RAMChip ramChip2 =
            new Mosa.EmulatedDevices.Emulated.RAMChip(1024 * 1024, 1024 * 1024 * 127);

            // Setup PCI Bus
            PCIBus pciBus = new PCIBus();

            // Setup PCI Controller
            pciBus.Add(new PCIController(PCIController.StandardIOBase, pciBus));
            IOPortDispatch.RegisterDevice(pciBus.Get(0) as IIOPortDevice);

            // Add CMOS
            IOPortDispatch.RegisterDevice(new CMOS(CMOS.StandardIOBase));

            // Add VGA Controller
            IOPortDispatch.RegisterDevice(new VGAConsole(PrimaryDisplayForm));

            // Add IDE Controller
            //string[] files = new string[1];
            //files[0] = @"..\Data\HardDriveImage\hd.img";

            // Fix for Linux
            //files[0] = files[0].Replace('\\', System.IO.Path.DirectorySeparatorChar);

            //IOPortDispatch.RegisterDevice(new IDEController(IDEController.PrimaryIOBase, files));

            // Simulate multiboot
            Mosa.EmulatedDevices.Multiboot.Setup();
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PCIController"/> class.
        /// </summary>
        /// <param name="ioBase">The io base.</param>
        /// <param name="pciBus">The pci bus.</param>
        public PCIController(ushort ioBase, PCIBus pciBus)
        {
            this.ioBase = ioBase;
            this.pciBus = pciBus;

            base.VendorID = 0x8086;
            base.DeviceID = 0x1237;
            base.Revision = 2;
            base.ClassCode = 6;
            base.SubClassCode = 0;
            base.HeaderType = 0;

            Initialize();
        }